diff --git a/CMakeLists.txt b/CMakeLists.txt index b78b89690858b91a95273b67272b72b9dd771b0f..0c7e31bfbb891cc23c2cd5e788772d6f33bc329e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,6 @@ add_subdirectory(tests) add_subdirectory(examples/c) # docs -add_subdirectory(docs) +add_subdirectory(docs/doxgen) # tests (TODO) diff --git a/docs-cn/07-develop/01-connect/_connect_c.mdx b/docs-cn/07-develop/01-connect/_connect_c.mdx deleted file mode 100644 index 9cd8669561195b49e8428ed490ad97bb5653ae6a..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/01-connect/_connect_c.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```c title="原生连接" -{{#include docs-examples/c/connect_example.c}} -``` diff --git a/docs-cn/07-develop/01-connect/_connect_node.mdx b/docs-cn/07-develop/01-connect/_connect_node.mdx deleted file mode 100644 index 199a6e3faa88fcb295379309a250990bf97fa973..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/01-connect/_connect_node.mdx +++ /dev/null @@ -1,7 +0,0 @@ -```js title="原生连接" -{{#include docs-examples/node/nativeexample/connect.js}} -``` - -```js title="REST 连接" -{{#include docs-examples/node/restexample/connect.js}} -``` diff --git a/docs-cn/07-develop/01-connect/_connect_php.mdx b/docs-cn/07-develop/01-connect/_connect_php.mdx deleted file mode 100644 index 2431df2a722659ae6e5962a955fba139be3e5f67..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/01-connect/_connect_php.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```php title="原生连接" -{{#include docs-examples/php/connect.php}} -``` diff --git a/docs-cn/07-develop/01-connect/_connect_python.mdx b/docs-cn/07-develop/01-connect/_connect_python.mdx deleted file mode 100644 index c0043c752e14bcc38f97c1046f2852a3f7fa2b7b..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/01-connect/_connect_python.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```python title="原生连接" -{{#include docs-examples/python/connect_example.py}} -``` diff --git a/docs-cn/07-develop/01-connect/_connect_r.mdx b/docs-cn/07-develop/01-connect/_connect_r.mdx deleted file mode 100644 index 8aab6121a66b38540bf1b8ebf5b48a513282ac7a..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/01-connect/_connect_r.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```r title="原生连接" -{{#include docs-examples/R/connect_native.r:demo}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_c_line.mdx b/docs-cn/07-develop/03-insert-data/_c_line.mdx deleted file mode 100644 index 5ef2e9af774c54e9f090357286f83d2280c2ab11..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_c_line.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```c -{{#include docs-examples/c/line_example.c:main}} -``` \ No newline at end of file diff --git a/docs-cn/07-develop/03-insert-data/_c_opts_json.mdx b/docs-cn/07-develop/03-insert-data/_c_opts_json.mdx deleted file mode 100644 index 22ad2e0122797248a372734aac0f3a16a1356530..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_c_opts_json.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```c -{{#include docs-examples/c/json_protocol_example.c:main}} -``` \ No newline at end of file diff --git a/docs-cn/07-develop/03-insert-data/_c_opts_telnet.mdx b/docs-cn/07-develop/03-insert-data/_c_opts_telnet.mdx deleted file mode 100644 index 508d7bc98a149f49766bcd0a474ffe226cbe30bb..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_c_opts_telnet.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```c -{{#include docs-examples/c/telnet_line_example.c:main}} -``` \ No newline at end of file diff --git a/docs-cn/07-develop/03-insert-data/_c_sql.mdx b/docs-cn/07-develop/03-insert-data/_c_sql.mdx deleted file mode 100644 index f4153fd2c427677a338d0c377663d0335f2672f0..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_c_sql.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```c -{{#include docs-examples/c/insert_example.c}} -``` \ No newline at end of file diff --git a/docs-cn/07-develop/03-insert-data/_c_stmt.mdx b/docs-cn/07-develop/03-insert-data/_c_stmt.mdx deleted file mode 100644 index 01ac067519a2bd224e313fd70169722ba5f20413..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_c_stmt.mdx +++ /dev/null @@ -1,6 +0,0 @@ -```c title=一次绑定一行 -{{#include docs-examples/c/stmt_example.c}} -``` -```c title=一次绑定多行 72:117 -{{#include docs-examples/c/multi_bind_example.c}} -``` \ No newline at end of file diff --git a/docs-cn/07-develop/03-insert-data/_cs_line.mdx b/docs-cn/07-develop/03-insert-data/_cs_line.mdx deleted file mode 100644 index 9c275ee3d7c7a1e52fbb34dbae922004543ee3ce..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_cs_line.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```csharp -{{#include docs-examples/csharp/InfluxDBLineExample.cs}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_cs_opts_json.mdx b/docs-cn/07-develop/03-insert-data/_cs_opts_json.mdx deleted file mode 100644 index 3d538b8506b298241faecd8098f89571359135c9..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_cs_opts_json.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```csharp -{{#include docs-examples/csharp/OptsJsonExample.cs}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_cs_opts_telnet.mdx b/docs-cn/07-develop/03-insert-data/_cs_opts_telnet.mdx deleted file mode 100644 index c53bf3d7233115351e5af03b7d9e6318aa4a0da6..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_cs_opts_telnet.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```csharp -{{#include docs-examples/csharp/OptsTelnetExample.cs}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_cs_sql.mdx b/docs-cn/07-develop/03-insert-data/_cs_sql.mdx deleted file mode 100644 index c7688bfbe77a1135424d829fe9b29fbb1bc93ae2..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_cs_sql.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```csharp -{{#include docs-examples/csharp/SQLInsertExample.cs}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_cs_stmt.mdx b/docs-cn/07-develop/03-insert-data/_cs_stmt.mdx deleted file mode 100644 index 97c3b910ffeb9e0c88fc143a02014115e819c147..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_cs_stmt.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```csharp -{{#include docs-examples/csharp/StmtInsertExample.cs}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_go_line.mdx b/docs-cn/07-develop/03-insert-data/_go_line.mdx deleted file mode 100644 index cd225945b70e28bef2ca7fdaf0d9be0ad7ffc18c..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_go_line.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```go -{{#include docs-examples/go/insert/line/main.go}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_go_opts_json.mdx b/docs-cn/07-develop/03-insert-data/_go_opts_json.mdx deleted file mode 100644 index 0c0d3e5b6330e046988cdd02234285ec67e92f01..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_go_opts_json.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```go -{{#include docs-examples/go/insert/json/main.go}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_go_opts_telnet.mdx b/docs-cn/07-develop/03-insert-data/_go_opts_telnet.mdx deleted file mode 100644 index d5ca40cc146e62412476289853e8e2739e0e9e4b..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_go_opts_telnet.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```go -{{#include docs-examples/go/insert/telnet/main.go}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_go_sql.mdx b/docs-cn/07-develop/03-insert-data/_go_sql.mdx deleted file mode 100644 index 613a65add1741eb763a4b24e65d180d05f7d670f..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_go_sql.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```go -{{#include docs-examples/go/insert/sql/main.go}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_java_line.mdx b/docs-cn/07-develop/03-insert-data/_java_line.mdx deleted file mode 100644 index 2e59a5d4701b2a2ab04ec5711845dc5c80067a1e..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_java_line.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```java -{{#include docs-examples/java/src/main/java/com/taos/example/LineProtocolExample.java}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_java_opts_json.mdx b/docs-cn/07-develop/03-insert-data/_java_opts_json.mdx deleted file mode 100644 index 826a1a07d9405cb193849f9d21e5444f68517914..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_java_opts_json.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```java -{{#include docs-examples/java/src/main/java/com/taos/example/JSONProtocolExample.java}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_java_opts_telnet.mdx b/docs-cn/07-develop/03-insert-data/_java_opts_telnet.mdx deleted file mode 100644 index 954dcc1a482a150dea0b190e1e0593adbfbde796..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_java_opts_telnet.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```java -{{#include docs-examples/java/src/main/java/com/taos/example/TelnetLineProtocolExample.java}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_java_sql.mdx b/docs-cn/07-develop/03-insert-data/_java_sql.mdx deleted file mode 100644 index a863378defe43b1f22c1f98087a34f053a7d6619..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_java_sql.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```java -{{#include docs-examples/java/src/main/java/com/taos/example/RestInsertExample.java:insert}} -``` \ No newline at end of file diff --git a/docs-cn/07-develop/03-insert-data/_java_stmt.mdx b/docs-cn/07-develop/03-insert-data/_java_stmt.mdx deleted file mode 100644 index 54443e535fa84bdf8dc9161ed4ad00f50b26266c..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_java_stmt.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```java -{{#include docs-examples/java/src/main/java/com/taos/example/StmtInsertExample.java}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_js_line.mdx b/docs-cn/07-develop/03-insert-data/_js_line.mdx deleted file mode 100644 index 172c9bc17b8cff8b2620720b235a9c8e69bd4197..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_js_line.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```js -{{#include docs-examples/node/nativeexample/influxdb_line_example.js}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_js_opts_json.mdx b/docs-cn/07-develop/03-insert-data/_js_opts_json.mdx deleted file mode 100644 index 20ac9ec91e8dc6675828b16d7da0acb09afd3b5f..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_js_opts_json.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```js -{{#include docs-examples/node/nativeexample/opentsdb_json_example.js}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_js_opts_telnet.mdx b/docs-cn/07-develop/03-insert-data/_js_opts_telnet.mdx deleted file mode 100644 index c3c8c40bd642f4f443de88e3db006ad50724d514..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_js_opts_telnet.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```js -{{#include docs-examples/node/nativeexample/opentsdb_telnet_example.js}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_js_sql.mdx b/docs-cn/07-develop/03-insert-data/_js_sql.mdx deleted file mode 100644 index f5e17c76892a57a94192a95451b508b1c176c984..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_js_sql.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```js -{{#include docs-examples/node/nativeexample/insert_example.js}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_php_sql.mdx b/docs-cn/07-develop/03-insert-data/_php_sql.mdx deleted file mode 100644 index 42d6a548479d526e7ecdba12807cf9cafb911ee5..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_php_sql.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```php -{{#include docs-examples/php/insert.php}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_php_stmt.mdx b/docs-cn/07-develop/03-insert-data/_php_stmt.mdx deleted file mode 100644 index c1ba4ed3b160514fafb50886d799fc27e60927ed..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_php_stmt.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```php -{{#include docs-examples/php/insert_stmt.php}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_py_line.mdx b/docs-cn/07-develop/03-insert-data/_py_line.mdx deleted file mode 100644 index d3bb1ebb3403b53fa43bfc9d5d1a0de9764d7583..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_py_line.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```py -{{#include docs-examples/python/line_protocol_example.py}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_py_opts_json.mdx b/docs-cn/07-develop/03-insert-data/_py_opts_json.mdx deleted file mode 100644 index cfbfe13ccfdb4f3f34b77300812863fdf70d0f59..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_py_opts_json.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```py -{{#include docs-examples/python/json_protocol_example.py}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_py_opts_telnet.mdx b/docs-cn/07-develop/03-insert-data/_py_opts_telnet.mdx deleted file mode 100644 index 14bc65a7a3da815abadf7f25c8deffeac666c8d7..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_py_opts_telnet.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```py -{{#include docs-examples/python/telnet_line_protocol_example.py}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_py_sql.mdx b/docs-cn/07-develop/03-insert-data/_py_sql.mdx deleted file mode 100644 index c0e15b8ec115b9244d50a47c9eafec04bcfdd70c..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_py_sql.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```py -{{#include docs-examples/python/native_insert_example.py}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_rust_line.mdx b/docs-cn/07-develop/03-insert-data/_rust_line.mdx deleted file mode 100644 index 696ddb7b854751b8dee01047066f97f74212933f..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_rust_line.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```rust -{{#include docs-examples/rust/schemalessexample/examples/influxdb_line_example.rs}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_rust_opts_json.mdx b/docs-cn/07-develop/03-insert-data/_rust_opts_json.mdx deleted file mode 100644 index 97d9052dacd1894cc7548a59951ecfaad9caee87..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_rust_opts_json.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```rust -{{#include docs-examples/rust/schemalessexample/examples/opentsdb_json_example.rs}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_rust_opts_telnet.mdx b/docs-cn/07-develop/03-insert-data/_rust_opts_telnet.mdx deleted file mode 100644 index 14021f43d8aff30c35dc30c5d278d4e51f375024..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_rust_opts_telnet.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```rust -{{#include docs-examples/rust/schemalessexample/examples/opentsdb_telnet_example.rs}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_rust_sql.mdx b/docs-cn/07-develop/03-insert-data/_rust_sql.mdx deleted file mode 100644 index 8e8013e4ad734efcc262ea2f750b82210a538e49..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_rust_sql.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```rust -{{#include docs-examples/rust/restexample/examples/insert_example.rs}} -``` diff --git a/docs-cn/07-develop/03-insert-data/_rust_stmt.mdx b/docs-cn/07-develop/03-insert-data/_rust_stmt.mdx deleted file mode 100644 index 590a7a0e717426ed0235331c49dfc578bc55b2f7..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/03-insert-data/_rust_stmt.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```rust -{{#include docs-examples/rust/nativeexample/examples/stmt_example.rs}} -``` diff --git a/docs-cn/07-develop/04-query-data/_c.mdx b/docs-cn/07-develop/04-query-data/_c.mdx deleted file mode 100644 index 76c9067e2f6af19465cf7c52c3e9b48bb868547d..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/04-query-data/_c.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```c -{{#include docs-examples/c/query_example.c}} -``` \ No newline at end of file diff --git a/docs-cn/07-develop/04-query-data/_c_async.mdx b/docs-cn/07-develop/04-query-data/_c_async.mdx deleted file mode 100644 index 09f3d3b3ff6d6644f837642ef41db459ba7c5753..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/04-query-data/_c_async.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```c -{{#include docs-examples/c/async_query_example.c:demo}} -``` \ No newline at end of file diff --git a/docs-cn/07-develop/04-query-data/_cs.mdx b/docs-cn/07-develop/04-query-data/_cs.mdx deleted file mode 100644 index 2ab52feb564eff0fe251bc9900ea2539171e5dba..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/04-query-data/_cs.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```csharp -{{#include docs-examples/csharp/QueryExample.cs}} -``` diff --git a/docs-cn/07-develop/04-query-data/_cs_async.mdx b/docs-cn/07-develop/04-query-data/_cs_async.mdx deleted file mode 100644 index f868994b303e62016b5e2f9304275135855c6ae5..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/04-query-data/_cs_async.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```csharp -{{#include docs-examples/csharp/AsyncQueryExample.cs}} -``` diff --git a/docs-cn/07-develop/04-query-data/_go.mdx b/docs-cn/07-develop/04-query-data/_go.mdx deleted file mode 100644 index 417c12315c06517e2f3de850ac9a379b7714b519..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/04-query-data/_go.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```go -{{#include docs-examples/go/query/sync/main.go}} -``` diff --git a/docs-cn/07-develop/04-query-data/_go_async.mdx b/docs-cn/07-develop/04-query-data/_go_async.mdx deleted file mode 100644 index 72fff411b980a0dcbdcaf4274722c63e0351db6f..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/04-query-data/_go_async.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```go -{{#include docs-examples/go/query/async/main.go}} -``` diff --git a/docs-cn/07-develop/04-query-data/_java.mdx b/docs-cn/07-develop/04-query-data/_java.mdx deleted file mode 100644 index 519b9266144486231caf3ee593e973d438941ee4..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/04-query-data/_java.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```java -{{#include docs-examples/java/src/main/java/com/taos/example/RestQueryExample.java}} -``` diff --git a/docs-cn/07-develop/04-query-data/_js.mdx b/docs-cn/07-develop/04-query-data/_js.mdx deleted file mode 100644 index c5e4c4f3fc20d3940a2bc6e13e6a5dea8a15ff13..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/04-query-data/_js.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```js -{{#include docs-examples/node/nativeexample/query_example.js}} -``` diff --git a/docs-cn/07-develop/04-query-data/_js_async.mdx b/docs-cn/07-develop/04-query-data/_js_async.mdx deleted file mode 100644 index c65d54ed12f6c4bbeb333e0de0ba9ca4638bff84..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/04-query-data/_js_async.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```js -{{#include docs-examples/node/nativeexample/async_query_example.js}} -``` diff --git a/docs-cn/07-develop/04-query-data/_php.mdx b/docs-cn/07-develop/04-query-data/_php.mdx deleted file mode 100644 index 6264bd99f534fbd800f1f349d93ac69b31c77397..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/04-query-data/_php.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```go -{{#include docs-examples/php/query.php}} -``` diff --git a/docs-cn/07-develop/04-query-data/_rust.mdx b/docs-cn/07-develop/04-query-data/_rust.mdx deleted file mode 100644 index 742d70fd025ff44b573eedf78441c9d73defad45..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/04-query-data/_rust.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```rust -{{#include docs-examples/rust/restexample/examples/query_example.rs}} -``` diff --git a/docs-cn/07-develop/_sub_c.mdx b/docs-cn/07-develop/_sub_c.mdx deleted file mode 100644 index 95fef0042d0a277f9136e6e6f8c15558487232f9..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/_sub_c.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```c -{{#include docs-examples/c/subscribe_demo.c}} -``` \ No newline at end of file diff --git a/docs-cn/07-develop/_sub_cs.mdx b/docs-cn/07-develop/_sub_cs.mdx deleted file mode 100644 index 80934aa4d014a076896dce7f41e520f06ffd735d..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/_sub_cs.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```csharp -{{#include docs-examples/csharp/SubscribeDemo.cs}} -``` \ No newline at end of file diff --git a/docs-cn/07-develop/_sub_go.mdx b/docs-cn/07-develop/_sub_go.mdx deleted file mode 100644 index cd908fc12c3a35f49ca108ee56c3951c5388a95f..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/_sub_go.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```go -{{#include docs-examples/go/sub/main.go}} -``` \ No newline at end of file diff --git a/docs-cn/07-develop/_sub_node.mdx b/docs-cn/07-develop/_sub_node.mdx deleted file mode 100644 index c93ad627ce9a77ca71a014b41d571089e6c1727b..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/_sub_node.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```js -{{#include docs-examples/node/nativeexample/subscribe_demo.js}} -``` \ No newline at end of file diff --git a/docs-cn/07-develop/_sub_python.mdx b/docs-cn/07-develop/_sub_python.mdx deleted file mode 100644 index b817deeba6e283a3ba16fee0d580d3823c999536..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/_sub_python.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```py -{{#include docs-examples/python/subscribe_demo.py}} -``` \ No newline at end of file diff --git a/docs-cn/07-develop/_sub_rust.mdx b/docs-cn/07-develop/_sub_rust.mdx deleted file mode 100644 index 4750cf7a3b871db48c9e5a26b22ab4b8a03f11be..0000000000000000000000000000000000000000 --- a/docs-cn/07-develop/_sub_rust.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```rs -{{#include docs-examples/rust/nativeexample/examples/subscribe_demo.rs}} -``` \ No newline at end of file diff --git a/docs-en/07-develop/01-connect/_connect_c.mdx b/docs-en/07-develop/01-connect/_connect_c.mdx deleted file mode 100644 index 174bf45c4e2f26bab8f57c098f9f8f00d2f5064d..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/01-connect/_connect_c.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```c title="Native Connection" -{{#include docs-examples/c/connect_example.c}} -``` diff --git a/docs-en/07-develop/01-connect/_connect_node.mdx b/docs-en/07-develop/01-connect/_connect_node.mdx deleted file mode 100644 index 489b0386e991ee1e8ddd173205637b75ae5a0c95..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/01-connect/_connect_node.mdx +++ /dev/null @@ -1,7 +0,0 @@ -```js title="Native Connection" -{{#include docs-examples/node/nativeexample/connect.js}} -``` - -```js title="REST Connection" -{{#include docs-examples/node/restexample/connect.js}} -``` diff --git a/docs-en/07-develop/01-connect/_connect_python.mdx b/docs-en/07-develop/01-connect/_connect_python.mdx deleted file mode 100644 index 44b7586fadbf618231fce7753d3b4b68853a7f57..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/01-connect/_connect_python.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```python title="Native Connection" -{{#include docs-examples/python/connect_example.py}} -``` diff --git a/docs-en/07-develop/01-connect/_connect_r.mdx b/docs-en/07-develop/01-connect/_connect_r.mdx deleted file mode 100644 index 09c3d71ac35b1134d3089247daea9a13db4129e2..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/01-connect/_connect_r.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```r title="Native Connection" -{{#include docs-examples/R/connect_native.r:demo}} -``` diff --git a/docs-en/07-develop/03-insert-data/_c_line.mdx b/docs-en/07-develop/03-insert-data/_c_line.mdx deleted file mode 100644 index 5ef2e9af774c54e9f090357286f83d2280c2ab11..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_c_line.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```c -{{#include docs-examples/c/line_example.c:main}} -``` \ No newline at end of file diff --git a/docs-en/07-develop/03-insert-data/_c_opts_json.mdx b/docs-en/07-develop/03-insert-data/_c_opts_json.mdx deleted file mode 100644 index 22ad2e0122797248a372734aac0f3a16a1356530..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_c_opts_json.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```c -{{#include docs-examples/c/json_protocol_example.c:main}} -``` \ No newline at end of file diff --git a/docs-en/07-develop/03-insert-data/_c_opts_telnet.mdx b/docs-en/07-develop/03-insert-data/_c_opts_telnet.mdx deleted file mode 100644 index 508d7bc98a149f49766bcd0a474ffe226cbe30bb..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_c_opts_telnet.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```c -{{#include docs-examples/c/telnet_line_example.c:main}} -``` \ No newline at end of file diff --git a/docs-en/07-develop/03-insert-data/_c_sql.mdx b/docs-en/07-develop/03-insert-data/_c_sql.mdx deleted file mode 100644 index f4153fd2c427677a338d0c377663d0335f2672f0..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_c_sql.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```c -{{#include docs-examples/c/insert_example.c}} -``` \ No newline at end of file diff --git a/docs-en/07-develop/03-insert-data/_c_stmt.mdx b/docs-en/07-develop/03-insert-data/_c_stmt.mdx deleted file mode 100644 index 7f5ef23a849689c36e732b6fd374a131695c9090..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_c_stmt.mdx +++ /dev/null @@ -1,6 +0,0 @@ -```c title=Single Row Binding -{{#include docs-examples/c/stmt_example.c}} -``` -```c title=Multiple Row Binding 72:117 -{{#include docs-examples/c/multi_bind_example.c}} -``` \ No newline at end of file diff --git a/docs-en/07-develop/03-insert-data/_cs_line.mdx b/docs-en/07-develop/03-insert-data/_cs_line.mdx deleted file mode 100644 index 9c275ee3d7c7a1e52fbb34dbae922004543ee3ce..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_cs_line.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```csharp -{{#include docs-examples/csharp/InfluxDBLineExample.cs}} -``` diff --git a/docs-en/07-develop/03-insert-data/_cs_opts_json.mdx b/docs-en/07-develop/03-insert-data/_cs_opts_json.mdx deleted file mode 100644 index 3d538b8506b298241faecd8098f89571359135c9..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_cs_opts_json.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```csharp -{{#include docs-examples/csharp/OptsJsonExample.cs}} -``` diff --git a/docs-en/07-develop/03-insert-data/_cs_opts_telnet.mdx b/docs-en/07-develop/03-insert-data/_cs_opts_telnet.mdx deleted file mode 100644 index c53bf3d7233115351e5af03b7d9e6318aa4a0da6..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_cs_opts_telnet.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```csharp -{{#include docs-examples/csharp/OptsTelnetExample.cs}} -``` diff --git a/docs-en/07-develop/03-insert-data/_cs_sql.mdx b/docs-en/07-develop/03-insert-data/_cs_sql.mdx deleted file mode 100644 index c7688bfbe77a1135424d829fe9b29fbb1bc93ae2..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_cs_sql.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```csharp -{{#include docs-examples/csharp/SQLInsertExample.cs}} -``` diff --git a/docs-en/07-develop/03-insert-data/_cs_stmt.mdx b/docs-en/07-develop/03-insert-data/_cs_stmt.mdx deleted file mode 100644 index 97c3b910ffeb9e0c88fc143a02014115e819c147..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_cs_stmt.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```csharp -{{#include docs-examples/csharp/StmtInsertExample.cs}} -``` diff --git a/docs-en/07-develop/03-insert-data/_go_line.mdx b/docs-en/07-develop/03-insert-data/_go_line.mdx deleted file mode 100644 index cd225945b70e28bef2ca7fdaf0d9be0ad7ffc18c..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_go_line.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```go -{{#include docs-examples/go/insert/line/main.go}} -``` diff --git a/docs-en/07-develop/03-insert-data/_go_opts_json.mdx b/docs-en/07-develop/03-insert-data/_go_opts_json.mdx deleted file mode 100644 index 0c0d3e5b6330e046988cdd02234285ec67e92f01..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_go_opts_json.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```go -{{#include docs-examples/go/insert/json/main.go}} -``` diff --git a/docs-en/07-develop/03-insert-data/_go_opts_telnet.mdx b/docs-en/07-develop/03-insert-data/_go_opts_telnet.mdx deleted file mode 100644 index d5ca40cc146e62412476289853e8e2739e0e9e4b..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_go_opts_telnet.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```go -{{#include docs-examples/go/insert/telnet/main.go}} -``` diff --git a/docs-en/07-develop/03-insert-data/_go_sql.mdx b/docs-en/07-develop/03-insert-data/_go_sql.mdx deleted file mode 100644 index 613a65add1741eb763a4b24e65d180d05f7d670f..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_go_sql.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```go -{{#include docs-examples/go/insert/sql/main.go}} -``` diff --git a/docs-en/07-develop/03-insert-data/_java_line.mdx b/docs-en/07-develop/03-insert-data/_java_line.mdx deleted file mode 100644 index 2e59a5d4701b2a2ab04ec5711845dc5c80067a1e..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_java_line.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```java -{{#include docs-examples/java/src/main/java/com/taos/example/LineProtocolExample.java}} -``` diff --git a/docs-en/07-develop/03-insert-data/_java_opts_json.mdx b/docs-en/07-develop/03-insert-data/_java_opts_json.mdx deleted file mode 100644 index 826a1a07d9405cb193849f9d21e5444f68517914..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_java_opts_json.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```java -{{#include docs-examples/java/src/main/java/com/taos/example/JSONProtocolExample.java}} -``` diff --git a/docs-en/07-develop/03-insert-data/_java_opts_telnet.mdx b/docs-en/07-develop/03-insert-data/_java_opts_telnet.mdx deleted file mode 100644 index 954dcc1a482a150dea0b190e1e0593adbfbde796..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_java_opts_telnet.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```java -{{#include docs-examples/java/src/main/java/com/taos/example/TelnetLineProtocolExample.java}} -``` diff --git a/docs-en/07-develop/03-insert-data/_java_sql.mdx b/docs-en/07-develop/03-insert-data/_java_sql.mdx deleted file mode 100644 index a863378defe43b1f22c1f98087a34f053a7d6619..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_java_sql.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```java -{{#include docs-examples/java/src/main/java/com/taos/example/RestInsertExample.java:insert}} -``` \ No newline at end of file diff --git a/docs-en/07-develop/03-insert-data/_java_stmt.mdx b/docs-en/07-develop/03-insert-data/_java_stmt.mdx deleted file mode 100644 index 54443e535fa84bdf8dc9161ed4ad00f50b26266c..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_java_stmt.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```java -{{#include docs-examples/java/src/main/java/com/taos/example/StmtInsertExample.java}} -``` diff --git a/docs-en/07-develop/03-insert-data/_js_line.mdx b/docs-en/07-develop/03-insert-data/_js_line.mdx deleted file mode 100644 index 172c9bc17b8cff8b2620720b235a9c8e69bd4197..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_js_line.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```js -{{#include docs-examples/node/nativeexample/influxdb_line_example.js}} -``` diff --git a/docs-en/07-develop/03-insert-data/_js_opts_json.mdx b/docs-en/07-develop/03-insert-data/_js_opts_json.mdx deleted file mode 100644 index 20ac9ec91e8dc6675828b16d7da0acb09afd3b5f..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_js_opts_json.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```js -{{#include docs-examples/node/nativeexample/opentsdb_json_example.js}} -``` diff --git a/docs-en/07-develop/03-insert-data/_js_opts_telnet.mdx b/docs-en/07-develop/03-insert-data/_js_opts_telnet.mdx deleted file mode 100644 index c3c8c40bd642f4f443de88e3db006ad50724d514..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_js_opts_telnet.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```js -{{#include docs-examples/node/nativeexample/opentsdb_telnet_example.js}} -``` diff --git a/docs-en/07-develop/03-insert-data/_js_sql.mdx b/docs-en/07-develop/03-insert-data/_js_sql.mdx deleted file mode 100644 index f5e17c76892a57a94192a95451b508b1c176c984..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_js_sql.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```js -{{#include docs-examples/node/nativeexample/insert_example.js}} -``` diff --git a/docs-en/07-develop/03-insert-data/_py_line.mdx b/docs-en/07-develop/03-insert-data/_py_line.mdx deleted file mode 100644 index d3bb1ebb3403b53fa43bfc9d5d1a0de9764d7583..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_py_line.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```py -{{#include docs-examples/python/line_protocol_example.py}} -``` diff --git a/docs-en/07-develop/03-insert-data/_py_opts_json.mdx b/docs-en/07-develop/03-insert-data/_py_opts_json.mdx deleted file mode 100644 index cfbfe13ccfdb4f3f34b77300812863fdf70d0f59..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_py_opts_json.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```py -{{#include docs-examples/python/json_protocol_example.py}} -``` diff --git a/docs-en/07-develop/03-insert-data/_py_opts_telnet.mdx b/docs-en/07-develop/03-insert-data/_py_opts_telnet.mdx deleted file mode 100644 index 14bc65a7a3da815abadf7f25c8deffeac666c8d7..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_py_opts_telnet.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```py -{{#include docs-examples/python/telnet_line_protocol_example.py}} -``` diff --git a/docs-en/07-develop/03-insert-data/_py_sql.mdx b/docs-en/07-develop/03-insert-data/_py_sql.mdx deleted file mode 100644 index c0e15b8ec115b9244d50a47c9eafec04bcfdd70c..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_py_sql.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```py -{{#include docs-examples/python/native_insert_example.py}} -``` diff --git a/docs-en/07-develop/03-insert-data/_rust_line.mdx b/docs-en/07-develop/03-insert-data/_rust_line.mdx deleted file mode 100644 index 696ddb7b854751b8dee01047066f97f74212933f..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_rust_line.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```rust -{{#include docs-examples/rust/schemalessexample/examples/influxdb_line_example.rs}} -``` diff --git a/docs-en/07-develop/03-insert-data/_rust_opts_json.mdx b/docs-en/07-develop/03-insert-data/_rust_opts_json.mdx deleted file mode 100644 index 97d9052dacd1894cc7548a59951ecfaad9caee87..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_rust_opts_json.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```rust -{{#include docs-examples/rust/schemalessexample/examples/opentsdb_json_example.rs}} -``` diff --git a/docs-en/07-develop/03-insert-data/_rust_opts_telnet.mdx b/docs-en/07-develop/03-insert-data/_rust_opts_telnet.mdx deleted file mode 100644 index 14021f43d8aff30c35dc30c5d278d4e51f375024..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_rust_opts_telnet.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```rust -{{#include docs-examples/rust/schemalessexample/examples/opentsdb_telnet_example.rs}} -``` diff --git a/docs-en/07-develop/03-insert-data/_rust_sql.mdx b/docs-en/07-develop/03-insert-data/_rust_sql.mdx deleted file mode 100644 index 8e8013e4ad734efcc262ea2f750b82210a538e49..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_rust_sql.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```rust -{{#include docs-examples/rust/restexample/examples/insert_example.rs}} -``` diff --git a/docs-en/07-develop/03-insert-data/_rust_stmt.mdx b/docs-en/07-develop/03-insert-data/_rust_stmt.mdx deleted file mode 100644 index 590a7a0e717426ed0235331c49dfc578bc55b2f7..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/03-insert-data/_rust_stmt.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```rust -{{#include docs-examples/rust/nativeexample/examples/stmt_example.rs}} -``` diff --git a/docs-en/07-develop/04-query-data/_c.mdx b/docs-en/07-develop/04-query-data/_c.mdx deleted file mode 100644 index 76c9067e2f6af19465cf7c52c3e9b48bb868547d..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/04-query-data/_c.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```c -{{#include docs-examples/c/query_example.c}} -``` \ No newline at end of file diff --git a/docs-en/07-develop/04-query-data/_c_async.mdx b/docs-en/07-develop/04-query-data/_c_async.mdx deleted file mode 100644 index 09f3d3b3ff6d6644f837642ef41db459ba7c5753..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/04-query-data/_c_async.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```c -{{#include docs-examples/c/async_query_example.c:demo}} -``` \ No newline at end of file diff --git a/docs-en/07-develop/04-query-data/_cs.mdx b/docs-en/07-develop/04-query-data/_cs.mdx deleted file mode 100644 index 2ab52feb564eff0fe251bc9900ea2539171e5dba..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/04-query-data/_cs.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```csharp -{{#include docs-examples/csharp/QueryExample.cs}} -``` diff --git a/docs-en/07-develop/04-query-data/_cs_async.mdx b/docs-en/07-develop/04-query-data/_cs_async.mdx deleted file mode 100644 index f868994b303e62016b5e2f9304275135855c6ae5..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/04-query-data/_cs_async.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```csharp -{{#include docs-examples/csharp/AsyncQueryExample.cs}} -``` diff --git a/docs-en/07-develop/04-query-data/_go.mdx b/docs-en/07-develop/04-query-data/_go.mdx deleted file mode 100644 index 417c12315c06517e2f3de850ac9a379b7714b519..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/04-query-data/_go.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```go -{{#include docs-examples/go/query/sync/main.go}} -``` diff --git a/docs-en/07-develop/04-query-data/_go_async.mdx b/docs-en/07-develop/04-query-data/_go_async.mdx deleted file mode 100644 index 72fff411b980a0dcbdcaf4274722c63e0351db6f..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/04-query-data/_go_async.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```go -{{#include docs-examples/go/query/async/main.go}} -``` diff --git a/docs-en/07-develop/04-query-data/_java.mdx b/docs-en/07-develop/04-query-data/_java.mdx deleted file mode 100644 index 519b9266144486231caf3ee593e973d438941ee4..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/04-query-data/_java.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```java -{{#include docs-examples/java/src/main/java/com/taos/example/RestQueryExample.java}} -``` diff --git a/docs-en/07-develop/04-query-data/_js.mdx b/docs-en/07-develop/04-query-data/_js.mdx deleted file mode 100644 index c5e4c4f3fc20d3940a2bc6e13e6a5dea8a15ff13..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/04-query-data/_js.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```js -{{#include docs-examples/node/nativeexample/query_example.js}} -``` diff --git a/docs-en/07-develop/04-query-data/_js_async.mdx b/docs-en/07-develop/04-query-data/_js_async.mdx deleted file mode 100644 index c65d54ed12f6c4bbeb333e0de0ba9ca4638bff84..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/04-query-data/_js_async.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```js -{{#include docs-examples/node/nativeexample/async_query_example.js}} -``` diff --git a/docs-en/07-develop/04-query-data/_rust.mdx b/docs-en/07-develop/04-query-data/_rust.mdx deleted file mode 100644 index 742d70fd025ff44b573eedf78441c9d73defad45..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/04-query-data/_rust.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```rust -{{#include docs-examples/rust/restexample/examples/query_example.rs}} -``` diff --git a/docs-en/07-develop/_sub_c.mdx b/docs-en/07-develop/_sub_c.mdx deleted file mode 100644 index 95fef0042d0a277f9136e6e6f8c15558487232f9..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/_sub_c.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```c -{{#include docs-examples/c/subscribe_demo.c}} -``` \ No newline at end of file diff --git a/docs-en/07-develop/_sub_cs.mdx b/docs-en/07-develop/_sub_cs.mdx deleted file mode 100644 index 80934aa4d014a076896dce7f41e520f06ffd735d..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/_sub_cs.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```csharp -{{#include docs-examples/csharp/SubscribeDemo.cs}} -``` \ No newline at end of file diff --git a/docs-en/07-develop/_sub_go.mdx b/docs-en/07-develop/_sub_go.mdx deleted file mode 100644 index cd908fc12c3a35f49ca108ee56c3951c5388a95f..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/_sub_go.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```go -{{#include docs-examples/go/sub/main.go}} -``` \ No newline at end of file diff --git a/docs-en/07-develop/_sub_node.mdx b/docs-en/07-develop/_sub_node.mdx deleted file mode 100644 index c93ad627ce9a77ca71a014b41d571089e6c1727b..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/_sub_node.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```js -{{#include docs-examples/node/nativeexample/subscribe_demo.js}} -``` \ No newline at end of file diff --git a/docs-en/07-develop/_sub_python.mdx b/docs-en/07-develop/_sub_python.mdx deleted file mode 100644 index b817deeba6e283a3ba16fee0d580d3823c999536..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/_sub_python.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```py -{{#include docs-examples/python/subscribe_demo.py}} -``` \ No newline at end of file diff --git a/docs-en/07-develop/_sub_rust.mdx b/docs-en/07-develop/_sub_rust.mdx deleted file mode 100644 index 4750cf7a3b871db48c9e5a26b22ab4b8a03f11be..0000000000000000000000000000000000000000 --- a/docs-en/07-develop/_sub_rust.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```rs -{{#include docs-examples/rust/nativeexample/examples/subscribe_demo.rs}} -``` \ No newline at end of file diff --git a/docs-examples/.gitignre b/docs-examples/.gitignre deleted file mode 100644 index 0853156c65c2c6c1b693290e74c3ee630bcaac19..0000000000000000000000000000000000000000 --- a/docs-examples/.gitignre +++ /dev/null @@ -1,2 +0,0 @@ -.vscode -*.lock \ No newline at end of file diff --git a/docs/CMakeLists.txt b/docs/doxgen/CMakeLists.txt similarity index 100% rename from docs/CMakeLists.txt rename to docs/doxgen/CMakeLists.txt diff --git a/docs/Doxyfile.in b/docs/doxgen/Doxyfile.in similarity index 100% rename from docs/Doxyfile.in rename to docs/doxgen/Doxyfile.in diff --git a/docs/scratch.md b/docs/doxgen/scratch.md similarity index 100% rename from docs/scratch.md rename to docs/doxgen/scratch.md diff --git a/docs/user_manual/Small_Materialized_Aggrates.md b/docs/doxgen/user_manual/Small_Materialized_Aggrates.md similarity index 100% rename from docs/user_manual/Small_Materialized_Aggrates.md rename to docs/doxgen/user_manual/Small_Materialized_Aggrates.md diff --git a/docs/vnode_write.md b/docs/doxgen/vnode_write.md similarity index 100% rename from docs/vnode_write.md rename to docs/doxgen/vnode_write.md diff --git a/docs-en/01-index.md b/docs/en/01-index.md similarity index 100% rename from docs-en/01-index.md rename to docs/en/01-index.md diff --git a/docs-en/02-intro/_category_.yml b/docs/en/02-intro/_category_.yml similarity index 100% rename from docs-en/02-intro/_category_.yml rename to docs/en/02-intro/_category_.yml diff --git a/docs-cn/eco_system.webp b/docs/en/02-intro/eco_system.webp similarity index 100% rename from docs-cn/eco_system.webp rename to docs/en/02-intro/eco_system.webp diff --git a/docs-en/02-intro/index.md b/docs/en/02-intro/index.md similarity index 100% rename from docs-en/02-intro/index.md rename to docs/en/02-intro/index.md diff --git a/docs-en/04-concept/_category_.yml b/docs/en/04-concept/_category_.yml similarity index 100% rename from docs-en/04-concept/_category_.yml rename to docs/en/04-concept/_category_.yml diff --git a/docs-en/04-concept/index.md b/docs/en/04-concept/index.md similarity index 100% rename from docs-en/04-concept/index.md rename to docs/en/04-concept/index.md diff --git a/docs-en/05-get-started/_apt_get_install.mdx b/docs/en/05-get-started/_apt_get_install.mdx similarity index 100% rename from docs-en/05-get-started/_apt_get_install.mdx rename to docs/en/05-get-started/_apt_get_install.mdx diff --git a/docs-en/05-get-started/_category_.yml b/docs/en/05-get-started/_category_.yml similarity index 100% rename from docs-en/05-get-started/_category_.yml rename to docs/en/05-get-started/_category_.yml diff --git a/docs-en/05-get-started/_pkg_install.mdx b/docs/en/05-get-started/_pkg_install.mdx similarity index 100% rename from docs-en/05-get-started/_pkg_install.mdx rename to docs/en/05-get-started/_pkg_install.mdx diff --git a/docs-en/05-get-started/index.md b/docs/en/05-get-started/index.md similarity index 100% rename from docs-en/05-get-started/index.md rename to docs/en/05-get-started/index.md diff --git a/docs-en/07-develop/01-connect/_category_.yml b/docs/en/07-develop/01-connect/_category_.yml similarity index 100% rename from docs-en/07-develop/01-connect/_category_.yml rename to docs/en/07-develop/01-connect/_category_.yml diff --git a/docs/en/07-develop/01-connect/_connect_c.mdx b/docs/en/07-develop/01-connect/_connect_c.mdx new file mode 100644 index 0000000000000000000000000000000000000000..4d13d80e085956a7ceccdc404b7106620b22c25e --- /dev/null +++ b/docs/en/07-develop/01-connect/_connect_c.mdx @@ -0,0 +1,3 @@ +```c title="Native Connection" +{{#include docs/examples/c/connect_example.c}} +``` diff --git a/docs-en/07-develop/01-connect/_connect_cs.mdx b/docs/en/07-develop/01-connect/_connect_cs.mdx similarity index 67% rename from docs-en/07-develop/01-connect/_connect_cs.mdx rename to docs/en/07-develop/01-connect/_connect_cs.mdx index 52ea2d437123a26bd87e6f3fdc05a17141f9f835..f8d8e519fde7fc6d0954bbfe865155221c0b0595 100644 --- a/docs-en/07-develop/01-connect/_connect_cs.mdx +++ b/docs/en/07-develop/01-connect/_connect_cs.mdx @@ -1,5 +1,5 @@ ```csharp title="Native Connection" -{{#include docs-examples/csharp/ConnectExample.cs}} +{{#include docs/examples/csharp/ConnectExample.cs}} ``` :::info diff --git a/docs-en/07-develop/01-connect/_connect_go.mdx b/docs/en/07-develop/01-connect/_connect_go.mdx similarity index 69% rename from docs-en/07-develop/01-connect/_connect_go.mdx rename to docs/en/07-develop/01-connect/_connect_go.mdx index 1dd5d67e3533bba21960269e49e3d843b026efc8..6f742ea0bcf027de6c97132167d4de65e2cbee8a 100644 --- a/docs-en/07-develop/01-connect/_connect_go.mdx +++ b/docs/en/07-develop/01-connect/_connect_go.mdx @@ -1,11 +1,11 @@ #### Unified Database Access Interface ```go title="Native Connection" -{{#include docs-examples/go/connect/cgoexample/main.go}} +{{#include docs/examples/go/connect/cgoexample/main.go}} ``` ```go title="REST Connection" -{{#include docs-examples/go/connect/restexample/main.go}} +{{#include docs/examples/go/connect/restexample/main.go}} ``` #### Advanced Features @@ -13,5 +13,5 @@ The af package of driver-go can also be used to establish connection, with this way some advanced features of TDengine, like parameter binding and subscription, can be used. ```go title="Establish native connection using af package" -{{#include docs-examples/go/connect/afconn/main.go}} +{{#include docs/examples/go/connect/afconn/main.go}} ``` diff --git a/docs-en/07-develop/01-connect/_connect_java.mdx b/docs/en/07-develop/01-connect/_connect_java.mdx similarity index 68% rename from docs-en/07-develop/01-connect/_connect_java.mdx rename to docs/en/07-develop/01-connect/_connect_java.mdx index 1c3e9326bf2ae597ffba683250dd43986e670469..880d2aa3e489566203fa0f4b8379feb653a98f73 100644 --- a/docs-en/07-develop/01-connect/_connect_java.mdx +++ b/docs/en/07-develop/01-connect/_connect_java.mdx @@ -1,15 +1,15 @@ ```java title="Native Connection" -{{#include docs-examples/java/src/main/java/com/taos/example/JNIConnectExample.java}} +{{#include docs/examples/java/src/main/java/com/taos/example/JNIConnectExample.java}} ``` ```java title="REST Connection" -{{#include docs-examples/java/src/main/java/com/taos/example/RESTConnectExample.java:main}} +{{#include docs/examples/java/src/main/java/com/taos/example/RESTConnectExample.java:main}} ``` When using REST connection, the feature of bulk pulling can be enabled if the size of resulting data set is huge. ```java title="Enable Bulk Pulling" {4} -{{#include docs-examples/java/src/main/java/com/taos/example/WSConnectExample.java:main}} +{{#include docs/examples/java/src/main/java/com/taos/example/WSConnectExample.java:main}} ``` More configuration about connection,please refer to [Java Connector](/reference/connector/java) diff --git a/docs/en/07-develop/01-connect/_connect_node.mdx b/docs/en/07-develop/01-connect/_connect_node.mdx new file mode 100644 index 0000000000000000000000000000000000000000..943677b36be22f73c970d5b1f4228ff757b0a62e --- /dev/null +++ b/docs/en/07-develop/01-connect/_connect_node.mdx @@ -0,0 +1,7 @@ +```js title="Native Connection" +{{#include docs/examples/node/nativeexample/connect.js}} +``` + +```js title="REST Connection" +{{#include docs/examples/node/restexample/connect.js}} +``` diff --git a/docs/en/07-develop/01-connect/_connect_python.mdx b/docs/en/07-develop/01-connect/_connect_python.mdx new file mode 100644 index 0000000000000000000000000000000000000000..60b454d52f3977d1feac9e745da984db83a38668 --- /dev/null +++ b/docs/en/07-develop/01-connect/_connect_python.mdx @@ -0,0 +1,3 @@ +```python title="Native Connection" +{{#include docs/examples/python/connect_example.py}} +``` diff --git a/docs/en/07-develop/01-connect/_connect_r.mdx b/docs/en/07-develop/01-connect/_connect_r.mdx new file mode 100644 index 0000000000000000000000000000000000000000..e2d7f631d2c467937589bd00271a7decd036506d --- /dev/null +++ b/docs/en/07-develop/01-connect/_connect_r.mdx @@ -0,0 +1,3 @@ +```r title="Native Connection" +{{#include docs/examples/R/connect_native.r:demo}} +``` diff --git a/docs-en/07-develop/01-connect/_connect_rust.mdx b/docs/en/07-develop/01-connect/_connect_rust.mdx similarity index 78% rename from docs-en/07-develop/01-connect/_connect_rust.mdx rename to docs/en/07-develop/01-connect/_connect_rust.mdx index aa19f58de6c9bab69df0663e5369402ab1a8f899..80ac1f4ff4a8174acc4c2f6af11b31f027ece602 100644 --- a/docs-en/07-develop/01-connect/_connect_rust.mdx +++ b/docs/en/07-develop/01-connect/_connect_rust.mdx @@ -1,5 +1,5 @@ ```rust title="Native Connection/REST Connection" -{{#include docs-examples/rust/nativeexample/examples/connect.rs}} +{{#include docs/examples/rust/nativeexample/examples/connect.rs}} ``` :::note diff --git a/docs-en/07-develop/01-connect/index.md b/docs/en/07-develop/01-connect/index.md similarity index 100% rename from docs-en/07-develop/01-connect/index.md rename to docs/en/07-develop/01-connect/index.md diff --git a/docs-en/07-develop/02-model/_category_.yml b/docs/en/07-develop/02-model/_category_.yml similarity index 100% rename from docs-en/07-develop/02-model/_category_.yml rename to docs/en/07-develop/02-model/_category_.yml diff --git a/docs-en/07-develop/02-model/index.mdx b/docs/en/07-develop/02-model/index.mdx similarity index 100% rename from docs-en/07-develop/02-model/index.mdx rename to docs/en/07-develop/02-model/index.mdx diff --git a/docs-en/07-develop/03-insert-data/01-sql-writing.mdx b/docs/en/07-develop/03-insert-data/01-sql-writing.mdx similarity index 100% rename from docs-en/07-develop/03-insert-data/01-sql-writing.mdx rename to docs/en/07-develop/03-insert-data/01-sql-writing.mdx diff --git a/docs-en/07-develop/03-insert-data/02-influxdb-line.mdx b/docs/en/07-develop/03-insert-data/02-influxdb-line.mdx similarity index 100% rename from docs-en/07-develop/03-insert-data/02-influxdb-line.mdx rename to docs/en/07-develop/03-insert-data/02-influxdb-line.mdx diff --git a/docs-en/07-develop/03-insert-data/03-opentsdb-telnet.mdx b/docs/en/07-develop/03-insert-data/03-opentsdb-telnet.mdx similarity index 100% rename from docs-en/07-develop/03-insert-data/03-opentsdb-telnet.mdx rename to docs/en/07-develop/03-insert-data/03-opentsdb-telnet.mdx diff --git a/docs-en/07-develop/03-insert-data/04-opentsdb-json.mdx b/docs/en/07-develop/03-insert-data/04-opentsdb-json.mdx similarity index 100% rename from docs-en/07-develop/03-insert-data/04-opentsdb-json.mdx rename to docs/en/07-develop/03-insert-data/04-opentsdb-json.mdx diff --git a/docs/en/07-develop/03-insert-data/_c_line.mdx b/docs/en/07-develop/03-insert-data/_c_line.mdx new file mode 100644 index 0000000000000000000000000000000000000000..7f2f0d5dd8198d52dda1da34256e54a1bbb4c967 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_c_line.mdx @@ -0,0 +1,3 @@ +```c +{{#include docs/examples/c/line_example.c:main}} +``` \ No newline at end of file diff --git a/docs/en/07-develop/03-insert-data/_c_opts_json.mdx b/docs/en/07-develop/03-insert-data/_c_opts_json.mdx new file mode 100644 index 0000000000000000000000000000000000000000..34b1d8ab3c1e299c2ab2a1ad6d47f81dfaa364cc --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_c_opts_json.mdx @@ -0,0 +1,3 @@ +```c +{{#include docs/examples/c/json_protocol_example.c:main}} +``` \ No newline at end of file diff --git a/docs/en/07-develop/03-insert-data/_c_opts_telnet.mdx b/docs/en/07-develop/03-insert-data/_c_opts_telnet.mdx new file mode 100644 index 0000000000000000000000000000000000000000..6bda068d12fd0b379a5af96438029c9ae476a753 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_c_opts_telnet.mdx @@ -0,0 +1,3 @@ +```c +{{#include docs/examples/c/telnet_line_example.c:main}} +``` \ No newline at end of file diff --git a/docs/en/07-develop/03-insert-data/_c_sql.mdx b/docs/en/07-develop/03-insert-data/_c_sql.mdx new file mode 100644 index 0000000000000000000000000000000000000000..4e55c3387ee1c6fe860f312afdbdad65142bf7fb --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_c_sql.mdx @@ -0,0 +1,3 @@ +```c +{{#include docs/examples/c/insert_example.c}} +``` \ No newline at end of file diff --git a/docs/en/07-develop/03-insert-data/_c_stmt.mdx b/docs/en/07-develop/03-insert-data/_c_stmt.mdx new file mode 100644 index 0000000000000000000000000000000000000000..4b609efe5e942c7ecb8296e8fdbd0607f1421229 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_c_stmt.mdx @@ -0,0 +1,6 @@ +```c title=Single Row Binding +{{#include docs/examples/c/stmt_example.c}} +``` +```c title=Multiple Row Binding 72:117 +{{#include docs/examples/c/multi_bind_example.c}} +``` \ No newline at end of file diff --git a/docs-en/07-develop/03-insert-data/_category_.yml b/docs/en/07-develop/03-insert-data/_category_.yml similarity index 100% rename from docs-en/07-develop/03-insert-data/_category_.yml rename to docs/en/07-develop/03-insert-data/_category_.yml diff --git a/docs/en/07-develop/03-insert-data/_cs_line.mdx b/docs/en/07-develop/03-insert-data/_cs_line.mdx new file mode 100644 index 0000000000000000000000000000000000000000..71f46c62be3dfe7d771a35b2298e476bed353aba --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_cs_line.mdx @@ -0,0 +1,3 @@ +```csharp +{{#include docs/examples/csharp/InfluxDBLineExample.cs}} +``` diff --git a/docs/en/07-develop/03-insert-data/_cs_opts_json.mdx b/docs/en/07-develop/03-insert-data/_cs_opts_json.mdx new file mode 100644 index 0000000000000000000000000000000000000000..8d80d042c984c513df5ca91813c0cd0a17b58eb5 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_cs_opts_json.mdx @@ -0,0 +1,3 @@ +```csharp +{{#include docs/examples/csharp/OptsJsonExample.cs}} +``` diff --git a/docs/en/07-develop/03-insert-data/_cs_opts_telnet.mdx b/docs/en/07-develop/03-insert-data/_cs_opts_telnet.mdx new file mode 100644 index 0000000000000000000000000000000000000000..cff32abf1feaf703971111542749fbe40152bc33 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_cs_opts_telnet.mdx @@ -0,0 +1,3 @@ +```csharp +{{#include docs/examples/csharp/OptsTelnetExample.cs}} +``` diff --git a/docs/en/07-develop/03-insert-data/_cs_sql.mdx b/docs/en/07-develop/03-insert-data/_cs_sql.mdx new file mode 100644 index 0000000000000000000000000000000000000000..1dc7bb3d1366aa3000212786756506eb5eb280e6 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_cs_sql.mdx @@ -0,0 +1,3 @@ +```csharp +{{#include docs/examples/csharp/SQLInsertExample.cs}} +``` diff --git a/docs/en/07-develop/03-insert-data/_cs_stmt.mdx b/docs/en/07-develop/03-insert-data/_cs_stmt.mdx new file mode 100644 index 0000000000000000000000000000000000000000..229c874ab9f515e7eae66890a3dfe2e59c129e86 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_cs_stmt.mdx @@ -0,0 +1,3 @@ +```csharp +{{#include docs/examples/csharp/StmtInsertExample.cs}} +``` diff --git a/docs/en/07-develop/03-insert-data/_go_line.mdx b/docs/en/07-develop/03-insert-data/_go_line.mdx new file mode 100644 index 0000000000000000000000000000000000000000..df2afc0e8720ca14e42e0e4bd7e50276cecace43 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_go_line.mdx @@ -0,0 +1,3 @@ +```go +{{#include docs/examples/go/insert/line/main.go}} +``` diff --git a/docs/en/07-develop/03-insert-data/_go_opts_json.mdx b/docs/en/07-develop/03-insert-data/_go_opts_json.mdx new file mode 100644 index 0000000000000000000000000000000000000000..362ce430515c70a3ac502e646630025d7f950612 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_go_opts_json.mdx @@ -0,0 +1,3 @@ +```go +{{#include docs/examples/go/insert/json/main.go}} +``` diff --git a/docs/en/07-develop/03-insert-data/_go_opts_telnet.mdx b/docs/en/07-develop/03-insert-data/_go_opts_telnet.mdx new file mode 100644 index 0000000000000000000000000000000000000000..518ea4c8164ab148afff9e21b03d892cbc1bfaf8 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_go_opts_telnet.mdx @@ -0,0 +1,3 @@ +```go +{{#include docs/examples/go/insert/telnet/main.go}} +``` diff --git a/docs/en/07-develop/03-insert-data/_go_sql.mdx b/docs/en/07-develop/03-insert-data/_go_sql.mdx new file mode 100644 index 0000000000000000000000000000000000000000..02f4d4e2ba21bc14dd67cb0443a1631b06750923 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_go_sql.mdx @@ -0,0 +1,3 @@ +```go +{{#include docs/examples/go/insert/sql/main.go}} +``` diff --git a/docs-en/07-develop/03-insert-data/_go_stmt.mdx b/docs/en/07-develop/03-insert-data/_go_stmt.mdx similarity index 76% rename from docs-en/07-develop/03-insert-data/_go_stmt.mdx rename to docs/en/07-develop/03-insert-data/_go_stmt.mdx index c32bc21fb9bcaf45059e4f47df73fb57f047ed1c..ab519c9a806345c2f14337f62c74728da955d2e0 100644 --- a/docs-en/07-develop/03-insert-data/_go_stmt.mdx +++ b/docs/en/07-develop/03-insert-data/_go_stmt.mdx @@ -1,5 +1,5 @@ ```go -{{#include docs-examples/go/insert/stmt/main.go}} +{{#include docs/examples/go/insert/stmt/main.go}} ``` :::tip diff --git a/docs/en/07-develop/03-insert-data/_java_line.mdx b/docs/en/07-develop/03-insert-data/_java_line.mdx new file mode 100644 index 0000000000000000000000000000000000000000..17f759d30fdb76744dc032be60ee91b6dd9f1540 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_java_line.mdx @@ -0,0 +1,3 @@ +```java +{{#include docs/examples/java/src/main/java/com/taos/example/LineProtocolExample.java}} +``` diff --git a/docs/en/07-develop/03-insert-data/_java_opts_json.mdx b/docs/en/07-develop/03-insert-data/_java_opts_json.mdx new file mode 100644 index 0000000000000000000000000000000000000000..1fc0adc202f26c73e64da09456e7e42bdc6367f6 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_java_opts_json.mdx @@ -0,0 +1,3 @@ +```java +{{#include docs/examples/java/src/main/java/com/taos/example/JSONProtocolExample.java}} +``` diff --git a/docs/en/07-develop/03-insert-data/_java_opts_telnet.mdx b/docs/en/07-develop/03-insert-data/_java_opts_telnet.mdx new file mode 100644 index 0000000000000000000000000000000000000000..b68f54b4e872a57f34ae6d5c3651a70812b71154 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_java_opts_telnet.mdx @@ -0,0 +1,3 @@ +```java +{{#include docs/examples/java/src/main/java/com/taos/example/TelnetLineProtocolExample.java}} +``` diff --git a/docs/en/07-develop/03-insert-data/_java_sql.mdx b/docs/en/07-develop/03-insert-data/_java_sql.mdx new file mode 100644 index 0000000000000000000000000000000000000000..636c7e00eb8846704678ef3cdd8394a99a4528f8 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_java_sql.mdx @@ -0,0 +1,3 @@ +```java +{{#include docs/examples/java/src/main/java/com/taos/example/RestInsertExample.java:insert}} +``` \ No newline at end of file diff --git a/docs/en/07-develop/03-insert-data/_java_stmt.mdx b/docs/en/07-develop/03-insert-data/_java_stmt.mdx new file mode 100644 index 0000000000000000000000000000000000000000..2f6a33769044ef5052e633e28a9b60fdab130e88 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_java_stmt.mdx @@ -0,0 +1,3 @@ +```java +{{#include docs/examples/java/src/main/java/com/taos/example/StmtInsertExample.java}} +``` diff --git a/docs/en/07-develop/03-insert-data/_js_line.mdx b/docs/en/07-develop/03-insert-data/_js_line.mdx new file mode 100644 index 0000000000000000000000000000000000000000..cc138a76bde76e779eaa1fe554ecc82c1f564e24 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_js_line.mdx @@ -0,0 +1,3 @@ +```js +{{#include docs/examples/node/nativeexample/influxdb_line_example.js}} +``` diff --git a/docs/en/07-develop/03-insert-data/_js_opts_json.mdx b/docs/en/07-develop/03-insert-data/_js_opts_json.mdx new file mode 100644 index 0000000000000000000000000000000000000000..cb3c275ce8140ed58d668bf03972a1f960bb6564 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_js_opts_json.mdx @@ -0,0 +1,3 @@ +```js +{{#include docs/examples/node/nativeexample/opentsdb_json_example.js}} +``` diff --git a/docs/en/07-develop/03-insert-data/_js_opts_telnet.mdx b/docs/en/07-develop/03-insert-data/_js_opts_telnet.mdx new file mode 100644 index 0000000000000000000000000000000000000000..db96742f31440342516134636db998af987af9fb --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_js_opts_telnet.mdx @@ -0,0 +1,3 @@ +```js +{{#include docs/examples/node/nativeexample/opentsdb_telnet_example.js}} +``` diff --git a/docs/en/07-develop/03-insert-data/_js_sql.mdx b/docs/en/07-develop/03-insert-data/_js_sql.mdx new file mode 100644 index 0000000000000000000000000000000000000000..a9a12f5d2cfb31bcaefba25a82846b455dbc8671 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_js_sql.mdx @@ -0,0 +1,3 @@ +```js +{{#include docs/examples/node/nativeexample/insert_example.js}} +``` diff --git a/docs-en/07-develop/03-insert-data/_js_stmt.mdx b/docs/en/07-develop/03-insert-data/_js_stmt.mdx similarity index 70% rename from docs-en/07-develop/03-insert-data/_js_stmt.mdx rename to docs/en/07-develop/03-insert-data/_js_stmt.mdx index 964d7ddc11b90031b70936efb85fbaabe873ddbb..8df1065c4a42537c2e4c61087ad77cdde9e24a77 100644 --- a/docs-en/07-develop/03-insert-data/_js_stmt.mdx +++ b/docs/en/07-develop/03-insert-data/_js_stmt.mdx @@ -1,9 +1,9 @@ ```js title=Single Row Binding -{{#include docs-examples/node/nativeexample/param_bind_example.js}} +{{#include docs/examples/node/nativeexample/param_bind_example.js}} ``` ```js title=Multiple Row Binding -{{#include docs-examples/node/nativeexample/multi_bind_example.js:insertData}} +{{#include docs/examples/node/nativeexample/multi_bind_example.js:insertData}} ``` :::info diff --git a/docs/en/07-develop/03-insert-data/_py_line.mdx b/docs/en/07-develop/03-insert-data/_py_line.mdx new file mode 100644 index 0000000000000000000000000000000000000000..85f7e32e6681c6d428a2332220194c169c421f2f --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_py_line.mdx @@ -0,0 +1,3 @@ +```py +{{#include docs/examples/python/line_protocol_example.py}} +``` diff --git a/docs/en/07-develop/03-insert-data/_py_opts_json.mdx b/docs/en/07-develop/03-insert-data/_py_opts_json.mdx new file mode 100644 index 0000000000000000000000000000000000000000..195c7090c02e03131c4261c57f1414a5ab1ba6b6 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_py_opts_json.mdx @@ -0,0 +1,3 @@ +```py +{{#include docs/examples/python/json_protocol_example.py}} +``` diff --git a/docs/en/07-develop/03-insert-data/_py_opts_telnet.mdx b/docs/en/07-develop/03-insert-data/_py_opts_telnet.mdx new file mode 100644 index 0000000000000000000000000000000000000000..3bae1ea57bcffe50be5b4e96a7ae8f83faed2087 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_py_opts_telnet.mdx @@ -0,0 +1,3 @@ +```py +{{#include docs/examples/python/telnet_line_protocol_example.py}} +``` diff --git a/docs/en/07-develop/03-insert-data/_py_sql.mdx b/docs/en/07-develop/03-insert-data/_py_sql.mdx new file mode 100644 index 0000000000000000000000000000000000000000..1557e3994b04e64c596918ee67c63e7765ebaa07 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_py_sql.mdx @@ -0,0 +1,3 @@ +```py +{{#include docs/examples/python/native_insert_example.py}} +``` diff --git a/docs-en/07-develop/03-insert-data/_py_stmt.mdx b/docs/en/07-develop/03-insert-data/_py_stmt.mdx similarity index 69% rename from docs-en/07-develop/03-insert-data/_py_stmt.mdx rename to docs/en/07-develop/03-insert-data/_py_stmt.mdx index 16d98f54329ad0d3dfb463392f5c1d41c9aab25b..4f7636bfb8ea920e1e879b8e59083543cf798d01 100644 --- a/docs-en/07-develop/03-insert-data/_py_stmt.mdx +++ b/docs/en/07-develop/03-insert-data/_py_stmt.mdx @@ -1,9 +1,9 @@ ```py title=Single Row Binding -{{#include docs-examples/python/bind_param_example.py}} +{{#include docs/examples/python/bind_param_example.py}} ``` ```py title=Multiple Row Binding -{{#include docs-examples/python/multi_bind_example.py:bind_batch}} +{{#include docs/examples/python/multi_bind_example.py:bind_batch}} ``` :::info diff --git a/docs/en/07-develop/03-insert-data/_rust_line.mdx b/docs/en/07-develop/03-insert-data/_rust_line.mdx new file mode 100644 index 0000000000000000000000000000000000000000..dbb35d76bc3517463902b642ce4a3861ae42b2f8 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_rust_line.mdx @@ -0,0 +1,3 @@ +```rust +{{#include docs/examples/rust/schemalessexample/examples/influxdb_line_example.rs}} +``` diff --git a/docs/en/07-develop/03-insert-data/_rust_opts_json.mdx b/docs/en/07-develop/03-insert-data/_rust_opts_json.mdx new file mode 100644 index 0000000000000000000000000000000000000000..cc2055510bce006491ed277a8e884b9958a5a993 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_rust_opts_json.mdx @@ -0,0 +1,3 @@ +```rust +{{#include docs/examples/rust/schemalessexample/examples/opentsdb_json_example.rs}} +``` diff --git a/docs/en/07-develop/03-insert-data/_rust_opts_telnet.mdx b/docs/en/07-develop/03-insert-data/_rust_opts_telnet.mdx new file mode 100644 index 0000000000000000000000000000000000000000..109c0c5d019e250b87e12c535e4f55c69924b4af --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_rust_opts_telnet.mdx @@ -0,0 +1,3 @@ +```rust +{{#include docs/examples/rust/schemalessexample/examples/opentsdb_telnet_example.rs}} +``` diff --git a/docs/en/07-develop/03-insert-data/_rust_sql.mdx b/docs/en/07-develop/03-insert-data/_rust_sql.mdx new file mode 100644 index 0000000000000000000000000000000000000000..fb59a4826510e666457ac592328cc5ba17412c79 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_rust_sql.mdx @@ -0,0 +1,3 @@ +```rust +{{#include docs/examples/rust/restexample/examples/insert_example.rs}} +``` diff --git a/docs/en/07-develop/03-insert-data/_rust_stmt.mdx b/docs/en/07-develop/03-insert-data/_rust_stmt.mdx new file mode 100644 index 0000000000000000000000000000000000000000..a889b56745601158489037a590b6cf5bd80da543 --- /dev/null +++ b/docs/en/07-develop/03-insert-data/_rust_stmt.mdx @@ -0,0 +1,3 @@ +```rust +{{#include docs/examples/rust/nativeexample/examples/stmt_example.rs}} +``` diff --git a/docs-en/07-develop/03-insert-data/index.md b/docs/en/07-develop/03-insert-data/index.md similarity index 100% rename from docs-en/07-develop/03-insert-data/index.md rename to docs/en/07-develop/03-insert-data/index.md diff --git a/docs/en/07-develop/04-query-data/_c.mdx b/docs/en/07-develop/04-query-data/_c.mdx new file mode 100644 index 0000000000000000000000000000000000000000..c51557ef2918dd9152e329c6e1937109d286b11c --- /dev/null +++ b/docs/en/07-develop/04-query-data/_c.mdx @@ -0,0 +1,3 @@ +```c +{{#include docs/examples/c/query_example.c}} +``` \ No newline at end of file diff --git a/docs/en/07-develop/04-query-data/_c_async.mdx b/docs/en/07-develop/04-query-data/_c_async.mdx new file mode 100644 index 0000000000000000000000000000000000000000..641a53e82ddb252e1b3255799bd922158a08f229 --- /dev/null +++ b/docs/en/07-develop/04-query-data/_c_async.mdx @@ -0,0 +1,3 @@ +```c +{{#include docs/examples/c/async_query_example.c:demo}} +``` \ No newline at end of file diff --git a/docs-en/07-develop/04-query-data/_category_.yml b/docs/en/07-develop/04-query-data/_category_.yml similarity index 100% rename from docs-en/07-develop/04-query-data/_category_.yml rename to docs/en/07-develop/04-query-data/_category_.yml diff --git a/docs/en/07-develop/04-query-data/_cs.mdx b/docs/en/07-develop/04-query-data/_cs.mdx new file mode 100644 index 0000000000000000000000000000000000000000..4bb582ecbfaeceac679af975e7752d1caeacb018 --- /dev/null +++ b/docs/en/07-develop/04-query-data/_cs.mdx @@ -0,0 +1,3 @@ +```csharp +{{#include docs/examples/csharp/QueryExample.cs}} +``` diff --git a/docs/en/07-develop/04-query-data/_cs_async.mdx b/docs/en/07-develop/04-query-data/_cs_async.mdx new file mode 100644 index 0000000000000000000000000000000000000000..3ecf635fd39db402d1db68de6d7336b7b2d9d8e8 --- /dev/null +++ b/docs/en/07-develop/04-query-data/_cs_async.mdx @@ -0,0 +1,3 @@ +```csharp +{{#include docs/examples/csharp/AsyncQueryExample.cs}} +``` diff --git a/docs/en/07-develop/04-query-data/_go.mdx b/docs/en/07-develop/04-query-data/_go.mdx new file mode 100644 index 0000000000000000000000000000000000000000..b43894a1ebe8aa0a261cce5f2469f2b3f8449fc4 --- /dev/null +++ b/docs/en/07-develop/04-query-data/_go.mdx @@ -0,0 +1,3 @@ +```go +{{#include docs/examples/go/query/sync/main.go}} +``` diff --git a/docs/en/07-develop/04-query-data/_go_async.mdx b/docs/en/07-develop/04-query-data/_go_async.mdx new file mode 100644 index 0000000000000000000000000000000000000000..3fbc6f5b6dac9d3987678e64d7268eed200ce513 --- /dev/null +++ b/docs/en/07-develop/04-query-data/_go_async.mdx @@ -0,0 +1,3 @@ +```go +{{#include docs/examples/go/query/async/main.go}} +``` diff --git a/docs/en/07-develop/04-query-data/_java.mdx b/docs/en/07-develop/04-query-data/_java.mdx new file mode 100644 index 0000000000000000000000000000000000000000..74de32658c658fb81c29349a1997e32ed512db1b --- /dev/null +++ b/docs/en/07-develop/04-query-data/_java.mdx @@ -0,0 +1,3 @@ +```java +{{#include docs/examples/java/src/main/java/com/taos/example/RestQueryExample.java}} +``` diff --git a/docs/en/07-develop/04-query-data/_js.mdx b/docs/en/07-develop/04-query-data/_js.mdx new file mode 100644 index 0000000000000000000000000000000000000000..5883d378e7c7acab033bffb2018f00f1ab5a48d5 --- /dev/null +++ b/docs/en/07-develop/04-query-data/_js.mdx @@ -0,0 +1,3 @@ +```js +{{#include docs/examples/node/nativeexample/query_example.js}} +``` diff --git a/docs/en/07-develop/04-query-data/_js_async.mdx b/docs/en/07-develop/04-query-data/_js_async.mdx new file mode 100644 index 0000000000000000000000000000000000000000..4b0f54a0342e62da1e5050d49546ca605ae1d729 --- /dev/null +++ b/docs/en/07-develop/04-query-data/_js_async.mdx @@ -0,0 +1,3 @@ +```js +{{#include docs/examples/node/nativeexample/async_query_example.js}} +``` diff --git a/docs-en/07-develop/04-query-data/_py.mdx b/docs/en/07-develop/04-query-data/_py.mdx similarity index 53% rename from docs-en/07-develop/04-query-data/_py.mdx rename to docs/en/07-develop/04-query-data/_py.mdx index aeae42a15e5c39b7e9d227afc424e77658109705..8ebeca450bd611913874b606b73e65f1e484d239 100644 --- a/docs-en/07-develop/04-query-data/_py.mdx +++ b/docs/en/07-develop/04-query-data/_py.mdx @@ -1,11 +1,11 @@ Result set is iterated row by row. ```py -{{#include docs-examples/python/query_example.py:iter}} +{{#include docs/examples/python/query_example.py:iter}} ``` Result set is retrieved as a whole, each row is converted to a dict and returned. ```py -{{#include docs-examples/python/query_example.py:fetch_all}} +{{#include docs/examples/python/query_example.py:fetch_all}} ``` \ No newline at end of file diff --git a/docs-en/07-develop/04-query-data/_py_async.mdx b/docs/en/07-develop/04-query-data/_py_async.mdx similarity index 58% rename from docs-en/07-develop/04-query-data/_py_async.mdx rename to docs/en/07-develop/04-query-data/_py_async.mdx index ed6880ae64e59a860e7dc75a5d3c1ad5d2614d01..393a5b173351bafcbdb469ac7d00db0a6b22dbc1 100644 --- a/docs-en/07-develop/04-query-data/_py_async.mdx +++ b/docs/en/07-develop/04-query-data/_py_async.mdx @@ -1,5 +1,5 @@ ```py -{{#include docs-examples/python/async_query_example.py}} +{{#include docs/examples/python/async_query_example.py}} ``` :::note diff --git a/docs/en/07-develop/04-query-data/_rust.mdx b/docs/en/07-develop/04-query-data/_rust.mdx new file mode 100644 index 0000000000000000000000000000000000000000..cab1b403fbba0cb432ecb9cb280a0fa7582c5be1 --- /dev/null +++ b/docs/en/07-develop/04-query-data/_rust.mdx @@ -0,0 +1,3 @@ +```rust +{{#include docs/examples/rust/restexample/examples/query_example.rs}} +``` diff --git a/docs-en/07-develop/04-query-data/index.mdx b/docs/en/07-develop/04-query-data/index.mdx similarity index 100% rename from docs-en/07-develop/04-query-data/index.mdx rename to docs/en/07-develop/04-query-data/index.mdx diff --git a/docs-en/07-develop/05-delete-data.mdx b/docs/en/07-develop/05-delete-data.mdx similarity index 100% rename from docs-en/07-develop/05-delete-data.mdx rename to docs/en/07-develop/05-delete-data.mdx diff --git a/docs-en/07-develop/06-continuous-query.mdx b/docs/en/07-develop/06-continuous-query.mdx similarity index 100% rename from docs-en/07-develop/06-continuous-query.mdx rename to docs/en/07-develop/06-continuous-query.mdx diff --git a/docs-en/07-develop/07-subscribe.mdx b/docs/en/07-develop/07-subscribe.mdx similarity index 100% rename from docs-en/07-develop/07-subscribe.mdx rename to docs/en/07-develop/07-subscribe.mdx diff --git a/docs-en/07-develop/08-cache.md b/docs/en/07-develop/08-cache.md similarity index 100% rename from docs-en/07-develop/08-cache.md rename to docs/en/07-develop/08-cache.md diff --git a/docs-en/07-develop/09-udf.md b/docs/en/07-develop/09-udf.md similarity index 100% rename from docs-en/07-develop/09-udf.md rename to docs/en/07-develop/09-udf.md diff --git a/docs-en/07-develop/_category_.yml b/docs/en/07-develop/_category_.yml similarity index 100% rename from docs-en/07-develop/_category_.yml rename to docs/en/07-develop/_category_.yml diff --git a/docs/en/07-develop/_sub_c.mdx b/docs/en/07-develop/_sub_c.mdx new file mode 100644 index 0000000000000000000000000000000000000000..da492a0269f064d8cdf9dfb80969894131d94015 --- /dev/null +++ b/docs/en/07-develop/_sub_c.mdx @@ -0,0 +1,3 @@ +```c +{{#include docs/examples/c/subscribe_demo.c}} +``` \ No newline at end of file diff --git a/docs/en/07-develop/_sub_cs.mdx b/docs/en/07-develop/_sub_cs.mdx new file mode 100644 index 0000000000000000000000000000000000000000..a435ea0273c94cbe75eaf7431e1a9c39d49d92e3 --- /dev/null +++ b/docs/en/07-develop/_sub_cs.mdx @@ -0,0 +1,3 @@ +```csharp +{{#include docs/examples/csharp/SubscribeDemo.cs}} +``` \ No newline at end of file diff --git a/docs/en/07-develop/_sub_go.mdx b/docs/en/07-develop/_sub_go.mdx new file mode 100644 index 0000000000000000000000000000000000000000..34b2aefd92c5eef75b59fbbba96b83da091722a7 --- /dev/null +++ b/docs/en/07-develop/_sub_go.mdx @@ -0,0 +1,3 @@ +```go +{{#include docs/examples/go/sub/main.go}} +``` \ No newline at end of file diff --git a/docs-en/07-develop/_sub_java.mdx b/docs/en/07-develop/_sub_java.mdx similarity index 70% rename from docs-en/07-develop/_sub_java.mdx rename to docs/en/07-develop/_sub_java.mdx index e65bc576ebed030d935ced6a4572289cd367ffac..ab77f61348c115d3fe3336df47d467c5525f41b8 100644 --- a/docs-en/07-develop/_sub_java.mdx +++ b/docs/en/07-develop/_sub_java.mdx @@ -1,5 +1,5 @@ ```java -{{#include docs-examples/java/src/main/java/com/taos/example/SubscribeDemo.java}} +{{#include docs/examples/java/src/main/java/com/taos/example/SubscribeDemo.java}} ``` :::note For now Java connector doesn't provide asynchronous subscription, but `TimerTask` can be used to achieve similar purpose. diff --git a/docs/en/07-develop/_sub_node.mdx b/docs/en/07-develop/_sub_node.mdx new file mode 100644 index 0000000000000000000000000000000000000000..3eeff0922a31a478dd34a77c6cb6471f51a57a8c --- /dev/null +++ b/docs/en/07-develop/_sub_node.mdx @@ -0,0 +1,3 @@ +```js +{{#include docs/examples/node/nativeexample/subscribe_demo.js}} +``` \ No newline at end of file diff --git a/docs/en/07-develop/_sub_python.mdx b/docs/en/07-develop/_sub_python.mdx new file mode 100644 index 0000000000000000000000000000000000000000..490b76fca6deb61e61dc59c2096b30742a7d25f7 --- /dev/null +++ b/docs/en/07-develop/_sub_python.mdx @@ -0,0 +1,3 @@ +```py +{{#include docs/examples/python/subscribe_demo.py}} +``` \ No newline at end of file diff --git a/docs/en/07-develop/_sub_rust.mdx b/docs/en/07-develop/_sub_rust.mdx new file mode 100644 index 0000000000000000000000000000000000000000..afb8d79daa3bbd72d72795cb4425f12277d710fc --- /dev/null +++ b/docs/en/07-develop/_sub_rust.mdx @@ -0,0 +1,3 @@ +```rs +{{#include docs/examples/rust/nativeexample/examples/subscribe_demo.rs}} +``` \ No newline at end of file diff --git a/docs-en/07-develop/index.md b/docs/en/07-develop/index.md similarity index 100% rename from docs-en/07-develop/index.md rename to docs/en/07-develop/index.md diff --git a/docs-en/10-cluster/01-deploy.md b/docs/en/10-cluster/01-deploy.md similarity index 100% rename from docs-en/10-cluster/01-deploy.md rename to docs/en/10-cluster/01-deploy.md diff --git a/docs-en/10-cluster/02-cluster-mgmt.md b/docs/en/10-cluster/02-cluster-mgmt.md similarity index 100% rename from docs-en/10-cluster/02-cluster-mgmt.md rename to docs/en/10-cluster/02-cluster-mgmt.md diff --git a/docs-en/10-cluster/03-ha-and-lb.md b/docs/en/10-cluster/03-ha-and-lb.md similarity index 100% rename from docs-en/10-cluster/03-ha-and-lb.md rename to docs/en/10-cluster/03-ha-and-lb.md diff --git a/docs-en/10-cluster/_category_.yml b/docs/en/10-cluster/_category_.yml similarity index 100% rename from docs-en/10-cluster/_category_.yml rename to docs/en/10-cluster/_category_.yml diff --git a/docs-en/10-cluster/index.md b/docs/en/10-cluster/index.md similarity index 100% rename from docs-en/10-cluster/index.md rename to docs/en/10-cluster/index.md diff --git a/docs-en/12-taos-sql/01-data-type.md b/docs/en/12-taos-sql/01-data-type.md similarity index 100% rename from docs-en/12-taos-sql/01-data-type.md rename to docs/en/12-taos-sql/01-data-type.md diff --git a/docs-en/12-taos-sql/02-database.md b/docs/en/12-taos-sql/02-database.md similarity index 100% rename from docs-en/12-taos-sql/02-database.md rename to docs/en/12-taos-sql/02-database.md diff --git a/docs-en/12-taos-sql/03-table.md b/docs/en/12-taos-sql/03-table.md similarity index 100% rename from docs-en/12-taos-sql/03-table.md rename to docs/en/12-taos-sql/03-table.md diff --git a/docs-en/12-taos-sql/04-stable.md b/docs/en/12-taos-sql/04-stable.md similarity index 100% rename from docs-en/12-taos-sql/04-stable.md rename to docs/en/12-taos-sql/04-stable.md diff --git a/docs-en/12-taos-sql/05-insert.md b/docs/en/12-taos-sql/05-insert.md similarity index 100% rename from docs-en/12-taos-sql/05-insert.md rename to docs/en/12-taos-sql/05-insert.md diff --git a/docs-en/12-taos-sql/06-select.md b/docs/en/12-taos-sql/06-select.md similarity index 100% rename from docs-en/12-taos-sql/06-select.md rename to docs/en/12-taos-sql/06-select.md diff --git a/docs-en/12-taos-sql/07-function.md b/docs/en/12-taos-sql/07-function.md similarity index 100% rename from docs-en/12-taos-sql/07-function.md rename to docs/en/12-taos-sql/07-function.md diff --git a/docs-en/12-taos-sql/08-interval.md b/docs/en/12-taos-sql/08-interval.md similarity index 100% rename from docs-en/12-taos-sql/08-interval.md rename to docs/en/12-taos-sql/08-interval.md diff --git a/docs-en/12-taos-sql/09-limit.md b/docs/en/12-taos-sql/09-limit.md similarity index 100% rename from docs-en/12-taos-sql/09-limit.md rename to docs/en/12-taos-sql/09-limit.md diff --git a/docs-en/12-taos-sql/10-json.md b/docs/en/12-taos-sql/10-json.md similarity index 100% rename from docs-en/12-taos-sql/10-json.md rename to docs/en/12-taos-sql/10-json.md diff --git a/docs-en/12-taos-sql/11-escape.md b/docs/en/12-taos-sql/11-escape.md similarity index 100% rename from docs-en/12-taos-sql/11-escape.md rename to docs/en/12-taos-sql/11-escape.md diff --git a/docs-en/12-taos-sql/12-keywords.md b/docs/en/12-taos-sql/12-keywords.md similarity index 100% rename from docs-en/12-taos-sql/12-keywords.md rename to docs/en/12-taos-sql/12-keywords.md diff --git a/docs-en/12-taos-sql/13-operators.md b/docs/en/12-taos-sql/13-operators.md similarity index 100% rename from docs-en/12-taos-sql/13-operators.md rename to docs/en/12-taos-sql/13-operators.md diff --git a/docs-en/12-taos-sql/_category_.yml b/docs/en/12-taos-sql/_category_.yml similarity index 100% rename from docs-en/12-taos-sql/_category_.yml rename to docs/en/12-taos-sql/_category_.yml diff --git a/docs-en/12-taos-sql/index.md b/docs/en/12-taos-sql/index.md similarity index 100% rename from docs-en/12-taos-sql/index.md rename to docs/en/12-taos-sql/index.md diff --git a/docs-cn/12-taos-sql/timewindow-1.webp b/docs/en/12-taos-sql/timewindow-1.webp similarity index 100% rename from docs-cn/12-taos-sql/timewindow-1.webp rename to docs/en/12-taos-sql/timewindow-1.webp diff --git a/docs-cn/12-taos-sql/timewindow-2.webp b/docs/en/12-taos-sql/timewindow-2.webp similarity index 100% rename from docs-cn/12-taos-sql/timewindow-2.webp rename to docs/en/12-taos-sql/timewindow-2.webp diff --git a/docs-cn/12-taos-sql/timewindow-3.webp b/docs/en/12-taos-sql/timewindow-3.webp similarity index 100% rename from docs-cn/12-taos-sql/timewindow-3.webp rename to docs/en/12-taos-sql/timewindow-3.webp diff --git a/docs-en/13-operation/01-pkg-install.md b/docs/en/13-operation/01-pkg-install.md similarity index 100% rename from docs-en/13-operation/01-pkg-install.md rename to docs/en/13-operation/01-pkg-install.md diff --git a/docs-en/13-operation/02-planning.mdx b/docs/en/13-operation/02-planning.mdx similarity index 100% rename from docs-en/13-operation/02-planning.mdx rename to docs/en/13-operation/02-planning.mdx diff --git a/docs-en/13-operation/03-tolerance.md b/docs/en/13-operation/03-tolerance.md similarity index 100% rename from docs-en/13-operation/03-tolerance.md rename to docs/en/13-operation/03-tolerance.md diff --git a/docs-en/13-operation/06-admin.md b/docs/en/13-operation/06-admin.md similarity index 100% rename from docs-en/13-operation/06-admin.md rename to docs/en/13-operation/06-admin.md diff --git a/docs-en/13-operation/07-import.md b/docs/en/13-operation/07-import.md similarity index 100% rename from docs-en/13-operation/07-import.md rename to docs/en/13-operation/07-import.md diff --git a/docs-en/13-operation/08-export.md b/docs/en/13-operation/08-export.md similarity index 100% rename from docs-en/13-operation/08-export.md rename to docs/en/13-operation/08-export.md diff --git a/docs-en/13-operation/09-status.md b/docs/en/13-operation/09-status.md similarity index 100% rename from docs-en/13-operation/09-status.md rename to docs/en/13-operation/09-status.md diff --git a/docs-en/13-operation/10-monitor.md b/docs/en/13-operation/10-monitor.md similarity index 100% rename from docs-en/13-operation/10-monitor.md rename to docs/en/13-operation/10-monitor.md diff --git a/docs-en/13-operation/17-diagnose.md b/docs/en/13-operation/17-diagnose.md similarity index 100% rename from docs-en/13-operation/17-diagnose.md rename to docs/en/13-operation/17-diagnose.md diff --git a/docs-en/13-operation/_category_.yml b/docs/en/13-operation/_category_.yml similarity index 100% rename from docs-en/13-operation/_category_.yml rename to docs/en/13-operation/_category_.yml diff --git a/docs-en/13-operation/index.md b/docs/en/13-operation/index.md similarity index 100% rename from docs-en/13-operation/index.md rename to docs/en/13-operation/index.md diff --git a/docs-en/14-reference/02-rest-api/02-rest-api.mdx b/docs/en/14-reference/02-rest-api/02-rest-api.mdx similarity index 100% rename from docs-en/14-reference/02-rest-api/02-rest-api.mdx rename to docs/en/14-reference/02-rest-api/02-rest-api.mdx diff --git a/docs-cn/14-reference/02-rest-api/_category_.yml b/docs/en/14-reference/02-rest-api/_category_.yml similarity index 100% rename from docs-cn/14-reference/02-rest-api/_category_.yml rename to docs/en/14-reference/02-rest-api/_category_.yml diff --git a/docs-en/14-reference/03-connector/03-connector.mdx b/docs/en/14-reference/03-connector/03-connector.mdx similarity index 100% rename from docs-en/14-reference/03-connector/03-connector.mdx rename to docs/en/14-reference/03-connector/03-connector.mdx diff --git a/docs-en/14-reference/03-connector/_category_.yml b/docs/en/14-reference/03-connector/_category_.yml similarity index 100% rename from docs-en/14-reference/03-connector/_category_.yml rename to docs/en/14-reference/03-connector/_category_.yml diff --git a/docs-en/14-reference/03-connector/_linux_install.mdx b/docs/en/14-reference/03-connector/_linux_install.mdx similarity index 100% rename from docs-en/14-reference/03-connector/_linux_install.mdx rename to docs/en/14-reference/03-connector/_linux_install.mdx diff --git a/docs-en/14-reference/03-connector/_preparation.mdx b/docs/en/14-reference/03-connector/_preparation.mdx similarity index 100% rename from docs-en/14-reference/03-connector/_preparation.mdx rename to docs/en/14-reference/03-connector/_preparation.mdx diff --git a/docs-en/14-reference/03-connector/_verify_linux.mdx b/docs/en/14-reference/03-connector/_verify_linux.mdx similarity index 100% rename from docs-en/14-reference/03-connector/_verify_linux.mdx rename to docs/en/14-reference/03-connector/_verify_linux.mdx diff --git a/docs-en/14-reference/03-connector/_verify_windows.mdx b/docs/en/14-reference/03-connector/_verify_windows.mdx similarity index 100% rename from docs-en/14-reference/03-connector/_verify_windows.mdx rename to docs/en/14-reference/03-connector/_verify_windows.mdx diff --git a/docs-en/14-reference/03-connector/_windows_install.mdx b/docs/en/14-reference/03-connector/_windows_install.mdx similarity index 100% rename from docs-en/14-reference/03-connector/_windows_install.mdx rename to docs/en/14-reference/03-connector/_windows_install.mdx diff --git a/docs-cn/14-reference/03-connector/connector.webp b/docs/en/14-reference/03-connector/connector.webp similarity index 100% rename from docs-cn/14-reference/03-connector/connector.webp rename to docs/en/14-reference/03-connector/connector.webp diff --git a/docs-en/14-reference/03-connector/cpp.mdx b/docs/en/14-reference/03-connector/cpp.mdx similarity index 100% rename from docs-en/14-reference/03-connector/cpp.mdx rename to docs/en/14-reference/03-connector/cpp.mdx diff --git a/docs-en/14-reference/03-connector/csharp.mdx b/docs/en/14-reference/03-connector/csharp.mdx similarity index 100% rename from docs-en/14-reference/03-connector/csharp.mdx rename to docs/en/14-reference/03-connector/csharp.mdx diff --git a/docs-en/14-reference/03-connector/go.mdx b/docs/en/14-reference/03-connector/go.mdx similarity index 100% rename from docs-en/14-reference/03-connector/go.mdx rename to docs/en/14-reference/03-connector/go.mdx diff --git a/docs-en/14-reference/03-connector/java.mdx b/docs/en/14-reference/03-connector/java.mdx similarity index 100% rename from docs-en/14-reference/03-connector/java.mdx rename to docs/en/14-reference/03-connector/java.mdx diff --git a/docs-en/14-reference/03-connector/node.mdx b/docs/en/14-reference/03-connector/node.mdx similarity index 100% rename from docs-en/14-reference/03-connector/node.mdx rename to docs/en/14-reference/03-connector/node.mdx diff --git a/docs-en/14-reference/03-connector/php.mdx b/docs/en/14-reference/03-connector/php.mdx similarity index 95% rename from docs-en/14-reference/03-connector/php.mdx rename to docs/en/14-reference/03-connector/php.mdx index 839a5c8c3cd27f39b234b51aab4d41ad05e93fbc..69dcce91e80fa05face1ffb35effe1ce1efa2631 100644 --- a/docs-en/14-reference/03-connector/php.mdx +++ b/docs/en/14-reference/03-connector/php.mdx @@ -91,7 +91,7 @@ In this section a few sample programs which use TDengine PHP connector to access Establish Connection ```c -{{#include docs-examples/php/connect.php}} +{{#include docs/examples/php/connect.php}} ``` @@ -102,7 +102,7 @@ In this section a few sample programs which use TDengine PHP connector to access Insert Data ```c -{{#include docs-examples/php/insert.php}} +{{#include docs/examples/php/insert.php}} ``` @@ -113,7 +113,7 @@ In this section a few sample programs which use TDengine PHP connector to access Synchronous Query ```c -{{#include docs-examples/php/query.php}} +{{#include docs/examples/php/query.php}} ``` @@ -124,7 +124,7 @@ In this section a few sample programs which use TDengine PHP connector to access Parameter Binding ```c -{{#include docs-examples/php/insert_stmt.php}} +{{#include docs/examples/php/insert_stmt.php}} ``` diff --git a/docs-en/14-reference/03-connector/python.mdx b/docs/en/14-reference/03-connector/python.mdx similarity index 95% rename from docs-en/14-reference/03-connector/python.mdx rename to docs/en/14-reference/03-connector/python.mdx index 58b94f13ae0f08404cef328834ef1c925c307816..04eb2e57d4455a83b62633ecb988cb64bf837fea 100644 --- a/docs-en/14-reference/03-connector/python.mdx +++ b/docs/en/14-reference/03-connector/python.mdx @@ -169,7 +169,7 @@ The following example code assumes that TDengine is installed locally and that t ```python -{{#include docs-examples/python/connect_native_reference.py}} +{{#include docs/examples/python/connect_native_reference.py}} ``` All arguments of the `connect()` function are optional keyword arguments. The following are the connection parameters specified. @@ -194,7 +194,7 @@ The `connect()` function returns a `taos.TaosConnection` instance. In client-sid ```python -{{#include docs-examples/python/connect_rest_examples.py:connect}} +{{#include docs/examples/python/connect_rest_examples.py:connect}} ``` All arguments to the `connect()` function are optional keyword arguments. The following are the connection parameters specified. @@ -219,11 +219,11 @@ All arguments to the `connect()` function are optional keyword arguments. The fo The `TaosConnection` class contains both an implementation of the PEP249 Connection interface (e.g., the `cursor()` method and the `close()` method) and many extensions (e.g., the `execute()`, `query()`, `schemaless_insert()`, and `subscribe()` methods). ```python title="execute method" -{{#include docs-examples/python/connection_usage_native_reference.py:insert}} +{{#include docs/examples/python/connection_usage_native_reference.py:insert}} ``` ```python title="query method" -{{#include docs-examples/python/connection_usage_native_reference.py:query}} +{{#include docs/examples/python/connection_usage_native_reference.py:query}} ``` :::tip @@ -235,14 +235,14 @@ The queried results can only be fetched once. For example, only one of `fetch_al In the above example of using the `TaosConnection` class, we have shown two ways to get the result of a query: `fetch_all()` and `fetch_all_into_dict()`. In addition, `TaosResult` also provides methods to iterate through the result set by rows (`rows_iter`) or by data blocks (`blocks_iter`). Using these two methods will be more efficient in scenarios where the query has a large amount of data. ```python title="blocks_iter method" -{{#include docs-examples/python/result_set_examples.py}} +{{#include docs/examples/python/result_set_examples.py}} ``` ##### Use of the TaosCursor class The `TaosConnection` class and the `TaosResult` class already implement all the functionality of the native interface. If you are familiar with the interfaces in the PEP249 specification, you can also use the methods provided by the `TaosCursor` class. ```python title="Use of TaosCursor" -{{#include docs-examples/python/cursor_usage_native_reference.py}} +{{#include docs/examples/python/cursor_usage_native_reference.py}} ``` :::note @@ -258,7 +258,7 @@ The TaosCursor class uses native connections for write and query operations. In The ``TaosRestCursor`` class is an implementation of the PEP249 Cursor interface. ```python title="Use of TaosRestCursor" -{{#include docs-examples/python/connect_rest_examples.py:basic}} +{{#include docs/examples/python/connect_rest_examples.py:basic}} ``` - `cursor.execute` : Used to execute arbitrary SQL statements. - `cursor.rowcount` : For write operations, returns the number of successful rows written. For query operations, returns the number of rows in the result set. @@ -269,7 +269,7 @@ The ``TaosRestCursor`` class is an implementation of the PEP249 Cursor interface The `RestClient` class is a direct wrapper for the [REST API](/reference/rest-api). It contains only a `sql()` method for executing arbitrary SQL statements and returning the result. ```python title="Use of RestClient" -{{#include docs-examples/python/rest_client_example.py}} +{{#include docs/examples/python/rest_client_example.py}} ``` For a more detailed description of the `sql()` method, please refer to [RestClient](https://docs.taosdata.com/api/taospy/taosrest/restclient.html). @@ -283,14 +283,14 @@ For a more detailed description of the `sql()` method, please refer to [RestClie ```python -{{#include docs-examples/python/conn_native_pandas.py}} +{{#include docs/examples/python/conn_native_pandas.py}} ``` ```python -{{#include docs-examples/python/conn_rest_pandas.py}} +{{#include docs/examples/python/conn_rest_pandas.py}} ``` @@ -314,7 +314,7 @@ For a more detailed description of the `sql()` method, please refer to [RestClie All errors from database operations are thrown directly as exceptions and the error message from the database is passed up the exception stack. The application is responsible for exception handling. For example: ```python -{{#include docs-examples/python/handle_exception.py}} +{{#include docs/examples/python/handle_exception.py}} ``` ### About nanoseconds diff --git a/docs-en/14-reference/03-connector/rust.mdx b/docs/en/14-reference/03-connector/rust.mdx similarity index 100% rename from docs-en/14-reference/03-connector/rust.mdx rename to docs/en/14-reference/03-connector/rust.mdx diff --git a/docs-en/14-reference/03-connector/tdengine-jdbc-connector.webp b/docs/en/14-reference/03-connector/tdengine-jdbc-connector.webp similarity index 100% rename from docs-en/14-reference/03-connector/tdengine-jdbc-connector.webp rename to docs/en/14-reference/03-connector/tdengine-jdbc-connector.webp diff --git a/docs-en/14-reference/04-taosadapter.md b/docs/en/14-reference/04-taosadapter.md similarity index 100% rename from docs-en/14-reference/04-taosadapter.md rename to docs/en/14-reference/04-taosadapter.md diff --git a/docs-en/14-reference/05-taosbenchmark.md b/docs/en/14-reference/05-taosbenchmark.md similarity index 100% rename from docs-en/14-reference/05-taosbenchmark.md rename to docs/en/14-reference/05-taosbenchmark.md diff --git a/docs-en/14-reference/06-taosdump.md b/docs/en/14-reference/06-taosdump.md similarity index 100% rename from docs-en/14-reference/06-taosdump.md rename to docs/en/14-reference/06-taosdump.md diff --git a/docs-cn/14-reference/07-tdinsight/assets/15146-tdengine-monitor-dashboard.json b/docs/en/14-reference/07-tdinsight/assets/15146-tdengine-monitor-dashboard.json similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/15146-tdengine-monitor-dashboard.json rename to docs/en/14-reference/07-tdinsight/assets/15146-tdengine-monitor-dashboard.json diff --git a/docs-cn/14-reference/07-tdinsight/assets/15155-tdengine-alert-demo.json b/docs/en/14-reference/07-tdinsight/assets/15155-tdengine-alert-demo.json similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/15155-tdengine-alert-demo.json rename to docs/en/14-reference/07-tdinsight/assets/15155-tdengine-alert-demo.json diff --git a/docs-cn/14-reference/07-tdinsight/assets/TDinsight-1-cluster-status.webp b/docs/en/14-reference/07-tdinsight/assets/TDinsight-1-cluster-status.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/TDinsight-1-cluster-status.webp rename to docs/en/14-reference/07-tdinsight/assets/TDinsight-1-cluster-status.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/TDinsight-2-dnodes.webp b/docs/en/14-reference/07-tdinsight/assets/TDinsight-2-dnodes.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/TDinsight-2-dnodes.webp rename to docs/en/14-reference/07-tdinsight/assets/TDinsight-2-dnodes.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/TDinsight-3-mnodes.webp b/docs/en/14-reference/07-tdinsight/assets/TDinsight-3-mnodes.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/TDinsight-3-mnodes.webp rename to docs/en/14-reference/07-tdinsight/assets/TDinsight-3-mnodes.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/TDinsight-4-requests.webp b/docs/en/14-reference/07-tdinsight/assets/TDinsight-4-requests.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/TDinsight-4-requests.webp rename to docs/en/14-reference/07-tdinsight/assets/TDinsight-4-requests.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/TDinsight-5-database.webp b/docs/en/14-reference/07-tdinsight/assets/TDinsight-5-database.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/TDinsight-5-database.webp rename to docs/en/14-reference/07-tdinsight/assets/TDinsight-5-database.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/TDinsight-6-dnode-usage.webp b/docs/en/14-reference/07-tdinsight/assets/TDinsight-6-dnode-usage.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/TDinsight-6-dnode-usage.webp rename to docs/en/14-reference/07-tdinsight/assets/TDinsight-6-dnode-usage.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/TDinsight-7-login-history.webp b/docs/en/14-reference/07-tdinsight/assets/TDinsight-7-login-history.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/TDinsight-7-login-history.webp rename to docs/en/14-reference/07-tdinsight/assets/TDinsight-7-login-history.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/TDinsight-8-taosadapter.webp b/docs/en/14-reference/07-tdinsight/assets/TDinsight-8-taosadapter.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/TDinsight-8-taosadapter.webp rename to docs/en/14-reference/07-tdinsight/assets/TDinsight-8-taosadapter.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/TDinsight-full.webp b/docs/en/14-reference/07-tdinsight/assets/TDinsight-full.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/TDinsight-full.webp rename to docs/en/14-reference/07-tdinsight/assets/TDinsight-full.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/alert-manager-status.webp b/docs/en/14-reference/07-tdinsight/assets/alert-manager-status.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/alert-manager-status.webp rename to docs/en/14-reference/07-tdinsight/assets/alert-manager-status.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/alert-notification-channel.webp b/docs/en/14-reference/07-tdinsight/assets/alert-notification-channel.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/alert-notification-channel.webp rename to docs/en/14-reference/07-tdinsight/assets/alert-notification-channel.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/alert-query-demo.webp b/docs/en/14-reference/07-tdinsight/assets/alert-query-demo.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/alert-query-demo.webp rename to docs/en/14-reference/07-tdinsight/assets/alert-query-demo.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/alert-rule-condition-notifications.webp b/docs/en/14-reference/07-tdinsight/assets/alert-rule-condition-notifications.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/alert-rule-condition-notifications.webp rename to docs/en/14-reference/07-tdinsight/assets/alert-rule-condition-notifications.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/alert-rule-test.webp b/docs/en/14-reference/07-tdinsight/assets/alert-rule-test.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/alert-rule-test.webp rename to docs/en/14-reference/07-tdinsight/assets/alert-rule-test.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/howto-add-datasource-button.webp b/docs/en/14-reference/07-tdinsight/assets/howto-add-datasource-button.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/howto-add-datasource-button.webp rename to docs/en/14-reference/07-tdinsight/assets/howto-add-datasource-button.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/howto-add-datasource-tdengine.webp b/docs/en/14-reference/07-tdinsight/assets/howto-add-datasource-tdengine.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/howto-add-datasource-tdengine.webp rename to docs/en/14-reference/07-tdinsight/assets/howto-add-datasource-tdengine.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/howto-add-datasource-test.webp b/docs/en/14-reference/07-tdinsight/assets/howto-add-datasource-test.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/howto-add-datasource-test.webp rename to docs/en/14-reference/07-tdinsight/assets/howto-add-datasource-test.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/howto-add-datasource.webp b/docs/en/14-reference/07-tdinsight/assets/howto-add-datasource.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/howto-add-datasource.webp rename to docs/en/14-reference/07-tdinsight/assets/howto-add-datasource.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/howto-dashboard-display.webp b/docs/en/14-reference/07-tdinsight/assets/howto-dashboard-display.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/howto-dashboard-display.webp rename to docs/en/14-reference/07-tdinsight/assets/howto-dashboard-display.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/howto-dashboard-import-options.webp b/docs/en/14-reference/07-tdinsight/assets/howto-dashboard-import-options.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/howto-dashboard-import-options.webp rename to docs/en/14-reference/07-tdinsight/assets/howto-dashboard-import-options.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/howto-import-dashboard.webp b/docs/en/14-reference/07-tdinsight/assets/howto-import-dashboard.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/howto-import-dashboard.webp rename to docs/en/14-reference/07-tdinsight/assets/howto-import-dashboard.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/import-dashboard-15167.webp b/docs/en/14-reference/07-tdinsight/assets/import-dashboard-15167.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/import-dashboard-15167.webp rename to docs/en/14-reference/07-tdinsight/assets/import-dashboard-15167.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/import-dashboard-for-tdengine.webp b/docs/en/14-reference/07-tdinsight/assets/import-dashboard-for-tdengine.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/import-dashboard-for-tdengine.webp rename to docs/en/14-reference/07-tdinsight/assets/import-dashboard-for-tdengine.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/import-via-grafana-dot-com.webp b/docs/en/14-reference/07-tdinsight/assets/import-via-grafana-dot-com.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/import-via-grafana-dot-com.webp rename to docs/en/14-reference/07-tdinsight/assets/import-via-grafana-dot-com.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/import_dashboard.webp b/docs/en/14-reference/07-tdinsight/assets/import_dashboard.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/import_dashboard.webp rename to docs/en/14-reference/07-tdinsight/assets/import_dashboard.webp diff --git a/docs-cn/14-reference/07-tdinsight/assets/tdengine-grafana-7.x.json b/docs/en/14-reference/07-tdinsight/assets/tdengine-grafana-7.x.json similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/tdengine-grafana-7.x.json rename to docs/en/14-reference/07-tdinsight/assets/tdengine-grafana-7.x.json diff --git a/docs-cn/14-reference/07-tdinsight/assets/tdengine-grafana.json b/docs/en/14-reference/07-tdinsight/assets/tdengine-grafana.json similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/tdengine-grafana.json rename to docs/en/14-reference/07-tdinsight/assets/tdengine-grafana.json diff --git a/docs-cn/14-reference/07-tdinsight/assets/tdengine_dashboard.webp b/docs/en/14-reference/07-tdinsight/assets/tdengine_dashboard.webp similarity index 100% rename from docs-cn/14-reference/07-tdinsight/assets/tdengine_dashboard.webp rename to docs/en/14-reference/07-tdinsight/assets/tdengine_dashboard.webp diff --git a/docs-en/14-reference/07-tdinsight/index.md b/docs/en/14-reference/07-tdinsight/index.md similarity index 100% rename from docs-en/14-reference/07-tdinsight/index.md rename to docs/en/14-reference/07-tdinsight/index.md diff --git a/docs-en/14-reference/08-taos-shell.md b/docs/en/14-reference/08-taos-shell.md similarity index 100% rename from docs-en/14-reference/08-taos-shell.md rename to docs/en/14-reference/08-taos-shell.md diff --git a/docs-en/14-reference/09-support-platform/_category_.yml b/docs/en/14-reference/09-support-platform/_category_.yml similarity index 100% rename from docs-en/14-reference/09-support-platform/_category_.yml rename to docs/en/14-reference/09-support-platform/_category_.yml diff --git a/docs-en/14-reference/09-support-platform/index.md b/docs/en/14-reference/09-support-platform/index.md similarity index 100% rename from docs-en/14-reference/09-support-platform/index.md rename to docs/en/14-reference/09-support-platform/index.md diff --git a/docs-en/14-reference/11-docker/_category_.yml b/docs/en/14-reference/11-docker/_category_.yml similarity index 100% rename from docs-en/14-reference/11-docker/_category_.yml rename to docs/en/14-reference/11-docker/_category_.yml diff --git a/docs-en/14-reference/11-docker/index.md b/docs/en/14-reference/11-docker/index.md similarity index 100% rename from docs-en/14-reference/11-docker/index.md rename to docs/en/14-reference/11-docker/index.md diff --git a/docs-en/14-reference/12-config/_category_.yml b/docs/en/14-reference/12-config/_category_.yml similarity index 100% rename from docs-en/14-reference/12-config/_category_.yml rename to docs/en/14-reference/12-config/_category_.yml diff --git a/docs-en/14-reference/12-config/index.md b/docs/en/14-reference/12-config/index.md similarity index 100% rename from docs-en/14-reference/12-config/index.md rename to docs/en/14-reference/12-config/index.md diff --git a/docs-en/14-reference/12-directory.md b/docs/en/14-reference/12-directory.md similarity index 100% rename from docs-en/14-reference/12-directory.md rename to docs/en/14-reference/12-directory.md diff --git a/docs-en/14-reference/13-schemaless/13-schemaless.md b/docs/en/14-reference/13-schemaless/13-schemaless.md similarity index 100% rename from docs-en/14-reference/13-schemaless/13-schemaless.md rename to docs/en/14-reference/13-schemaless/13-schemaless.md diff --git a/docs-en/14-reference/13-schemaless/_category_.yml b/docs/en/14-reference/13-schemaless/_category_.yml similarity index 100% rename from docs-en/14-reference/13-schemaless/_category_.yml rename to docs/en/14-reference/13-schemaless/_category_.yml diff --git a/docs-en/14-reference/_category_.yml b/docs/en/14-reference/_category_.yml similarity index 100% rename from docs-en/14-reference/_category_.yml rename to docs/en/14-reference/_category_.yml diff --git a/docs-en/14-reference/_collectd.mdx b/docs/en/14-reference/_collectd.mdx similarity index 100% rename from docs-en/14-reference/_collectd.mdx rename to docs/en/14-reference/_collectd.mdx diff --git a/docs-en/14-reference/_icinga2.mdx b/docs/en/14-reference/_icinga2.mdx similarity index 100% rename from docs-en/14-reference/_icinga2.mdx rename to docs/en/14-reference/_icinga2.mdx diff --git a/docs-en/14-reference/_prometheus.mdx b/docs/en/14-reference/_prometheus.mdx similarity index 100% rename from docs-en/14-reference/_prometheus.mdx rename to docs/en/14-reference/_prometheus.mdx diff --git a/docs-en/14-reference/_statsd.mdx b/docs/en/14-reference/_statsd.mdx similarity index 100% rename from docs-en/14-reference/_statsd.mdx rename to docs/en/14-reference/_statsd.mdx diff --git a/docs-en/14-reference/_tcollector.mdx b/docs/en/14-reference/_tcollector.mdx similarity index 100% rename from docs-en/14-reference/_tcollector.mdx rename to docs/en/14-reference/_tcollector.mdx diff --git a/docs-en/14-reference/_telegraf.mdx b/docs/en/14-reference/_telegraf.mdx similarity index 100% rename from docs-en/14-reference/_telegraf.mdx rename to docs/en/14-reference/_telegraf.mdx diff --git a/docs-en/14-reference/index.md b/docs/en/14-reference/index.md similarity index 100% rename from docs-en/14-reference/index.md rename to docs/en/14-reference/index.md diff --git a/docs-cn/14-reference/taosAdapter-architecture.webp b/docs/en/14-reference/taosAdapter-architecture.webp similarity index 100% rename from docs-cn/14-reference/taosAdapter-architecture.webp rename to docs/en/14-reference/taosAdapter-architecture.webp diff --git a/docs-en/20-third-party/01-grafana.mdx b/docs/en/20-third-party/01-grafana.mdx similarity index 100% rename from docs-en/20-third-party/01-grafana.mdx rename to docs/en/20-third-party/01-grafana.mdx diff --git a/docs-en/20-third-party/02-prometheus.md b/docs/en/20-third-party/02-prometheus.md similarity index 100% rename from docs-en/20-third-party/02-prometheus.md rename to docs/en/20-third-party/02-prometheus.md diff --git a/docs-en/20-third-party/03-telegraf.md b/docs/en/20-third-party/03-telegraf.md similarity index 100% rename from docs-en/20-third-party/03-telegraf.md rename to docs/en/20-third-party/03-telegraf.md diff --git a/docs-en/20-third-party/05-collectd.md b/docs/en/20-third-party/05-collectd.md similarity index 100% rename from docs-en/20-third-party/05-collectd.md rename to docs/en/20-third-party/05-collectd.md diff --git a/docs-en/20-third-party/06-statsd.md b/docs/en/20-third-party/06-statsd.md similarity index 100% rename from docs-en/20-third-party/06-statsd.md rename to docs/en/20-third-party/06-statsd.md diff --git a/docs-en/20-third-party/07-icinga2.md b/docs/en/20-third-party/07-icinga2.md similarity index 100% rename from docs-en/20-third-party/07-icinga2.md rename to docs/en/20-third-party/07-icinga2.md diff --git a/docs-en/20-third-party/08-tcollector.md b/docs/en/20-third-party/08-tcollector.md similarity index 100% rename from docs-en/20-third-party/08-tcollector.md rename to docs/en/20-third-party/08-tcollector.md diff --git a/docs-en/20-third-party/09-emq-broker.md b/docs/en/20-third-party/09-emq-broker.md similarity index 99% rename from docs-en/20-third-party/09-emq-broker.md rename to docs/en/20-third-party/09-emq-broker.md index 7c6b83cf99dd733f9e9a86435e079a2daee00ad9..8dfa09e6c7d1615ea3a1145428efe920588b687e 100644 --- a/docs-en/20-third-party/09-emq-broker.md +++ b/docs/en/20-third-party/09-emq-broker.md @@ -108,7 +108,7 @@ Finally, click the "Create" button at bottom left corner saving the rule. ## Compose program to mock data ```javascript -{{#include docs-examples/other/mock.js}} +{{#include docs/examples/other/mock.js}} ``` Note: `CLIENT_NUM` in the code can be set to a smaller value at the beginning of the test to avoid hardware performance be not capable to handle a more significant number of concurrent clients. diff --git a/docs-en/20-third-party/10-hive-mq-broker.md b/docs/en/20-third-party/10-hive-mq-broker.md similarity index 100% rename from docs-en/20-third-party/10-hive-mq-broker.md rename to docs/en/20-third-party/10-hive-mq-broker.md diff --git a/docs-en/20-third-party/11-kafka.md b/docs/en/20-third-party/11-kafka.md similarity index 100% rename from docs-en/20-third-party/11-kafka.md rename to docs/en/20-third-party/11-kafka.md diff --git a/docs-en/20-third-party/_category_.yml b/docs/en/20-third-party/_category_.yml similarity index 100% rename from docs-en/20-third-party/_category_.yml rename to docs/en/20-third-party/_category_.yml diff --git a/docs-en/20-third-party/_deploytaosadapter.mdx b/docs/en/20-third-party/_deploytaosadapter.mdx similarity index 100% rename from docs-en/20-third-party/_deploytaosadapter.mdx rename to docs/en/20-third-party/_deploytaosadapter.mdx diff --git a/docs-cn/20-third-party/emqx/add-action-handler.webp b/docs/en/20-third-party/emqx/add-action-handler.webp similarity index 100% rename from docs-cn/20-third-party/emqx/add-action-handler.webp rename to docs/en/20-third-party/emqx/add-action-handler.webp diff --git a/docs-cn/20-third-party/emqx/check-result-in-taos.webp b/docs/en/20-third-party/emqx/check-result-in-taos.webp similarity index 100% rename from docs-cn/20-third-party/emqx/check-result-in-taos.webp rename to docs/en/20-third-party/emqx/check-result-in-taos.webp diff --git a/docs-cn/20-third-party/emqx/check-rule-matched.webp b/docs/en/20-third-party/emqx/check-rule-matched.webp similarity index 100% rename from docs-cn/20-third-party/emqx/check-rule-matched.webp rename to docs/en/20-third-party/emqx/check-rule-matched.webp diff --git a/docs-cn/20-third-party/emqx/client-num.webp b/docs/en/20-third-party/emqx/client-num.webp similarity index 100% rename from docs-cn/20-third-party/emqx/client-num.webp rename to docs/en/20-third-party/emqx/client-num.webp diff --git a/docs-cn/20-third-party/emqx/create-resource.webp b/docs/en/20-third-party/emqx/create-resource.webp similarity index 100% rename from docs-cn/20-third-party/emqx/create-resource.webp rename to docs/en/20-third-party/emqx/create-resource.webp diff --git a/docs-cn/20-third-party/emqx/create-rule.webp b/docs/en/20-third-party/emqx/create-rule.webp similarity index 100% rename from docs-cn/20-third-party/emqx/create-rule.webp rename to docs/en/20-third-party/emqx/create-rule.webp diff --git a/docs-cn/20-third-party/emqx/edit-action.webp b/docs/en/20-third-party/emqx/edit-action.webp similarity index 100% rename from docs-cn/20-third-party/emqx/edit-action.webp rename to docs/en/20-third-party/emqx/edit-action.webp diff --git a/docs-cn/20-third-party/emqx/edit-resource.webp b/docs/en/20-third-party/emqx/edit-resource.webp similarity index 100% rename from docs-cn/20-third-party/emqx/edit-resource.webp rename to docs/en/20-third-party/emqx/edit-resource.webp diff --git a/docs-cn/20-third-party/emqx/login-dashboard.webp b/docs/en/20-third-party/emqx/login-dashboard.webp similarity index 100% rename from docs-cn/20-third-party/emqx/login-dashboard.webp rename to docs/en/20-third-party/emqx/login-dashboard.webp diff --git a/docs-cn/20-third-party/emqx/rule-engine.webp b/docs/en/20-third-party/emqx/rule-engine.webp similarity index 100% rename from docs-cn/20-third-party/emqx/rule-engine.webp rename to docs/en/20-third-party/emqx/rule-engine.webp diff --git a/docs-cn/20-third-party/emqx/rule-header-key-value.webp b/docs/en/20-third-party/emqx/rule-header-key-value.webp similarity index 100% rename from docs-cn/20-third-party/emqx/rule-header-key-value.webp rename to docs/en/20-third-party/emqx/rule-header-key-value.webp diff --git a/docs-cn/20-third-party/emqx/run-mock.webp b/docs/en/20-third-party/emqx/run-mock.webp similarity index 100% rename from docs-cn/20-third-party/emqx/run-mock.webp rename to docs/en/20-third-party/emqx/run-mock.webp diff --git a/docs-cn/20-third-party/add_datasource1.webp b/docs/en/20-third-party/grafana/add_datasource1.webp similarity index 100% rename from docs-cn/20-third-party/add_datasource1.webp rename to docs/en/20-third-party/grafana/add_datasource1.webp diff --git a/docs-cn/20-third-party/add_datasource2.webp b/docs/en/20-third-party/grafana/add_datasource2.webp similarity index 100% rename from docs-cn/20-third-party/add_datasource2.webp rename to docs/en/20-third-party/grafana/add_datasource2.webp diff --git a/docs-cn/20-third-party/add_datasource3.webp b/docs/en/20-third-party/grafana/add_datasource3.webp similarity index 100% rename from docs-cn/20-third-party/add_datasource3.webp rename to docs/en/20-third-party/grafana/add_datasource3.webp diff --git a/docs-cn/20-third-party/add_datasource4.webp b/docs/en/20-third-party/grafana/add_datasource4.webp similarity index 100% rename from docs-cn/20-third-party/add_datasource4.webp rename to docs/en/20-third-party/grafana/add_datasource4.webp diff --git a/docs-cn/20-third-party/create_dashboard1.webp b/docs/en/20-third-party/grafana/create_dashboard1.webp similarity index 100% rename from docs-cn/20-third-party/create_dashboard1.webp rename to docs/en/20-third-party/grafana/create_dashboard1.webp diff --git a/docs-cn/20-third-party/create_dashboard2.webp b/docs/en/20-third-party/grafana/create_dashboard2.webp similarity index 100% rename from docs-cn/20-third-party/create_dashboard2.webp rename to docs/en/20-third-party/grafana/create_dashboard2.webp diff --git a/docs-en/20-third-party/index.md b/docs/en/20-third-party/index.md similarity index 100% rename from docs-en/20-third-party/index.md rename to docs/en/20-third-party/index.md diff --git a/docs-cn/20-third-party/kafka/Kafka_Connect.webp b/docs/en/20-third-party/kafka/Kafka_Connect.webp similarity index 100% rename from docs-cn/20-third-party/kafka/Kafka_Connect.webp rename to docs/en/20-third-party/kafka/Kafka_Connect.webp diff --git a/docs-cn/20-third-party/kafka/confluentPlatform.webp b/docs/en/20-third-party/kafka/confluentPlatform.webp similarity index 100% rename from docs-cn/20-third-party/kafka/confluentPlatform.webp rename to docs/en/20-third-party/kafka/confluentPlatform.webp diff --git a/docs-cn/20-third-party/kafka/streaming-integration-with-kafka-connect.webp b/docs/en/20-third-party/kafka/streaming-integration-with-kafka-connect.webp similarity index 100% rename from docs-cn/20-third-party/kafka/streaming-integration-with-kafka-connect.webp rename to docs/en/20-third-party/kafka/streaming-integration-with-kafka-connect.webp diff --git a/docs-en/21-tdinternal/01-arch.md b/docs/en/21-tdinternal/01-arch.md similarity index 100% rename from docs-en/21-tdinternal/01-arch.md rename to docs/en/21-tdinternal/01-arch.md diff --git a/docs-en/21-tdinternal/_category_.yml b/docs/en/21-tdinternal/_category_.yml similarity index 100% rename from docs-en/21-tdinternal/_category_.yml rename to docs/en/21-tdinternal/_category_.yml diff --git a/docs-cn/21-tdinternal/dnode.webp b/docs/en/21-tdinternal/dnode.webp similarity index 100% rename from docs-cn/21-tdinternal/dnode.webp rename to docs/en/21-tdinternal/dnode.webp diff --git a/docs-en/21-tdinternal/index.md b/docs/en/21-tdinternal/index.md similarity index 100% rename from docs-en/21-tdinternal/index.md rename to docs/en/21-tdinternal/index.md diff --git a/docs-cn/21-tdinternal/message.webp b/docs/en/21-tdinternal/message.webp similarity index 100% rename from docs-cn/21-tdinternal/message.webp rename to docs/en/21-tdinternal/message.webp diff --git a/docs-cn/21-tdinternal/modules.webp b/docs/en/21-tdinternal/modules.webp similarity index 100% rename from docs-cn/21-tdinternal/modules.webp rename to docs/en/21-tdinternal/modules.webp diff --git a/docs-cn/21-tdinternal/multi_tables.webp b/docs/en/21-tdinternal/multi_tables.webp similarity index 100% rename from docs-cn/21-tdinternal/multi_tables.webp rename to docs/en/21-tdinternal/multi_tables.webp diff --git a/docs-cn/21-tdinternal/replica-forward.webp b/docs/en/21-tdinternal/replica-forward.webp similarity index 100% rename from docs-cn/21-tdinternal/replica-forward.webp rename to docs/en/21-tdinternal/replica-forward.webp diff --git a/docs-cn/21-tdinternal/replica-master.webp b/docs/en/21-tdinternal/replica-master.webp similarity index 100% rename from docs-cn/21-tdinternal/replica-master.webp rename to docs/en/21-tdinternal/replica-master.webp diff --git a/docs-cn/21-tdinternal/replica-restore.webp b/docs/en/21-tdinternal/replica-restore.webp similarity index 100% rename from docs-cn/21-tdinternal/replica-restore.webp rename to docs/en/21-tdinternal/replica-restore.webp diff --git a/docs-cn/21-tdinternal/structure.webp b/docs/en/21-tdinternal/structure.webp similarity index 100% rename from docs-cn/21-tdinternal/structure.webp rename to docs/en/21-tdinternal/structure.webp diff --git a/docs-cn/21-tdinternal/vnode.webp b/docs/en/21-tdinternal/vnode.webp similarity index 100% rename from docs-cn/21-tdinternal/vnode.webp rename to docs/en/21-tdinternal/vnode.webp diff --git a/docs-cn/21-tdinternal/write_master.webp b/docs/en/21-tdinternal/write_master.webp similarity index 100% rename from docs-cn/21-tdinternal/write_master.webp rename to docs/en/21-tdinternal/write_master.webp diff --git a/docs-cn/21-tdinternal/write_slave.webp b/docs/en/21-tdinternal/write_slave.webp similarity index 100% rename from docs-cn/21-tdinternal/write_slave.webp rename to docs/en/21-tdinternal/write_slave.webp diff --git a/docs-en/25-application/01-telegraf.md b/docs/en/25-application/01-telegraf.md similarity index 100% rename from docs-en/25-application/01-telegraf.md rename to docs/en/25-application/01-telegraf.md diff --git a/docs-en/25-application/02-collectd.md b/docs/en/25-application/02-collectd.md similarity index 100% rename from docs-en/25-application/02-collectd.md rename to docs/en/25-application/02-collectd.md diff --git a/docs-en/25-application/03-immigrate.md b/docs/en/25-application/03-immigrate.md similarity index 100% rename from docs-en/25-application/03-immigrate.md rename to docs/en/25-application/03-immigrate.md diff --git a/docs-cn/25-application/IT-DevOps-Solutions-Collectd-StatsD.webp b/docs/en/25-application/IT-DevOps-Solutions-Collectd-StatsD.webp similarity index 100% rename from docs-cn/25-application/IT-DevOps-Solutions-Collectd-StatsD.webp rename to docs/en/25-application/IT-DevOps-Solutions-Collectd-StatsD.webp diff --git a/docs-cn/25-application/IT-DevOps-Solutions-Immigrate-OpenTSDB-Arch.webp b/docs/en/25-application/IT-DevOps-Solutions-Immigrate-OpenTSDB-Arch.webp similarity index 100% rename from docs-cn/25-application/IT-DevOps-Solutions-Immigrate-OpenTSDB-Arch.webp rename to docs/en/25-application/IT-DevOps-Solutions-Immigrate-OpenTSDB-Arch.webp diff --git a/docs-cn/25-application/IT-DevOps-Solutions-Immigrate-OpenTSDB-Dashboard.webp b/docs/en/25-application/IT-DevOps-Solutions-Immigrate-OpenTSDB-Dashboard.webp similarity index 100% rename from docs-cn/25-application/IT-DevOps-Solutions-Immigrate-OpenTSDB-Dashboard.webp rename to docs/en/25-application/IT-DevOps-Solutions-Immigrate-OpenTSDB-Dashboard.webp diff --git a/docs-cn/25-application/IT-DevOps-Solutions-Immigrate-TDengine-Arch.webp b/docs/en/25-application/IT-DevOps-Solutions-Immigrate-TDengine-Arch.webp similarity index 100% rename from docs-cn/25-application/IT-DevOps-Solutions-Immigrate-TDengine-Arch.webp rename to docs/en/25-application/IT-DevOps-Solutions-Immigrate-TDengine-Arch.webp diff --git a/docs-cn/25-application/IT-DevOps-Solutions-Telegraf.webp b/docs/en/25-application/IT-DevOps-Solutions-Telegraf.webp similarity index 100% rename from docs-cn/25-application/IT-DevOps-Solutions-Telegraf.webp rename to docs/en/25-application/IT-DevOps-Solutions-Telegraf.webp diff --git a/docs-cn/25-application/IT-DevOps-Solutions-collectd-dashboard.webp b/docs/en/25-application/IT-DevOps-Solutions-collectd-dashboard.webp similarity index 100% rename from docs-cn/25-application/IT-DevOps-Solutions-collectd-dashboard.webp rename to docs/en/25-application/IT-DevOps-Solutions-collectd-dashboard.webp diff --git a/docs-cn/25-application/IT-DevOps-Solutions-statsd-dashboard.webp b/docs/en/25-application/IT-DevOps-Solutions-statsd-dashboard.webp similarity index 100% rename from docs-cn/25-application/IT-DevOps-Solutions-statsd-dashboard.webp rename to docs/en/25-application/IT-DevOps-Solutions-statsd-dashboard.webp diff --git a/docs-cn/25-application/IT-DevOps-Solutions-telegraf-dashboard.webp b/docs/en/25-application/IT-DevOps-Solutions-telegraf-dashboard.webp similarity index 100% rename from docs-cn/25-application/IT-DevOps-Solutions-telegraf-dashboard.webp rename to docs/en/25-application/IT-DevOps-Solutions-telegraf-dashboard.webp diff --git a/docs-en/25-application/_category_.yml b/docs/en/25-application/_category_.yml similarity index 100% rename from docs-en/25-application/_category_.yml rename to docs/en/25-application/_category_.yml diff --git a/docs-en/25-application/index.md b/docs/en/25-application/index.md similarity index 100% rename from docs-en/25-application/index.md rename to docs/en/25-application/index.md diff --git a/docs-en/27-train-faq/01-faq.md b/docs/en/27-train-faq/01-faq.md similarity index 100% rename from docs-en/27-train-faq/01-faq.md rename to docs/en/27-train-faq/01-faq.md diff --git a/docs-en/27-train-faq/03-docker.md b/docs/en/27-train-faq/03-docker.md similarity index 100% rename from docs-en/27-train-faq/03-docker.md rename to docs/en/27-train-faq/03-docker.md diff --git a/docs-en/27-train-faq/_category_.yml b/docs/en/27-train-faq/_category_.yml similarity index 100% rename from docs-en/27-train-faq/_category_.yml rename to docs/en/27-train-faq/_category_.yml diff --git a/docs-en/27-train-faq/index.md b/docs/en/27-train-faq/index.md similarity index 100% rename from docs-en/27-train-faq/index.md rename to docs/en/27-train-faq/index.md diff --git a/docs-examples/.gitignore b/docs/examples/.gitignore similarity index 100% rename from docs-examples/.gitignore rename to docs/examples/.gitignore diff --git a/docs-examples/R/connect_native.r b/docs/examples/R/connect_native.r similarity index 100% rename from docs-examples/R/connect_native.r rename to docs/examples/R/connect_native.r diff --git a/docs-examples/R/connect_rest.r b/docs/examples/R/connect_rest.r similarity index 100% rename from docs-examples/R/connect_rest.r rename to docs/examples/R/connect_rest.r diff --git a/docs-examples/c/.gitignore b/docs/examples/c/.gitignore similarity index 100% rename from docs-examples/c/.gitignore rename to docs/examples/c/.gitignore diff --git a/docs-examples/c/async_query_example.c b/docs/examples/c/async_query_example.c similarity index 100% rename from docs-examples/c/async_query_example.c rename to docs/examples/c/async_query_example.c diff --git a/docs-examples/c/connect_example.c b/docs/examples/c/connect_example.c similarity index 100% rename from docs-examples/c/connect_example.c rename to docs/examples/c/connect_example.c diff --git a/docs-examples/c/error_handle_example.c b/docs/examples/c/error_handle_example.c similarity index 100% rename from docs-examples/c/error_handle_example.c rename to docs/examples/c/error_handle_example.c diff --git a/docs-examples/c/insert_example.c b/docs/examples/c/insert_example.c similarity index 100% rename from docs-examples/c/insert_example.c rename to docs/examples/c/insert_example.c diff --git a/docs-examples/c/json_protocol_example.c b/docs/examples/c/json_protocol_example.c similarity index 100% rename from docs-examples/c/json_protocol_example.c rename to docs/examples/c/json_protocol_example.c diff --git a/docs-examples/c/line_example.c b/docs/examples/c/line_example.c similarity index 100% rename from docs-examples/c/line_example.c rename to docs/examples/c/line_example.c diff --git a/docs-examples/c/multi_bind_example.c b/docs/examples/c/multi_bind_example.c similarity index 100% rename from docs-examples/c/multi_bind_example.c rename to docs/examples/c/multi_bind_example.c diff --git a/docs-examples/c/query_example.c b/docs/examples/c/query_example.c similarity index 100% rename from docs-examples/c/query_example.c rename to docs/examples/c/query_example.c diff --git a/docs-examples/c/stmt_example.c b/docs/examples/c/stmt_example.c similarity index 100% rename from docs-examples/c/stmt_example.c rename to docs/examples/c/stmt_example.c diff --git a/docs-examples/c/subscribe_demo.c b/docs/examples/c/subscribe_demo.c similarity index 100% rename from docs-examples/c/subscribe_demo.c rename to docs/examples/c/subscribe_demo.c diff --git a/docs-examples/c/telnet_line_example.c b/docs/examples/c/telnet_line_example.c similarity index 100% rename from docs-examples/c/telnet_line_example.c rename to docs/examples/c/telnet_line_example.c diff --git a/docs-examples/csharp/.gitignore b/docs/examples/csharp/.gitignore similarity index 100% rename from docs-examples/csharp/.gitignore rename to docs/examples/csharp/.gitignore diff --git a/docs-examples/csharp/AsyncQueryExample.cs b/docs/examples/csharp/AsyncQueryExample.cs similarity index 100% rename from docs-examples/csharp/AsyncQueryExample.cs rename to docs/examples/csharp/AsyncQueryExample.cs diff --git a/docs-examples/csharp/ConnectExample.cs b/docs/examples/csharp/ConnectExample.cs similarity index 100% rename from docs-examples/csharp/ConnectExample.cs rename to docs/examples/csharp/ConnectExample.cs diff --git a/docs-examples/csharp/InfluxDBLineExample.cs b/docs/examples/csharp/InfluxDBLineExample.cs similarity index 100% rename from docs-examples/csharp/InfluxDBLineExample.cs rename to docs/examples/csharp/InfluxDBLineExample.cs diff --git a/docs-examples/csharp/OptsJsonExample.cs b/docs/examples/csharp/OptsJsonExample.cs similarity index 100% rename from docs-examples/csharp/OptsJsonExample.cs rename to docs/examples/csharp/OptsJsonExample.cs diff --git a/docs-examples/csharp/OptsTelnetExample.cs b/docs/examples/csharp/OptsTelnetExample.cs similarity index 100% rename from docs-examples/csharp/OptsTelnetExample.cs rename to docs/examples/csharp/OptsTelnetExample.cs diff --git a/docs-examples/csharp/QueryExample.cs b/docs/examples/csharp/QueryExample.cs similarity index 100% rename from docs-examples/csharp/QueryExample.cs rename to docs/examples/csharp/QueryExample.cs diff --git a/docs-examples/csharp/SQLInsertExample.cs b/docs/examples/csharp/SQLInsertExample.cs similarity index 100% rename from docs-examples/csharp/SQLInsertExample.cs rename to docs/examples/csharp/SQLInsertExample.cs diff --git a/docs-examples/csharp/StmtInsertExample.cs b/docs/examples/csharp/StmtInsertExample.cs similarity index 100% rename from docs-examples/csharp/StmtInsertExample.cs rename to docs/examples/csharp/StmtInsertExample.cs diff --git a/docs-examples/csharp/SubscribeDemo.cs b/docs/examples/csharp/SubscribeDemo.cs similarity index 100% rename from docs-examples/csharp/SubscribeDemo.cs rename to docs/examples/csharp/SubscribeDemo.cs diff --git a/docs-examples/csharp/asyncquery.csproj b/docs/examples/csharp/asyncquery.csproj similarity index 100% rename from docs-examples/csharp/asyncquery.csproj rename to docs/examples/csharp/asyncquery.csproj diff --git a/docs-examples/csharp/connect.csproj b/docs/examples/csharp/connect.csproj similarity index 100% rename from docs-examples/csharp/connect.csproj rename to docs/examples/csharp/connect.csproj diff --git a/docs-examples/csharp/influxdbline.csproj b/docs/examples/csharp/influxdbline.csproj similarity index 100% rename from docs-examples/csharp/influxdbline.csproj rename to docs/examples/csharp/influxdbline.csproj diff --git a/docs-examples/csharp/optsjson.csproj b/docs/examples/csharp/optsjson.csproj similarity index 100% rename from docs-examples/csharp/optsjson.csproj rename to docs/examples/csharp/optsjson.csproj diff --git a/docs-examples/csharp/optstelnet.csproj b/docs/examples/csharp/optstelnet.csproj similarity index 100% rename from docs-examples/csharp/optstelnet.csproj rename to docs/examples/csharp/optstelnet.csproj diff --git a/docs-examples/csharp/query.csproj b/docs/examples/csharp/query.csproj similarity index 100% rename from docs-examples/csharp/query.csproj rename to docs/examples/csharp/query.csproj diff --git a/docs-examples/csharp/sqlinsert.csproj b/docs/examples/csharp/sqlinsert.csproj similarity index 100% rename from docs-examples/csharp/sqlinsert.csproj rename to docs/examples/csharp/sqlinsert.csproj diff --git a/docs-examples/csharp/stmtinsert.csproj b/docs/examples/csharp/stmtinsert.csproj similarity index 100% rename from docs-examples/csharp/stmtinsert.csproj rename to docs/examples/csharp/stmtinsert.csproj diff --git a/docs-examples/csharp/subscribe.csproj b/docs/examples/csharp/subscribe.csproj similarity index 100% rename from docs-examples/csharp/subscribe.csproj rename to docs/examples/csharp/subscribe.csproj diff --git a/docs-examples/go/.gitignore b/docs/examples/go/.gitignore similarity index 100% rename from docs-examples/go/.gitignore rename to docs/examples/go/.gitignore diff --git a/docs-examples/go/connect/afconn/main.go b/docs/examples/go/connect/afconn/main.go similarity index 100% rename from docs-examples/go/connect/afconn/main.go rename to docs/examples/go/connect/afconn/main.go diff --git a/docs-examples/go/connect/cgoexample/main.go b/docs/examples/go/connect/cgoexample/main.go similarity index 100% rename from docs-examples/go/connect/cgoexample/main.go rename to docs/examples/go/connect/cgoexample/main.go diff --git a/docs-examples/go/connect/restexample/main.go b/docs/examples/go/connect/restexample/main.go similarity index 100% rename from docs-examples/go/connect/restexample/main.go rename to docs/examples/go/connect/restexample/main.go diff --git a/docs-examples/go/connect/wrapper/main.go b/docs/examples/go/connect/wrapper/main.go similarity index 100% rename from docs-examples/go/connect/wrapper/main.go rename to docs/examples/go/connect/wrapper/main.go diff --git a/docs-examples/go/go.mod b/docs/examples/go/go.mod similarity index 100% rename from docs-examples/go/go.mod rename to docs/examples/go/go.mod diff --git a/docs-examples/go/insert/json/main.go b/docs/examples/go/insert/json/main.go similarity index 100% rename from docs-examples/go/insert/json/main.go rename to docs/examples/go/insert/json/main.go diff --git a/docs-examples/go/insert/line/main.go b/docs/examples/go/insert/line/main.go similarity index 100% rename from docs-examples/go/insert/line/main.go rename to docs/examples/go/insert/line/main.go diff --git a/docs-examples/go/insert/sql/main.go b/docs/examples/go/insert/sql/main.go similarity index 100% rename from docs-examples/go/insert/sql/main.go rename to docs/examples/go/insert/sql/main.go diff --git a/docs-examples/go/insert/stmt/main.go b/docs/examples/go/insert/stmt/main.go similarity index 100% rename from docs-examples/go/insert/stmt/main.go rename to docs/examples/go/insert/stmt/main.go diff --git a/docs-examples/go/insert/telnet/main.go b/docs/examples/go/insert/telnet/main.go similarity index 100% rename from docs-examples/go/insert/telnet/main.go rename to docs/examples/go/insert/telnet/main.go diff --git a/docs-examples/go/query/async/main.go b/docs/examples/go/query/async/main.go similarity index 100% rename from docs-examples/go/query/async/main.go rename to docs/examples/go/query/async/main.go diff --git a/docs-examples/go/query/sync/main.go b/docs/examples/go/query/sync/main.go similarity index 100% rename from docs-examples/go/query/sync/main.go rename to docs/examples/go/query/sync/main.go diff --git a/docs-examples/go/rest/opentsdbjson/main.go b/docs/examples/go/rest/opentsdbjson/main.go similarity index 100% rename from docs-examples/go/rest/opentsdbjson/main.go rename to docs/examples/go/rest/opentsdbjson/main.go diff --git a/docs-examples/go/sub/main.go b/docs/examples/go/sub/main.go similarity index 100% rename from docs-examples/go/sub/main.go rename to docs/examples/go/sub/main.go diff --git a/docs-examples/java/.gitignore b/docs/examples/java/.gitignore similarity index 100% rename from docs-examples/java/.gitignore rename to docs/examples/java/.gitignore diff --git a/docs-examples/java/pom.xml b/docs/examples/java/pom.xml similarity index 100% rename from docs-examples/java/pom.xml rename to docs/examples/java/pom.xml diff --git a/docs-examples/java/src/main/java/com/taos/example/JNIConnectExample.java b/docs/examples/java/src/main/java/com/taos/example/JNIConnectExample.java similarity index 100% rename from docs-examples/java/src/main/java/com/taos/example/JNIConnectExample.java rename to docs/examples/java/src/main/java/com/taos/example/JNIConnectExample.java diff --git a/docs-examples/java/src/main/java/com/taos/example/JSONProtocolExample.java b/docs/examples/java/src/main/java/com/taos/example/JSONProtocolExample.java similarity index 100% rename from docs-examples/java/src/main/java/com/taos/example/JSONProtocolExample.java rename to docs/examples/java/src/main/java/com/taos/example/JSONProtocolExample.java diff --git a/docs-examples/java/src/main/java/com/taos/example/LineProtocolExample.java b/docs/examples/java/src/main/java/com/taos/example/LineProtocolExample.java similarity index 100% rename from docs-examples/java/src/main/java/com/taos/example/LineProtocolExample.java rename to docs/examples/java/src/main/java/com/taos/example/LineProtocolExample.java diff --git a/docs-examples/java/src/main/java/com/taos/example/RESTConnectExample.java b/docs/examples/java/src/main/java/com/taos/example/RESTConnectExample.java similarity index 100% rename from docs-examples/java/src/main/java/com/taos/example/RESTConnectExample.java rename to docs/examples/java/src/main/java/com/taos/example/RESTConnectExample.java diff --git a/docs-examples/java/src/main/java/com/taos/example/RestInsertExample.java b/docs/examples/java/src/main/java/com/taos/example/RestInsertExample.java similarity index 100% rename from docs-examples/java/src/main/java/com/taos/example/RestInsertExample.java rename to docs/examples/java/src/main/java/com/taos/example/RestInsertExample.java diff --git a/docs-examples/java/src/main/java/com/taos/example/RestQueryExample.java b/docs/examples/java/src/main/java/com/taos/example/RestQueryExample.java similarity index 100% rename from docs-examples/java/src/main/java/com/taos/example/RestQueryExample.java rename to docs/examples/java/src/main/java/com/taos/example/RestQueryExample.java diff --git a/docs-examples/java/src/main/java/com/taos/example/StmtInsertExample.java b/docs/examples/java/src/main/java/com/taos/example/StmtInsertExample.java similarity index 100% rename from docs-examples/java/src/main/java/com/taos/example/StmtInsertExample.java rename to docs/examples/java/src/main/java/com/taos/example/StmtInsertExample.java 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 similarity index 100% rename from docs-examples/java/src/main/java/com/taos/example/SubscribeDemo.java rename to docs/examples/java/src/main/java/com/taos/example/SubscribeDemo.java diff --git a/docs-examples/java/src/main/java/com/taos/example/TelnetLineProtocolExample.java b/docs/examples/java/src/main/java/com/taos/example/TelnetLineProtocolExample.java similarity index 100% rename from docs-examples/java/src/main/java/com/taos/example/TelnetLineProtocolExample.java rename to docs/examples/java/src/main/java/com/taos/example/TelnetLineProtocolExample.java diff --git a/docs-examples/java/src/main/java/com/taos/example/WSConnectExample.java b/docs/examples/java/src/main/java/com/taos/example/WSConnectExample.java similarity index 100% rename from docs-examples/java/src/main/java/com/taos/example/WSConnectExample.java rename to docs/examples/java/src/main/java/com/taos/example/WSConnectExample.java diff --git a/docs-examples/java/src/test/java/com/taos/test/TestAll.java b/docs/examples/java/src/test/java/com/taos/test/TestAll.java similarity index 100% rename from docs-examples/java/src/test/java/com/taos/test/TestAll.java rename to docs/examples/java/src/test/java/com/taos/test/TestAll.java diff --git a/docs-examples/node/.gitignore b/docs/examples/node/.gitignore similarity index 100% rename from docs-examples/node/.gitignore rename to docs/examples/node/.gitignore diff --git a/docs-examples/node/nativeexample/async_query_example.js b/docs/examples/node/nativeexample/async_query_example.js similarity index 100% rename from docs-examples/node/nativeexample/async_query_example.js rename to docs/examples/node/nativeexample/async_query_example.js diff --git a/docs-examples/node/nativeexample/connect.js b/docs/examples/node/nativeexample/connect.js similarity index 100% rename from docs-examples/node/nativeexample/connect.js rename to docs/examples/node/nativeexample/connect.js diff --git a/docs-examples/node/nativeexample/influxdb_line_example.js b/docs/examples/node/nativeexample/influxdb_line_example.js similarity index 100% rename from docs-examples/node/nativeexample/influxdb_line_example.js rename to docs/examples/node/nativeexample/influxdb_line_example.js diff --git a/docs-examples/node/nativeexample/insert_example.js b/docs/examples/node/nativeexample/insert_example.js similarity index 100% rename from docs-examples/node/nativeexample/insert_example.js rename to docs/examples/node/nativeexample/insert_example.js diff --git a/docs-examples/node/nativeexample/multi_bind_example.js b/docs/examples/node/nativeexample/multi_bind_example.js similarity index 100% rename from docs-examples/node/nativeexample/multi_bind_example.js rename to docs/examples/node/nativeexample/multi_bind_example.js diff --git a/docs-examples/node/nativeexample/opentsdb_json_example.js b/docs/examples/node/nativeexample/opentsdb_json_example.js similarity index 100% rename from docs-examples/node/nativeexample/opentsdb_json_example.js rename to docs/examples/node/nativeexample/opentsdb_json_example.js diff --git a/docs-examples/node/nativeexample/opentsdb_telnet_example.js b/docs/examples/node/nativeexample/opentsdb_telnet_example.js similarity index 100% rename from docs-examples/node/nativeexample/opentsdb_telnet_example.js rename to docs/examples/node/nativeexample/opentsdb_telnet_example.js diff --git a/docs-examples/node/nativeexample/param_bind_example.js b/docs/examples/node/nativeexample/param_bind_example.js similarity index 100% rename from docs-examples/node/nativeexample/param_bind_example.js rename to docs/examples/node/nativeexample/param_bind_example.js diff --git a/docs-examples/node/nativeexample/query_example.js b/docs/examples/node/nativeexample/query_example.js similarity index 100% rename from docs-examples/node/nativeexample/query_example.js rename to docs/examples/node/nativeexample/query_example.js diff --git a/docs-examples/node/nativeexample/subscribe_demo.js b/docs/examples/node/nativeexample/subscribe_demo.js similarity index 100% rename from docs-examples/node/nativeexample/subscribe_demo.js rename to docs/examples/node/nativeexample/subscribe_demo.js diff --git a/docs-examples/node/package.json b/docs/examples/node/package.json similarity index 100% rename from docs-examples/node/package.json rename to docs/examples/node/package.json diff --git a/docs-examples/node/restexample/connect.js b/docs/examples/node/restexample/connect.js similarity index 100% rename from docs-examples/node/restexample/connect.js rename to docs/examples/node/restexample/connect.js diff --git a/docs-examples/other/mock.js b/docs/examples/other/mock.js similarity index 100% rename from docs-examples/other/mock.js rename to docs/examples/other/mock.js diff --git a/docs-examples/php/connect.php b/docs/examples/php/connect.php similarity index 100% rename from docs-examples/php/connect.php rename to docs/examples/php/connect.php diff --git a/docs-examples/php/insert.php b/docs/examples/php/insert.php similarity index 100% rename from docs-examples/php/insert.php rename to docs/examples/php/insert.php diff --git a/docs-examples/php/insert_stmt.php b/docs/examples/php/insert_stmt.php similarity index 100% rename from docs-examples/php/insert_stmt.php rename to docs/examples/php/insert_stmt.php diff --git a/docs-examples/php/query.php b/docs/examples/php/query.php similarity index 100% rename from docs-examples/php/query.php rename to docs/examples/php/query.php diff --git a/docs-examples/python/.gitignore b/docs/examples/python/.gitignore similarity index 100% rename from docs-examples/python/.gitignore rename to docs/examples/python/.gitignore diff --git a/docs-examples/python/.gitkeep b/docs/examples/python/.gitkeep similarity index 100% rename from docs-examples/python/.gitkeep rename to docs/examples/python/.gitkeep diff --git a/docs-examples/python/async_query_example.py b/docs/examples/python/async_query_example.py similarity index 100% rename from docs-examples/python/async_query_example.py rename to docs/examples/python/async_query_example.py diff --git a/docs-examples/python/bind_param_example.py b/docs/examples/python/bind_param_example.py similarity index 100% rename from docs-examples/python/bind_param_example.py rename to docs/examples/python/bind_param_example.py diff --git a/docs-examples/python/conn_native_pandas.py b/docs/examples/python/conn_native_pandas.py similarity index 100% rename from docs-examples/python/conn_native_pandas.py rename to docs/examples/python/conn_native_pandas.py diff --git a/docs-examples/python/conn_rest_pandas.py b/docs/examples/python/conn_rest_pandas.py similarity index 100% rename from docs-examples/python/conn_rest_pandas.py rename to docs/examples/python/conn_rest_pandas.py diff --git a/docs-examples/python/connect_example.py b/docs/examples/python/connect_example.py similarity index 100% rename from docs-examples/python/connect_example.py rename to docs/examples/python/connect_example.py diff --git a/docs-examples/python/connect_native_reference.py b/docs/examples/python/connect_native_reference.py similarity index 100% rename from docs-examples/python/connect_native_reference.py rename to docs/examples/python/connect_native_reference.py diff --git a/docs-examples/python/connect_rest_examples.py b/docs/examples/python/connect_rest_examples.py similarity index 100% rename from docs-examples/python/connect_rest_examples.py rename to docs/examples/python/connect_rest_examples.py diff --git a/docs-examples/python/connection_usage_native_reference.py b/docs/examples/python/connection_usage_native_reference.py similarity index 100% rename from docs-examples/python/connection_usage_native_reference.py rename to docs/examples/python/connection_usage_native_reference.py diff --git a/docs-examples/python/cursor_usage_native_reference.py b/docs/examples/python/cursor_usage_native_reference.py similarity index 100% rename from docs-examples/python/cursor_usage_native_reference.py rename to docs/examples/python/cursor_usage_native_reference.py diff --git a/docs-examples/python/handle_exception.py b/docs/examples/python/handle_exception.py similarity index 100% rename from docs-examples/python/handle_exception.py rename to docs/examples/python/handle_exception.py diff --git a/docs-examples/python/json_protocol_example.py b/docs/examples/python/json_protocol_example.py similarity index 100% rename from docs-examples/python/json_protocol_example.py rename to docs/examples/python/json_protocol_example.py diff --git a/docs-examples/python/line_protocol_example.py b/docs/examples/python/line_protocol_example.py similarity index 100% rename from docs-examples/python/line_protocol_example.py rename to docs/examples/python/line_protocol_example.py diff --git a/docs-examples/python/multi_bind_example.py b/docs/examples/python/multi_bind_example.py similarity index 100% rename from docs-examples/python/multi_bind_example.py rename to docs/examples/python/multi_bind_example.py diff --git a/docs-examples/python/native_insert_example.py b/docs/examples/python/native_insert_example.py similarity index 100% rename from docs-examples/python/native_insert_example.py rename to docs/examples/python/native_insert_example.py diff --git a/docs-examples/python/query_example.py b/docs/examples/python/query_example.py similarity index 100% rename from docs-examples/python/query_example.py rename to docs/examples/python/query_example.py diff --git a/docs-examples/python/rest_client_example.py b/docs/examples/python/rest_client_example.py similarity index 100% rename from docs-examples/python/rest_client_example.py rename to docs/examples/python/rest_client_example.py diff --git a/docs-examples/python/result_set_examples.py b/docs/examples/python/result_set_examples.py similarity index 100% rename from docs-examples/python/result_set_examples.py rename to docs/examples/python/result_set_examples.py diff --git a/docs-examples/python/subscribe_demo.py b/docs/examples/python/subscribe_demo.py similarity index 100% rename from docs-examples/python/subscribe_demo.py rename to docs/examples/python/subscribe_demo.py diff --git a/docs-examples/python/telnet_line_protocol_example.py b/docs/examples/python/telnet_line_protocol_example.py similarity index 100% rename from docs-examples/python/telnet_line_protocol_example.py rename to docs/examples/python/telnet_line_protocol_example.py diff --git a/docs-examples/rust/Cargo.toml b/docs/examples/rust/Cargo.toml similarity index 100% rename from docs-examples/rust/Cargo.toml rename to docs/examples/rust/Cargo.toml diff --git a/docs-examples/rust/nativeexample/Cargo.toml b/docs/examples/rust/nativeexample/Cargo.toml similarity index 100% rename from docs-examples/rust/nativeexample/Cargo.toml rename to docs/examples/rust/nativeexample/Cargo.toml diff --git a/docs-examples/rust/nativeexample/examples/connect.rs b/docs/examples/rust/nativeexample/examples/connect.rs similarity index 100% rename from docs-examples/rust/nativeexample/examples/connect.rs rename to docs/examples/rust/nativeexample/examples/connect.rs diff --git a/docs-examples/rust/nativeexample/examples/stmt_example.rs b/docs/examples/rust/nativeexample/examples/stmt_example.rs similarity index 100% rename from docs-examples/rust/nativeexample/examples/stmt_example.rs rename to docs/examples/rust/nativeexample/examples/stmt_example.rs diff --git a/docs-examples/rust/nativeexample/examples/subscribe_demo.rs b/docs/examples/rust/nativeexample/examples/subscribe_demo.rs similarity index 100% rename from docs-examples/rust/nativeexample/examples/subscribe_demo.rs rename to docs/examples/rust/nativeexample/examples/subscribe_demo.rs diff --git a/docs-examples/rust/nativeexample/src/main.rs b/docs/examples/rust/nativeexample/src/main.rs similarity index 100% rename from docs-examples/rust/nativeexample/src/main.rs rename to docs/examples/rust/nativeexample/src/main.rs diff --git a/docs-examples/rust/restexample/Cargo.toml b/docs/examples/rust/restexample/Cargo.toml similarity index 100% rename from docs-examples/rust/restexample/Cargo.toml rename to docs/examples/rust/restexample/Cargo.toml diff --git a/docs-examples/rust/restexample/examples/connect.rs b/docs/examples/rust/restexample/examples/connect.rs similarity index 100% rename from docs-examples/rust/restexample/examples/connect.rs rename to docs/examples/rust/restexample/examples/connect.rs diff --git a/docs-examples/rust/restexample/examples/insert_example.rs b/docs/examples/rust/restexample/examples/insert_example.rs similarity index 100% rename from docs-examples/rust/restexample/examples/insert_example.rs rename to docs/examples/rust/restexample/examples/insert_example.rs diff --git a/docs-examples/rust/restexample/examples/query_example.rs b/docs/examples/rust/restexample/examples/query_example.rs similarity index 100% rename from docs-examples/rust/restexample/examples/query_example.rs rename to docs/examples/rust/restexample/examples/query_example.rs diff --git a/docs-examples/rust/restexample/src/main.rs b/docs/examples/rust/restexample/src/main.rs similarity index 100% rename from docs-examples/rust/restexample/src/main.rs rename to docs/examples/rust/restexample/src/main.rs diff --git a/docs-examples/rust/schemalessexample/Cargo.toml b/docs/examples/rust/schemalessexample/Cargo.toml similarity index 100% rename from docs-examples/rust/schemalessexample/Cargo.toml rename to docs/examples/rust/schemalessexample/Cargo.toml diff --git a/docs-examples/rust/schemalessexample/examples/influxdb_line_example.rs b/docs/examples/rust/schemalessexample/examples/influxdb_line_example.rs similarity index 100% rename from docs-examples/rust/schemalessexample/examples/influxdb_line_example.rs rename to docs/examples/rust/schemalessexample/examples/influxdb_line_example.rs diff --git a/docs-examples/rust/schemalessexample/examples/opentsdb_json_example.rs b/docs/examples/rust/schemalessexample/examples/opentsdb_json_example.rs similarity index 100% rename from docs-examples/rust/schemalessexample/examples/opentsdb_json_example.rs rename to docs/examples/rust/schemalessexample/examples/opentsdb_json_example.rs diff --git a/docs-examples/rust/schemalessexample/examples/opentsdb_telnet_example.rs b/docs/examples/rust/schemalessexample/examples/opentsdb_telnet_example.rs similarity index 100% rename from docs-examples/rust/schemalessexample/examples/opentsdb_telnet_example.rs rename to docs/examples/rust/schemalessexample/examples/opentsdb_telnet_example.rs diff --git a/docs-examples/rust/schemalessexample/src/main.rs b/docs/examples/rust/schemalessexample/src/main.rs similarity index 100% rename from docs-examples/rust/schemalessexample/src/main.rs rename to docs/examples/rust/schemalessexample/src/main.rs diff --git a/docs-cn/01-index.md b/docs/zh/01-index.md similarity index 100% rename from docs-cn/01-index.md rename to docs/zh/01-index.md diff --git a/docs-cn/02-intro.md b/docs/zh/02-intro.md similarity index 100% rename from docs-cn/02-intro.md rename to docs/zh/02-intro.md diff --git a/docs-cn/04-concept/_category_.yml b/docs/zh/04-concept/_category_.yml similarity index 100% rename from docs-cn/04-concept/_category_.yml rename to docs/zh/04-concept/_category_.yml diff --git a/docs-cn/04-concept/index.md b/docs/zh/04-concept/index.md similarity index 100% rename from docs-cn/04-concept/index.md rename to docs/zh/04-concept/index.md diff --git a/docs-cn/05-get-started/_apt_get_install.mdx b/docs/zh/05-get-started/_apt_get_install.mdx similarity index 100% rename from docs-cn/05-get-started/_apt_get_install.mdx rename to docs/zh/05-get-started/_apt_get_install.mdx diff --git a/docs-cn/05-get-started/_category_.yml b/docs/zh/05-get-started/_category_.yml similarity index 100% rename from docs-cn/05-get-started/_category_.yml rename to docs/zh/05-get-started/_category_.yml diff --git a/docs-cn/05-get-started/_pkg_install.mdx b/docs/zh/05-get-started/_pkg_install.mdx similarity index 100% rename from docs-cn/05-get-started/_pkg_install.mdx rename to docs/zh/05-get-started/_pkg_install.mdx diff --git a/docs-cn/05-get-started/index.md b/docs/zh/05-get-started/index.md similarity index 100% rename from docs-cn/05-get-started/index.md rename to docs/zh/05-get-started/index.md diff --git a/docs-cn/07-develop/01-connect/_category_.yml b/docs/zh/07-develop/01-connect/_category_.yml similarity index 100% rename from docs-cn/07-develop/01-connect/_category_.yml rename to docs/zh/07-develop/01-connect/_category_.yml diff --git a/docs/zh/07-develop/01-connect/_connect_c.mdx b/docs/zh/07-develop/01-connect/_connect_c.mdx new file mode 100644 index 0000000000000000000000000000000000000000..1b145538dc9ec77a91d3a20786521a8922cafc66 --- /dev/null +++ b/docs/zh/07-develop/01-connect/_connect_c.mdx @@ -0,0 +1,3 @@ +```c title="原生连接" +{{#include docs/examples/c/connect_example.c}} +``` diff --git a/docs-cn/07-develop/01-connect/_connect_cs.mdx b/docs/zh/07-develop/01-connect/_connect_cs.mdx similarity index 63% rename from docs-cn/07-develop/01-connect/_connect_cs.mdx rename to docs/zh/07-develop/01-connect/_connect_cs.mdx index 821820e8fe1d87a35e01943530179eeb6e0f48be..13b8a5dff250e6143fbed3090ba1f35e74adb9a0 100644 --- a/docs-cn/07-develop/01-connect/_connect_cs.mdx +++ b/docs/zh/07-develop/01-connect/_connect_cs.mdx @@ -1,5 +1,5 @@ ```csharp title="原生连接" -{{#include docs-examples/csharp/ConnectExample.cs}} +{{#include docs/examples/csharp/ConnectExample.cs}} ``` :::info diff --git a/docs-cn/07-develop/01-connect/_connect_go.mdx b/docs/zh/07-develop/01-connect/_connect_go.mdx similarity index 65% rename from docs-cn/07-develop/01-connect/_connect_go.mdx rename to docs/zh/07-develop/01-connect/_connect_go.mdx index 478768caaacc8aceb9a3f5a85f008dde00125eb7..d69720496df86436153a7b969c0125235b2d93b0 100644 --- a/docs-cn/07-develop/01-connect/_connect_go.mdx +++ b/docs/zh/07-develop/01-connect/_connect_go.mdx @@ -1,11 +1,11 @@ #### 使用数据库访问统一接口 ```go title="原生连接" -{{#include docs-examples/go/connect/cgoexample/main.go}} +{{#include docs/examples/go/connect/cgoexample/main.go}} ``` ```go title="REST 连接" -{{#include docs-examples/go/connect/restexample/main.go}} +{{#include docs/examples/go/connect/restexample/main.go}} ``` #### 使用高级封装 @@ -13,5 +13,5 @@ 也可以使用 driver-go 的 af 包建立连接。这个模块封装了 TDengine 的高级功能, 如:参数绑定、订阅等。 ```go title="使用 af 包建立原生连接" -{{#include docs-examples/go/connect/afconn/main.go}} +{{#include docs/examples/go/connect/afconn/main.go}} ``` diff --git a/docs-cn/07-develop/01-connect/_connect_java.mdx b/docs/zh/07-develop/01-connect/_connect_java.mdx similarity index 65% rename from docs-cn/07-develop/01-connect/_connect_java.mdx rename to docs/zh/07-develop/01-connect/_connect_java.mdx index 635f39ceb28ffc3fd0b0d8edb057d9aa01c593de..f5b8ea1cc2bf309bbb182be6ae06100102328a16 100644 --- a/docs-cn/07-develop/01-connect/_connect_java.mdx +++ b/docs/zh/07-develop/01-connect/_connect_java.mdx @@ -1,15 +1,15 @@ ```java title="原生连接" -{{#include docs-examples/java/src/main/java/com/taos/example/JNIConnectExample.java}} +{{#include docs/examples/java/src/main/java/com/taos/example/JNIConnectExample.java}} ``` ```java title="REST 连接" -{{#include docs-examples/java/src/main/java/com/taos/example/RESTConnectExample.java:main}} +{{#include docs/examples/java/src/main/java/com/taos/example/RESTConnectExample.java:main}} ``` 使用 REST 连接时,如果查询数据量比较大,还可开启批量拉取功能。 ```java title="开启批量拉取功能" {4} -{{#include docs-examples/java/src/main/java/com/taos/example/WSConnectExample.java:main}} +{{#include docs/examples/java/src/main/java/com/taos/example/WSConnectExample.java:main}} ``` 更多连接参数配置,参考[Java 连接器](/reference/connector/java) diff --git a/docs/zh/07-develop/01-connect/_connect_node.mdx b/docs/zh/07-develop/01-connect/_connect_node.mdx new file mode 100644 index 0000000000000000000000000000000000000000..3a856d40229513c8fc890aab4abe36dfdf15382e --- /dev/null +++ b/docs/zh/07-develop/01-connect/_connect_node.mdx @@ -0,0 +1,7 @@ +```js title="原生连接" +{{#include docs/examples/node/nativeexample/connect.js}} +``` + +```js title="REST 连接" +{{#include docs/examples/node/restexample/connect.js}} +``` diff --git a/docs/zh/07-develop/01-connect/_connect_php.mdx b/docs/zh/07-develop/01-connect/_connect_php.mdx new file mode 100644 index 0000000000000000000000000000000000000000..dbad72bc1988bd5336f1da132dd9e6ba9b8020e6 --- /dev/null +++ b/docs/zh/07-develop/01-connect/_connect_php.mdx @@ -0,0 +1,3 @@ +```php title="原生连接" +{{#include docs/examples/php/connect.php}} +``` diff --git a/docs/zh/07-develop/01-connect/_connect_python.mdx b/docs/zh/07-develop/01-connect/_connect_python.mdx new file mode 100644 index 0000000000000000000000000000000000000000..b331f4648c60fdcf354ea6e4440c9d716040a609 --- /dev/null +++ b/docs/zh/07-develop/01-connect/_connect_python.mdx @@ -0,0 +1,3 @@ +```python title="原生连接" +{{#include docs/examples/python/connect_example.py}} +``` diff --git a/docs/zh/07-develop/01-connect/_connect_r.mdx b/docs/zh/07-develop/01-connect/_connect_r.mdx new file mode 100644 index 0000000000000000000000000000000000000000..ba72dc848c5393340f1041c83f2fe3581db5a5d3 --- /dev/null +++ b/docs/zh/07-develop/01-connect/_connect_r.mdx @@ -0,0 +1,3 @@ +```r title="原生连接" +{{#include docs/examples/R/connect_native.r:demo}} +``` diff --git a/docs-cn/07-develop/01-connect/_connect_rust.mdx b/docs/zh/07-develop/01-connect/_connect_rust.mdx similarity index 78% rename from docs-cn/07-develop/01-connect/_connect_rust.mdx rename to docs/zh/07-develop/01-connect/_connect_rust.mdx index 9e64724c178ba2c72e14fc9878bf9c3237bb50e7..25f178a285f63230ad4e0af4c5de1bae638e77da 100644 --- a/docs-cn/07-develop/01-connect/_connect_rust.mdx +++ b/docs/zh/07-develop/01-connect/_connect_rust.mdx @@ -1,5 +1,5 @@ ```rust title="原生连接/REST 连接" -{{#include docs-examples/rust/nativeexample/examples/connect.rs}} +{{#include docs/examples/rust/nativeexample/examples/connect.rs}} ``` :::note diff --git a/docs-cn/07-develop/01-connect/index.md b/docs/zh/07-develop/01-connect/index.md similarity index 100% rename from docs-cn/07-develop/01-connect/index.md rename to docs/zh/07-develop/01-connect/index.md diff --git a/docs-cn/07-develop/02-model/_category_.yml b/docs/zh/07-develop/02-model/_category_.yml similarity index 100% rename from docs-cn/07-develop/02-model/_category_.yml rename to docs/zh/07-develop/02-model/_category_.yml diff --git a/docs-cn/07-develop/02-model/index.mdx b/docs/zh/07-develop/02-model/index.mdx similarity index 100% rename from docs-cn/07-develop/02-model/index.mdx rename to docs/zh/07-develop/02-model/index.mdx diff --git a/docs-cn/07-develop/03-insert-data/01-sql-writing.mdx b/docs/zh/07-develop/03-insert-data/01-sql-writing.mdx similarity index 100% rename from docs-cn/07-develop/03-insert-data/01-sql-writing.mdx rename to docs/zh/07-develop/03-insert-data/01-sql-writing.mdx diff --git a/docs-cn/07-develop/03-insert-data/02-influxdb-line.mdx b/docs/zh/07-develop/03-insert-data/02-influxdb-line.mdx similarity index 100% rename from docs-cn/07-develop/03-insert-data/02-influxdb-line.mdx rename to docs/zh/07-develop/03-insert-data/02-influxdb-line.mdx diff --git a/docs-cn/07-develop/03-insert-data/03-opentsdb-telnet.mdx b/docs/zh/07-develop/03-insert-data/03-opentsdb-telnet.mdx similarity index 100% rename from docs-cn/07-develop/03-insert-data/03-opentsdb-telnet.mdx rename to docs/zh/07-develop/03-insert-data/03-opentsdb-telnet.mdx diff --git a/docs-cn/07-develop/03-insert-data/04-opentsdb-json.mdx b/docs/zh/07-develop/03-insert-data/04-opentsdb-json.mdx similarity index 100% rename from docs-cn/07-develop/03-insert-data/04-opentsdb-json.mdx rename to docs/zh/07-develop/03-insert-data/04-opentsdb-json.mdx diff --git a/docs/zh/07-develop/03-insert-data/_c_line.mdx b/docs/zh/07-develop/03-insert-data/_c_line.mdx new file mode 100644 index 0000000000000000000000000000000000000000..7f2f0d5dd8198d52dda1da34256e54a1bbb4c967 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_c_line.mdx @@ -0,0 +1,3 @@ +```c +{{#include docs/examples/c/line_example.c:main}} +``` \ No newline at end of file diff --git a/docs/zh/07-develop/03-insert-data/_c_opts_json.mdx b/docs/zh/07-develop/03-insert-data/_c_opts_json.mdx new file mode 100644 index 0000000000000000000000000000000000000000..34b1d8ab3c1e299c2ab2a1ad6d47f81dfaa364cc --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_c_opts_json.mdx @@ -0,0 +1,3 @@ +```c +{{#include docs/examples/c/json_protocol_example.c:main}} +``` \ No newline at end of file diff --git a/docs/zh/07-develop/03-insert-data/_c_opts_telnet.mdx b/docs/zh/07-develop/03-insert-data/_c_opts_telnet.mdx new file mode 100644 index 0000000000000000000000000000000000000000..6bda068d12fd0b379a5af96438029c9ae476a753 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_c_opts_telnet.mdx @@ -0,0 +1,3 @@ +```c +{{#include docs/examples/c/telnet_line_example.c:main}} +``` \ No newline at end of file diff --git a/docs/zh/07-develop/03-insert-data/_c_sql.mdx b/docs/zh/07-develop/03-insert-data/_c_sql.mdx new file mode 100644 index 0000000000000000000000000000000000000000..4e55c3387ee1c6fe860f312afdbdad65142bf7fb --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_c_sql.mdx @@ -0,0 +1,3 @@ +```c +{{#include docs/examples/c/insert_example.c}} +``` \ No newline at end of file diff --git a/docs/zh/07-develop/03-insert-data/_c_stmt.mdx b/docs/zh/07-develop/03-insert-data/_c_stmt.mdx new file mode 100644 index 0000000000000000000000000000000000000000..78f2d20dfb95859448e998bc41dc815efc4d9bd0 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_c_stmt.mdx @@ -0,0 +1,6 @@ +```c title=一次绑定一行 +{{#include docs/examples/c/stmt_example.c}} +``` +```c title=一次绑定多行 72:117 +{{#include docs/examples/c/multi_bind_example.c}} +``` \ No newline at end of file diff --git a/docs-cn/07-develop/03-insert-data/_category_.yml b/docs/zh/07-develop/03-insert-data/_category_.yml similarity index 100% rename from docs-cn/07-develop/03-insert-data/_category_.yml rename to docs/zh/07-develop/03-insert-data/_category_.yml diff --git a/docs/zh/07-develop/03-insert-data/_cs_line.mdx b/docs/zh/07-develop/03-insert-data/_cs_line.mdx new file mode 100644 index 0000000000000000000000000000000000000000..71f46c62be3dfe7d771a35b2298e476bed353aba --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_cs_line.mdx @@ -0,0 +1,3 @@ +```csharp +{{#include docs/examples/csharp/InfluxDBLineExample.cs}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_cs_opts_json.mdx b/docs/zh/07-develop/03-insert-data/_cs_opts_json.mdx new file mode 100644 index 0000000000000000000000000000000000000000..8d80d042c984c513df5ca91813c0cd0a17b58eb5 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_cs_opts_json.mdx @@ -0,0 +1,3 @@ +```csharp +{{#include docs/examples/csharp/OptsJsonExample.cs}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_cs_opts_telnet.mdx b/docs/zh/07-develop/03-insert-data/_cs_opts_telnet.mdx new file mode 100644 index 0000000000000000000000000000000000000000..cff32abf1feaf703971111542749fbe40152bc33 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_cs_opts_telnet.mdx @@ -0,0 +1,3 @@ +```csharp +{{#include docs/examples/csharp/OptsTelnetExample.cs}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_cs_sql.mdx b/docs/zh/07-develop/03-insert-data/_cs_sql.mdx new file mode 100644 index 0000000000000000000000000000000000000000..1dc7bb3d1366aa3000212786756506eb5eb280e6 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_cs_sql.mdx @@ -0,0 +1,3 @@ +```csharp +{{#include docs/examples/csharp/SQLInsertExample.cs}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_cs_stmt.mdx b/docs/zh/07-develop/03-insert-data/_cs_stmt.mdx new file mode 100644 index 0000000000000000000000000000000000000000..229c874ab9f515e7eae66890a3dfe2e59c129e86 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_cs_stmt.mdx @@ -0,0 +1,3 @@ +```csharp +{{#include docs/examples/csharp/StmtInsertExample.cs}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_go_line.mdx b/docs/zh/07-develop/03-insert-data/_go_line.mdx new file mode 100644 index 0000000000000000000000000000000000000000..df2afc0e8720ca14e42e0e4bd7e50276cecace43 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_go_line.mdx @@ -0,0 +1,3 @@ +```go +{{#include docs/examples/go/insert/line/main.go}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_go_opts_json.mdx b/docs/zh/07-develop/03-insert-data/_go_opts_json.mdx new file mode 100644 index 0000000000000000000000000000000000000000..362ce430515c70a3ac502e646630025d7f950612 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_go_opts_json.mdx @@ -0,0 +1,3 @@ +```go +{{#include docs/examples/go/insert/json/main.go}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_go_opts_telnet.mdx b/docs/zh/07-develop/03-insert-data/_go_opts_telnet.mdx new file mode 100644 index 0000000000000000000000000000000000000000..518ea4c8164ab148afff9e21b03d892cbc1bfaf8 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_go_opts_telnet.mdx @@ -0,0 +1,3 @@ +```go +{{#include docs/examples/go/insert/telnet/main.go}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_go_sql.mdx b/docs/zh/07-develop/03-insert-data/_go_sql.mdx new file mode 100644 index 0000000000000000000000000000000000000000..02f4d4e2ba21bc14dd67cb0443a1631b06750923 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_go_sql.mdx @@ -0,0 +1,3 @@ +```go +{{#include docs/examples/go/insert/sql/main.go}} +``` diff --git a/docs-cn/07-develop/03-insert-data/_go_stmt.mdx b/docs/zh/07-develop/03-insert-data/_go_stmt.mdx similarity index 77% rename from docs-cn/07-develop/03-insert-data/_go_stmt.mdx rename to docs/zh/07-develop/03-insert-data/_go_stmt.mdx index 7bb6792d6df5b250850bd0a0021ecceba994aa09..d65a96549fbef3cd14b47853f765d557447dde1d 100644 --- a/docs-cn/07-develop/03-insert-data/_go_stmt.mdx +++ b/docs/zh/07-develop/03-insert-data/_go_stmt.mdx @@ -1,5 +1,5 @@ ```go -{{#include docs-examples/go/insert/stmt/main.go}} +{{#include docs/examples/go/insert/stmt/main.go}} ``` :::tip diff --git a/docs/zh/07-develop/03-insert-data/_java_line.mdx b/docs/zh/07-develop/03-insert-data/_java_line.mdx new file mode 100644 index 0000000000000000000000000000000000000000..17f759d30fdb76744dc032be60ee91b6dd9f1540 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_java_line.mdx @@ -0,0 +1,3 @@ +```java +{{#include docs/examples/java/src/main/java/com/taos/example/LineProtocolExample.java}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_java_opts_json.mdx b/docs/zh/07-develop/03-insert-data/_java_opts_json.mdx new file mode 100644 index 0000000000000000000000000000000000000000..1fc0adc202f26c73e64da09456e7e42bdc6367f6 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_java_opts_json.mdx @@ -0,0 +1,3 @@ +```java +{{#include docs/examples/java/src/main/java/com/taos/example/JSONProtocolExample.java}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_java_opts_telnet.mdx b/docs/zh/07-develop/03-insert-data/_java_opts_telnet.mdx new file mode 100644 index 0000000000000000000000000000000000000000..b68f54b4e872a57f34ae6d5c3651a70812b71154 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_java_opts_telnet.mdx @@ -0,0 +1,3 @@ +```java +{{#include docs/examples/java/src/main/java/com/taos/example/TelnetLineProtocolExample.java}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_java_sql.mdx b/docs/zh/07-develop/03-insert-data/_java_sql.mdx new file mode 100644 index 0000000000000000000000000000000000000000..636c7e00eb8846704678ef3cdd8394a99a4528f8 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_java_sql.mdx @@ -0,0 +1,3 @@ +```java +{{#include docs/examples/java/src/main/java/com/taos/example/RestInsertExample.java:insert}} +``` \ No newline at end of file diff --git a/docs/zh/07-develop/03-insert-data/_java_stmt.mdx b/docs/zh/07-develop/03-insert-data/_java_stmt.mdx new file mode 100644 index 0000000000000000000000000000000000000000..2f6a33769044ef5052e633e28a9b60fdab130e88 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_java_stmt.mdx @@ -0,0 +1,3 @@ +```java +{{#include docs/examples/java/src/main/java/com/taos/example/StmtInsertExample.java}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_js_line.mdx b/docs/zh/07-develop/03-insert-data/_js_line.mdx new file mode 100644 index 0000000000000000000000000000000000000000..cc138a76bde76e779eaa1fe554ecc82c1f564e24 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_js_line.mdx @@ -0,0 +1,3 @@ +```js +{{#include docs/examples/node/nativeexample/influxdb_line_example.js}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_js_opts_json.mdx b/docs/zh/07-develop/03-insert-data/_js_opts_json.mdx new file mode 100644 index 0000000000000000000000000000000000000000..cb3c275ce8140ed58d668bf03972a1f960bb6564 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_js_opts_json.mdx @@ -0,0 +1,3 @@ +```js +{{#include docs/examples/node/nativeexample/opentsdb_json_example.js}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_js_opts_telnet.mdx b/docs/zh/07-develop/03-insert-data/_js_opts_telnet.mdx new file mode 100644 index 0000000000000000000000000000000000000000..db96742f31440342516134636db998af987af9fb --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_js_opts_telnet.mdx @@ -0,0 +1,3 @@ +```js +{{#include docs/examples/node/nativeexample/opentsdb_telnet_example.js}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_js_sql.mdx b/docs/zh/07-develop/03-insert-data/_js_sql.mdx new file mode 100644 index 0000000000000000000000000000000000000000..a9a12f5d2cfb31bcaefba25a82846b455dbc8671 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_js_sql.mdx @@ -0,0 +1,3 @@ +```js +{{#include docs/examples/node/nativeexample/insert_example.js}} +``` diff --git a/docs-cn/07-develop/03-insert-data/_js_stmt.mdx b/docs/zh/07-develop/03-insert-data/_js_stmt.mdx similarity index 65% rename from docs-cn/07-develop/03-insert-data/_js_stmt.mdx rename to docs/zh/07-develop/03-insert-data/_js_stmt.mdx index 17a6c9785c7dc1e3c3fa6a59982913f1f139f9c2..b94ae121c50387c899336fc6f09348f48483bf58 100644 --- a/docs-cn/07-develop/03-insert-data/_js_stmt.mdx +++ b/docs/zh/07-develop/03-insert-data/_js_stmt.mdx @@ -1,9 +1,9 @@ ```js title=一次绑定一行 -{{#include docs-examples/node/nativeexample/param_bind_example.js}} +{{#include docs/examples/node/nativeexample/param_bind_example.js}} ``` ```js title=一次绑定多行 -{{#include docs-examples/node/nativeexample/multi_bind_example.js:insertData}} +{{#include docs/examples/node/nativeexample/multi_bind_example.js:insertData}} ``` :::info diff --git a/docs/zh/07-develop/03-insert-data/_php_sql.mdx b/docs/zh/07-develop/03-insert-data/_php_sql.mdx new file mode 100644 index 0000000000000000000000000000000000000000..78cd663ec219dabc2eeb81c7e67426eda41d7762 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_php_sql.mdx @@ -0,0 +1,3 @@ +```php +{{#include docs/examples/php/insert.php}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_php_stmt.mdx b/docs/zh/07-develop/03-insert-data/_php_stmt.mdx new file mode 100644 index 0000000000000000000000000000000000000000..3bb7b2f8da9887c1063822e69bfdff599aa50b7b --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_php_stmt.mdx @@ -0,0 +1,3 @@ +```php +{{#include docs/examples/php/insert_stmt.php}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_py_line.mdx b/docs/zh/07-develop/03-insert-data/_py_line.mdx new file mode 100644 index 0000000000000000000000000000000000000000..85f7e32e6681c6d428a2332220194c169c421f2f --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_py_line.mdx @@ -0,0 +1,3 @@ +```py +{{#include docs/examples/python/line_protocol_example.py}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_py_opts_json.mdx b/docs/zh/07-develop/03-insert-data/_py_opts_json.mdx new file mode 100644 index 0000000000000000000000000000000000000000..195c7090c02e03131c4261c57f1414a5ab1ba6b6 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_py_opts_json.mdx @@ -0,0 +1,3 @@ +```py +{{#include docs/examples/python/json_protocol_example.py}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_py_opts_telnet.mdx b/docs/zh/07-develop/03-insert-data/_py_opts_telnet.mdx new file mode 100644 index 0000000000000000000000000000000000000000..3bae1ea57bcffe50be5b4e96a7ae8f83faed2087 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_py_opts_telnet.mdx @@ -0,0 +1,3 @@ +```py +{{#include docs/examples/python/telnet_line_protocol_example.py}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_py_sql.mdx b/docs/zh/07-develop/03-insert-data/_py_sql.mdx new file mode 100644 index 0000000000000000000000000000000000000000..1557e3994b04e64c596918ee67c63e7765ebaa07 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_py_sql.mdx @@ -0,0 +1,3 @@ +```py +{{#include docs/examples/python/native_insert_example.py}} +``` diff --git a/docs-cn/07-develop/03-insert-data/_py_stmt.mdx b/docs/zh/07-develop/03-insert-data/_py_stmt.mdx similarity index 64% rename from docs-cn/07-develop/03-insert-data/_py_stmt.mdx rename to docs/zh/07-develop/03-insert-data/_py_stmt.mdx index 8241ea86bc64ac64d842dc0a6cddc0eae0399503..e244288401ae99228701fc3b965389f4c3a362b4 100644 --- a/docs-cn/07-develop/03-insert-data/_py_stmt.mdx +++ b/docs/zh/07-develop/03-insert-data/_py_stmt.mdx @@ -1,9 +1,9 @@ ```py title=一次绑定一行 -{{#include docs-examples/python/bind_param_example.py}} +{{#include docs/examples/python/bind_param_example.py}} ``` ```py title=一次绑定多行 -{{#include docs-examples/python/multi_bind_example.py:bind_batch}} +{{#include docs/examples/python/multi_bind_example.py:bind_batch}} ``` :::info diff --git a/docs/zh/07-develop/03-insert-data/_rust_line.mdx b/docs/zh/07-develop/03-insert-data/_rust_line.mdx new file mode 100644 index 0000000000000000000000000000000000000000..dbb35d76bc3517463902b642ce4a3861ae42b2f8 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_rust_line.mdx @@ -0,0 +1,3 @@ +```rust +{{#include docs/examples/rust/schemalessexample/examples/influxdb_line_example.rs}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_rust_opts_json.mdx b/docs/zh/07-develop/03-insert-data/_rust_opts_json.mdx new file mode 100644 index 0000000000000000000000000000000000000000..cc2055510bce006491ed277a8e884b9958a5a993 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_rust_opts_json.mdx @@ -0,0 +1,3 @@ +```rust +{{#include docs/examples/rust/schemalessexample/examples/opentsdb_json_example.rs}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_rust_opts_telnet.mdx b/docs/zh/07-develop/03-insert-data/_rust_opts_telnet.mdx new file mode 100644 index 0000000000000000000000000000000000000000..109c0c5d019e250b87e12c535e4f55c69924b4af --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_rust_opts_telnet.mdx @@ -0,0 +1,3 @@ +```rust +{{#include docs/examples/rust/schemalessexample/examples/opentsdb_telnet_example.rs}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_rust_sql.mdx b/docs/zh/07-develop/03-insert-data/_rust_sql.mdx new file mode 100644 index 0000000000000000000000000000000000000000..fb59a4826510e666457ac592328cc5ba17412c79 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_rust_sql.mdx @@ -0,0 +1,3 @@ +```rust +{{#include docs/examples/rust/restexample/examples/insert_example.rs}} +``` diff --git a/docs/zh/07-develop/03-insert-data/_rust_stmt.mdx b/docs/zh/07-develop/03-insert-data/_rust_stmt.mdx new file mode 100644 index 0000000000000000000000000000000000000000..a889b56745601158489037a590b6cf5bd80da543 --- /dev/null +++ b/docs/zh/07-develop/03-insert-data/_rust_stmt.mdx @@ -0,0 +1,3 @@ +```rust +{{#include docs/examples/rust/nativeexample/examples/stmt_example.rs}} +``` diff --git a/docs-cn/07-develop/03-insert-data/index.md b/docs/zh/07-develop/03-insert-data/index.md similarity index 100% rename from docs-cn/07-develop/03-insert-data/index.md rename to docs/zh/07-develop/03-insert-data/index.md diff --git a/docs/zh/07-develop/04-query-data/_c.mdx b/docs/zh/07-develop/04-query-data/_c.mdx new file mode 100644 index 0000000000000000000000000000000000000000..c51557ef2918dd9152e329c6e1937109d286b11c --- /dev/null +++ b/docs/zh/07-develop/04-query-data/_c.mdx @@ -0,0 +1,3 @@ +```c +{{#include docs/examples/c/query_example.c}} +``` \ No newline at end of file diff --git a/docs/zh/07-develop/04-query-data/_c_async.mdx b/docs/zh/07-develop/04-query-data/_c_async.mdx new file mode 100644 index 0000000000000000000000000000000000000000..641a53e82ddb252e1b3255799bd922158a08f229 --- /dev/null +++ b/docs/zh/07-develop/04-query-data/_c_async.mdx @@ -0,0 +1,3 @@ +```c +{{#include docs/examples/c/async_query_example.c:demo}} +``` \ No newline at end of file diff --git a/docs-cn/07-develop/04-query-data/_category_.yml b/docs/zh/07-develop/04-query-data/_category_.yml similarity index 100% rename from docs-cn/07-develop/04-query-data/_category_.yml rename to docs/zh/07-develop/04-query-data/_category_.yml diff --git a/docs/zh/07-develop/04-query-data/_cs.mdx b/docs/zh/07-develop/04-query-data/_cs.mdx new file mode 100644 index 0000000000000000000000000000000000000000..4bb582ecbfaeceac679af975e7752d1caeacb018 --- /dev/null +++ b/docs/zh/07-develop/04-query-data/_cs.mdx @@ -0,0 +1,3 @@ +```csharp +{{#include docs/examples/csharp/QueryExample.cs}} +``` diff --git a/docs/zh/07-develop/04-query-data/_cs_async.mdx b/docs/zh/07-develop/04-query-data/_cs_async.mdx new file mode 100644 index 0000000000000000000000000000000000000000..3ecf635fd39db402d1db68de6d7336b7b2d9d8e8 --- /dev/null +++ b/docs/zh/07-develop/04-query-data/_cs_async.mdx @@ -0,0 +1,3 @@ +```csharp +{{#include docs/examples/csharp/AsyncQueryExample.cs}} +``` diff --git a/docs/zh/07-develop/04-query-data/_go.mdx b/docs/zh/07-develop/04-query-data/_go.mdx new file mode 100644 index 0000000000000000000000000000000000000000..b43894a1ebe8aa0a261cce5f2469f2b3f8449fc4 --- /dev/null +++ b/docs/zh/07-develop/04-query-data/_go.mdx @@ -0,0 +1,3 @@ +```go +{{#include docs/examples/go/query/sync/main.go}} +``` diff --git a/docs/zh/07-develop/04-query-data/_go_async.mdx b/docs/zh/07-develop/04-query-data/_go_async.mdx new file mode 100644 index 0000000000000000000000000000000000000000..3fbc6f5b6dac9d3987678e64d7268eed200ce513 --- /dev/null +++ b/docs/zh/07-develop/04-query-data/_go_async.mdx @@ -0,0 +1,3 @@ +```go +{{#include docs/examples/go/query/async/main.go}} +``` diff --git a/docs/zh/07-develop/04-query-data/_java.mdx b/docs/zh/07-develop/04-query-data/_java.mdx new file mode 100644 index 0000000000000000000000000000000000000000..74de32658c658fb81c29349a1997e32ed512db1b --- /dev/null +++ b/docs/zh/07-develop/04-query-data/_java.mdx @@ -0,0 +1,3 @@ +```java +{{#include docs/examples/java/src/main/java/com/taos/example/RestQueryExample.java}} +``` diff --git a/docs/zh/07-develop/04-query-data/_js.mdx b/docs/zh/07-develop/04-query-data/_js.mdx new file mode 100644 index 0000000000000000000000000000000000000000..5883d378e7c7acab033bffb2018f00f1ab5a48d5 --- /dev/null +++ b/docs/zh/07-develop/04-query-data/_js.mdx @@ -0,0 +1,3 @@ +```js +{{#include docs/examples/node/nativeexample/query_example.js}} +``` diff --git a/docs/zh/07-develop/04-query-data/_js_async.mdx b/docs/zh/07-develop/04-query-data/_js_async.mdx new file mode 100644 index 0000000000000000000000000000000000000000..4b0f54a0342e62da1e5050d49546ca605ae1d729 --- /dev/null +++ b/docs/zh/07-develop/04-query-data/_js_async.mdx @@ -0,0 +1,3 @@ +```js +{{#include docs/examples/node/nativeexample/async_query_example.js}} +``` diff --git a/docs/zh/07-develop/04-query-data/_php.mdx b/docs/zh/07-develop/04-query-data/_php.mdx new file mode 100644 index 0000000000000000000000000000000000000000..bcafd1cfbcb1bbb55b03f6fe198e6fa1b5251b19 --- /dev/null +++ b/docs/zh/07-develop/04-query-data/_php.mdx @@ -0,0 +1,3 @@ +```go +{{#include docs/examples/php/query.php}} +``` diff --git a/docs-cn/07-develop/04-query-data/_py.mdx b/docs/zh/07-develop/04-query-data/_py.mdx similarity index 54% rename from docs-cn/07-develop/04-query-data/_py.mdx rename to docs/zh/07-develop/04-query-data/_py.mdx index 6a1bacdd3ef91e9484c1d87d6a22de8b128e2144..7184c66b8ea35a72309246aefc737d430434bb54 100644 --- a/docs-cn/07-develop/04-query-data/_py.mdx +++ b/docs/zh/07-develop/04-query-data/_py.mdx @@ -1,11 +1,11 @@ 通过迭代逐行获取查询结果。 ```py -{{#include docs-examples/python/query_example.py:iter}} +{{#include docs/examples/python/query_example.py:iter}} ``` 一次获取所有查询结果,并把每一行转化为一个字典返回。 ```py -{{#include docs-examples/python/query_example.py:fetch_all}} +{{#include docs/examples/python/query_example.py:fetch_all}} ``` diff --git a/docs-cn/07-develop/04-query-data/_py_async.mdx b/docs/zh/07-develop/04-query-data/_py_async.mdx similarity index 60% rename from docs-cn/07-develop/04-query-data/_py_async.mdx rename to docs/zh/07-develop/04-query-data/_py_async.mdx index 2399a50df645804788036e17bf223c53482d4eaf..dd323ef364d67fc5d37c6c094433e0c9d14d5b08 100644 --- a/docs-cn/07-develop/04-query-data/_py_async.mdx +++ b/docs/zh/07-develop/04-query-data/_py_async.mdx @@ -1,5 +1,5 @@ ```py -{{#include docs-examples/python/async_query_example.py}} +{{#include docs/examples/python/async_query_example.py}} ``` :::note diff --git a/docs/zh/07-develop/04-query-data/_rust.mdx b/docs/zh/07-develop/04-query-data/_rust.mdx new file mode 100644 index 0000000000000000000000000000000000000000..cab1b403fbba0cb432ecb9cb280a0fa7582c5be1 --- /dev/null +++ b/docs/zh/07-develop/04-query-data/_rust.mdx @@ -0,0 +1,3 @@ +```rust +{{#include docs/examples/rust/restexample/examples/query_example.rs}} +``` diff --git a/docs-cn/07-develop/04-query-data/index.mdx b/docs/zh/07-develop/04-query-data/index.mdx similarity index 100% rename from docs-cn/07-develop/04-query-data/index.mdx rename to docs/zh/07-develop/04-query-data/index.mdx diff --git a/docs-cn/07-develop/05-delete-data.mdx b/docs/zh/07-develop/05-delete-data.mdx similarity index 100% rename from docs-cn/07-develop/05-delete-data.mdx rename to docs/zh/07-develop/05-delete-data.mdx diff --git a/docs-cn/07-develop/06-continuous-query.mdx b/docs/zh/07-develop/06-continuous-query.mdx similarity index 100% rename from docs-cn/07-develop/06-continuous-query.mdx rename to docs/zh/07-develop/06-continuous-query.mdx diff --git a/docs-cn/07-develop/07-subscribe.md b/docs/zh/07-develop/07-subscribe.md similarity index 100% rename from docs-cn/07-develop/07-subscribe.md rename to docs/zh/07-develop/07-subscribe.md diff --git a/docs-cn/07-develop/08-cache.md b/docs/zh/07-develop/08-cache.md similarity index 100% rename from docs-cn/07-develop/08-cache.md rename to docs/zh/07-develop/08-cache.md diff --git a/docs-cn/07-develop/09-udf.md b/docs/zh/07-develop/09-udf.md similarity index 100% rename from docs-cn/07-develop/09-udf.md rename to docs/zh/07-develop/09-udf.md diff --git a/docs-cn/07-develop/_category_.yml b/docs/zh/07-develop/_category_.yml similarity index 100% rename from docs-cn/07-develop/_category_.yml rename to docs/zh/07-develop/_category_.yml diff --git a/docs/zh/07-develop/_sub_c.mdx b/docs/zh/07-develop/_sub_c.mdx new file mode 100644 index 0000000000000000000000000000000000000000..da492a0269f064d8cdf9dfb80969894131d94015 --- /dev/null +++ b/docs/zh/07-develop/_sub_c.mdx @@ -0,0 +1,3 @@ +```c +{{#include docs/examples/c/subscribe_demo.c}} +``` \ No newline at end of file diff --git a/docs/zh/07-develop/_sub_cs.mdx b/docs/zh/07-develop/_sub_cs.mdx new file mode 100644 index 0000000000000000000000000000000000000000..a435ea0273c94cbe75eaf7431e1a9c39d49d92e3 --- /dev/null +++ b/docs/zh/07-develop/_sub_cs.mdx @@ -0,0 +1,3 @@ +```csharp +{{#include docs/examples/csharp/SubscribeDemo.cs}} +``` \ No newline at end of file diff --git a/docs/zh/07-develop/_sub_go.mdx b/docs/zh/07-develop/_sub_go.mdx new file mode 100644 index 0000000000000000000000000000000000000000..34b2aefd92c5eef75b59fbbba96b83da091722a7 --- /dev/null +++ b/docs/zh/07-develop/_sub_go.mdx @@ -0,0 +1,3 @@ +```go +{{#include docs/examples/go/sub/main.go}} +``` \ No newline at end of file diff --git a/docs-cn/07-develop/_sub_java.mdx b/docs/zh/07-develop/_sub_java.mdx similarity index 71% rename from docs-cn/07-develop/_sub_java.mdx rename to docs/zh/07-develop/_sub_java.mdx index 1ee0cb1a21e35f6760f8680e2ba6dedee92201cd..52df23f7dd0dbdc9810b1e53d66c4fcfd610759e 100644 --- a/docs-cn/07-develop/_sub_java.mdx +++ b/docs/zh/07-develop/_sub_java.mdx @@ -1,5 +1,5 @@ ```java -{{#include docs-examples/java/src/main/java/com/taos/example/SubscribeDemo.java}} +{{#include docs/examples/java/src/main/java/com/taos/example/SubscribeDemo.java}} ``` :::note 目前 Java 接口没有提供异步订阅模式,但用户程序可以通过创建 `TimerTask` 等方式达到同样的效果。 diff --git a/docs/zh/07-develop/_sub_node.mdx b/docs/zh/07-develop/_sub_node.mdx new file mode 100644 index 0000000000000000000000000000000000000000..3eeff0922a31a478dd34a77c6cb6471f51a57a8c --- /dev/null +++ b/docs/zh/07-develop/_sub_node.mdx @@ -0,0 +1,3 @@ +```js +{{#include docs/examples/node/nativeexample/subscribe_demo.js}} +``` \ No newline at end of file diff --git a/docs/zh/07-develop/_sub_python.mdx b/docs/zh/07-develop/_sub_python.mdx new file mode 100644 index 0000000000000000000000000000000000000000..490b76fca6deb61e61dc59c2096b30742a7d25f7 --- /dev/null +++ b/docs/zh/07-develop/_sub_python.mdx @@ -0,0 +1,3 @@ +```py +{{#include docs/examples/python/subscribe_demo.py}} +``` \ No newline at end of file diff --git a/docs/zh/07-develop/_sub_rust.mdx b/docs/zh/07-develop/_sub_rust.mdx new file mode 100644 index 0000000000000000000000000000000000000000..afb8d79daa3bbd72d72795cb4425f12277d710fc --- /dev/null +++ b/docs/zh/07-develop/_sub_rust.mdx @@ -0,0 +1,3 @@ +```rs +{{#include docs/examples/rust/nativeexample/examples/subscribe_demo.rs}} +``` \ No newline at end of file diff --git a/docs-cn/07-develop/index.md b/docs/zh/07-develop/index.md similarity index 100% rename from docs-cn/07-develop/index.md rename to docs/zh/07-develop/index.md diff --git a/docs-cn/10-cluster/01-deploy.md b/docs/zh/10-cluster/01-deploy.md similarity index 100% rename from docs-cn/10-cluster/01-deploy.md rename to docs/zh/10-cluster/01-deploy.md diff --git a/docs-cn/10-cluster/02-cluster-mgmt.md b/docs/zh/10-cluster/02-cluster-mgmt.md similarity index 100% rename from docs-cn/10-cluster/02-cluster-mgmt.md rename to docs/zh/10-cluster/02-cluster-mgmt.md diff --git a/docs-cn/10-cluster/03-ha-and-lb.md b/docs/zh/10-cluster/03-ha-and-lb.md similarity index 100% rename from docs-cn/10-cluster/03-ha-and-lb.md rename to docs/zh/10-cluster/03-ha-and-lb.md diff --git a/docs-cn/10-cluster/_category_.yml b/docs/zh/10-cluster/_category_.yml similarity index 100% rename from docs-cn/10-cluster/_category_.yml rename to docs/zh/10-cluster/_category_.yml diff --git a/docs-cn/10-cluster/index.md b/docs/zh/10-cluster/index.md similarity index 100% rename from docs-cn/10-cluster/index.md rename to docs/zh/10-cluster/index.md diff --git a/docs-cn/12-taos-sql/01-data-type.md b/docs/zh/12-taos-sql/01-data-type.md similarity index 100% rename from docs-cn/12-taos-sql/01-data-type.md rename to docs/zh/12-taos-sql/01-data-type.md diff --git a/docs-cn/12-taos-sql/02-database.md b/docs/zh/12-taos-sql/02-database.md similarity index 100% rename from docs-cn/12-taos-sql/02-database.md rename to docs/zh/12-taos-sql/02-database.md diff --git a/docs-cn/12-taos-sql/03-table.md b/docs/zh/12-taos-sql/03-table.md similarity index 100% rename from docs-cn/12-taos-sql/03-table.md rename to docs/zh/12-taos-sql/03-table.md diff --git a/docs-cn/12-taos-sql/04-stable.md b/docs/zh/12-taos-sql/04-stable.md similarity index 100% rename from docs-cn/12-taos-sql/04-stable.md rename to docs/zh/12-taos-sql/04-stable.md diff --git a/docs-cn/12-taos-sql/05-insert.md b/docs/zh/12-taos-sql/05-insert.md similarity index 100% rename from docs-cn/12-taos-sql/05-insert.md rename to docs/zh/12-taos-sql/05-insert.md diff --git a/docs-cn/12-taos-sql/06-select.md b/docs/zh/12-taos-sql/06-select.md similarity index 100% rename from docs-cn/12-taos-sql/06-select.md rename to docs/zh/12-taos-sql/06-select.md diff --git a/docs-cn/12-taos-sql/07-function.md b/docs/zh/12-taos-sql/07-function.md similarity index 100% rename from docs-cn/12-taos-sql/07-function.md rename to docs/zh/12-taos-sql/07-function.md diff --git a/docs-cn/12-taos-sql/08-interval.md b/docs/zh/12-taos-sql/08-interval.md similarity index 100% rename from docs-cn/12-taos-sql/08-interval.md rename to docs/zh/12-taos-sql/08-interval.md diff --git a/docs-cn/12-taos-sql/09-limit.md b/docs/zh/12-taos-sql/09-limit.md similarity index 100% rename from docs-cn/12-taos-sql/09-limit.md rename to docs/zh/12-taos-sql/09-limit.md diff --git a/docs-cn/12-taos-sql/10-json.md b/docs/zh/12-taos-sql/10-json.md similarity index 100% rename from docs-cn/12-taos-sql/10-json.md rename to docs/zh/12-taos-sql/10-json.md diff --git a/docs-cn/12-taos-sql/11-escape.md b/docs/zh/12-taos-sql/11-escape.md similarity index 100% rename from docs-cn/12-taos-sql/11-escape.md rename to docs/zh/12-taos-sql/11-escape.md diff --git a/docs-cn/12-taos-sql/12-keywords.md b/docs/zh/12-taos-sql/12-keywords.md similarity index 100% rename from docs-cn/12-taos-sql/12-keywords.md rename to docs/zh/12-taos-sql/12-keywords.md diff --git a/docs-cn/12-taos-sql/13-operators.md b/docs/zh/12-taos-sql/13-operators.md similarity index 100% rename from docs-cn/12-taos-sql/13-operators.md rename to docs/zh/12-taos-sql/13-operators.md diff --git a/docs-cn/12-taos-sql/_category_.yml b/docs/zh/12-taos-sql/_category_.yml similarity index 100% rename from docs-cn/12-taos-sql/_category_.yml rename to docs/zh/12-taos-sql/_category_.yml diff --git a/docs-cn/12-taos-sql/index.md b/docs/zh/12-taos-sql/index.md similarity index 100% rename from docs-cn/12-taos-sql/index.md rename to docs/zh/12-taos-sql/index.md diff --git a/docs-en/12-taos-sql/timewindow-1.webp b/docs/zh/12-taos-sql/timewindow-1.webp similarity index 100% rename from docs-en/12-taos-sql/timewindow-1.webp rename to docs/zh/12-taos-sql/timewindow-1.webp diff --git a/docs-en/12-taos-sql/timewindow-2.webp b/docs/zh/12-taos-sql/timewindow-2.webp similarity index 100% rename from docs-en/12-taos-sql/timewindow-2.webp rename to docs/zh/12-taos-sql/timewindow-2.webp diff --git a/docs-en/12-taos-sql/timewindow-3.webp b/docs/zh/12-taos-sql/timewindow-3.webp similarity index 100% rename from docs-en/12-taos-sql/timewindow-3.webp rename to docs/zh/12-taos-sql/timewindow-3.webp diff --git a/docs-cn/13-operation/01-pkg-install.md b/docs/zh/13-operation/01-pkg-install.md similarity index 100% rename from docs-cn/13-operation/01-pkg-install.md rename to docs/zh/13-operation/01-pkg-install.md diff --git a/docs-cn/13-operation/02-planning.mdx b/docs/zh/13-operation/02-planning.mdx similarity index 100% rename from docs-cn/13-operation/02-planning.mdx rename to docs/zh/13-operation/02-planning.mdx diff --git a/docs-cn/13-operation/03-tolerance.md b/docs/zh/13-operation/03-tolerance.md similarity index 100% rename from docs-cn/13-operation/03-tolerance.md rename to docs/zh/13-operation/03-tolerance.md diff --git a/docs-cn/13-operation/06-admin.md b/docs/zh/13-operation/06-admin.md similarity index 100% rename from docs-cn/13-operation/06-admin.md rename to docs/zh/13-operation/06-admin.md diff --git a/docs-cn/13-operation/07-import.md b/docs/zh/13-operation/07-import.md similarity index 100% rename from docs-cn/13-operation/07-import.md rename to docs/zh/13-operation/07-import.md diff --git a/docs-cn/13-operation/08-export.md b/docs/zh/13-operation/08-export.md similarity index 100% rename from docs-cn/13-operation/08-export.md rename to docs/zh/13-operation/08-export.md diff --git a/docs-cn/13-operation/09-status.md b/docs/zh/13-operation/09-status.md similarity index 100% rename from docs-cn/13-operation/09-status.md rename to docs/zh/13-operation/09-status.md diff --git a/docs-cn/13-operation/10-monitor.md b/docs/zh/13-operation/10-monitor.md similarity index 100% rename from docs-cn/13-operation/10-monitor.md rename to docs/zh/13-operation/10-monitor.md diff --git a/docs-cn/13-operation/17-diagnose.md b/docs/zh/13-operation/17-diagnose.md similarity index 100% rename from docs-cn/13-operation/17-diagnose.md rename to docs/zh/13-operation/17-diagnose.md diff --git a/docs-cn/13-operation/_category_.yml b/docs/zh/13-operation/_category_.yml similarity index 100% rename from docs-cn/13-operation/_category_.yml rename to docs/zh/13-operation/_category_.yml diff --git a/docs-cn/13-operation/index.md b/docs/zh/13-operation/index.md similarity index 100% rename from docs-cn/13-operation/index.md rename to docs/zh/13-operation/index.md diff --git a/docs-cn/14-reference/02-rest-api/02-rest-api.mdx b/docs/zh/14-reference/02-rest-api/02-rest-api.mdx similarity index 100% rename from docs-cn/14-reference/02-rest-api/02-rest-api.mdx rename to docs/zh/14-reference/02-rest-api/02-rest-api.mdx diff --git a/docs-en/14-reference/02-rest-api/_category_.yml b/docs/zh/14-reference/02-rest-api/_category_.yml similarity index 100% rename from docs-en/14-reference/02-rest-api/_category_.yml rename to docs/zh/14-reference/02-rest-api/_category_.yml diff --git a/docs-cn/14-reference/03-connector/03-connector.mdx b/docs/zh/14-reference/03-connector/03-connector.mdx similarity index 100% rename from docs-cn/14-reference/03-connector/03-connector.mdx rename to docs/zh/14-reference/03-connector/03-connector.mdx diff --git a/docs-cn/14-reference/03-connector/_category_.yml b/docs/zh/14-reference/03-connector/_category_.yml similarity index 100% rename from docs-cn/14-reference/03-connector/_category_.yml rename to docs/zh/14-reference/03-connector/_category_.yml diff --git a/docs-cn/14-reference/03-connector/_linux_install.mdx b/docs/zh/14-reference/03-connector/_linux_install.mdx similarity index 100% rename from docs-cn/14-reference/03-connector/_linux_install.mdx rename to docs/zh/14-reference/03-connector/_linux_install.mdx diff --git a/docs-cn/14-reference/03-connector/_preparition.mdx b/docs/zh/14-reference/03-connector/_preparition.mdx similarity index 100% rename from docs-cn/14-reference/03-connector/_preparition.mdx rename to docs/zh/14-reference/03-connector/_preparition.mdx diff --git a/docs-cn/14-reference/03-connector/_verify_linux.mdx b/docs/zh/14-reference/03-connector/_verify_linux.mdx similarity index 100% rename from docs-cn/14-reference/03-connector/_verify_linux.mdx rename to docs/zh/14-reference/03-connector/_verify_linux.mdx diff --git a/docs-cn/14-reference/03-connector/_verify_windows.mdx b/docs/zh/14-reference/03-connector/_verify_windows.mdx similarity index 100% rename from docs-cn/14-reference/03-connector/_verify_windows.mdx rename to docs/zh/14-reference/03-connector/_verify_windows.mdx diff --git a/docs-cn/14-reference/03-connector/_windows_install.mdx b/docs/zh/14-reference/03-connector/_windows_install.mdx similarity index 100% rename from docs-cn/14-reference/03-connector/_windows_install.mdx rename to docs/zh/14-reference/03-connector/_windows_install.mdx diff --git a/docs-en/14-reference/03-connector/connector.webp b/docs/zh/14-reference/03-connector/connector.webp similarity index 100% rename from docs-en/14-reference/03-connector/connector.webp rename to docs/zh/14-reference/03-connector/connector.webp diff --git a/docs-cn/14-reference/03-connector/cpp.mdx b/docs/zh/14-reference/03-connector/cpp.mdx similarity index 100% rename from docs-cn/14-reference/03-connector/cpp.mdx rename to docs/zh/14-reference/03-connector/cpp.mdx diff --git a/docs-cn/14-reference/03-connector/csharp.mdx b/docs/zh/14-reference/03-connector/csharp.mdx similarity index 100% rename from docs-cn/14-reference/03-connector/csharp.mdx rename to docs/zh/14-reference/03-connector/csharp.mdx diff --git a/docs-cn/14-reference/03-connector/go.mdx b/docs/zh/14-reference/03-connector/go.mdx similarity index 100% rename from docs-cn/14-reference/03-connector/go.mdx rename to docs/zh/14-reference/03-connector/go.mdx diff --git a/docs-cn/14-reference/03-connector/java.mdx b/docs/zh/14-reference/03-connector/java.mdx similarity index 100% rename from docs-cn/14-reference/03-connector/java.mdx rename to docs/zh/14-reference/03-connector/java.mdx diff --git a/docs-cn/14-reference/03-connector/node.mdx b/docs/zh/14-reference/03-connector/node.mdx similarity index 100% rename from docs-cn/14-reference/03-connector/node.mdx rename to docs/zh/14-reference/03-connector/node.mdx diff --git a/docs-cn/14-reference/03-connector/php.mdx b/docs/zh/14-reference/03-connector/php.mdx similarity index 95% rename from docs-cn/14-reference/03-connector/php.mdx rename to docs/zh/14-reference/03-connector/php.mdx index f150aed4c8a6ba855d5e830a2944a6d6f88ab0f5..2b7ff2a6febd162fe34ebb737d2f33fbd9fc58a2 100644 --- a/docs-cn/14-reference/03-connector/php.mdx +++ b/docs/zh/14-reference/03-connector/php.mdx @@ -91,7 +91,7 @@ phpize && ./configure --enable-swoole && make -j && make install 建立连接 ```c -{{#include docs-examples/php/connect.php}} +{{#include docs/examples/php/connect.php}} ``` @@ -102,7 +102,7 @@ phpize && ./configure --enable-swoole && make -j && make install 插入数据 ```c -{{#include docs-examples/php/insert.php}} +{{#include docs/examples/php/insert.php}} ``` @@ -113,7 +113,7 @@ phpize && ./configure --enable-swoole && make -j && make install 同步查询 ```c -{{#include docs-examples/php/query.php}} +{{#include docs/examples/php/query.php}} ``` @@ -124,7 +124,7 @@ phpize && ./configure --enable-swoole && make -j && make install 参数绑定 ```c -{{#include docs-examples/php/insert_stmt.php}} +{{#include docs/examples/php/insert_stmt.php}} ``` diff --git a/docs-cn/14-reference/03-connector/python.mdx b/docs/zh/14-reference/03-connector/python.mdx similarity index 95% rename from docs-cn/14-reference/03-connector/python.mdx rename to docs/zh/14-reference/03-connector/python.mdx index 828e0a4abb758a72c3a127be13dd89c4d86186f4..a77dc71db7d07c93084984d2e95e3d4267bca924 100644 --- a/docs-cn/14-reference/03-connector/python.mdx +++ b/docs/zh/14-reference/03-connector/python.mdx @@ -169,7 +169,7 @@ curl -u root:taosdata http://:/rest/sql -d "select server_version()" ```python -{{#include docs-examples/python/connect_native_reference.py}} +{{#include docs/examples/python/connect_native_reference.py}} ``` `connect` 函数的所有参数都是可选的关键字参数。下面是连接参数的具体说明: @@ -194,7 +194,7 @@ curl -u root:taosdata http://:/rest/sql -d "select server_version()" ```python -{{#include docs-examples/python/connect_rest_examples.py:connect}} +{{#include docs/examples/python/connect_rest_examples.py:connect}} ``` `connect()` 函数的所有参数都是可选的关键字参数。下面是连接参数的具体说明: @@ -219,11 +219,11 @@ curl -u root:taosdata http://:/rest/sql -d "select server_version()" `TaosConnection` 类既包含对 PEP249 Connection 接口的实现(如:`cursor`方法和 `close` 方法),也包含很多扩展功能(如: `execute`、 `query`、`schemaless_insert` 和 `subscribe` 方法。 ```python title="execute 方法" -{{#include docs-examples/python/connection_usage_native_reference.py:insert}} +{{#include docs/examples/python/connection_usage_native_reference.py:insert}} ``` ```python title="query 方法" -{{#include docs-examples/python/connection_usage_native_reference.py:query}} +{{#include docs/examples/python/connection_usage_native_reference.py:query}} ``` :::tip @@ -235,14 +235,14 @@ curl -u root:taosdata http://:/rest/sql -d "select server_version()" 上面 `TaosConnection` 类的使用示例中,我们已经展示了两种获取查询结果的方法: `fetch_all()` 和 `fetch_all_into_dict()`。除此之外 `TaosResult` 还提供了按行迭代(`rows_iter`)或按数据块迭代(`blocks_iter`)结果集的方法。在查询数据量较大的场景,使用这两个方法会更高效。 ```python title="blocks_iter 方法" -{{#include docs-examples/python/result_set_examples.py}} +{{#include docs/examples/python/result_set_examples.py}} ``` ##### TaosCursor 类的使用 `TaosConnection` 类和 `TaosResult` 类已经实现了原生接口的所有功能。如果你对 PEP249 规范中的接口比较熟悉也可以使用 `TaosCursor` 类提供的方法。 ```python title="TaosCursor 的使用" -{{#include docs-examples/python/cursor_usage_native_reference.py}} +{{#include docs/examples/python/cursor_usage_native_reference.py}} ``` :::note @@ -258,7 +258,7 @@ TaosCursor 类使用原生连接进行写入、查询操作。在客户端多线 `TaosRestCursor` 类是对 PEP249 Cursor 接口的实现。 ```python title="TaosRestCursor 的使用" -{{#include docs-examples/python/connect_rest_examples.py:basic}} +{{#include docs/examples/python/connect_rest_examples.py:basic}} ``` - `cursor.execute` : 用来执行任意 SQL 语句。 - `cursor.rowcount`: 对于写入操作返回写入成功记录数。对于查询操作,返回结果集行数。 @@ -269,7 +269,7 @@ TaosCursor 类使用原生连接进行写入、查询操作。在客户端多线 `RestClient` 类是对于 [REST API](/reference/rest-api) 的直接封装。它只包含一个 `sql()` 方法用于执行任意 SQL 语句, 并返回执行结果。 ```python title="RestClient 的使用" -{{#include docs-examples/python/rest_client_example.py}} +{{#include docs/examples/python/rest_client_example.py}} ``` 对于 `sql()` 方法更详细的介绍, 请参考 [RestClient](https://docs.taosdata.com/api/taospy/taosrest/restclient.html)。 @@ -285,14 +285,14 @@ TaosCursor 类使用原生连接进行写入、查询操作。在客户端多线 ```python -{{#include docs-examples/python/conn_native_pandas.py}} +{{#include docs/examples/python/conn_native_pandas.py}} ``` ```python -{{#include docs-examples/python/conn_rest_pandas.py}} +{{#include docs/examples/python/conn_rest_pandas.py}} ``` @@ -316,7 +316,7 @@ TaosCursor 类使用原生连接进行写入、查询操作。在客户端多线 所有数据库操作如果出现异常,都会直接抛出来。由应用程序负责异常处理。比如: ```python -{{#include docs-examples/python/handle_exception.py}} +{{#include docs/examples/python/handle_exception.py}} ``` ### 关于纳秒 (nanosecond) diff --git a/docs-cn/14-reference/03-connector/rust.mdx b/docs/zh/14-reference/03-connector/rust.mdx similarity index 100% rename from docs-cn/14-reference/03-connector/rust.mdx rename to docs/zh/14-reference/03-connector/rust.mdx diff --git a/docs-cn/14-reference/03-connector/tdengine-jdbc-connector.webp b/docs/zh/14-reference/03-connector/tdengine-jdbc-connector.webp similarity index 100% rename from docs-cn/14-reference/03-connector/tdengine-jdbc-connector.webp rename to docs/zh/14-reference/03-connector/tdengine-jdbc-connector.webp diff --git a/docs-cn/14-reference/04-taosadapter.md b/docs/zh/14-reference/04-taosadapter.md similarity index 100% rename from docs-cn/14-reference/04-taosadapter.md rename to docs/zh/14-reference/04-taosadapter.md diff --git a/docs-cn/14-reference/05-taosbenchmark.md b/docs/zh/14-reference/05-taosbenchmark.md similarity index 100% rename from docs-cn/14-reference/05-taosbenchmark.md rename to docs/zh/14-reference/05-taosbenchmark.md diff --git a/docs-cn/14-reference/06-taosdump.md b/docs/zh/14-reference/06-taosdump.md similarity index 100% rename from docs-cn/14-reference/06-taosdump.md rename to docs/zh/14-reference/06-taosdump.md diff --git a/docs-en/14-reference/07-tdinsight/assets/15146-tdengine-monitor-dashboard.json b/docs/zh/14-reference/07-tdinsight/assets/15146-tdengine-monitor-dashboard.json similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/15146-tdengine-monitor-dashboard.json rename to docs/zh/14-reference/07-tdinsight/assets/15146-tdengine-monitor-dashboard.json diff --git a/docs-en/14-reference/07-tdinsight/assets/15155-tdengine-alert-demo.json b/docs/zh/14-reference/07-tdinsight/assets/15155-tdengine-alert-demo.json similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/15155-tdengine-alert-demo.json rename to docs/zh/14-reference/07-tdinsight/assets/15155-tdengine-alert-demo.json diff --git a/docs-en/14-reference/07-tdinsight/assets/TDinsight-1-cluster-status.webp b/docs/zh/14-reference/07-tdinsight/assets/TDinsight-1-cluster-status.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/TDinsight-1-cluster-status.webp rename to docs/zh/14-reference/07-tdinsight/assets/TDinsight-1-cluster-status.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/TDinsight-2-dnodes.webp b/docs/zh/14-reference/07-tdinsight/assets/TDinsight-2-dnodes.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/TDinsight-2-dnodes.webp rename to docs/zh/14-reference/07-tdinsight/assets/TDinsight-2-dnodes.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/TDinsight-3-mnodes.webp b/docs/zh/14-reference/07-tdinsight/assets/TDinsight-3-mnodes.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/TDinsight-3-mnodes.webp rename to docs/zh/14-reference/07-tdinsight/assets/TDinsight-3-mnodes.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/TDinsight-4-requests.webp b/docs/zh/14-reference/07-tdinsight/assets/TDinsight-4-requests.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/TDinsight-4-requests.webp rename to docs/zh/14-reference/07-tdinsight/assets/TDinsight-4-requests.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/TDinsight-5-database.webp b/docs/zh/14-reference/07-tdinsight/assets/TDinsight-5-database.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/TDinsight-5-database.webp rename to docs/zh/14-reference/07-tdinsight/assets/TDinsight-5-database.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/TDinsight-6-dnode-usage.webp b/docs/zh/14-reference/07-tdinsight/assets/TDinsight-6-dnode-usage.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/TDinsight-6-dnode-usage.webp rename to docs/zh/14-reference/07-tdinsight/assets/TDinsight-6-dnode-usage.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/TDinsight-7-login-history.webp b/docs/zh/14-reference/07-tdinsight/assets/TDinsight-7-login-history.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/TDinsight-7-login-history.webp rename to docs/zh/14-reference/07-tdinsight/assets/TDinsight-7-login-history.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/TDinsight-8-taosadapter.webp b/docs/zh/14-reference/07-tdinsight/assets/TDinsight-8-taosadapter.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/TDinsight-8-taosadapter.webp rename to docs/zh/14-reference/07-tdinsight/assets/TDinsight-8-taosadapter.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/TDinsight-full.webp b/docs/zh/14-reference/07-tdinsight/assets/TDinsight-full.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/TDinsight-full.webp rename to docs/zh/14-reference/07-tdinsight/assets/TDinsight-full.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/alert-manager-status.webp b/docs/zh/14-reference/07-tdinsight/assets/alert-manager-status.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/alert-manager-status.webp rename to docs/zh/14-reference/07-tdinsight/assets/alert-manager-status.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/alert-notification-channel.webp b/docs/zh/14-reference/07-tdinsight/assets/alert-notification-channel.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/alert-notification-channel.webp rename to docs/zh/14-reference/07-tdinsight/assets/alert-notification-channel.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/alert-query-demo.webp b/docs/zh/14-reference/07-tdinsight/assets/alert-query-demo.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/alert-query-demo.webp rename to docs/zh/14-reference/07-tdinsight/assets/alert-query-demo.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/alert-rule-condition-notifications.webp b/docs/zh/14-reference/07-tdinsight/assets/alert-rule-condition-notifications.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/alert-rule-condition-notifications.webp rename to docs/zh/14-reference/07-tdinsight/assets/alert-rule-condition-notifications.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/alert-rule-test.webp b/docs/zh/14-reference/07-tdinsight/assets/alert-rule-test.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/alert-rule-test.webp rename to docs/zh/14-reference/07-tdinsight/assets/alert-rule-test.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/howto-add-datasource-button.webp b/docs/zh/14-reference/07-tdinsight/assets/howto-add-datasource-button.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/howto-add-datasource-button.webp rename to docs/zh/14-reference/07-tdinsight/assets/howto-add-datasource-button.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/howto-add-datasource-tdengine.webp b/docs/zh/14-reference/07-tdinsight/assets/howto-add-datasource-tdengine.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/howto-add-datasource-tdengine.webp rename to docs/zh/14-reference/07-tdinsight/assets/howto-add-datasource-tdengine.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/howto-add-datasource-test.webp b/docs/zh/14-reference/07-tdinsight/assets/howto-add-datasource-test.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/howto-add-datasource-test.webp rename to docs/zh/14-reference/07-tdinsight/assets/howto-add-datasource-test.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/howto-add-datasource.webp b/docs/zh/14-reference/07-tdinsight/assets/howto-add-datasource.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/howto-add-datasource.webp rename to docs/zh/14-reference/07-tdinsight/assets/howto-add-datasource.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/howto-dashboard-display.webp b/docs/zh/14-reference/07-tdinsight/assets/howto-dashboard-display.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/howto-dashboard-display.webp rename to docs/zh/14-reference/07-tdinsight/assets/howto-dashboard-display.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/howto-dashboard-import-options.webp b/docs/zh/14-reference/07-tdinsight/assets/howto-dashboard-import-options.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/howto-dashboard-import-options.webp rename to docs/zh/14-reference/07-tdinsight/assets/howto-dashboard-import-options.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/howto-import-dashboard.webp b/docs/zh/14-reference/07-tdinsight/assets/howto-import-dashboard.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/howto-import-dashboard.webp rename to docs/zh/14-reference/07-tdinsight/assets/howto-import-dashboard.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/import-dashboard-15167.webp b/docs/zh/14-reference/07-tdinsight/assets/import-dashboard-15167.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/import-dashboard-15167.webp rename to docs/zh/14-reference/07-tdinsight/assets/import-dashboard-15167.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/import-dashboard-for-tdengine.webp b/docs/zh/14-reference/07-tdinsight/assets/import-dashboard-for-tdengine.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/import-dashboard-for-tdengine.webp rename to docs/zh/14-reference/07-tdinsight/assets/import-dashboard-for-tdengine.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/import-via-grafana-dot-com.webp b/docs/zh/14-reference/07-tdinsight/assets/import-via-grafana-dot-com.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/import-via-grafana-dot-com.webp rename to docs/zh/14-reference/07-tdinsight/assets/import-via-grafana-dot-com.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/import_dashboard.webp b/docs/zh/14-reference/07-tdinsight/assets/import_dashboard.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/import_dashboard.webp rename to docs/zh/14-reference/07-tdinsight/assets/import_dashboard.webp diff --git a/docs-en/14-reference/07-tdinsight/assets/tdengine-grafana-7.x.json b/docs/zh/14-reference/07-tdinsight/assets/tdengine-grafana-7.x.json similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/tdengine-grafana-7.x.json rename to docs/zh/14-reference/07-tdinsight/assets/tdengine-grafana-7.x.json diff --git a/docs-en/14-reference/07-tdinsight/assets/tdengine-grafana.json b/docs/zh/14-reference/07-tdinsight/assets/tdengine-grafana.json similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/tdengine-grafana.json rename to docs/zh/14-reference/07-tdinsight/assets/tdengine-grafana.json diff --git a/docs-en/14-reference/07-tdinsight/assets/tdengine_dashboard.webp b/docs/zh/14-reference/07-tdinsight/assets/tdengine_dashboard.webp similarity index 100% rename from docs-en/14-reference/07-tdinsight/assets/tdengine_dashboard.webp rename to docs/zh/14-reference/07-tdinsight/assets/tdengine_dashboard.webp diff --git a/docs-cn/14-reference/07-tdinsight/index.md b/docs/zh/14-reference/07-tdinsight/index.md similarity index 100% rename from docs-cn/14-reference/07-tdinsight/index.md rename to docs/zh/14-reference/07-tdinsight/index.md diff --git a/docs-cn/14-reference/08-taos-shell.md b/docs/zh/14-reference/08-taos-shell.md similarity index 100% rename from docs-cn/14-reference/08-taos-shell.md rename to docs/zh/14-reference/08-taos-shell.md diff --git a/docs-cn/14-reference/09-support-platform/_category_.yml b/docs/zh/14-reference/09-support-platform/_category_.yml similarity index 100% rename from docs-cn/14-reference/09-support-platform/_category_.yml rename to docs/zh/14-reference/09-support-platform/_category_.yml diff --git a/docs-cn/14-reference/09-support-platform/index.md b/docs/zh/14-reference/09-support-platform/index.md similarity index 100% rename from docs-cn/14-reference/09-support-platform/index.md rename to docs/zh/14-reference/09-support-platform/index.md diff --git a/docs-cn/14-reference/11-docker/_category_.yml b/docs/zh/14-reference/11-docker/_category_.yml similarity index 100% rename from docs-cn/14-reference/11-docker/_category_.yml rename to docs/zh/14-reference/11-docker/_category_.yml diff --git a/docs-cn/14-reference/11-docker/index.md b/docs/zh/14-reference/11-docker/index.md similarity index 100% rename from docs-cn/14-reference/11-docker/index.md rename to docs/zh/14-reference/11-docker/index.md diff --git a/docs-cn/14-reference/12-config/_category_.yml b/docs/zh/14-reference/12-config/_category_.yml similarity index 100% rename from docs-cn/14-reference/12-config/_category_.yml rename to docs/zh/14-reference/12-config/_category_.yml diff --git a/docs-cn/14-reference/12-config/index.md b/docs/zh/14-reference/12-config/index.md similarity index 100% rename from docs-cn/14-reference/12-config/index.md rename to docs/zh/14-reference/12-config/index.md diff --git a/docs-cn/14-reference/12-directory.md b/docs/zh/14-reference/12-directory.md similarity index 100% rename from docs-cn/14-reference/12-directory.md rename to docs/zh/14-reference/12-directory.md diff --git a/docs-cn/14-reference/13-schemaless/13-schemaless.md b/docs/zh/14-reference/13-schemaless/13-schemaless.md similarity index 100% rename from docs-cn/14-reference/13-schemaless/13-schemaless.md rename to docs/zh/14-reference/13-schemaless/13-schemaless.md diff --git a/docs-cn/14-reference/13-schemaless/_category_.yml b/docs/zh/14-reference/13-schemaless/_category_.yml similarity index 100% rename from docs-cn/14-reference/13-schemaless/_category_.yml rename to docs/zh/14-reference/13-schemaless/_category_.yml diff --git a/docs-cn/14-reference/_category_.yml b/docs/zh/14-reference/_category_.yml similarity index 100% rename from docs-cn/14-reference/_category_.yml rename to docs/zh/14-reference/_category_.yml diff --git a/docs-cn/14-reference/_collectd.mdx b/docs/zh/14-reference/_collectd.mdx similarity index 100% rename from docs-cn/14-reference/_collectd.mdx rename to docs/zh/14-reference/_collectd.mdx diff --git a/docs-cn/14-reference/_icinga2.mdx b/docs/zh/14-reference/_icinga2.mdx similarity index 100% rename from docs-cn/14-reference/_icinga2.mdx rename to docs/zh/14-reference/_icinga2.mdx diff --git a/docs-cn/14-reference/_prometheus.mdx b/docs/zh/14-reference/_prometheus.mdx similarity index 100% rename from docs-cn/14-reference/_prometheus.mdx rename to docs/zh/14-reference/_prometheus.mdx diff --git a/docs-cn/14-reference/_statsd.mdx b/docs/zh/14-reference/_statsd.mdx similarity index 100% rename from docs-cn/14-reference/_statsd.mdx rename to docs/zh/14-reference/_statsd.mdx diff --git a/docs-cn/14-reference/_tcollector.mdx b/docs/zh/14-reference/_tcollector.mdx similarity index 100% rename from docs-cn/14-reference/_tcollector.mdx rename to docs/zh/14-reference/_tcollector.mdx diff --git a/docs-cn/14-reference/_telegraf.mdx b/docs/zh/14-reference/_telegraf.mdx similarity index 100% rename from docs-cn/14-reference/_telegraf.mdx rename to docs/zh/14-reference/_telegraf.mdx diff --git a/docs-cn/14-reference/index.md b/docs/zh/14-reference/index.md similarity index 100% rename from docs-cn/14-reference/index.md rename to docs/zh/14-reference/index.md diff --git a/docs-en/14-reference/taosAdapter-architecture.webp b/docs/zh/14-reference/taosAdapter-architecture.webp similarity index 100% rename from docs-en/14-reference/taosAdapter-architecture.webp rename to docs/zh/14-reference/taosAdapter-architecture.webp diff --git a/docs-cn/20-third-party/01-grafana.mdx b/docs/zh/20-third-party/01-grafana.mdx similarity index 100% rename from docs-cn/20-third-party/01-grafana.mdx rename to docs/zh/20-third-party/01-grafana.mdx diff --git a/docs-cn/20-third-party/02-prometheus.md b/docs/zh/20-third-party/02-prometheus.md similarity index 100% rename from docs-cn/20-third-party/02-prometheus.md rename to docs/zh/20-third-party/02-prometheus.md diff --git a/docs-cn/20-third-party/03-telegraf.md b/docs/zh/20-third-party/03-telegraf.md similarity index 100% rename from docs-cn/20-third-party/03-telegraf.md rename to docs/zh/20-third-party/03-telegraf.md diff --git a/docs-cn/20-third-party/05-collectd.md b/docs/zh/20-third-party/05-collectd.md similarity index 100% rename from docs-cn/20-third-party/05-collectd.md rename to docs/zh/20-third-party/05-collectd.md diff --git a/docs-cn/20-third-party/06-statsd.md b/docs/zh/20-third-party/06-statsd.md similarity index 100% rename from docs-cn/20-third-party/06-statsd.md rename to docs/zh/20-third-party/06-statsd.md diff --git a/docs-cn/20-third-party/07-icinga2.md b/docs/zh/20-third-party/07-icinga2.md similarity index 100% rename from docs-cn/20-third-party/07-icinga2.md rename to docs/zh/20-third-party/07-icinga2.md diff --git a/docs-cn/20-third-party/08-tcollector.md b/docs/zh/20-third-party/08-tcollector.md similarity index 100% rename from docs-cn/20-third-party/08-tcollector.md rename to docs/zh/20-third-party/08-tcollector.md diff --git a/docs-cn/20-third-party/09-emq-broker.md b/docs/zh/20-third-party/09-emq-broker.md similarity index 99% rename from docs-cn/20-third-party/09-emq-broker.md rename to docs/zh/20-third-party/09-emq-broker.md index 2125545f393819d74fc2c5df1c37784823e33343..84b1027f6b080cc5d5f8ac98f9aa6ea8be428f28 100644 --- a/docs-cn/20-third-party/09-emq-broker.md +++ b/docs/zh/20-third-party/09-emq-broker.md @@ -116,7 +116,7 @@ INSERT INTO test.sensor_data VALUES( ## 编写模拟测试程序 ```javascript -{{#include docs-examples/other/mock.js}} +{{#include docs/examples/other/mock.js}} ``` 注意:代码中 CLIENT_NUM 在开始测试中可以先设置一个较小的值,避免硬件性能不能完全处理较大并发客户端数量。 diff --git a/docs-cn/20-third-party/10-hive-mq-broker.md b/docs/zh/20-third-party/10-hive-mq-broker.md similarity index 100% rename from docs-cn/20-third-party/10-hive-mq-broker.md rename to docs/zh/20-third-party/10-hive-mq-broker.md diff --git a/docs-cn/20-third-party/11-kafka.md b/docs/zh/20-third-party/11-kafka.md similarity index 100% rename from docs-cn/20-third-party/11-kafka.md rename to docs/zh/20-third-party/11-kafka.md diff --git a/docs-cn/20-third-party/_category_.yml b/docs/zh/20-third-party/_category_.yml similarity index 100% rename from docs-cn/20-third-party/_category_.yml rename to docs/zh/20-third-party/_category_.yml diff --git a/docs-cn/20-third-party/_deploytaosadapter.mdx b/docs/zh/20-third-party/_deploytaosadapter.mdx similarity index 100% rename from docs-cn/20-third-party/_deploytaosadapter.mdx rename to docs/zh/20-third-party/_deploytaosadapter.mdx diff --git a/docs-en/20-third-party/grafana/add_datasource1.webp b/docs/zh/20-third-party/add_datasource1.webp similarity index 100% rename from docs-en/20-third-party/grafana/add_datasource1.webp rename to docs/zh/20-third-party/add_datasource1.webp diff --git a/docs-en/20-third-party/grafana/add_datasource2.webp b/docs/zh/20-third-party/add_datasource2.webp similarity index 100% rename from docs-en/20-third-party/grafana/add_datasource2.webp rename to docs/zh/20-third-party/add_datasource2.webp diff --git a/docs-en/20-third-party/grafana/add_datasource3.webp b/docs/zh/20-third-party/add_datasource3.webp similarity index 100% rename from docs-en/20-third-party/grafana/add_datasource3.webp rename to docs/zh/20-third-party/add_datasource3.webp diff --git a/docs-en/20-third-party/grafana/add_datasource4.webp b/docs/zh/20-third-party/add_datasource4.webp similarity index 100% rename from docs-en/20-third-party/grafana/add_datasource4.webp rename to docs/zh/20-third-party/add_datasource4.webp diff --git a/docs-en/20-third-party/grafana/create_dashboard1.webp b/docs/zh/20-third-party/create_dashboard1.webp similarity index 100% rename from docs-en/20-third-party/grafana/create_dashboard1.webp rename to docs/zh/20-third-party/create_dashboard1.webp diff --git a/docs-en/20-third-party/grafana/create_dashboard2.webp b/docs/zh/20-third-party/create_dashboard2.webp similarity index 100% rename from docs-en/20-third-party/grafana/create_dashboard2.webp rename to docs/zh/20-third-party/create_dashboard2.webp diff --git a/docs-cn/20-third-party/dashboard-15146.webp b/docs/zh/20-third-party/dashboard-15146.webp similarity index 100% rename from docs-cn/20-third-party/dashboard-15146.webp rename to docs/zh/20-third-party/dashboard-15146.webp diff --git a/docs-en/20-third-party/emqx/add-action-handler.webp b/docs/zh/20-third-party/emqx/add-action-handler.webp similarity index 100% rename from docs-en/20-third-party/emqx/add-action-handler.webp rename to docs/zh/20-third-party/emqx/add-action-handler.webp diff --git a/docs-en/20-third-party/emqx/check-result-in-taos.webp b/docs/zh/20-third-party/emqx/check-result-in-taos.webp similarity index 100% rename from docs-en/20-third-party/emqx/check-result-in-taos.webp rename to docs/zh/20-third-party/emqx/check-result-in-taos.webp diff --git a/docs-en/20-third-party/emqx/check-rule-matched.webp b/docs/zh/20-third-party/emqx/check-rule-matched.webp similarity index 100% rename from docs-en/20-third-party/emqx/check-rule-matched.webp rename to docs/zh/20-third-party/emqx/check-rule-matched.webp diff --git a/docs-en/20-third-party/emqx/client-num.webp b/docs/zh/20-third-party/emqx/client-num.webp similarity index 100% rename from docs-en/20-third-party/emqx/client-num.webp rename to docs/zh/20-third-party/emqx/client-num.webp diff --git a/docs-en/20-third-party/emqx/create-resource.webp b/docs/zh/20-third-party/emqx/create-resource.webp similarity index 100% rename from docs-en/20-third-party/emqx/create-resource.webp rename to docs/zh/20-third-party/emqx/create-resource.webp diff --git a/docs-en/20-third-party/emqx/create-rule.webp b/docs/zh/20-third-party/emqx/create-rule.webp similarity index 100% rename from docs-en/20-third-party/emqx/create-rule.webp rename to docs/zh/20-third-party/emqx/create-rule.webp diff --git a/docs-en/20-third-party/emqx/edit-action.webp b/docs/zh/20-third-party/emqx/edit-action.webp similarity index 100% rename from docs-en/20-third-party/emqx/edit-action.webp rename to docs/zh/20-third-party/emqx/edit-action.webp diff --git a/docs-en/20-third-party/emqx/edit-resource.webp b/docs/zh/20-third-party/emqx/edit-resource.webp similarity index 100% rename from docs-en/20-third-party/emqx/edit-resource.webp rename to docs/zh/20-third-party/emqx/edit-resource.webp diff --git a/docs-en/20-third-party/emqx/login-dashboard.webp b/docs/zh/20-third-party/emqx/login-dashboard.webp similarity index 100% rename from docs-en/20-third-party/emqx/login-dashboard.webp rename to docs/zh/20-third-party/emqx/login-dashboard.webp diff --git a/docs-en/20-third-party/emqx/rule-engine.webp b/docs/zh/20-third-party/emqx/rule-engine.webp similarity index 100% rename from docs-en/20-third-party/emqx/rule-engine.webp rename to docs/zh/20-third-party/emqx/rule-engine.webp diff --git a/docs-en/20-third-party/emqx/rule-header-key-value.webp b/docs/zh/20-third-party/emqx/rule-header-key-value.webp similarity index 100% rename from docs-en/20-third-party/emqx/rule-header-key-value.webp rename to docs/zh/20-third-party/emqx/rule-header-key-value.webp diff --git a/docs-en/20-third-party/emqx/run-mock.webp b/docs/zh/20-third-party/emqx/run-mock.webp similarity index 100% rename from docs-en/20-third-party/emqx/run-mock.webp rename to docs/zh/20-third-party/emqx/run-mock.webp diff --git a/docs-cn/20-third-party/import_dashboard1.webp b/docs/zh/20-third-party/import_dashboard1.webp similarity index 100% rename from docs-cn/20-third-party/import_dashboard1.webp rename to docs/zh/20-third-party/import_dashboard1.webp diff --git a/docs-cn/20-third-party/import_dashboard2.webp b/docs/zh/20-third-party/import_dashboard2.webp similarity index 100% rename from docs-cn/20-third-party/import_dashboard2.webp rename to docs/zh/20-third-party/import_dashboard2.webp diff --git a/docs-cn/20-third-party/index.md b/docs/zh/20-third-party/index.md similarity index 100% rename from docs-cn/20-third-party/index.md rename to docs/zh/20-third-party/index.md diff --git a/docs-en/20-third-party/kafka/Kafka_Connect.webp b/docs/zh/20-third-party/kafka/Kafka_Connect.webp similarity index 100% rename from docs-en/20-third-party/kafka/Kafka_Connect.webp rename to docs/zh/20-third-party/kafka/Kafka_Connect.webp diff --git a/docs-en/20-third-party/kafka/confluentPlatform.webp b/docs/zh/20-third-party/kafka/confluentPlatform.webp similarity index 100% rename from docs-en/20-third-party/kafka/confluentPlatform.webp rename to docs/zh/20-third-party/kafka/confluentPlatform.webp diff --git a/docs-en/20-third-party/kafka/streaming-integration-with-kafka-connect.webp b/docs/zh/20-third-party/kafka/streaming-integration-with-kafka-connect.webp similarity index 100% rename from docs-en/20-third-party/kafka/streaming-integration-with-kafka-connect.webp rename to docs/zh/20-third-party/kafka/streaming-integration-with-kafka-connect.webp diff --git a/docs-cn/21-tdinternal/01-arch.md b/docs/zh/21-tdinternal/01-arch.md similarity index 100% rename from docs-cn/21-tdinternal/01-arch.md rename to docs/zh/21-tdinternal/01-arch.md diff --git a/docs-cn/21-tdinternal/_category_.yml b/docs/zh/21-tdinternal/_category_.yml similarity index 100% rename from docs-cn/21-tdinternal/_category_.yml rename to docs/zh/21-tdinternal/_category_.yml diff --git a/docs-en/21-tdinternal/dnode.webp b/docs/zh/21-tdinternal/dnode.webp similarity index 100% rename from docs-en/21-tdinternal/dnode.webp rename to docs/zh/21-tdinternal/dnode.webp diff --git a/docs-cn/21-tdinternal/index.md b/docs/zh/21-tdinternal/index.md similarity index 100% rename from docs-cn/21-tdinternal/index.md rename to docs/zh/21-tdinternal/index.md diff --git a/docs-en/21-tdinternal/message.webp b/docs/zh/21-tdinternal/message.webp similarity index 100% rename from docs-en/21-tdinternal/message.webp rename to docs/zh/21-tdinternal/message.webp diff --git a/docs-en/21-tdinternal/modules.webp b/docs/zh/21-tdinternal/modules.webp similarity index 100% rename from docs-en/21-tdinternal/modules.webp rename to docs/zh/21-tdinternal/modules.webp diff --git a/docs-en/21-tdinternal/multi_tables.webp b/docs/zh/21-tdinternal/multi_tables.webp similarity index 100% rename from docs-en/21-tdinternal/multi_tables.webp rename to docs/zh/21-tdinternal/multi_tables.webp diff --git a/docs-en/21-tdinternal/replica-forward.webp b/docs/zh/21-tdinternal/replica-forward.webp similarity index 100% rename from docs-en/21-tdinternal/replica-forward.webp rename to docs/zh/21-tdinternal/replica-forward.webp diff --git a/docs-en/21-tdinternal/replica-master.webp b/docs/zh/21-tdinternal/replica-master.webp similarity index 100% rename from docs-en/21-tdinternal/replica-master.webp rename to docs/zh/21-tdinternal/replica-master.webp diff --git a/docs-en/21-tdinternal/replica-restore.webp b/docs/zh/21-tdinternal/replica-restore.webp similarity index 100% rename from docs-en/21-tdinternal/replica-restore.webp rename to docs/zh/21-tdinternal/replica-restore.webp diff --git a/docs-en/21-tdinternal/structure.webp b/docs/zh/21-tdinternal/structure.webp similarity index 100% rename from docs-en/21-tdinternal/structure.webp rename to docs/zh/21-tdinternal/structure.webp diff --git a/docs-en/21-tdinternal/vnode.webp b/docs/zh/21-tdinternal/vnode.webp similarity index 100% rename from docs-en/21-tdinternal/vnode.webp rename to docs/zh/21-tdinternal/vnode.webp diff --git a/docs-en/21-tdinternal/write_master.webp b/docs/zh/21-tdinternal/write_master.webp similarity index 100% rename from docs-en/21-tdinternal/write_master.webp rename to docs/zh/21-tdinternal/write_master.webp diff --git a/docs-en/21-tdinternal/write_slave.webp b/docs/zh/21-tdinternal/write_slave.webp similarity index 100% rename from docs-en/21-tdinternal/write_slave.webp rename to docs/zh/21-tdinternal/write_slave.webp diff --git a/docs-cn/25-application/01-telegraf.md b/docs/zh/25-application/01-telegraf.md similarity index 100% rename from docs-cn/25-application/01-telegraf.md rename to docs/zh/25-application/01-telegraf.md diff --git a/docs-cn/25-application/02-collectd.md b/docs/zh/25-application/02-collectd.md similarity index 100% rename from docs-cn/25-application/02-collectd.md rename to docs/zh/25-application/02-collectd.md diff --git a/docs-cn/25-application/03-immigrate.md b/docs/zh/25-application/03-immigrate.md similarity index 100% rename from docs-cn/25-application/03-immigrate.md rename to docs/zh/25-application/03-immigrate.md diff --git a/docs-en/25-application/IT-DevOps-Solutions-Collectd-StatsD.webp b/docs/zh/25-application/IT-DevOps-Solutions-Collectd-StatsD.webp similarity index 100% rename from docs-en/25-application/IT-DevOps-Solutions-Collectd-StatsD.webp rename to docs/zh/25-application/IT-DevOps-Solutions-Collectd-StatsD.webp diff --git a/docs-en/25-application/IT-DevOps-Solutions-Immigrate-OpenTSDB-Arch.webp b/docs/zh/25-application/IT-DevOps-Solutions-Immigrate-OpenTSDB-Arch.webp similarity index 100% rename from docs-en/25-application/IT-DevOps-Solutions-Immigrate-OpenTSDB-Arch.webp rename to docs/zh/25-application/IT-DevOps-Solutions-Immigrate-OpenTSDB-Arch.webp diff --git a/docs-en/25-application/IT-DevOps-Solutions-Immigrate-OpenTSDB-Dashboard.webp b/docs/zh/25-application/IT-DevOps-Solutions-Immigrate-OpenTSDB-Dashboard.webp similarity index 100% rename from docs-en/25-application/IT-DevOps-Solutions-Immigrate-OpenTSDB-Dashboard.webp rename to docs/zh/25-application/IT-DevOps-Solutions-Immigrate-OpenTSDB-Dashboard.webp diff --git a/docs-en/25-application/IT-DevOps-Solutions-Immigrate-TDengine-Arch.webp b/docs/zh/25-application/IT-DevOps-Solutions-Immigrate-TDengine-Arch.webp similarity index 100% rename from docs-en/25-application/IT-DevOps-Solutions-Immigrate-TDengine-Arch.webp rename to docs/zh/25-application/IT-DevOps-Solutions-Immigrate-TDengine-Arch.webp diff --git a/docs-en/25-application/IT-DevOps-Solutions-Telegraf.webp b/docs/zh/25-application/IT-DevOps-Solutions-Telegraf.webp similarity index 100% rename from docs-en/25-application/IT-DevOps-Solutions-Telegraf.webp rename to docs/zh/25-application/IT-DevOps-Solutions-Telegraf.webp diff --git a/docs-en/25-application/IT-DevOps-Solutions-collectd-dashboard.webp b/docs/zh/25-application/IT-DevOps-Solutions-collectd-dashboard.webp similarity index 100% rename from docs-en/25-application/IT-DevOps-Solutions-collectd-dashboard.webp rename to docs/zh/25-application/IT-DevOps-Solutions-collectd-dashboard.webp diff --git a/docs-en/25-application/IT-DevOps-Solutions-statsd-dashboard.webp b/docs/zh/25-application/IT-DevOps-Solutions-statsd-dashboard.webp similarity index 100% rename from docs-en/25-application/IT-DevOps-Solutions-statsd-dashboard.webp rename to docs/zh/25-application/IT-DevOps-Solutions-statsd-dashboard.webp diff --git a/docs-en/25-application/IT-DevOps-Solutions-telegraf-dashboard.webp b/docs/zh/25-application/IT-DevOps-Solutions-telegraf-dashboard.webp similarity index 100% rename from docs-en/25-application/IT-DevOps-Solutions-telegraf-dashboard.webp rename to docs/zh/25-application/IT-DevOps-Solutions-telegraf-dashboard.webp diff --git a/docs-cn/25-application/_category_.yml b/docs/zh/25-application/_category_.yml similarity index 100% rename from docs-cn/25-application/_category_.yml rename to docs/zh/25-application/_category_.yml diff --git a/docs-cn/25-application/index.md b/docs/zh/25-application/index.md similarity index 100% rename from docs-cn/25-application/index.md rename to docs/zh/25-application/index.md diff --git a/docs-cn/27-train-faq/01-faq.md b/docs/zh/27-train-faq/01-faq.md similarity index 100% rename from docs-cn/27-train-faq/01-faq.md rename to docs/zh/27-train-faq/01-faq.md diff --git a/docs-cn/27-train-faq/03-docker.md b/docs/zh/27-train-faq/03-docker.md similarity index 100% rename from docs-cn/27-train-faq/03-docker.md rename to docs/zh/27-train-faq/03-docker.md diff --git a/docs-cn/27-train-faq/_category_.yml b/docs/zh/27-train-faq/_category_.yml similarity index 100% rename from docs-cn/27-train-faq/_category_.yml rename to docs/zh/27-train-faq/_category_.yml diff --git a/docs-cn/27-train-faq/index.md b/docs/zh/27-train-faq/index.md similarity index 100% rename from docs-cn/27-train-faq/index.md rename to docs/zh/27-train-faq/index.md diff --git a/docs-en/02-intro/eco_system.webp b/docs/zh/eco_system.webp similarity index 100% rename from docs-en/02-intro/eco_system.webp rename to docs/zh/eco_system.webp diff --git a/include/common/tmsg.h b/include/common/tmsg.h index d69849349cb5481eb734f964bf664e5a2c6357ed..935e2f6626794d35cb86f92819d28ad1ff8b4955 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -1294,6 +1294,14 @@ typedef struct { int32_t tSerializeSDCreateMnodeReq(void* buf, int32_t bufLen, SDCreateMnodeReq* pReq); int32_t tDeserializeSDCreateMnodeReq(void* buf, int32_t bufLen, SDCreateMnodeReq* pReq); +typedef struct { + int32_t dnodeId; + int8_t standby; +} SSetStandbyReq; + +int32_t tSerializeSSetStandbyReq(void* buf, int32_t bufLen, SSetStandbyReq* pReq); +int32_t tDeserializeSSetStandbyReq(void* buf, int32_t bufLen, SSetStandbyReq* pReq); + typedef struct { int32_t connId; int32_t queryId; @@ -1494,9 +1502,9 @@ typedef struct { int32_t code; } STaskDropRsp; -#define STREAM_TRIGGER_AT_ONCE 1 -#define STREAM_TRIGGER_WINDOW_CLOSE 2 -#define STREAM_TRIGGER_MAX_DELAY 3 +#define STREAM_TRIGGER_AT_ONCE 1 +#define STREAM_TRIGGER_WINDOW_CLOSE 2 +#define STREAM_TRIGGER_MAX_DELAY 3 typedef struct { char name[TSDB_TABLE_FNAME_LEN]; @@ -1506,6 +1514,7 @@ typedef struct { char* sql; char* ast; int8_t triggerType; + int64_t maxDelay; int64_t watermark; } SCMCreateStreamReq; diff --git a/include/common/tmsgdef.h b/include/common/tmsgdef.h index 743f10bd55509204b82ee2d2e10aac511caacd34..0f272aef9c299e69991824ead6fb4c65235df4b9 100644 --- a/include/common/tmsgdef.h +++ b/include/common/tmsgdef.h @@ -97,6 +97,7 @@ enum { TD_DEF_MSG_TYPE(TDMT_MND_CREATE_MNODE, "create-mnode", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_ALTER_MNODE, "alter-mnode", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_DROP_MNODE, "drop-mnode", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_MND_SET_STANDBY, "set-mnode-standby", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_CREATE_QNODE, "create-qnode", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_ALTER_QNODE, "alter-qnode", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_DROP_QNODE, "drop-qnode", NULL, NULL) diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index 84e0527587a5eb462be97958195ac3fd9c490ab2..f5495db5ae125ffdf2783e763992bc1df2df37de 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -184,76 +184,77 @@ #define TK_TRIGGER 166 #define TK_AT_ONCE 167 #define TK_WINDOW_CLOSE 168 -#define TK_WATERMARK 169 -#define TK_KILL 170 -#define TK_CONNECTION 171 -#define TK_TRANSACTION 172 -#define TK_BALANCE 173 -#define TK_VGROUP 174 -#define TK_MERGE 175 -#define TK_REDISTRIBUTE 176 -#define TK_SPLIT 177 -#define TK_SYNCDB 178 -#define TK_DELETE 179 -#define TK_NULL 180 -#define TK_NK_QUESTION 181 -#define TK_NK_ARROW 182 -#define TK_ROWTS 183 -#define TK_TBNAME 184 -#define TK_QSTARTTS 185 -#define TK_QENDTS 186 -#define TK_WSTARTTS 187 -#define TK_WENDTS 188 -#define TK_WDURATION 189 -#define TK_CAST 190 -#define TK_NOW 191 -#define TK_TODAY 192 -#define TK_TIMEZONE 193 -#define TK_COUNT 194 -#define TK_FIRST 195 -#define TK_LAST 196 -#define TK_LAST_ROW 197 -#define TK_BETWEEN 198 -#define TK_IS 199 -#define TK_NK_LT 200 -#define TK_NK_GT 201 -#define TK_NK_LE 202 -#define TK_NK_GE 203 -#define TK_NK_NE 204 -#define TK_MATCH 205 -#define TK_NMATCH 206 -#define TK_CONTAINS 207 -#define TK_JOIN 208 -#define TK_INNER 209 -#define TK_SELECT 210 -#define TK_DISTINCT 211 -#define TK_WHERE 212 -#define TK_PARTITION 213 -#define TK_BY 214 -#define TK_SESSION 215 -#define TK_STATE_WINDOW 216 -#define TK_SLIDING 217 -#define TK_FILL 218 -#define TK_VALUE 219 -#define TK_NONE 220 -#define TK_PREV 221 -#define TK_LINEAR 222 -#define TK_NEXT 223 -#define TK_HAVING 224 -#define TK_ORDER 225 -#define TK_SLIMIT 226 -#define TK_SOFFSET 227 -#define TK_LIMIT 228 -#define TK_OFFSET 229 -#define TK_ASC 230 -#define TK_NULLS 231 -#define TK_ID 232 -#define TK_NK_BITNOT 233 -#define TK_INSERT 234 -#define TK_VALUES 235 -#define TK_IMPORT 236 -#define TK_NK_SEMI 237 -#define TK_FILE 238 +#define TK_MAX_DELAY 169 +#define TK_WATERMARK 170 +#define TK_KILL 171 +#define TK_CONNECTION 172 +#define TK_TRANSACTION 173 +#define TK_BALANCE 174 +#define TK_VGROUP 175 +#define TK_MERGE 176 +#define TK_REDISTRIBUTE 177 +#define TK_SPLIT 178 +#define TK_SYNCDB 179 +#define TK_DELETE 180 +#define TK_NULL 181 +#define TK_NK_QUESTION 182 +#define TK_NK_ARROW 183 +#define TK_ROWTS 184 +#define TK_TBNAME 185 +#define TK_QSTARTTS 186 +#define TK_QENDTS 187 +#define TK_WSTARTTS 188 +#define TK_WENDTS 189 +#define TK_WDURATION 190 +#define TK_CAST 191 +#define TK_NOW 192 +#define TK_TODAY 193 +#define TK_TIMEZONE 194 +#define TK_COUNT 195 +#define TK_FIRST 196 +#define TK_LAST 197 +#define TK_LAST_ROW 198 +#define TK_BETWEEN 199 +#define TK_IS 200 +#define TK_NK_LT 201 +#define TK_NK_GT 202 +#define TK_NK_LE 203 +#define TK_NK_GE 204 +#define TK_NK_NE 205 +#define TK_MATCH 206 +#define TK_NMATCH 207 +#define TK_CONTAINS 208 +#define TK_JOIN 209 +#define TK_INNER 210 +#define TK_SELECT 211 +#define TK_DISTINCT 212 +#define TK_WHERE 213 +#define TK_PARTITION 214 +#define TK_BY 215 +#define TK_SESSION 216 +#define TK_STATE_WINDOW 217 +#define TK_SLIDING 218 +#define TK_FILL 219 +#define TK_VALUE 220 +#define TK_NONE 221 +#define TK_PREV 222 +#define TK_LINEAR 223 +#define TK_NEXT 224 +#define TK_HAVING 225 +#define TK_ORDER 226 +#define TK_SLIMIT 227 +#define TK_SOFFSET 228 +#define TK_LIMIT 229 +#define TK_OFFSET 230 +#define TK_ASC 231 +#define TK_NULLS 232 +#define TK_ID 233 +#define TK_NK_BITNOT 234 +#define TK_INSERT 235 +#define TK_VALUES 236 +#define TK_IMPORT 237 +#define TK_NK_SEMI 238 +#define TK_FILE 239 #define TK_NK_SPACE 300 #define TK_NK_COMMENT 301 diff --git a/include/libs/function/functionMgt.h b/include/libs/function/functionMgt.h index f01e734fdee56cb749e2f32c4db72a3919bec278..e78763989756ab3ef1bfb5100e2f8a830dbdf3f7 100644 --- a/include/libs/function/functionMgt.h +++ b/include/libs/function/functionMgt.h @@ -177,6 +177,7 @@ bool fmIsRepeatScanFunc(int32_t funcId); bool fmIsUserDefinedFunc(int32_t funcId); bool fmIsDistExecFunc(int32_t funcId); bool fmIsForbidFillFunc(int32_t funcId); +bool fmIsForbidStreamFunc(int32_t funcId); int32_t fmGetDistMethod(const SFunctionNode* pFunc, SFunctionNode** pPartialFunc, SFunctionNode** pMergeFunc); diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index 25369f2342f6d5cd928f2f1c2782a9cb9186dc60..8d4e94663f83a6efd4cb80468cb7a1bb889d89e5 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -289,6 +289,7 @@ typedef struct SKillStmt { typedef struct SStreamOptions { ENodeType type; int8_t triggerType; + SNode* pDelay; SNode* pWatermark; } SStreamOptions; diff --git a/include/libs/nodes/nodes.h b/include/libs/nodes/nodes.h index 7df731b95caf3320039aa8737f8a7fa071eb913e..3937fc13f40b4fc5eccf0c70ca27d5874d620865 100644 --- a/include/libs/nodes/nodes.h +++ b/include/libs/nodes/nodes.h @@ -252,22 +252,20 @@ typedef struct SNodeList { SListCell* pTail; } SNodeList; -#define SNodeptr void* - -SNodeptr nodesMakeNode(ENodeType type); -void nodesDestroyNode(SNodeptr pNode); +SNode* nodesMakeNode(ENodeType type); +void nodesDestroyNode(SNode* pNode); SNodeList* nodesMakeList(); -int32_t nodesListAppend(SNodeList* pList, SNodeptr pNode); -int32_t nodesListStrictAppend(SNodeList* pList, SNodeptr pNode); -int32_t nodesListMakeAppend(SNodeList** pList, SNodeptr pNode); -int32_t nodesListMakeStrictAppend(SNodeList** pList, SNodeptr pNode); +int32_t nodesListAppend(SNodeList* pList, SNode* pNode); +int32_t nodesListStrictAppend(SNodeList* pList, SNode* pNode); +int32_t nodesListMakeAppend(SNodeList** pList, SNode* pNode); +int32_t nodesListMakeStrictAppend(SNodeList** pList, SNode* pNode); int32_t nodesListAppendList(SNodeList* pTarget, SNodeList* pSrc); int32_t nodesListStrictAppendList(SNodeList* pTarget, SNodeList* pSrc); -int32_t nodesListPushFront(SNodeList* pList, SNodeptr pNode); +int32_t nodesListPushFront(SNodeList* pList, SNode* pNode); SListCell* nodesListErase(SNodeList* pList, SListCell* pCell); void nodesListInsertList(SNodeList* pTarget, SListCell* pPos, SNodeList* pSrc); -SNodeptr nodesListGetNode(SNodeList* pList, int32_t index); +SNode* nodesListGetNode(SNodeList* pList, int32_t index); void nodesDestroyList(SNodeList* pList); // Only clear the linked list structure, without releasing the elements inside void nodesClearList(SNodeList* pList); @@ -275,9 +273,9 @@ void nodesClearList(SNodeList* pList); typedef enum EDealRes { DEAL_RES_CONTINUE = 1, DEAL_RES_IGNORE_CHILD, DEAL_RES_ERROR, DEAL_RES_END } EDealRes; typedef EDealRes (*FNodeWalker)(SNode* pNode, void* pContext); -void nodesWalkExpr(SNodeptr pNode, FNodeWalker walker, void* pContext); +void nodesWalkExpr(SNode* pNode, FNodeWalker walker, void* pContext); void nodesWalkExprs(SNodeList* pList, FNodeWalker walker, void* pContext); -void nodesWalkExprPostOrder(SNodeptr pNode, FNodeWalker walker, void* pContext); +void nodesWalkExprPostOrder(SNode* pNode, FNodeWalker walker, void* pContext); void nodesWalkExprsPostOrder(SNodeList* pList, FNodeWalker walker, void* pContext); typedef EDealRes (*FNodeRewriter)(SNode** pNode, void* pContext); @@ -286,13 +284,13 @@ void nodesRewriteExprs(SNodeList* pList, FNodeRewriter rewriter, void* pContext) void nodesRewriteExprPostOrder(SNode** pNode, FNodeRewriter rewriter, void* pContext); void nodesRewriteExprsPostOrder(SNodeList* pList, FNodeRewriter rewriter, void* pContext); -bool nodesEqualNode(const SNodeptr a, const SNodeptr b); +bool nodesEqualNode(const SNode* a, const SNode* b); -SNodeptr nodesCloneNode(const SNodeptr pNode); +SNode* nodesCloneNode(const SNode* pNode); SNodeList* nodesCloneList(const SNodeList* pList); const char* nodesNodeName(ENodeType type); -int32_t nodesNodeToString(const SNodeptr pNode, bool format, char** pStr, int32_t* pLen); +int32_t nodesNodeToString(const SNode* pNode, bool format, char** pStr, int32_t* pLen); int32_t nodesStringToNode(const char* pStr, SNode** pNode); int32_t nodesListToString(const SNodeList* pList, bool format, char** pStr, int32_t* pLen); diff --git a/include/libs/nodes/querynodes.h b/include/libs/nodes/querynodes.h index 33cc4a9c865241d39ca2b94317f93ffff4694581..3957f3b75534726c53241e131c5231cdfb48ae08 100644 --- a/include/libs/nodes/querynodes.h +++ b/include/libs/nodes/querynodes.h @@ -336,22 +336,21 @@ typedef enum EQueryExecMode { } EQueryExecMode; typedef struct SQuery { - ENodeType type; - EQueryExecMode execMode; - bool haveResultSet; - SNode* pRoot; - int32_t numOfResCols; - SSchema* pResSchema; - int8_t precision; - SCmdMsgInfo* pCmdMsg; - int32_t msgType; - SArray* pTableList; - SArray* pDbList; - bool showRewrite; - int32_t placeholderNum; - SArray* pPlaceholderValues; - SNode* pPrepareRoot; - struct SParseMetaCache* pMetaCache; + ENodeType type; + EQueryExecMode execMode; + bool haveResultSet; + SNode* pRoot; + int32_t numOfResCols; + SSchema* pResSchema; + int8_t precision; + SCmdMsgInfo* pCmdMsg; + int32_t msgType; + SArray* pTableList; + SArray* pDbList; + bool showRewrite; + int32_t placeholderNum; + SArray* pPlaceholderValues; + SNode* pPrepareRoot; } SQuery; void nodesWalkSelectStmt(SSelectStmt* pSelect, ESqlClause clause, FNodeWalker walker, void* pContext); diff --git a/source/client/src/clientHb.c b/source/client/src/clientHb.c index 9df0e0c1c86962e05c5265252097900e3fcbf7bd..2412b32df24fa9514ecb1e863e7b9586afc955a8 100644 --- a/source/client/src/clientHb.c +++ b/source/client/src/clientHb.c @@ -698,7 +698,7 @@ SAppHbMgr *appHbMgrInit(SAppInstInfo *pAppInstInfo, char *key) { return NULL; } - taosHashSetFreeFp(pAppHbMgr->activeInfo, tFreeClientHbReq); + // taosHashSetFreeFp(pAppHbMgr->activeInfo, tFreeClientHbReq); taosThreadMutexLock(&clientHbMgr.lock); taosArrayPush(clientHbMgr.appHbMgrs, &pAppHbMgr); diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index 216aa5fbd01f517f4e1f0ec9f38440827e4be43c..93234a3e800addf5333d9252b1c841ff2a5e54ff 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -233,9 +233,7 @@ int32_t execDdlQuery(SRequestObj* pRequest, SQuery* pQuery) { return TSDB_CODE_SUCCESS; } -static SAppInstInfo* getAppInfo(SRequestObj* pRequest) { - return pRequest->pTscObj->pAppInfo; -} +static SAppInstInfo* getAppInfo(SRequestObj* pRequest) { return pRequest->pTscObj->pAppInfo; } void asyncExecLocalCmd(SRequestObj* pRequest, SQuery* pQuery) { SRetrieveTableRsp* pRsp = NULL; @@ -259,7 +257,7 @@ void asyncExecLocalCmd(SRequestObj* pRequest, SQuery* pQuery) { } pRequest->body.queryFp(pRequest->body.param, pRequest, 0); -// pRequest->body.fetchFp(pRequest->body.param, pRequest, pResultInfo->numOfRows); + // pRequest->body.fetchFp(pRequest->body.param, pRequest, pResultInfo->numOfRows); } int32_t asyncExecDdlQuery(SRequestObj* pRequest, SQuery* pQuery) { @@ -323,7 +321,7 @@ int32_t getQnodeList(SRequestObj* pRequest, SArray** pNodeList) { code = catalogGetHandle(pRequest->pTscObj->pAppInfo->clusterId, &pCatalog); if (TSDB_CODE_SUCCESS == code) { *pNodeList = taosArrayInit(5, sizeof(SQueryNodeLoad)); - SRequestConnInfo conn = {.pTrans = pRequest->pTscObj->pAppInfo->pTransporter, + SRequestConnInfo conn = {.pTrans = pRequest->pTscObj->pAppInfo->pTransporter, .requestId = pRequest->requestId, .requestObjRefId = pRequest->self, .mgmtEps = getEpSet_s(&pRequest->pTscObj->pAppInfo->mgmtEp)}; @@ -401,21 +399,19 @@ void setResPrecision(SReqResultInfo* pResInfo, int32_t precision) { int32_t scheduleAsyncQuery(SRequestObj* pRequest, SQueryPlan* pDag, SArray* pNodeList) { tsem_init(&schdRspSem, 0, 0); - SQueryResult res = {.code = 0, .numOfRows = 0}; - SRequestConnInfo conn = {.pTrans = pRequest->pTscObj->pAppInfo->pTransporter, + SQueryResult res = {.code = 0, .numOfRows = 0}; + SRequestConnInfo conn = {.pTrans = pRequest->pTscObj->pAppInfo->pTransporter, .requestId = pRequest->requestId, - .requestObjRefId = pRequest->self - }; - SSchedulerReq req = {.pConn = &conn, - .pNodeList = pNodeList, - .pDag = pDag, - .sql = pRequest->sqlstr, - .startTs = pRequest->metric.start, - .fp = schdExecCallback, - .cbParam = &res - }; - - int32_t code = schedulerAsyncExecJob(&req, &pRequest->body.queryJob); + .requestObjRefId = pRequest->self}; + SSchedulerReq req = {.pConn = &conn, + .pNodeList = pNodeList, + .pDag = pDag, + .sql = pRequest->sqlstr, + .startTs = pRequest->metric.start, + .fp = schdExecCallback, + .cbParam = &res}; + + int32_t code = schedulerAsyncExecJob(&req, &pRequest->body.queryJob); pRequest->body.resInfo.execRes = res.res; @@ -455,21 +451,19 @@ int32_t scheduleAsyncQuery(SRequestObj* pRequest, SQueryPlan* pDag, SArray* pNod int32_t scheduleQuery(SRequestObj* pRequest, SQueryPlan* pDag, SArray* pNodeList) { void* pTransporter = pRequest->pTscObj->pAppInfo->pTransporter; - SQueryResult res = {0}; - SRequestConnInfo conn = {.pTrans = pRequest->pTscObj->pAppInfo->pTransporter, + SQueryResult res = {0}; + SRequestConnInfo conn = {.pTrans = pRequest->pTscObj->pAppInfo->pTransporter, .requestId = pRequest->requestId, - .requestObjRefId = pRequest->self - }; - SSchedulerReq req = {.pConn = &conn, - .pNodeList = pNodeList, - .pDag = pDag, - .sql = pRequest->sqlstr, - .startTs = pRequest->metric.start, - .fp = NULL, - .cbParam = NULL - }; - - int32_t code = schedulerExecJob(&req,&pRequest->body.queryJob, &res); + .requestObjRefId = pRequest->self}; + SSchedulerReq req = {.pConn = &conn, + .pNodeList = pNodeList, + .pDag = pDag, + .sql = pRequest->sqlstr, + .startTs = pRequest->metric.start, + .fp = NULL, + .cbParam = NULL}; + + int32_t code = schedulerExecJob(&req, &pRequest->body.queryJob, &res); pRequest->body.resInfo.execRes = res.res; if (code != TSDB_CODE_SUCCESS) { @@ -482,7 +476,8 @@ int32_t scheduleQuery(SRequestObj* pRequest, SQueryPlan* pDag, SArray* pNodeList return pRequest->code; } - if (TDMT_VND_SUBMIT == pRequest->type || TDMT_VND_DELETE == pRequest->type || TDMT_VND_CREATE_TABLE == pRequest->type) { + if (TDMT_VND_SUBMIT == pRequest->type || TDMT_VND_DELETE == pRequest->type || + TDMT_VND_CREATE_TABLE == pRequest->type) { pRequest->body.resInfo.numOfRows = res.numOfRows; if (pRequest->body.queryJob != 0) { @@ -495,9 +490,9 @@ int32_t scheduleQuery(SRequestObj* pRequest, SQueryPlan* pDag, SArray* pNodeList return pRequest->code; } -int32_t handleSubmitExecRes(SRequestObj* pRequest, void* res, SCatalog* pCatalog, SEpSet *epset) { - int32_t code = 0; - SArray* pArray = NULL; +int32_t handleSubmitExecRes(SRequestObj* pRequest, void* res, SCatalog* pCatalog, SEpSet* epset) { + int32_t code = 0; + SArray* pArray = NULL; SSubmitRsp* pRsp = (SSubmitRsp*)res; if (pRsp->nBlocks <= 0) { return TSDB_CODE_SUCCESS; @@ -519,7 +514,7 @@ int32_t handleSubmitExecRes(SRequestObj* pRequest, void* res, SCatalog* pCatalog taosArrayPush(pArray, &tbSver); } - SRequestConnInfo conn = {.pTrans = pRequest->pTscObj->pAppInfo->pTransporter, + SRequestConnInfo conn = {.pTrans = pRequest->pTscObj->pAppInfo->pTransporter, .requestId = pRequest->requestId, .requestObjRefId = pRequest->self, .mgmtEps = *epset}; @@ -532,7 +527,7 @@ _return: return code; } -int32_t handleQueryExecRes(SRequestObj* pRequest, void* res, SCatalog* pCatalog, SEpSet *epset) { +int32_t handleQueryExecRes(SRequestObj* pRequest, void* res, SCatalog* pCatalog, SEpSet* epset) { int32_t code = 0; SArray* pArray = NULL; SArray* pTbArray = (SArray*)res; @@ -553,7 +548,7 @@ int32_t handleQueryExecRes(SRequestObj* pRequest, void* res, SCatalog* pCatalog, taosArrayPush(pArray, &tbSver); } - SRequestConnInfo conn = {.pTrans = pRequest->pTscObj->pAppInfo->pTransporter, + SRequestConnInfo conn = {.pTrans = pRequest->pTscObj->pAppInfo->pTransporter, .requestId = pRequest->requestId, .requestObjRefId = pRequest->self, .mgmtEps = *epset}; @@ -575,15 +570,15 @@ int32_t handleQueryExecRsp(SRequestObj* pRequest) { return TSDB_CODE_SUCCESS; } - SCatalog* pCatalog = NULL; - SAppInstInfo* pAppInfo = getAppInfo(pRequest); + SCatalog* pCatalog = NULL; + SAppInstInfo* pAppInfo = getAppInfo(pRequest); int32_t code = catalogGetHandle(pAppInfo->clusterId, &pCatalog); if (code) { return code; } - SEpSet epset = getEpSet_s(&pAppInfo->mgmtEp); + SEpSet epset = getEpSet_s(&pAppInfo->mgmtEp); SQueryExecRes* pRes = &pRequest->body.resInfo.execRes; switch (pRes->msgType) { @@ -601,8 +596,8 @@ int32_t handleQueryExecRsp(SRequestObj* pRequest) { break; } default: - tscError("0x%"PRIx64", invalid exec result for request type %d, reqId:0x%"PRIx64, pRequest->self, - pRequest->type, pRequest->requestId); + tscError("0x%" PRIx64 ", invalid exec result for request type %d, reqId:0x%" PRIx64, pRequest->self, + pRequest->type, pRequest->requestId); code = TSDB_CODE_APP_ERROR; } @@ -610,13 +605,13 @@ int32_t handleQueryExecRsp(SRequestObj* pRequest) { } void schedulerExecCb(SQueryResult* pResult, void* param, int32_t code) { - SRequestObj* pRequest = (SRequestObj*) param; + SRequestObj* pRequest = (SRequestObj*)param; pRequest->code = code; STscObj* pTscObj = pRequest->pTscObj; if (code != TSDB_CODE_SUCCESS && NEED_CLIENT_HANDLE_ERROR(code)) { - tscDebug("0x%"PRIx64" client retry to handle the error, code:%d - %s, tryCount:%d, reqId:0x%"PRIx64, pRequest->self, code, tstrerror(code), - pRequest->retry, pRequest->requestId); + tscDebug("0x%" PRIx64 " client retry to handle the error, code:%d - %s, tryCount:%d, reqId:0x%" PRIx64, + pRequest->self, code, tstrerror(code), pRequest->retry, pRequest->requestId); pRequest->prevCode = code; doAsyncQuery(pRequest, true); return; @@ -624,7 +619,7 @@ void schedulerExecCb(SQueryResult* pResult, void* param, int32_t code) { if (code == TSDB_CODE_SUCCESS) { code = handleQueryExecRsp(pRequest); - ASSERT(pRequest->code == TSDB_CODE_SUCCESS); + ASSERT(pRequest->code == TSDB_CODE_SUCCESS); pRequest->code = code; } @@ -727,35 +722,34 @@ void launchAsyncQuery(SRequestObj* pRequest, SQuery* pQuery) { if (TSDB_CODE_SUCCESS == code) { code = qCreateQueryPlan(&cxt, &pRequest->body.pDag, pNodeList); if (code) { - tscError("0x%"PRIx64" failed to create query plan, code:%s 0x%"PRIx64, pRequest->self, tstrerror(code), pRequest->requestId); + tscError("0x%" PRIx64 " failed to create query plan, code:%s 0x%" PRIx64, pRequest->self, tstrerror(code), + pRequest->requestId); } } if (TSDB_CODE_SUCCESS == code) { - SRequestConnInfo conn = {.pTrans = pAppInfo->pTransporter, - .requestId = pRequest->requestId, - .requestObjRefId = pRequest->self - }; + SRequestConnInfo conn = { + .pTrans = pAppInfo->pTransporter, .requestId = pRequest->requestId, .requestObjRefId = pRequest->self}; SSchedulerReq req = {.pConn = &conn, .pNodeList = pNodeList, .pDag = pRequest->body.pDag, .sql = pRequest->sqlstr, .startTs = pRequest->metric.start, .fp = schedulerExecCb, - .cbParam = pRequest - }; + .cbParam = pRequest}; code = schedulerAsyncExecJob(&req, &pRequest->body.queryJob); } else { - tscError("0x%"PRIx64" failed to create query plan, code:%s 0x%"PRIx64, pRequest->self, tstrerror(code), pRequest->requestId); + tscError("0x%" PRIx64 " failed to create query plan, code:%s 0x%" PRIx64, pRequest->self, tstrerror(code), + pRequest->requestId); pRequest->body.queryFp(pRequest->body.param, pRequest, code); } - //todo not to be released here + // todo not to be released here taosArrayDestroy(pNodeList); break; } case QUERY_EXEC_MODE_EMPTY_RESULT: - pRequest->type = TSDB_SQL_RETRIEVE_EMPTY_RESULT; + pRequest->type = TSDB_SQL_RETRIEVE_EMPTY_RESULT; pRequest->body.queryFp(pRequest->body.param, pRequest, 0); break; default: @@ -786,7 +780,7 @@ int32_t refreshMeta(STscObj* pTscObj, SRequestObj* pRequest) { return code; } - SRequestConnInfo conn = {.pTrans = pTscObj->pAppInfo->pTransporter, + SRequestConnInfo conn = {.pTrans = pTscObj->pAppInfo->pTransporter, .requestId = pRequest->requestId, .requestObjRefId = pRequest->self, .mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp)}; @@ -989,23 +983,22 @@ void updateTargetEpSet(SMsgSendInfo* pSendInfo, STscObj* pTscObj, SRpcMsg* pMsg, switch (pSendInfo->target.type) { case TARGET_TYPE_MNODE: if (NULL == pTscObj) { - tscError("mnode epset changed but not able to update it, msg:%s, reqObjRefId:%" PRIx64, - TMSG_INFO(pMsg->msgType), pSendInfo->requestObjRefId); + tscError("mnode epset changed but not able to update it, msg:%s, reqObjRefId:%" PRIx64, + TMSG_INFO(pMsg->msgType), pSendInfo->requestObjRefId); return; } SEpSet* pOrig = &pTscObj->pAppInfo->mgmtEp.epSet; - SEp* pOrigEp = &pOrig->eps[pOrig->inUse]; - SEp* pNewEp = &pEpSet->eps[pEpSet->inUse]; - tscDebug("mnode epset updated from %d/%d=>%s:%d to %d/%d=>%s:%d in client", - pOrig->inUse, pOrig->numOfEps, pOrigEp->fqdn, pOrigEp->port, - pEpSet->inUse, pEpSet->numOfEps, pNewEp->fqdn, pNewEp->port); + SEp* pOrigEp = &pOrig->eps[pOrig->inUse]; + SEp* pNewEp = &pEpSet->eps[pEpSet->inUse]; + tscDebug("mnode epset updated from %d/%d=>%s:%d to %d/%d=>%s:%d in client", pOrig->inUse, pOrig->numOfEps, + pOrigEp->fqdn, pOrigEp->port, pEpSet->inUse, pEpSet->numOfEps, pNewEp->fqdn, pNewEp->port); updateEpSet_s(&pTscObj->pAppInfo->mgmtEp, pEpSet); break; case TARGET_TYPE_VNODE: { if (NULL == pTscObj) { - tscError("vnode epset changed but not able to update it, msg:%s, reqObjRefId:%" PRIx64, - TMSG_INFO(pMsg->msgType), pSendInfo->requestObjRefId); + tscError("vnode epset changed but not able to update it, msg:%s, reqObjRefId:%" PRIx64, + TMSG_INFO(pMsg->msgType), pSendInfo->requestObjRefId); return; } @@ -1415,14 +1408,14 @@ int32_t setResultDataPtr(SReqResultInfo* pResultInfo, TAOS_FIELD* pFields, int32 p += sizeof(uint64_t); // check fields - for(int32_t i = 0; i < numOfCols; ++i) { - int16_t type = *(int16_t*) p; + for (int32_t i = 0; i < numOfCols; ++i) { + int16_t type = *(int16_t*)p; p += sizeof(int16_t); - int32_t bytes = *(int32_t*) p; + int32_t bytes = *(int32_t*)p; p += sizeof(int32_t); -// ASSERT(type == pFields[i].type && bytes == pFields[i].bytes); + // ASSERT(type == pFields[i].type && bytes == pFields[i].bytes); } int32_t* colLength = (int32_t*)p; diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index e3fafa0a8216db542ca3bc3d329f68e40af5206a..83b481658efca5ff77164a9b6307bc87333fd188 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -30,7 +30,7 @@ #define TSC_VAR_RELEASED 0 static int32_t sentinel = TSC_VAR_NOT_RELEASE; -static int32_t createParseContext(const SRequestObj *pRequest, SParseContext** pCxt); +static int32_t createParseContext(const SRequestObj *pRequest, SParseContext **pCxt); int taos_options(TSDB_OPTION option, const void *arg, ...) { static int32_t lock = 0; @@ -177,8 +177,8 @@ TAOS_FIELD *taos_fetch_fields(TAOS_RES *res) { return pResInfo->userFields; } -static void syncQueryFn(void* param, void* res, int32_t code) { - SSyncQueryParam* pParam = param; +static void syncQueryFn(void *param, void *res, int32_t code) { + SSyncQueryParam *pParam = param; pParam->pRequest = res; pParam->pRequest->code = code; @@ -190,10 +190,10 @@ TAOS_RES *taos_query(TAOS *taos, const char *sql) { return NULL; } - STscObj* pTscObj = (STscObj*)taos; + STscObj *pTscObj = (STscObj *)taos; #if SYNC_ON_TOP_OF_ASYNC - SSyncQueryParam* param = taosMemoryCalloc(1, sizeof(SSyncQueryParam)); + SSyncQueryParam *param = taosMemoryCalloc(1, sizeof(SSyncQueryParam)); tsem_init(¶m->sem, 0, 0); taos_query_a(pTscObj, sql, syncQueryFn, param); @@ -606,16 +606,30 @@ const char *taos_get_server_info(TAOS *taos) { } typedef struct SqlParseWrapper { - SParseContext* pCtx; + SParseContext *pCtx; SCatalogReq catalogReq; - SRequestObj* pRequest; - SQuery* pQuery; + SRequestObj *pRequest; + SQuery *pQuery; } SqlParseWrapper; -void retrieveMetaCallback(SMetaData* pResultMeta, void* param, int32_t code) { - SqlParseWrapper *pWrapper = (SqlParseWrapper*) param; - SQuery* pQuery = pWrapper->pQuery; - SRequestObj* pRequest = pWrapper->pRequest; +static void destorySqlParseWrapper(SqlParseWrapper *pWrapper) { + taosArrayDestroy(pWrapper->catalogReq.pDbVgroup); + taosArrayDestroy(pWrapper->catalogReq.pDbCfg); + taosArrayDestroy(pWrapper->catalogReq.pDbInfo); + taosArrayDestroy(pWrapper->catalogReq.pTableMeta); + taosArrayDestroy(pWrapper->catalogReq.pTableHash); + taosArrayDestroy(pWrapper->catalogReq.pUdf); + taosArrayDestroy(pWrapper->catalogReq.pIndex); + taosArrayDestroy(pWrapper->catalogReq.pUser); + taosArrayDestroy(pWrapper->catalogReq.pTableIndex); + taosMemoryFree(pWrapper->pCtx); + taosMemoryFree(pWrapper); +} + +void retrieveMetaCallback(SMetaData *pResultMeta, void *param, int32_t code) { + SqlParseWrapper *pWrapper = (SqlParseWrapper *)param; + SQuery *pQuery = pWrapper->pQuery; + SRequestObj *pRequest = pWrapper->pRequest; if (code == TSDB_CODE_SUCCESS) { code = qAnalyseSqlSemantic(pWrapper->pCtx, &pWrapper->catalogReq, pResultMeta, pQuery); @@ -630,22 +644,22 @@ void retrieveMetaCallback(SMetaData* pResultMeta, void* param, int32_t code) { TSWAP(pRequest->dbList, (pQuery)->pDbList); TSWAP(pRequest->tableList, (pQuery)->pTableList); - taosMemoryFree(pWrapper); + destorySqlParseWrapper(pWrapper); launchAsyncQuery(pRequest, pQuery); } else { + destorySqlParseWrapper(pWrapper); tscDebug("error happens, code:%d", code); if (NEED_CLIENT_HANDLE_ERROR(code)) { - tscDebug("0x%"PRIx64" client retry to handle the error, code:%d - %s, tryCount:%d, reqId:0x%"PRIx64, pRequest->self, code, tstrerror(code), - pRequest->retry, pRequest->requestId); + tscDebug("0x%" PRIx64 " client retry to handle the error, code:%d - %s, tryCount:%d, reqId:0x%" PRIx64, + pRequest->self, code, tstrerror(code), pRequest->retry, pRequest->requestId); pRequest->prevCode = code; doAsyncQuery(pRequest, true); return; } // return to app directly - taosMemoryFree(pWrapper); - tscError("0x%" PRIx64 " error occurs, code:%s, return to user app, reqId:0x%" PRIx64, pRequest->self, tstrerror(code), - pRequest->requestId); + tscError("0x%" PRIx64 " error occurs, code:%s, return to user app, reqId:0x%" PRIx64, pRequest->self, + tstrerror(code), pRequest->requestId); pRequest->code = code; pRequest->body.queryFp(pRequest->body.param, pRequest, code); } @@ -670,7 +684,7 @@ void taos_query_a(TAOS *taos, const char *sql, __taos_async_fn_t fp, void *param } SRequestObj *pRequest = NULL; - int32_t code = buildRequest(taos, sql, sqlLen, &pRequest); + int32_t code = buildRequest(taos, sql, sqlLen, &pRequest); if (code != TSDB_CODE_SUCCESS) { terrno = code; fp(param, NULL, terrno); @@ -678,11 +692,11 @@ void taos_query_a(TAOS *taos, const char *sql, __taos_async_fn_t fp, void *param } pRequest->body.queryFp = fp; - pRequest->body.param = param; + pRequest->body.param = param; doAsyncQuery(pRequest, false); } -int32_t createParseContext(const SRequestObj *pRequest, SParseContext** pCxt) { +int32_t createParseContext(const SRequestObj *pRequest, SParseContext **pCxt) { const STscObj *pTscObj = pRequest->pTscObj; *pCxt = taosMemoryCalloc(1, sizeof(SParseContext)); @@ -690,28 +704,30 @@ int32_t createParseContext(const SRequestObj *pRequest, SParseContext** pCxt) { return TSDB_CODE_OUT_OF_MEMORY; } - **pCxt = (SParseContext){.requestId = pRequest->requestId, - .requestRid = pRequest->self, - .acctId = pTscObj->acctId, - .db = pRequest->pDb, - .topicQuery = false, - .pSql = pRequest->sqlstr, - .sqlLen = pRequest->sqlLen, - .pMsg = pRequest->msgBuf, - .msgLen = ERROR_MSG_BUF_DEFAULT_SIZE, - .pTransporter = pTscObj->pAppInfo->pTransporter, - .pStmtCb = NULL, - .pUser = pTscObj->user, - .schemalessType = pTscObj->schemalessType, - .isSuperUser = (0 == strcmp(pTscObj->user, TSDB_DEFAULT_USER)), - .async = true,}; + **pCxt = (SParseContext){ + .requestId = pRequest->requestId, + .requestRid = pRequest->self, + .acctId = pTscObj->acctId, + .db = pRequest->pDb, + .topicQuery = false, + .pSql = pRequest->sqlstr, + .sqlLen = pRequest->sqlLen, + .pMsg = pRequest->msgBuf, + .msgLen = ERROR_MSG_BUF_DEFAULT_SIZE, + .pTransporter = pTscObj->pAppInfo->pTransporter, + .pStmtCb = NULL, + .pUser = pTscObj->user, + .schemalessType = pTscObj->schemalessType, + .isSuperUser = (0 == strcmp(pTscObj->user, TSDB_DEFAULT_USER)), + .async = true, + }; return TSDB_CODE_SUCCESS; } -void doAsyncQuery(SRequestObj* pRequest, bool updateMetaForce) { - SParseContext* pCxt = NULL; - STscObj *pTscObj = pRequest->pTscObj; - int32_t code = 0; +void doAsyncQuery(SRequestObj *pRequest, bool updateMetaForce) { + SParseContext *pCxt = NULL; + STscObj *pTscObj = pRequest->pTscObj; + int32_t code = 0; if (pRequest->retry++ > REQUEST_TOTAL_EXEC_TIMES) { code = pRequest->prevCode; @@ -748,28 +764,29 @@ void doAsyncQuery(SRequestObj* pRequest, bool updateMetaForce) { pWrapper->pRequest = pRequest; pWrapper->catalogReq = catalogReq; - SRequestConnInfo conn = {.pTrans = pCxt->pTransporter, + SRequestConnInfo conn = {.pTrans = pCxt->pTransporter, .requestId = pCxt->requestId, .requestObjRefId = pCxt->requestRid, .mgmtEps = pCxt->mgmtEpSet}; - code = catalogAsyncGetAllMeta(pCxt->pCatalog, &conn, pRequest->requestId, - &catalogReq, retrieveMetaCallback, pWrapper, &pRequest->body.queryJob); + code = catalogAsyncGetAllMeta(pCxt->pCatalog, &conn, pRequest->requestId, &catalogReq, retrieveMetaCallback, pWrapper, + &pRequest->body.queryJob); if (code == TSDB_CODE_SUCCESS) { return; } - _error: - tscError("0x%"PRIx64" error happens, code:%d - %s, reqId:0x%"PRIx64, pRequest->self, code, tstrerror(code), pRequest->requestId); +_error: + tscError("0x%" PRIx64 " error happens, code:%d - %s, reqId:0x%" PRIx64, pRequest->self, code, tstrerror(code), + pRequest->requestId); terrno = code; pRequest->code = code; pRequest->body.queryFp(pRequest->body.param, pRequest, code); } -static void fetchCallback(void* pResult, void* param, int32_t code) { - SRequestObj* pRequest = (SRequestObj*) param; +static void fetchCallback(void *pResult, void *param, int32_t code) { + SRequestObj *pRequest = (SRequestObj *)param; - SReqResultInfo* pResultInfo = &pRequest->body.resInfo; + SReqResultInfo *pResultInfo = &pRequest->body.resInfo; pResultInfo->pData = pResult; pResultInfo->numOfRows = 0; @@ -785,7 +802,8 @@ static void fetchCallback(void* pResult, void* param, int32_t code) { return; } - pRequest->code = setQueryResultFromRsp(pResultInfo, (SRetrieveTableRsp*)pResultInfo->pData, pResultInfo->convertUcs4, false); + pRequest->code = + setQueryResultFromRsp(pResultInfo, (SRetrieveTableRsp *)pResultInfo->pData, pResultInfo->convertUcs4, false); if (pRequest->code != TSDB_CODE_SUCCESS) { pResultInfo->numOfRows = 0; pRequest->code = code; @@ -801,7 +819,7 @@ static void fetchCallback(void* pResult, void* param, int32_t code) { } void taos_fetch_rows_a(TAOS_RES *res, __taos_async_fn_t fp, void *param) { - ASSERT (res != NULL && fp != NULL); + ASSERT(res != NULL && fp != NULL); SRequestObj *pRequest = res; pRequest->body.fetchFp = fp; @@ -825,7 +843,7 @@ void taos_fetch_rows_a(TAOS_RES *res, __taos_async_fn_t fp, void *param) { schedulerAsyncFetchRows(pRequest->body.queryJob, fetchCallback, pRequest); } -void taos_fetch_raw_block_a(TAOS_RES* res, __taos_async_fn_t fp, void* param) { +void taos_fetch_raw_block_a(TAOS_RES *res, __taos_async_fn_t fp, void *param) { ASSERT(res != NULL && fp != NULL); SRequestObj *pRequest = res; @@ -838,9 +856,9 @@ void taos_fetch_raw_block_a(TAOS_RES* res, __taos_async_fn_t fp, void* param) { taos_fetch_rows_a(res, fp, param); } -const void* taos_get_raw_block(TAOS_RES* res) { +const void *taos_get_raw_block(TAOS_RES *res) { ASSERT(res != NULL); - SRequestObj* pRequest = res; + SRequestObj *pRequest = res; return pRequest->body.resInfo.pData; } @@ -924,26 +942,25 @@ int taos_stmt_set_tags(TAOS_STMT *stmt, TAOS_MULTI_BIND *tags) { return stmtSetTbTags(stmt, tags); } - int taos_stmt_set_sub_tbname(TAOS_STMT *stmt, const char *name) { return taos_stmt_set_tbname(stmt, name); } -int taos_stmt_get_tag_fields(TAOS_STMT *stmt, int* fieldNum, TAOS_FIELD_E** fields) { +int taos_stmt_get_tag_fields(TAOS_STMT *stmt, int *fieldNum, TAOS_FIELD_E **fields) { if (stmt == NULL || NULL == fieldNum) { tscError("NULL parameter for %s", __FUNCTION__); terrno = TSDB_CODE_INVALID_PARA; return terrno; } - + return stmtGetTagFields(stmt, fieldNum, fields); } -int taos_stmt_get_col_fields(TAOS_STMT *stmt, int* fieldNum, TAOS_FIELD_E** fields) { +int taos_stmt_get_col_fields(TAOS_STMT *stmt, int *fieldNum, TAOS_FIELD_E **fields) { if (stmt == NULL || NULL == fieldNum) { tscError("NULL parameter for %s", __FUNCTION__); terrno = TSDB_CODE_INVALID_PARA; return terrno; } - + return stmtGetColFields(stmt, fieldNum, fields); } @@ -1102,4 +1119,3 @@ int taos_stmt_close(TAOS_STMT *stmt) { return stmtClose(stmt); } - diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c index 8c5645e5b605495c733e656c625a95fab02c27ad..cf1d5b7828141c3bc8f3a2f0cbad4c61302a8427 100644 --- a/source/client/src/clientSml.c +++ b/source/client/src/clientSml.c @@ -3,22 +3,22 @@ #include #include +#include "cJSON.h" +#include "catalog.h" +#include "clientInt.h" +#include "osSemaphore.h" +#include "osThread.h" #include "query.h" #include "taos.h" #include "taoserror.h" +#include "tcommon.h" #include "tdef.h" +#include "tglobal.h" #include "tlog.h" #include "tmsg.h" +#include "tname.h" #include "ttime.h" #include "ttypes.h" -#include "tcommon.h" -#include "catalog.h" -#include "clientInt.h" -#include "tname.h" -#include "cJSON.h" -#include "tglobal.h" -#include "osSemaphore.h" -#include "osThread.h" //================================================================================================= @@ -28,34 +28,41 @@ #define QUOTE '"' #define SLASH '\\' -#define JUMP_SPACE(sql) while (*sql != '\0'){if(*sql == SPACE) sql++;else break;} +#define JUMP_SPACE(sql) \ + while (*sql != '\0') { \ + if (*sql == SPACE) \ + sql++; \ + else \ + break; \ + } // comma , -#define IS_SLASH_COMMA(sql) (*(sql) == COMMA && *((sql) - 1) == SLASH) -#define IS_COMMA(sql) (*(sql) == COMMA && *((sql) - 1) != SLASH) +#define IS_SLASH_COMMA(sql) (*(sql) == COMMA && *((sql)-1) == SLASH) +#define IS_COMMA(sql) (*(sql) == COMMA && *((sql)-1) != SLASH) // space -#define IS_SLASH_SPACE(sql) (*(sql) == SPACE && *((sql) - 1) == SLASH) -#define IS_SPACE(sql) (*(sql) == SPACE && *((sql) - 1) != SLASH) +#define IS_SLASH_SPACE(sql) (*(sql) == SPACE && *((sql)-1) == SLASH) +#define IS_SPACE(sql) (*(sql) == SPACE && *((sql)-1) != SLASH) // equal = -#define IS_SLASH_EQUAL(sql) (*(sql) == EQUAL && *((sql) - 1) == SLASH) -#define IS_EQUAL(sql) (*(sql) == EQUAL && *((sql) - 1) != SLASH) +#define IS_SLASH_EQUAL(sql) (*(sql) == EQUAL && *((sql)-1) == SLASH) +#define IS_EQUAL(sql) (*(sql) == EQUAL && *((sql)-1) != SLASH) // quote " -#define IS_SLASH_QUOTE(sql) (*(sql) == QUOTE && *((sql) - 1) == SLASH) -#define IS_QUOTE(sql) (*(sql) == QUOTE && *((sql) - 1) != SLASH) +#define IS_SLASH_QUOTE(sql) (*(sql) == QUOTE && *((sql)-1) == SLASH) +#define IS_QUOTE(sql) (*(sql) == QUOTE && *((sql)-1) != SLASH) // SLASH -#define IS_SLASH_SLASH(sql) (*(sql) == SLASH && *((sql) - 1) == SLASH) +#define IS_SLASH_SLASH(sql) (*(sql) == SLASH && *((sql)-1) == SLASH) -#define IS_SLASH_LETTER(sql) (IS_SLASH_COMMA(sql) || IS_SLASH_SPACE(sql) || IS_SLASH_EQUAL(sql) || IS_SLASH_QUOTE(sql) || IS_SLASH_SLASH(sql)) +#define IS_SLASH_LETTER(sql) \ + (IS_SLASH_COMMA(sql) || IS_SLASH_SPACE(sql) || IS_SLASH_EQUAL(sql) || IS_SLASH_QUOTE(sql) || IS_SLASH_SLASH(sql)) -#define MOVE_FORWARD_ONE(sql,len) (memmove((void*)((sql) - 1), (sql), len)) +#define MOVE_FORWARD_ONE(sql, len) (memmove((void *)((sql)-1), (sql), len)) -#define PROCESS_SLASH(key,keyLen) \ -for (int i = 1; i < keyLen; ++i) { \ - if(IS_SLASH_LETTER(key+i)){ \ - MOVE_FORWARD_ONE(key+i, keyLen-i); \ - i--; \ - keyLen--; \ - } \ -} +#define PROCESS_SLASH(key, keyLen) \ + for (int i = 1; i < keyLen; ++i) { \ + if (IS_SLASH_LETTER(key + i)) { \ + MOVE_FORWARD_ONE(key + i, keyLen - i); \ + i--; \ + keyLen--; \ + } \ + } #define IS_INVALID_COL_LEN(len) ((len) <= 0 || (len) >= TSDB_COL_NAME_LEN) #define IS_INVALID_TABLE_LEN(len) ((len) <= 0 || (len) >= TSDB_TABLE_NAME_LEN) @@ -63,16 +70,16 @@ for (int i = 1; i < keyLen; ++i) { \ #define OTD_JSON_SUB_FIELDS_NUM 2 #define OTD_JSON_FIELDS_NUM 4 -#define TS "_ts" -#define TS_LEN 3 -#define VALUE "_value" -#define VALUE_LEN 6 +#define TS "_ts" +#define TS_LEN 3 +#define VALUE "_value" +#define VALUE_LEN 6 -#define BINARY_ADD_LEN 2 // "binary" 2 means " " -#define NCHAR_ADD_LEN 3 // L"nchar" 3 means L" " +#define BINARY_ADD_LEN 2 // "binary" 2 means " " +#define NCHAR_ADD_LEN 3 // L"nchar" 3 means L" " #define MAX_RETRY_TIMES 5 -#define LINE_BATCH 20000 +#define LINE_BATCH 20000 //================================================================================================= typedef TSDB_SML_PROTOCOL_TYPE SMLProtocolType; @@ -85,18 +92,18 @@ typedef enum { } ESchemaAction; typedef struct { - char sTableName[TSDB_TABLE_NAME_LEN]; - SArray *tags; - SArray *fields; + char sTableName[TSDB_TABLE_NAME_LEN]; + SArray *tags; + SArray *fields; } SCreateSTableActionInfo; typedef struct { - char sTableName[TSDB_TABLE_NAME_LEN]; - SSmlKv *field; + char sTableName[TSDB_TABLE_NAME_LEN]; + SSmlKv *field; } SAlterSTableActionInfo; typedef struct { - ESchemaAction action; + ESchemaAction action; union { SCreateSTableActionInfo createSTable; SAlterSTableActionInfo alterSTable; @@ -104,10 +111,10 @@ typedef struct { } SSchemaAction; typedef struct { - const char *measure; - const char *tags; - const char *cols; - const char *timestamp; + const char *measure; + const char *tags; + const char *cols; + const char *timestamp; int32_t measureLen; int32_t measureTagsLen; @@ -117,31 +124,31 @@ typedef struct { } SSmlLineInfo; typedef struct { - const char *sTableName; // super table name - int32_t sTableNameLen; - char childTableName[TSDB_TABLE_NAME_LEN]; - uint64_t uid; + const char *sTableName; // super table name + int32_t sTableNameLen; + char childTableName[TSDB_TABLE_NAME_LEN]; + uint64_t uid; - SArray *tags; + SArray *tags; // if info->formatData is true, elements are SArray. // if info->formatData is false, elements are SHashObj for find by key quickly - SArray *cols; + SArray *cols; } SSmlTableInfo; typedef struct { - SArray *tags; // save the origin order to create table - SHashObj *tagHash; // elements are + SArray *tags; // save the origin order to create table + SHashObj *tagHash; // elements are - SArray *cols; - SHashObj *colHash; + SArray *cols; + SHashObj *colHash; STableMeta *tableMeta; } SSmlSTableMeta; typedef struct { - int32_t len; - char *buf; + int32_t len; + char *buf; } SSmlMsgBuf; typedef struct { @@ -159,53 +166,53 @@ typedef struct { int64_t endTime; } SSmlCostInfo; -typedef struct{ - SRequestObj* request; - tsem_t sem; +typedef struct { + SRequestObj *request; + tsem_t sem; TdThreadSpinlock lock; } Params; typedef struct { - int64_t id; - Params *params; - bool isLast; - - SMLProtocolType protocol; - int8_t precision; - bool dataFormat; // true means that the name and order of keys in each line are the same(only for influx protocol) - - SHashObj *childTables; - SHashObj *superTables; - SHashObj *pVgHash; - void *exec; - - STscObj *taos; - SCatalog *pCatalog; - SRequestObj *pRequest; - SQuery *pQuery; - - SSmlCostInfo cost; - int32_t affectedRows; - SSmlMsgBuf msgBuf; - SHashObj *dumplicateKey; // for dumplicate key - SArray *colsContainer; // for cols parse, if dataFormat == false + int64_t id; + Params *params; + bool isLast; + + SMLProtocolType protocol; + int8_t precision; + bool dataFormat; // true means that the name and order of keys in each line are the same(only for influx protocol) + + SHashObj *childTables; + SHashObj *superTables; + SHashObj *pVgHash; + void *exec; + + STscObj *taos; + SCatalog *pCatalog; + SRequestObj *pRequest; + SQuery *pQuery; + + SSmlCostInfo cost; + int32_t affectedRows; + SSmlMsgBuf msgBuf; + SHashObj *dumplicateKey; // for dumplicate key + SArray *colsContainer; // for cols parse, if dataFormat == false } SSmlHandle; //================================================================================================= //================================================================================================= static volatile int64_t linesSmlHandleId = 0; -static int64_t smlGenId() { - int64_t id; +static int64_t smlGenId() { + int64_t id; - do { - id = atomic_add_fetch_64(&linesSmlHandleId, 1); + do { + id = atomic_add_fetch_64(&linesSmlHandleId, 1); } while (id == 0); - return id; + return id; } static inline bool smlDoubleToInt64OverFlow(double num) { - if(num >= (double)INT64_MAX || num <= (double)INT64_MIN) return true; + if (num >= (double)INT64_MAX || num <= (double)INT64_MIN) return true; return false; } @@ -218,29 +225,31 @@ static inline bool smlCheckDuplicateKey(const char *key, int32_t keyLen, SHashOb return false; } -static int32_t smlBuildInvalidDataMsg(SSmlMsgBuf* pBuf, const char *msg1, const char *msg2) { - memset(pBuf->buf, 0 , pBuf->len); - if(msg1) strncat(pBuf->buf, msg1, pBuf->len); +static int32_t smlBuildInvalidDataMsg(SSmlMsgBuf *pBuf, const char *msg1, const char *msg2) { + memset(pBuf->buf, 0, pBuf->len); + if (msg1) strncat(pBuf->buf, msg1, pBuf->len); int32_t left = pBuf->len - strlen(pBuf->buf); - if(left > 2 && msg2) { + if (left > 2 && msg2) { strncat(pBuf->buf, ":", left - 1); strncat(pBuf->buf, msg2, left - 2); } return TSDB_CODE_SML_INVALID_DATA; } -static int32_t smlGenerateSchemaAction(SSchema* colField, SHashObj* colHash, SSmlKv* kv, bool isTag, - SSchemaAction* action, bool* actionNeeded, SSmlHandle* info) { +static int32_t smlGenerateSchemaAction(SSchema *colField, SHashObj *colHash, SSmlKv *kv, bool isTag, + SSchemaAction *action, bool *actionNeeded, SSmlHandle *info) { uint16_t *index = (uint16_t *)taosHashGet(colHash, kv->key, kv->keyLen); if (index) { if (colField[*index].type != kv->type) { - uError("SML:0x%"PRIx64" point type and db type mismatch. key: %s. point type: %d, db type: %d", info->id, kv->key, - colField[*index].type, kv->type); + uError("SML:0x%" PRIx64 " point type and db type mismatch. key: %s. point type: %d, db type: %d", info->id, + kv->key, colField[*index].type, kv->type); return TSDB_CODE_TSC_INVALID_VALUE; } - if ((colField[*index].type == TSDB_DATA_TYPE_VARCHAR && (colField[*index].bytes - VARSTR_HEADER_SIZE) < kv->length) || - (colField[*index].type == TSDB_DATA_TYPE_NCHAR &&((colField[*index].bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE < kv->length))) { + if ((colField[*index].type == TSDB_DATA_TYPE_VARCHAR && + (colField[*index].bytes - VARSTR_HEADER_SIZE) < kv->length) || + (colField[*index].type == TSDB_DATA_TYPE_NCHAR && + ((colField[*index].bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE < kv->length))) { if (isTag) { action->action = SCHEMA_ACTION_CHANGE_TAG_SIZE; } else { @@ -260,27 +269,26 @@ static int32_t smlGenerateSchemaAction(SSchema* colField, SHashObj* colHash, SSm } if (*actionNeeded) { uDebug("SML:0x%" PRIx64 " generate schema action. column name: %s, action: %d", info->id, colField->name, - action->action); + action->action); } return 0; } -static int32_t smlFindNearestPowerOf2(int32_t length){ +static int32_t smlFindNearestPowerOf2(int32_t length) { int32_t result = 1; - while(result <= length){ + while (result <= length) { result *= 2; } return result; } -static int32_t smlBuildColumnDescription(SSmlKv* field, char* buf, int32_t bufSize, int32_t* outBytes) { +static int32_t smlBuildColumnDescription(SSmlKv *field, char *buf, int32_t bufSize, int32_t *outBytes) { uint8_t type = field->type; char tname[TSDB_TABLE_NAME_LEN] = {0}; memcpy(tname, field->key, field->keyLen); if (type == TSDB_DATA_TYPE_BINARY || type == TSDB_DATA_TYPE_NCHAR) { int32_t bytes = smlFindNearestPowerOf2(field->length); - int out = snprintf(buf, bufSize, "`%s` %s(%d)", - tname, tDataTypes[field->type].name, bytes); + int out = snprintf(buf, bufSize, "`%s` %s(%d)", tname, tDataTypes[field->type].name, bytes); *outBytes = out; } else { int out = snprintf(buf, bufSize, "`%s` %s", tname, tDataTypes[type].name); @@ -290,22 +298,22 @@ static int32_t smlBuildColumnDescription(SSmlKv* field, char* buf, int32_t bufSi return 0; } -static int32_t smlApplySchemaAction(SSmlHandle* info, SSchemaAction* action) { +static int32_t smlApplySchemaAction(SSmlHandle *info, SSchemaAction *action) { int32_t code = 0; int32_t outBytes = 0; - char *result = (char *)taosMemoryCalloc(1, TSDB_MAX_ALLOWED_SQL_LEN); + char *result = (char *)taosMemoryCalloc(1, TSDB_MAX_ALLOWED_SQL_LEN); int32_t capacity = TSDB_MAX_ALLOWED_SQL_LEN; - uDebug("SML:0x%"PRIx64" apply schema action. action: %d", info->id, action->action); + uDebug("SML:0x%" PRIx64 " apply schema action. action: %d", info->id, action->action); switch (action->action) { case SCHEMA_ACTION_ADD_COLUMN: { int n = sprintf(result, "alter stable `%s` add column ", action->alterSTable.sTableName); - smlBuildColumnDescription(action->alterSTable.field, result+n, capacity-n, &outBytes); - TAOS_RES* res = taos_query(info->taos, result); //TODO async doAsyncQuery + smlBuildColumnDescription(action->alterSTable.field, result + n, capacity - n, &outBytes); + TAOS_RES *res = taos_query(info->taos, result); // TODO async doAsyncQuery code = taos_errno(res); - const char* errStr = taos_errstr(res); + const char *errStr = taos_errstr(res); if (code != TSDB_CODE_SUCCESS) { - uError("SML:0x%"PRIx64" apply schema action. error: %s", info->id, errStr); + uError("SML:0x%" PRIx64 " apply schema action. error: %s", info->id, errStr); taosMsleep(100); } taos_free_result(res); @@ -314,13 +322,12 @@ static int32_t smlApplySchemaAction(SSmlHandle* info, SSchemaAction* action) { } case SCHEMA_ACTION_ADD_TAG: { int n = sprintf(result, "alter stable `%s` add tag ", action->alterSTable.sTableName); - smlBuildColumnDescription(action->alterSTable.field, - result+n, capacity-n, &outBytes); - TAOS_RES* res = taos_query(info->taos, result); //TODO async doAsyncQuery + smlBuildColumnDescription(action->alterSTable.field, result + n, capacity - n, &outBytes); + TAOS_RES *res = taos_query(info->taos, result); // TODO async doAsyncQuery code = taos_errno(res); - const char* errStr = taos_errstr(res); + const char *errStr = taos_errstr(res); if (code != TSDB_CODE_SUCCESS) { - uError("SML:0x%"PRIx64" apply schema action. error : %s", info->id, taos_errstr(res)); + uError("SML:0x%" PRIx64 " apply schema action. error : %s", info->id, taos_errstr(res)); taosMsleep(100); } taos_free_result(res); @@ -329,12 +336,11 @@ static int32_t smlApplySchemaAction(SSmlHandle* info, SSchemaAction* action) { } case SCHEMA_ACTION_CHANGE_COLUMN_SIZE: { int n = sprintf(result, "alter stable `%s` modify column ", action->alterSTable.sTableName); - smlBuildColumnDescription(action->alterSTable.field, result+n, - capacity-n, &outBytes); - TAOS_RES* res = taos_query(info->taos, result); //TODO async doAsyncQuery + smlBuildColumnDescription(action->alterSTable.field, result + n, capacity - n, &outBytes); + TAOS_RES *res = taos_query(info->taos, result); // TODO async doAsyncQuery code = taos_errno(res); if (code != TSDB_CODE_SUCCESS) { - uError("SML:0x%"PRIx64" apply schema action. error : %s", info->id, taos_errstr(res)); + uError("SML:0x%" PRIx64 " apply schema action. error : %s", info->id, taos_errstr(res)); taosMsleep(100); } taos_free_result(res); @@ -343,12 +349,11 @@ static int32_t smlApplySchemaAction(SSmlHandle* info, SSchemaAction* action) { } case SCHEMA_ACTION_CHANGE_TAG_SIZE: { int n = sprintf(result, "alter stable `%s` modify tag ", action->alterSTable.sTableName); - smlBuildColumnDescription(action->alterSTable.field, result+n, - capacity-n, &outBytes); - TAOS_RES* res = taos_query(info->taos, result); //TODO async doAsyncQuery + smlBuildColumnDescription(action->alterSTable.field, result + n, capacity - n, &outBytes); + TAOS_RES *res = taos_query(info->taos, result); // TODO async doAsyncQuery code = taos_errno(res); if (code != TSDB_CODE_SUCCESS) { - uError("SML:0x%"PRIx64" apply schema action. error : %s", info->id, taos_errstr(res)); + uError("SML:0x%" PRIx64 " apply schema action. error : %s", info->id, taos_errstr(res)); taosMsleep(100); } taos_free_result(res); @@ -356,42 +361,54 @@ static int32_t smlApplySchemaAction(SSmlHandle* info, SSchemaAction* action) { break; } case SCHEMA_ACTION_CREATE_STABLE: { - int n = sprintf(result, "create stable `%s` (", action->createSTable.sTableName); - char* pos = result + n; int freeBytes = capacity - n; + int n = sprintf(result, "create stable `%s` (", action->createSTable.sTableName); + char *pos = result + n; + int freeBytes = capacity - n; SArray *cols = action->createSTable.fields; - for(int i = 0; i < taosArrayGetSize(cols); i++){ + for (int i = 0; i < taosArrayGetSize(cols); i++) { SSmlKv *kv = (SSmlKv *)taosArrayGetP(cols, i); smlBuildColumnDescription(kv, pos, freeBytes, &outBytes); - pos += outBytes; freeBytes -= outBytes; - *pos = ','; ++pos; --freeBytes; + pos += outBytes; + freeBytes -= outBytes; + *pos = ','; + ++pos; + --freeBytes; } - --pos; ++freeBytes; + --pos; + ++freeBytes; outBytes = snprintf(pos, freeBytes, ") tags ("); - pos += outBytes; freeBytes -= outBytes; + pos += outBytes; + freeBytes -= outBytes; cols = action->createSTable.tags; - for(int i = 0; i < taosArrayGetSize(cols); i++){ + for (int i = 0; i < taosArrayGetSize(cols); i++) { SSmlKv *kv = (SSmlKv *)taosArrayGetP(cols, i); smlBuildColumnDescription(kv, pos, freeBytes, &outBytes); - pos += outBytes; freeBytes -= outBytes; - *pos = ','; ++pos; --freeBytes; + pos += outBytes; + freeBytes -= outBytes; + *pos = ','; + ++pos; + --freeBytes; } - if(taosArrayGetSize(cols) == 0){ - outBytes = snprintf(pos, freeBytes,"`%s` %s(%d)", - tsSmlTagName, tDataTypes[TSDB_DATA_TYPE_NCHAR].name, 1); - pos += outBytes; freeBytes -= outBytes; - *pos = ','; ++pos; --freeBytes; + if (taosArrayGetSize(cols) == 0) { + outBytes = snprintf(pos, freeBytes, "`%s` %s(%d)", tsSmlTagName, tDataTypes[TSDB_DATA_TYPE_NCHAR].name, 1); + pos += outBytes; + freeBytes -= outBytes; + *pos = ','; + ++pos; + --freeBytes; } - pos--; ++freeBytes; + pos--; + ++freeBytes; outBytes = snprintf(pos, freeBytes, ")"); - TAOS_RES* res = taos_query(info->taos, result); + TAOS_RES *res = taos_query(info->taos, result); code = taos_errno(res); if (code != TSDB_CODE_SUCCESS) { - uError("SML:0x%"PRIx64" apply schema action. error : %s", info->id, taos_errstr(res)); + uError("SML:0x%" PRIx64 " apply schema action. error : %s", info->id, taos_errstr(res)); taosMsleep(100); } taos_free_result(res); @@ -405,18 +422,19 @@ static int32_t smlApplySchemaAction(SSmlHandle* info, SSchemaAction* action) { taosMemoryFreeClear(result); if (code != 0) { - uError("SML:0x%"PRIx64 " apply schema action failure. %s", info->id, tstrerror(code)); + uError("SML:0x%" PRIx64 " apply schema action failure. %s", info->id, tstrerror(code)); } return code; } -static int32_t smlProcessSchemaAction(SSmlHandle* info, SSchema* schemaField, SHashObj* schemaHash, SArray *cols, SSchemaAction* action, bool isTag){ +static int32_t smlProcessSchemaAction(SSmlHandle *info, SSchema *schemaField, SHashObj *schemaHash, SArray *cols, + SSchemaAction *action, bool isTag) { int32_t code = TSDB_CODE_SUCCESS; for (int j = 0; j < taosArrayGetSize(cols); ++j) { - SSmlKv* kv = (SSmlKv*)taosArrayGetP(cols, j); - bool actionNeeded = false; + SSmlKv *kv = (SSmlKv *)taosArrayGetP(cols, j); + bool actionNeeded = false; code = smlGenerateSchemaAction(schemaField, schemaHash, kv, isTag, action, &actionNeeded, info); - if(code != TSDB_CODE_SUCCESS){ + if (code != TSDB_CODE_SUCCESS) { return code; } if (actionNeeded) { @@ -429,24 +447,24 @@ static int32_t smlProcessSchemaAction(SSmlHandle* info, SSchema* schemaField, SH return TSDB_CODE_SUCCESS; } -static int32_t smlCheckMeta(SSchema* schema, int32_t length, SArray* cols){ +static int32_t smlCheckMeta(SSchema *schema, int32_t length, SArray *cols) { SHashObj *hashTmp = taosHashInit(length, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK); - for(uint16_t i = 0; i < length; i++){ + for (uint16_t i = 0; i < length; i++) { taosHashPut(hashTmp, schema[i].name, strlen(schema[i].name), &i, SHORT_BYTES); } - for(int32_t i = 0; i < taosArrayGetSize(cols); i++){ - SSmlKv* kv = (SSmlKv*)taosArrayGetP(cols, i); - if(taosHashGet(hashTmp, kv->key, kv->keyLen) == NULL){ + for (int32_t i = 0; i < taosArrayGetSize(cols); i++) { + SSmlKv *kv = (SSmlKv *)taosArrayGetP(cols, i); + if (taosHashGet(hashTmp, kv->key, kv->keyLen) == NULL) { return -1; } } return 0; } -static int32_t smlModifyDBSchemas(SSmlHandle* info) { +static int32_t smlModifyDBSchemas(SSmlHandle *info) { int32_t code = 0; - SName pName = {TSDB_TABLE_NAME_T, info->taos->acctId, {0}, {0}}; + SName pName = {TSDB_TABLE_NAME_T, info->taos->acctId, {0}, {0}}; strcpy(pName.dbname, info->pRequest->pDb); SRequestConnInfo conn = {0}; @@ -454,15 +472,15 @@ static int32_t smlModifyDBSchemas(SSmlHandle* info) { conn.requestId = info->pRequest->requestId; conn.requestObjRefId = info->pRequest->self; conn.mgmtEps = getEpSet_s(&info->taos->pAppInfo->mgmtEp); - - SSmlSTableMeta** tableMetaSml = (SSmlSTableMeta**)taosHashIterate(info->superTables, NULL); + + SSmlSTableMeta **tableMetaSml = (SSmlSTableMeta **)taosHashIterate(info->superTables, NULL); while (tableMetaSml) { - SSmlSTableMeta* sTableData = *tableMetaSml; - STableMeta *pTableMeta = NULL; - bool needCheckMeta = false; // for multi thread + SSmlSTableMeta *sTableData = *tableMetaSml; + STableMeta *pTableMeta = NULL; + bool needCheckMeta = false; // for multi thread size_t superTableLen = 0; - void *superTable = taosHashGetKey(tableMetaSml, &superTableLen); + void *superTable = taosHashGetKey(tableMetaSml, &superTableLen); memset(pName.tname, 0, TSDB_TABLE_NAME_LEN); memcpy(pName.tname, superTable, superTableLen); @@ -477,13 +495,16 @@ static int32_t smlModifyDBSchemas(SSmlHandle* info) { schemaAction.createSTable.fields = sTableData->cols; code = smlApplySchemaAction(info, &schemaAction); if (code != TSDB_CODE_SUCCESS) { - uError("SML:0x%"PRIx64" smlApplySchemaAction failed. can not create %s", info->id, schemaAction.createSTable.sTableName); + uError("SML:0x%" PRIx64 " smlApplySchemaAction failed. can not create %s", info->id, + schemaAction.createSTable.sTableName); goto end; } info->cost.numOfCreateSTables++; - }else if (code == TSDB_CODE_SUCCESS) { - SHashObj *hashTmp = taosHashInit(pTableMeta->tableInfo.numOfTags, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK); - for(uint16_t i = pTableMeta->tableInfo.numOfColumns; i < pTableMeta->tableInfo.numOfColumns + pTableMeta->tableInfo.numOfTags; i++){ + } else if (code == TSDB_CODE_SUCCESS) { + SHashObj *hashTmp = taosHashInit(pTableMeta->tableInfo.numOfTags, + taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK); + for (uint16_t i = pTableMeta->tableInfo.numOfColumns; + i < pTableMeta->tableInfo.numOfColumns + pTableMeta->tableInfo.numOfTags; i++) { taosHashPut(hashTmp, pTableMeta->schema[i].name, strlen(pTableMeta->schema[i].name), &i, SHORT_BYTES); } @@ -497,7 +518,7 @@ static int32_t smlModifyDBSchemas(SSmlHandle* info) { } taosHashClear(hashTmp); - for(uint16_t i = 0; i < pTableMeta->tableInfo.numOfColumns; i++){ + for (uint16_t i = 0; i < pTableMeta->tableInfo.numOfColumns; i++) { taosHashPut(hashTmp, pTableMeta->schema[i].name, strlen(pTableMeta->schema[i].name), &i, SHORT_BYTES); } code = smlProcessSchemaAction(info, pTableMeta->schema, hashTmp, sTableData->cols, &schemaAction, false); @@ -512,33 +533,34 @@ static int32_t smlModifyDBSchemas(SSmlHandle* info) { } needCheckMeta = true; } else { - uError("SML:0x%"PRIx64" load table meta error: %s", info->id, tstrerror(code)); + uError("SML:0x%" PRIx64 " load table meta error: %s", info->id, tstrerror(code)); goto end; } - if(pTableMeta) taosMemoryFree(pTableMeta); + if (pTableMeta) taosMemoryFree(pTableMeta); code = catalogGetSTableMeta(info->pCatalog, &conn, &pName, &pTableMeta); if (code != TSDB_CODE_SUCCESS) { - uError("SML:0x%"PRIx64" catalogGetSTableMeta failed. super table name %s", info->id, (char*)superTable); + uError("SML:0x%" PRIx64 " catalogGetSTableMeta failed. super table name %s", info->id, (char *)superTable); goto end; } - if(needCheckMeta){ - code = smlCheckMeta(&(pTableMeta->schema[pTableMeta->tableInfo.numOfColumns]), pTableMeta->tableInfo.numOfTags, sTableData->tags); + if (needCheckMeta) { + code = smlCheckMeta(&(pTableMeta->schema[pTableMeta->tableInfo.numOfColumns]), pTableMeta->tableInfo.numOfTags, + sTableData->tags); if (code != TSDB_CODE_SUCCESS) { - uError("SML:0x%"PRIx64" check tag failed. super table name %s", info->id, (char*)superTable); + uError("SML:0x%" PRIx64 " check tag failed. super table name %s", info->id, (char *)superTable); goto end; } code = smlCheckMeta(&(pTableMeta->schema[0]), pTableMeta->tableInfo.numOfColumns, sTableData->cols); if (code != TSDB_CODE_SUCCESS) { - uError("SML:0x%"PRIx64" check cols failed. super table name %s", info->id, (char*)superTable); + uError("SML:0x%" PRIx64 " check cols failed. super table name %s", info->id, (char *)superTable); goto end; } } sTableData->tableMeta = pTableMeta; - tableMetaSml = (SSmlSTableMeta**)taosHashIterate(info->superTables, tableMetaSml); + tableMetaSml = (SSmlSTableMeta **)taosHashIterate(info->superTables, tableMetaSml); } return 0; @@ -547,32 +569,32 @@ end: return code; } -static bool smlParseNumber(SSmlKv *kvVal, SSmlMsgBuf *msg){ +static bool smlParseNumber(SSmlKv *kvVal, SSmlMsgBuf *msg) { const char *pVal = kvVal->value; - int32_t len = kvVal->length; - char *endptr = NULL; - double result = taosStr2Double(pVal, &endptr); - if(pVal == endptr){ + int32_t len = kvVal->length; + char *endptr = NULL; + double result = taosStr2Double(pVal, &endptr); + if (pVal == endptr) { smlBuildInvalidDataMsg(msg, "invalid data", pVal); return false; } int32_t left = len - (endptr - pVal); - if(left == 0 || (left == 3 && strncasecmp(endptr, "f64", left) == 0)){ + if (left == 0 || (left == 3 && strncasecmp(endptr, "f64", left) == 0)) { kvVal->type = TSDB_DATA_TYPE_DOUBLE; kvVal->d = result; - }else if ((left == 3 && strncasecmp(endptr, "f32", left) == 0)){ - if(!IS_VALID_FLOAT(result)){ + } else if ((left == 3 && strncasecmp(endptr, "f32", left) == 0)) { + if (!IS_VALID_FLOAT(result)) { smlBuildInvalidDataMsg(msg, "float out of range[-3.402823466e+38,3.402823466e+38]", pVal); return false; } kvVal->type = TSDB_DATA_TYPE_FLOAT; kvVal->f = (float)result; - }else if ((left == 1 && *endptr == 'i') || (left == 3 && strncasecmp(endptr, "i64", left) == 0)){ - if(smlDoubleToInt64OverFlow(result)){ + } else if ((left == 1 && *endptr == 'i') || (left == 3 && strncasecmp(endptr, "i64", left) == 0)) { + if (smlDoubleToInt64OverFlow(result)) { errno = 0; int64_t tmp = taosStr2Int64(pVal, &endptr, 10); - if(errno == ERANGE){ + if (errno == ERANGE) { smlBuildInvalidDataMsg(msg, "big int out of range[-9223372036854775808,9223372036854775807]", pVal); return false; } @@ -582,11 +604,11 @@ static bool smlParseNumber(SSmlKv *kvVal, SSmlMsgBuf *msg){ } kvVal->type = TSDB_DATA_TYPE_BIGINT; kvVal->i = (int64_t)result; - }else if ((left == 3 && strncasecmp(endptr, "u64", left) == 0)){ - if(result >= (double)UINT64_MAX || result < 0){ + } else if ((left == 3 && strncasecmp(endptr, "u64", left) == 0)) { + if (result >= (double)UINT64_MAX || result < 0) { errno = 0; uint64_t tmp = taosStr2UInt64(pVal, &endptr, 10); - if(errno == ERANGE || result < 0){ + if (errno == ERANGE || result < 0) { smlBuildInvalidDataMsg(msg, "unsigned big int out of range[0,18446744073709551615]", pVal); return false; } @@ -596,49 +618,49 @@ static bool smlParseNumber(SSmlKv *kvVal, SSmlMsgBuf *msg){ } kvVal->type = TSDB_DATA_TYPE_UBIGINT; kvVal->u = result; - }else if (left == 3 && strncasecmp(endptr, "i32", left) == 0){ - if(!IS_VALID_INT(result)){ + } else if (left == 3 && strncasecmp(endptr, "i32", left) == 0) { + if (!IS_VALID_INT(result)) { smlBuildInvalidDataMsg(msg, "int out of range[-2147483648,2147483647]", pVal); return false; } kvVal->type = TSDB_DATA_TYPE_INT; kvVal->i = result; - }else if (left == 3 && strncasecmp(endptr, "u32", left) == 0){ - if(!IS_VALID_UINT(result)){ + } else if (left == 3 && strncasecmp(endptr, "u32", left) == 0) { + if (!IS_VALID_UINT(result)) { smlBuildInvalidDataMsg(msg, "unsigned int out of range[0,4294967295]", pVal); return false; } kvVal->type = TSDB_DATA_TYPE_UINT; kvVal->u = result; - }else if (left == 3 && strncasecmp(endptr, "i16", left) == 0){ - if(!IS_VALID_SMALLINT(result)){ + } else if (left == 3 && strncasecmp(endptr, "i16", left) == 0) { + if (!IS_VALID_SMALLINT(result)) { smlBuildInvalidDataMsg(msg, "small int our of range[-32768,32767]", pVal); return false; } kvVal->type = TSDB_DATA_TYPE_SMALLINT; kvVal->i = result; - }else if (left == 3 && strncasecmp(endptr, "u16", left) == 0){ - if(!IS_VALID_USMALLINT(result)){ + } else if (left == 3 && strncasecmp(endptr, "u16", left) == 0) { + if (!IS_VALID_USMALLINT(result)) { smlBuildInvalidDataMsg(msg, "unsigned small int out of rang[0,65535]", pVal); return false; } kvVal->type = TSDB_DATA_TYPE_USMALLINT; kvVal->u = result; - }else if (left == 2 && strncasecmp(endptr, "i8", left) == 0){ - if(!IS_VALID_TINYINT(result)){ + } else if (left == 2 && strncasecmp(endptr, "i8", left) == 0) { + if (!IS_VALID_TINYINT(result)) { smlBuildInvalidDataMsg(msg, "tiny int out of range[-128,127]", pVal); return false; } kvVal->type = TSDB_DATA_TYPE_TINYINT; kvVal->i = result; - }else if (left == 2 && strncasecmp(endptr, "u8", left) == 0){ - if(!IS_VALID_UTINYINT(result)){ + } else if (left == 2 && strncasecmp(endptr, "u8", left) == 0) { + if (!IS_VALID_UTINYINT(result)) { smlBuildInvalidDataMsg(msg, "unsigned tiny int out of range[0,255]", pVal); return false; } kvVal->type = TSDB_DATA_TYPE_UTINYINT; kvVal->u = result; - }else{ + } else { smlBuildInvalidDataMsg(msg, "invalid data", pVal); return false; } @@ -647,7 +669,7 @@ static bool smlParseNumber(SSmlKv *kvVal, SSmlMsgBuf *msg){ static bool smlParseBool(SSmlKv *kvVal) { const char *pVal = kvVal->value; - int32_t len = kvVal->length; + int32_t len = kvVal->length; if ((len == 1) && (pVal[0] == 't' || pVal[0] == 'T')) { kvVal->i = true; return true; @@ -658,11 +680,11 @@ static bool smlParseBool(SSmlKv *kvVal) { return true; } - if((len == 4) && !strncasecmp(pVal, "true", len)) { + if ((len == 4) && !strncasecmp(pVal, "true", len)) { kvVal->i = true; return true; } - if((len == 5) && !strncasecmp(pVal, "false", len)) { + if ((len == 5) && !strncasecmp(pVal, "false", len)) { kvVal->i = false; return true; } @@ -670,7 +692,7 @@ static bool smlParseBool(SSmlKv *kvVal) { } static bool smlIsBinary(const char *pVal, uint16_t len) { - //binary: "abc" + // binary: "abc" if (len < 2) { return false; } @@ -681,20 +703,20 @@ static bool smlIsBinary(const char *pVal, uint16_t len) { } static bool smlIsNchar(const char *pVal, uint16_t len) { - //nchar: L"abc" + // nchar: L"abc" if (len < 3) { return false; } - if ((pVal[0] == 'l' || pVal[0] == 'L')&& pVal[1] == '"' && pVal[len - 1] == '"') { + if ((pVal[0] == 'l' || pVal[0] == 'L') && pVal[1] == '"' && pVal[len - 1] == '"') { return true; } return false; } static int64_t smlGetTimeValue(const char *value, int32_t len, int8_t type) { - char *endPtr = NULL; + char *endPtr = NULL; int64_t tsInt64 = taosStr2Int64(value, &endPtr, 10); - if(value + len != endPtr){ + if (value + len != endPtr) { return -1; } double ts = tsInt64; @@ -724,7 +746,7 @@ static int64_t smlGetTimeValue(const char *value, int32_t len, int8_t type) { default: ASSERT(0); } - if(ts >= (double)INT64_MAX || ts < 0){ + if (ts >= (double)INT64_MAX || ts < 0) { return -1; } @@ -761,8 +783,8 @@ static int8_t smlGetTsTypeByPrecision(int8_t precision) { } } -static int64_t smlParseInfluxTime(SSmlHandle* info, const char* data, int32_t len){ - if(len == 0 || (len == 1 && data[0] == '0')){ +static int64_t smlParseInfluxTime(SSmlHandle *info, const char *data, int32_t len) { + if (len == 0 || (len == 1 && data[0] == '0')) { return taosGetTimestampNs(); } @@ -773,49 +795,50 @@ static int64_t smlParseInfluxTime(SSmlHandle* info, const char* data, int32_t le } int64_t ts = smlGetTimeValue(data, len, tsType); - if(ts == -1){ + if (ts == -1) { smlBuildInvalidDataMsg(&info->msgBuf, "invalid timestamp", data); return -1; } return ts; } -static int64_t smlParseOpenTsdbTime(SSmlHandle* info, const char* data, int32_t len){ - if(!data){ +static int64_t smlParseOpenTsdbTime(SSmlHandle *info, const char *data, int32_t len) { + if (!data) { smlBuildInvalidDataMsg(&info->msgBuf, "timestamp can not be null", NULL); return -1; } - if(len == 1 && data[0] == '0'){ + if (len == 1 && data[0] == '0') { return taosGetTimestampNs(); } int8_t tsType = smlGetTsTypeByLen(len); if (tsType == -1) { - smlBuildInvalidDataMsg(&info->msgBuf, "timestamp precision can only be seconds(10 digits) or milli seconds(13 digits)", data); + smlBuildInvalidDataMsg(&info->msgBuf, + "timestamp precision can only be seconds(10 digits) or milli seconds(13 digits)", data); return -1; } int64_t ts = smlGetTimeValue(data, len, tsType); - if(ts == -1){ + if (ts == -1) { smlBuildInvalidDataMsg(&info->msgBuf, "invalid timestamp", data); return -1; } return ts; } -static int32_t smlParseTS(SSmlHandle* info, const char* data, int32_t len, SArray *cols){ +static int32_t smlParseTS(SSmlHandle *info, const char *data, int32_t len, SArray *cols) { int64_t ts = 0; - if(info->protocol == TSDB_SML_LINE_PROTOCOL){ + if (info->protocol == TSDB_SML_LINE_PROTOCOL) { ts = smlParseInfluxTime(info, data, len); - }else if(info->protocol == TSDB_SML_TELNET_PROTOCOL){ + } else if (info->protocol == TSDB_SML_TELNET_PROTOCOL) { ts = smlParseOpenTsdbTime(info, data, len); - }else{ + } else { ASSERT(0); } - if(ts == -1) return TSDB_CODE_TSC_INVALID_TIME_STAMP; + if (ts == -1) return TSDB_CODE_TSC_INVALID_TIME_STAMP; // add ts to SSmlKv *kv = (SSmlKv *)taosMemoryCalloc(sizeof(SSmlKv), 1); - if(!kv){ + if (!kv) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -824,19 +847,19 @@ static int32_t smlParseTS(SSmlHandle* info, const char* data, int32_t len, SArra kv->i = ts; kv->type = TSDB_DATA_TYPE_TIMESTAMP; kv->length = (int16_t)tDataTypes[kv->type].bytes; - if(cols) taosArrayPush(cols, &kv); + if (cols) taosArrayPush(cols, &kv); return TSDB_CODE_SUCCESS; } static bool smlParseValue(SSmlKv *pVal, SSmlMsgBuf *msg) { - //binary + // binary if (smlIsBinary(pVal->value, pVal->length)) { pVal->type = TSDB_DATA_TYPE_BINARY; pVal->length -= BINARY_ADD_LEN; pVal->value += (BINARY_ADD_LEN - 1); return true; } - //nchar + // nchar if (smlIsNchar(pVal->value, pVal->length)) { pVal->type = TSDB_DATA_TYPE_NCHAR; pVal->length -= NCHAR_ADD_LEN; @@ -844,13 +867,13 @@ static bool smlParseValue(SSmlKv *pVal, SSmlMsgBuf *msg) { return true; } - //bool + // bool if (smlParseBool(pVal)) { pVal->type = TSDB_DATA_TYPE_BOOL; pVal->length = (int16_t)tDataTypes[pVal->type].bytes; return true; } - //number + // number if (smlParseNumber(pVal, msg)) { pVal->length = (int16_t)tDataTypes[pVal->type].bytes; return true; @@ -859,41 +882,41 @@ static bool smlParseValue(SSmlKv *pVal, SSmlMsgBuf *msg) { return false; } -static int32_t smlParseInfluxString(const char* sql, SSmlLineInfo *elements, SSmlMsgBuf *msg){ - if(!sql) return TSDB_CODE_SML_INVALID_DATA; +static int32_t smlParseInfluxString(const char *sql, SSmlLineInfo *elements, SSmlMsgBuf *msg) { + if (!sql) return TSDB_CODE_SML_INVALID_DATA; JUMP_SPACE(sql) - if(*sql == COMMA) return TSDB_CODE_SML_INVALID_DATA; + if (*sql == COMMA) return TSDB_CODE_SML_INVALID_DATA; elements->measure = sql; // parse measure while (*sql != '\0') { - if((sql != elements->measure) && IS_SLASH_LETTER(sql)){ - MOVE_FORWARD_ONE(sql,strlen(sql) + 1); + if ((sql != elements->measure) && IS_SLASH_LETTER(sql)) { + MOVE_FORWARD_ONE(sql, strlen(sql) + 1); continue; } - if(IS_COMMA(sql)){ + if (IS_COMMA(sql)) { break; } - if(IS_SPACE(sql)){ + if (IS_SPACE(sql)) { break; } sql++; } elements->measureLen = sql - elements->measure; - if(IS_INVALID_TABLE_LEN(elements->measureLen)) { + if (IS_INVALID_TABLE_LEN(elements->measureLen)) { smlBuildInvalidDataMsg(msg, "measure is empty or too large than 192", NULL); return TSDB_CODE_SML_INVALID_DATA; } // parse tag - if(*sql == SPACE){ + if (*sql == SPACE) { elements->tagsLen = 0; - }else{ - if(*sql == COMMA) sql++; + } else { + if (*sql == COMMA) sql++; elements->tags = sql; while (*sql != '\0') { - if(IS_SPACE(sql)){ + if (IS_SPACE(sql)) { break; } sql++; @@ -907,20 +930,20 @@ static int32_t smlParseInfluxString(const char* sql, SSmlLineInfo *elements, SSm elements->cols = sql; bool isInQuote = false; while (*sql != '\0') { - if(IS_QUOTE(sql)){ + if (IS_QUOTE(sql)) { isInQuote = !isInQuote; } - if(!isInQuote && IS_SPACE(sql)){ + if (!isInQuote && IS_SPACE(sql)) { break; } sql++; } - if(isInQuote){ + if (isInQuote) { smlBuildInvalidDataMsg(msg, "only one quote", elements->cols); return TSDB_CODE_SML_INVALID_DATA; } elements->colsLen = sql - elements->cols; - if(elements->colsLen == 0) { + if (elements->colsLen == 0) { smlBuildInvalidDataMsg(msg, "cols is empty", NULL); return TSDB_CODE_SML_INVALID_DATA; } @@ -929,7 +952,7 @@ static int32_t smlParseInfluxString(const char* sql, SSmlLineInfo *elements, SSm JUMP_SPACE(sql) elements->timestamp = sql; while (*sql != '\0') { - if(*sql == SPACE){ + if (*sql == SPACE) { break; } sql++; @@ -939,11 +962,11 @@ static int32_t smlParseInfluxString(const char* sql, SSmlLineInfo *elements, SSm return TSDB_CODE_SUCCESS; } -static void smlParseTelnetElement(const char **sql, const char **data, int32_t *len){ +static void smlParseTelnetElement(const char **sql, const char **data, int32_t *len) { while (**sql != '\0') { - if(**sql != SPACE && !(*data)) { + if (**sql != SPACE && !(*data)) { *data = *sql; - }else if (**sql == SPACE && *data) { + } else if (**sql == SPACE && *data) { *len = *sql - *data; break; } @@ -951,23 +974,24 @@ static void smlParseTelnetElement(const char **sql, const char **data, int32_t * } } -static int32_t smlParseTelnetTags(const char* data, SArray *cols, char *childTableName, SHashObj *dumplicateKey, SSmlMsgBuf *msg){ +static int32_t smlParseTelnetTags(const char *data, SArray *cols, char *childTableName, SHashObj *dumplicateKey, + SSmlMsgBuf *msg) { const char *sql = data; - size_t childTableNameLen = strlen(tsSmlChildTableName); - while(*sql != '\0'){ + size_t childTableNameLen = strlen(tsSmlChildTableName); + while (*sql != '\0') { JUMP_SPACE(sql) - if(*sql == '\0') break; + if (*sql == '\0') break; const char *key = sql; - int32_t keyLen = 0; + int32_t keyLen = 0; // parse key - while(*sql != '\0'){ - if(*sql == SPACE) { + while (*sql != '\0') { + if (*sql == SPACE) { smlBuildInvalidDataMsg(msg, "invalid data", sql); return TSDB_CODE_SML_INVALID_DATA; } - if(*sql == EQUAL) { + if (*sql == EQUAL) { keyLen = sql - key; sql++; break; @@ -975,19 +999,19 @@ static int32_t smlParseTelnetTags(const char* data, SArray *cols, char *childTab sql++; } - if(IS_INVALID_COL_LEN(keyLen)){ + if (IS_INVALID_COL_LEN(keyLen)) { smlBuildInvalidDataMsg(msg, "invalid key or key is too long than 64", key); return TSDB_CODE_SML_INVALID_DATA; } - if(smlCheckDuplicateKey(key, keyLen, dumplicateKey)){ + if (smlCheckDuplicateKey(key, keyLen, dumplicateKey)) { smlBuildInvalidDataMsg(msg, "dumplicate key", key); return TSDB_CODE_TSC_DUP_TAG_NAMES; } // parse value const char *value = sql; - int32_t valueLen = 0; - while(*sql != '\0') { + int32_t valueLen = 0; + while (*sql != '\0') { // parse value if (*sql == SPACE) { break; @@ -1000,13 +1024,13 @@ static int32_t smlParseTelnetTags(const char* data, SArray *cols, char *childTab } valueLen = sql - value; - if(valueLen == 0){ + if (valueLen == 0) { smlBuildInvalidDataMsg(msg, "invalid value", value); return TSDB_CODE_SML_INVALID_DATA; } - //handle child table name - if(childTableNameLen != 0 && strncmp(key, tsSmlChildTableName, keyLen) == 0){ + // handle child table name + if (childTableNameLen != 0 && strncmp(key, tsSmlChildTableName, keyLen) == 0) { memset(childTableName, 0, TSDB_TABLE_NAME_LEN); strncpy(childTableName, value, (valueLen < TSDB_TABLE_NAME_LEN ? valueLen : TSDB_TABLE_NAME_LEN)); continue; @@ -1014,22 +1038,22 @@ static int32_t smlParseTelnetTags(const char* data, SArray *cols, char *childTab // add kv to SSmlKv SSmlKv *kv = (SSmlKv *)taosMemoryCalloc(sizeof(SSmlKv), 1); - if(!kv) return TSDB_CODE_OUT_OF_MEMORY; + if (!kv) return TSDB_CODE_OUT_OF_MEMORY; kv->key = key; kv->keyLen = keyLen; kv->value = value; kv->length = valueLen; kv->type = TSDB_DATA_TYPE_NCHAR; - if(cols) taosArrayPush(cols, &kv); + if (cols) taosArrayPush(cols, &kv); } return TSDB_CODE_SUCCESS; } // format: =[ =] -static int32_t smlParseTelnetString(SSmlHandle *info, const char* sql, SSmlTableInfo *tinfo, SArray *cols){ - if(!sql) return TSDB_CODE_SML_INVALID_DATA; +static int32_t smlParseTelnetString(SSmlHandle *info, const char *sql, SSmlTableInfo *tinfo, SArray *cols) { + if (!sql) return TSDB_CODE_SML_INVALID_DATA; // parse metric smlParseTelnetElement(&sql, &tinfo->sTableName, &tinfo->sTableNameLen); @@ -1040,7 +1064,7 @@ static int32_t smlParseTelnetString(SSmlHandle *info, const char* sql, SSmlTable // parse timestamp const char *timestamp = NULL; - int32_t tLen = 0; + int32_t tLen = 0; smlParseTelnetElement(&sql, ×tamp, &tLen); if (!timestamp || tLen == 0) { smlBuildInvalidDataMsg(&info->msgBuf, "invalid timestamp", sql); @@ -1055,7 +1079,7 @@ static int32_t smlParseTelnetString(SSmlHandle *info, const char* sql, SSmlTable // parse value const char *value = NULL; - int32_t valueLen = 0; + int32_t valueLen = 0; smlParseTelnetElement(&sql, &value, &valueLen); if (!value || valueLen == 0) { smlBuildInvalidDataMsg(&info->msgBuf, "invalid value", sql); @@ -1063,13 +1087,13 @@ static int32_t smlParseTelnetString(SSmlHandle *info, const char* sql, SSmlTable } SSmlKv *kv = (SSmlKv *)taosMemoryCalloc(sizeof(SSmlKv), 1); - if(!kv) return TSDB_CODE_OUT_OF_MEMORY; + if (!kv) return TSDB_CODE_OUT_OF_MEMORY; taosArrayPush(cols, &kv); kv->key = VALUE; kv->keyLen = VALUE_LEN; kv->value = value; kv->length = valueLen; - if(!smlParseValue(kv, &info->msgBuf)){ + if (!smlParseValue(kv, &info->msgBuf)) { return TSDB_CODE_SML_INVALID_DATA; } @@ -1083,24 +1107,25 @@ static int32_t smlParseTelnetString(SSmlHandle *info, const char* sql, SSmlTable return TSDB_CODE_SUCCESS; } -static int32_t smlParseCols(const char* data, int32_t len, SArray *cols, char *childTableName, bool isTag, SHashObj *dumplicateKey, SSmlMsgBuf *msg){ - if(len == 0){ +static int32_t smlParseCols(const char *data, int32_t len, SArray *cols, char *childTableName, bool isTag, + SHashObj *dumplicateKey, SSmlMsgBuf *msg) { + if (len == 0) { return TSDB_CODE_SUCCESS; } - size_t childTableNameLen = strlen(tsSmlChildTableName); + size_t childTableNameLen = strlen(tsSmlChildTableName); const char *sql = data; - while(sql < data + len){ + while (sql < data + len) { const char *key = sql; - int32_t keyLen = 0; + int32_t keyLen = 0; - while(sql < data + len){ + while (sql < data + len) { // parse key - if(IS_COMMA(sql)) { + if (IS_COMMA(sql)) { smlBuildInvalidDataMsg(msg, "invalid data", sql); return TSDB_CODE_SML_INVALID_DATA; } - if(IS_EQUAL(sql)) { + if (IS_EQUAL(sql)) { keyLen = sql - key; sql++; break; @@ -1108,22 +1133,22 @@ static int32_t smlParseCols(const char* data, int32_t len, SArray *cols, char *c sql++; } - if(IS_INVALID_COL_LEN(keyLen)){ + if (IS_INVALID_COL_LEN(keyLen)) { smlBuildInvalidDataMsg(msg, "invalid key or key is too long than 64", key); return TSDB_CODE_SML_INVALID_DATA; } - if(smlCheckDuplicateKey(key, keyLen, dumplicateKey)){ + if (smlCheckDuplicateKey(key, keyLen, dumplicateKey)) { smlBuildInvalidDataMsg(msg, "dumplicate key", key); return TSDB_CODE_TSC_DUP_TAG_NAMES; } // parse value const char *value = sql; - int32_t valueLen = 0; - bool isInQuote = false; - while(sql < data + len) { + int32_t valueLen = 0; + bool isInQuote = false; + while (sql < data + len) { // parse value - if(!isTag && IS_QUOTE(sql)){ + if (!isTag && IS_QUOTE(sql)) { isInQuote = !isInQuote; sql++; continue; @@ -1140,19 +1165,19 @@ static int32_t smlParseCols(const char* data, int32_t len, SArray *cols, char *c valueLen = sql - value; sql++; - if(isInQuote){ + if (isInQuote) { smlBuildInvalidDataMsg(msg, "only one quote", value); return TSDB_CODE_SML_INVALID_DATA; } - if(valueLen == 0){ + if (valueLen == 0) { smlBuildInvalidDataMsg(msg, "invalid value", value); return TSDB_CODE_SML_INVALID_DATA; } PROCESS_SLASH(key, keyLen) PROCESS_SLASH(value, valueLen) - //handle child table name - if(childTableName && childTableNameLen != 0 && strncmp(key, tsSmlChildTableName, keyLen) == 0){ + // handle child table name + if (childTableName && childTableNameLen != 0 && strncmp(key, tsSmlChildTableName, keyLen) == 0) { memset(childTableName, 0, TSDB_TABLE_NAME_LEN); strncpy(childTableName, value, (valueLen < TSDB_TABLE_NAME_LEN ? valueLen : TSDB_TABLE_NAME_LEN)); continue; @@ -1160,17 +1185,17 @@ static int32_t smlParseCols(const char* data, int32_t len, SArray *cols, char *c // add kv to SSmlKv SSmlKv *kv = (SSmlKv *)taosMemoryCalloc(sizeof(SSmlKv), 1); - if(!kv) return TSDB_CODE_OUT_OF_MEMORY; - if(cols) taosArrayPush(cols, &kv); + if (!kv) return TSDB_CODE_OUT_OF_MEMORY; + if (cols) taosArrayPush(cols, &kv); kv->key = key; kv->keyLen = keyLen; kv->value = value; kv->length = valueLen; - if(isTag){ + if (isTag) { kv->type = TSDB_DATA_TYPE_NCHAR; - }else{ - if(!smlParseValue(kv, msg)){ + } else { + if (!smlParseValue(kv, msg)) { return TSDB_CODE_SML_INVALID_DATA; } } @@ -1179,24 +1204,24 @@ static int32_t smlParseCols(const char* data, int32_t len, SArray *cols, char *c return TSDB_CODE_SUCCESS; } -static bool smlUpdateMeta(SHashObj *metaHash, SArray *metaArray, SArray *cols, SSmlMsgBuf *msg){ - for (int i = 0; i < taosArrayGetSize(cols); ++i) { //jump timestamp +static bool smlUpdateMeta(SHashObj *metaHash, SArray *metaArray, SArray *cols, SSmlMsgBuf *msg) { + for (int i = 0; i < taosArrayGetSize(cols); ++i) { // jump timestamp SSmlKv *kv = (SSmlKv *)taosArrayGetP(cols, i); int16_t *index = (int16_t *)taosHashGet(metaHash, kv->key, kv->keyLen); - if(index){ + if (index) { SSmlKv **value = (SSmlKv **)taosArrayGet(metaArray, *index); - if(kv->type != (*value)->type){ + if (kv->type != (*value)->type) { smlBuildInvalidDataMsg(msg, "the type is not the same like before", kv->key); return false; - }else{ - if(IS_VAR_DATA_TYPE(kv->type)){ // update string len, if bigger - if(kv->length > (*value)->length){ + } else { + if (IS_VAR_DATA_TYPE(kv->type)) { // update string len, if bigger + if (kv->length > (*value)->length) { *value = kv; } } } - }else{ + } else { size_t tmp = taosArrayGetSize(metaArray); ASSERT(tmp <= INT16_MAX); int16_t size = tmp; @@ -1208,7 +1233,7 @@ static bool smlUpdateMeta(SHashObj *metaHash, SArray *metaArray, SArray *cols, S return true; } -static void smlInsertMeta(SHashObj *metaHash, SArray *metaArray, SArray *cols){ +static void smlInsertMeta(SHashObj *metaHash, SArray *metaArray, SArray *cols) { for (int16_t i = 0; i < taosArrayGetSize(cols); ++i) { SSmlKv *kv = (SSmlKv *)taosArrayGetP(cols, i); taosArrayPush(metaArray, &kv); @@ -1216,9 +1241,9 @@ static void smlInsertMeta(SHashObj *metaHash, SArray *metaArray, SArray *cols){ } } -static SSmlTableInfo* smlBuildTableInfo(){ +static SSmlTableInfo *smlBuildTableInfo() { SSmlTableInfo *tag = (SSmlTableInfo *)taosMemoryCalloc(sizeof(SSmlTableInfo), 1); - if(!tag){ + if (!tag) { return NULL; } @@ -1240,50 +1265,50 @@ cleanup: return NULL; } -static void smlDestroyTableInfo(SSmlHandle* info, SSmlTableInfo *tag){ - if(info->dataFormat){ - for(size_t i = 0; i < taosArrayGetSize(tag->cols); i++){ +static void smlDestroyTableInfo(SSmlHandle *info, SSmlTableInfo *tag) { + if (info->dataFormat) { + for (size_t i = 0; i < taosArrayGetSize(tag->cols); i++) { SArray *kvArray = (SArray *)taosArrayGetP(tag->cols, i); for (int j = 0; j < taosArrayGetSize(kvArray); ++j) { SSmlKv *p = (SSmlKv *)taosArrayGetP(kvArray, j); - if(info->protocol == TSDB_SML_JSON_PROTOCOL && - (p->type == TSDB_DATA_TYPE_NCHAR || p->type == TSDB_DATA_TYPE_BINARY)){ - taosMemoryFree((void*)p->value); + if (info->protocol == TSDB_SML_JSON_PROTOCOL && + (p->type == TSDB_DATA_TYPE_NCHAR || p->type == TSDB_DATA_TYPE_BINARY)) { + taosMemoryFree((void *)p->value); } taosMemoryFree(p); } taosArrayDestroy(kvArray); } - }else{ - for(size_t i = 0; i < taosArrayGetSize(tag->cols); i++){ + } else { + for (size_t i = 0; i < taosArrayGetSize(tag->cols); i++) { SHashObj *kvHash = (SHashObj *)taosArrayGetP(tag->cols, i); - void** p1 = (void**)taosHashIterate(kvHash, NULL); + void **p1 = (void **)taosHashIterate(kvHash, NULL); while (p1) { taosMemoryFree(*p1); - p1 = (void**)taosHashIterate(kvHash, p1); + p1 = (void **)taosHashIterate(kvHash, p1); } taosHashCleanup(kvHash); } } - for(size_t i = 0; i < taosArrayGetSize(tag->tags); i++){ + for (size_t i = 0; i < taosArrayGetSize(tag->tags); i++) { SSmlKv *p = (SSmlKv *)taosArrayGetP(tag->tags, i); - if(info->protocol == TSDB_SML_JSON_PROTOCOL){ - taosMemoryFree((void*)p->key); - if(p->type == TSDB_DATA_TYPE_NCHAR || p->type == TSDB_DATA_TYPE_BINARY){ - taosMemoryFree((void*)p->value); + if (info->protocol == TSDB_SML_JSON_PROTOCOL) { + taosMemoryFree((void *)p->key); + if (p->type == TSDB_DATA_TYPE_NCHAR || p->type == TSDB_DATA_TYPE_BINARY) { + taosMemoryFree((void *)p->value); } } taosMemoryFree(p); } - if(info->protocol == TSDB_SML_JSON_PROTOCOL && tag->sTableName){ - taosMemoryFree((void*)tag->sTableName); + if (info->protocol == TSDB_SML_JSON_PROTOCOL && tag->sTableName) { + taosMemoryFree((void *)tag->sTableName); } taosArrayDestroy(tag->cols); taosArrayDestroy(tag->tags); taosMemoryFree(tag); } -static int32_t smlKvTimeArrayCompare(const void* key1, const void* key2) { +static int32_t smlKvTimeArrayCompare(const void *key1, const void *key2) { SArray *s1 = *(SArray **)key1; SArray *s2 = *(SArray **)key2; SSmlKv *kv1 = (SSmlKv *)taosArrayGetP(s1, 0); @@ -1299,11 +1324,11 @@ static int32_t smlKvTimeArrayCompare(const void* key1, const void* key2) { } } -static int32_t smlKvTimeHashCompare(const void* key1, const void* key2) { +static int32_t smlKvTimeHashCompare(const void *key1, const void *key2) { SHashObj *s1 = *(SHashObj **)key1; SHashObj *s2 = *(SHashObj **)key2; - SSmlKv *kv1 = (SSmlKv *)taosHashGet(s1, TS, TS_LEN); - SSmlKv *kv2 = (SSmlKv *)taosHashGet(s2, TS, TS_LEN); + SSmlKv *kv1 = (SSmlKv *)taosHashGet(s1, TS, TS_LEN); + SSmlKv *kv2 = (SSmlKv *)taosHashGet(s2, TS, TS_LEN); ASSERT(kv1->type == TSDB_DATA_TYPE_TIMESTAMP); ASSERT(kv2->type == TSDB_DATA_TYPE_TIMESTAMP); if (kv1->i < kv2->i) { @@ -1315,24 +1340,24 @@ static int32_t smlKvTimeHashCompare(const void* key1, const void* key2) { } } -static int32_t smlDealCols(SSmlTableInfo* oneTable, bool dataFormat, SArray *cols){ - if(dataFormat){ +static int32_t smlDealCols(SSmlTableInfo *oneTable, bool dataFormat, SArray *cols) { + if (dataFormat) { void *p = taosArraySearch(oneTable->cols, &cols, smlKvTimeArrayCompare, TD_GE); - if(p == NULL){ + if (p == NULL) { taosArrayPush(oneTable->cols, &cols); - }else{ // to make the sort stable for update data + } else { // to make the sort stable for update data SArray *sa = (SArray *)p; - SSmlKv *cur = (SSmlKv*)taosArrayGet(sa, 0); - SSmlKv *dCur = (SSmlKv*)taosArrayGet(cols, 0); - if(cur->i > dCur->i){ + SSmlKv *cur = (SSmlKv *)taosArrayGet(sa, 0); + SSmlKv *dCur = (SSmlKv *)taosArrayGet(cols, 0); + if (cur->i > dCur->i) { taosArrayInsert(oneTable->cols, TARRAY_ELEM_IDX(oneTable->cols, p), &cols); - }else{ + } else { ASSERT(cur->i == dCur->i); int32_t index = TARRAY_ELEM_IDX(oneTable->cols, p) + 1; - for(; index < taosArrayGetSize(oneTable->cols); index++){ + for (; index < taosArrayGetSize(oneTable->cols); index++) { SArray *tmp = (SArray *)taosArrayGet(oneTable->cols, index); - SSmlKv *curTs = (SSmlKv*)taosArrayGet(tmp, 0); - if(curTs->i > dCur->i){ + SSmlKv *curTs = (SSmlKv *)taosArrayGet(tmp, 0); + if (curTs->i > dCur->i) { break; } } @@ -1343,31 +1368,31 @@ static int32_t smlDealCols(SSmlTableInfo* oneTable, bool dataFormat, SArray *col } SHashObj *kvHash = taosHashInit(32, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK); - if(!kvHash){ + if (!kvHash) { uError("SML:smlDealCols failed to allocate memory"); return TSDB_CODE_TSC_OUT_OF_MEMORY; } - for(size_t i = 0; i < taosArrayGetSize(cols); i++){ + for (size_t i = 0; i < taosArrayGetSize(cols); i++) { SSmlKv *kv = (SSmlKv *)taosArrayGetP(cols, i); taosHashPut(kvHash, kv->key, kv->keyLen, &kv, POINTER_BYTES); } void *p = taosArraySearch(oneTable->cols, &kvHash, smlKvTimeHashCompare, TD_GE); - if(p == NULL){ + if (p == NULL) { taosArrayPush(oneTable->cols, &kvHash); - }else{ // to make the sort stable for update data + } else { // to make the sort stable for update data SHashObj *sa = (SHashObj *)p; - SSmlKv *cur = (SSmlKv *)taosHashGet(sa, TS, TS_LEN); - SSmlKv *dCur = (SSmlKv*)taosArrayGet(cols, 0); - if(cur->i > dCur->i){ + SSmlKv *cur = (SSmlKv *)taosHashGet(sa, TS, TS_LEN); + SSmlKv *dCur = (SSmlKv *)taosArrayGet(cols, 0); + if (cur->i > dCur->i) { taosArrayInsert(oneTable->cols, TARRAY_ELEM_IDX(oneTable->cols, p), &cols); - }else{ + } else { ASSERT(cur->i == dCur->i); int32_t index = TARRAY_ELEM_IDX(oneTable->cols, p) + 1; - for(; index < taosArrayGetSize(oneTable->cols); index++){ + for (; index < taosArrayGetSize(oneTable->cols); index++) { SHashObj *tmp = (SHashObj *)taosArrayGet(oneTable->cols, index); - SSmlKv *curTs = (SSmlKv *)taosHashGet(tmp, TS, TS_LEN); - if(curTs->i > dCur->i){ + SSmlKv *curTs = (SSmlKv *)taosHashGet(tmp, TS, TS_LEN); + if (curTs->i > dCur->i) { break; } } @@ -1377,9 +1402,9 @@ static int32_t smlDealCols(SSmlTableInfo* oneTable, bool dataFormat, SArray *col return TSDB_CODE_SUCCESS; } -static SSmlSTableMeta* smlBuildSTableMeta(){ - SSmlSTableMeta* meta = (SSmlSTableMeta*)taosMemoryCalloc(sizeof(SSmlSTableMeta), 1); - if(!meta){ +static SSmlSTableMeta *smlBuildSTableMeta() { + SSmlSTableMeta *meta = (SSmlSTableMeta *)taosMemoryCalloc(sizeof(SSmlSTableMeta), 1); + if (!meta) { return NULL; } meta->tagHash = taosHashInit(32, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK); @@ -1412,7 +1437,7 @@ cleanup: return NULL; } -static void smlDestroySTableMeta(SSmlSTableMeta *meta){ +static void smlDestroySTableMeta(SSmlSTableMeta *meta) { taosHashCleanup(meta->tagHash); taosHashCleanup(meta->colHash); taosArrayDestroy(meta->tags); @@ -1429,95 +1454,94 @@ static void smlDestroyCols(SArray *cols) { } } -static void smlDestroyInfo(SSmlHandle* info){ - if(!info) return; +static void smlDestroyInfo(SSmlHandle *info) { + if (!info) return; qDestroyQuery(info->pQuery); smlDestroyHandle(info->exec); // destroy info->childTables - void** p1 = (void**)taosHashIterate(info->childTables, NULL); + void **p1 = (void **)taosHashIterate(info->childTables, NULL); while (p1) { - smlDestroyTableInfo(info, (SSmlTableInfo*)(*p1)); - p1 = (void**)taosHashIterate(info->childTables, p1); + smlDestroyTableInfo(info, (SSmlTableInfo *)(*p1)); + p1 = (void **)taosHashIterate(info->childTables, p1); } taosHashCleanup(info->childTables); // destroy info->superTables - p1 = (void**)taosHashIterate(info->superTables, NULL); + p1 = (void **)taosHashIterate(info->superTables, NULL); while (p1) { - smlDestroySTableMeta((SSmlSTableMeta*)(*p1)); - p1 = (void**)taosHashIterate(info->superTables, p1); + smlDestroySTableMeta((SSmlSTableMeta *)(*p1)); + p1 = (void **)taosHashIterate(info->superTables, p1); } taosHashCleanup(info->superTables); // destroy info->pVgHash taosHashCleanup(info->pVgHash); taosHashCleanup(info->dumplicateKey); - if(!info->dataFormat){ + if (!info->dataFormat) { taosArrayDestroy(info->colsContainer); } destroyRequest(info->pRequest); taosMemoryFreeClear(info); } -static SSmlHandle* smlBuildSmlInfo(TAOS* taos, SRequestObj* request, SMLProtocolType protocol, int8_t precision){ - int32_t code = TSDB_CODE_SUCCESS; - SSmlHandle* info = (SSmlHandle*)taosMemoryCalloc(1, sizeof(SSmlHandle)); +static SSmlHandle *smlBuildSmlInfo(TAOS *taos, SRequestObj *request, SMLProtocolType protocol, int8_t precision) { + int32_t code = TSDB_CODE_SUCCESS; + SSmlHandle *info = (SSmlHandle *)taosMemoryCalloc(1, sizeof(SSmlHandle)); if (NULL == info) { return NULL; } - info->id = smlGenId(); + info->id = smlGenId(); - info->pQuery = (SQuery *)taosMemoryCalloc(1, sizeof(SQuery)); + info->pQuery = (SQuery *)taosMemoryCalloc(1, sizeof(SQuery)); if (NULL == info->pQuery) { - uError("SML:0x%"PRIx64" create info->pQuery error", info->id); + uError("SML:0x%" PRIx64 " create info->pQuery error", info->id); goto cleanup; } - info->pQuery->execMode = QUERY_EXEC_MODE_SCHEDULE; + info->pQuery->execMode = QUERY_EXEC_MODE_SCHEDULE; info->pQuery->haveResultSet = false; - info->pQuery->msgType = TDMT_VND_SUBMIT; - info->pQuery->pRoot = (SNode*)nodesMakeNode(QUERY_NODE_VNODE_MODIF_STMT); - if(NULL == info->pQuery->pRoot){ - uError("SML:0x%"PRIx64" create info->pQuery->pRoot error", info->id); + info->pQuery->msgType = TDMT_VND_SUBMIT; + info->pQuery->pRoot = (SNode *)nodesMakeNode(QUERY_NODE_VNODE_MODIF_STMT); + if (NULL == info->pQuery->pRoot) { + uError("SML:0x%" PRIx64 " create info->pQuery->pRoot error", info->id); goto cleanup; } - ((SVnodeModifOpStmt*)(info->pQuery->pRoot))->payloadType = PAYLOAD_TYPE_KV; + ((SVnodeModifOpStmt *)(info->pQuery->pRoot))->payloadType = PAYLOAD_TYPE_KV; - info->taos = (STscObj *)taos; + info->taos = (STscObj *)taos; code = catalogGetHandle(info->taos->pAppInfo->clusterId, &info->pCatalog); - if(code != TSDB_CODE_SUCCESS){ - uError("SML:0x%"PRIx64" get catalog error %d", info->id, code); + if (code != TSDB_CODE_SUCCESS) { + uError("SML:0x%" PRIx64 " get catalog error %d", info->id, code); goto cleanup; } - info->precision = precision; - info->protocol = protocol; - if(protocol == TSDB_SML_LINE_PROTOCOL){ + info->precision = precision; + info->protocol = protocol; + if (protocol == TSDB_SML_LINE_PROTOCOL) { info->dataFormat = tsSmlDataFormat; - }else{ + } else { info->dataFormat = true; } - info->pRequest = request; - info->msgBuf.buf = info->pRequest->msgBuf; - info->msgBuf.len = ERROR_MSG_BUF_DEFAULT_SIZE; + info->pRequest = request; + info->msgBuf.buf = info->pRequest->msgBuf; + info->msgBuf.len = ERROR_MSG_BUF_DEFAULT_SIZE; - info->exec = smlInitHandle(info->pQuery); + info->exec = smlInitHandle(info->pQuery); info->childTables = taosHashInit(32, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK); info->superTables = taosHashInit(32, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK); - info->pVgHash = taosHashInit(16, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_NO_LOCK); + info->pVgHash = taosHashInit(16, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_NO_LOCK); info->dumplicateKey = taosHashInit(32, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK); - if(!info->dataFormat){ + if (!info->dataFormat) { info->colsContainer = taosArrayInit(32, POINTER_BYTES); - if(NULL == info->colsContainer){ - uError("SML:0x%"PRIx64" create info failed", info->id); + if (NULL == info->colsContainer) { + uError("SML:0x%" PRIx64 " create info failed", info->id); goto cleanup; } } - if(NULL == info->exec || NULL == info->childTables - || NULL == info->superTables || NULL == info->pVgHash - || NULL == info->dumplicateKey){ - uError("SML:0x%"PRIx64" create info failed", info->id); + if (NULL == info->exec || NULL == info->childTables || NULL == info->superTables || NULL == info->pVgHash || + NULL == info->dumplicateKey) { + uError("SML:0x%" PRIx64 " create info failed", info->id); goto cleanup; } @@ -1528,25 +1552,25 @@ cleanup: } /************* TSDB_SML_JSON_PROTOCOL function start **************/ -static int32_t smlJsonCreateSring(const char **output, char *input, int32_t inputLen){ +static int32_t smlJsonCreateSring(const char **output, char *input, int32_t inputLen) { *output = (const char *)taosMemoryMalloc(inputLen); - if (*output == NULL){ + if (*output == NULL) { return TSDB_CODE_TSC_OUT_OF_MEMORY; } - memcpy((void*)(*output), input, inputLen); + memcpy((void *)(*output), input, inputLen); return TSDB_CODE_SUCCESS; } static int32_t smlParseMetricFromJSON(SSmlHandle *info, cJSON *root, SSmlTableInfo *tinfo) { cJSON *metric = cJSON_GetObjectItem(root, "metric"); if (!cJSON_IsString(metric)) { - return TSDB_CODE_TSC_INVALID_JSON; + return TSDB_CODE_TSC_INVALID_JSON; } tinfo->sTableNameLen = strlen(metric->valuestring); if (IS_INVALID_TABLE_LEN(tinfo->sTableNameLen)) { - uError("OTD:0x%"PRIx64" Metric lenght is 0 or large than 192", info->id); + uError("OTD:0x%" PRIx64 " Metric lenght is 0 or large than 192", info->id); return TSDB_CODE_TSC_INVALID_TABLE_ID_LENGTH; } @@ -1570,19 +1594,19 @@ static int32_t smlParseTSFromJSONObj(SSmlHandle *info, cJSON *root, int64_t *tsV } double timeDouble = value->valuedouble; - if(smlDoubleToInt64OverFlow(timeDouble)){ + if (smlDoubleToInt64OverFlow(timeDouble)) { smlBuildInvalidDataMsg(&info->msgBuf, "timestamp is too large", NULL); return TSDB_CODE_TSC_INVALID_TIME_STAMP; } - if(timeDouble <= 0){ + if (timeDouble <= 0) { return TSDB_CODE_TSC_INVALID_TIME_STAMP; } size_t typeLen = strlen(type->valuestring); if (typeLen == 1 && (type->valuestring[0] == 's' || type->valuestring[0] == 'S')) { - //seconds + // seconds timeDouble = timeDouble * 1e9; - if(smlDoubleToInt64OverFlow(timeDouble)){ + if (smlDoubleToInt64OverFlow(timeDouble)) { smlBuildInvalidDataMsg(&info->msgBuf, "timestamp is too large", NULL); return TSDB_CODE_TSC_INVALID_TIME_STAMP; } @@ -1591,9 +1615,9 @@ static int32_t smlParseTSFromJSONObj(SSmlHandle *info, cJSON *root, int64_t *tsV switch (type->valuestring[0]) { case 'm': case 'M': - //milliseconds + // milliseconds timeDouble = timeDouble * 1e6; - if(smlDoubleToInt64OverFlow(timeDouble)){ + if (smlDoubleToInt64OverFlow(timeDouble)) { smlBuildInvalidDataMsg(&info->msgBuf, "timestamp is too large", NULL); return TSDB_CODE_TSC_INVALID_TIME_STAMP; } @@ -1601,9 +1625,9 @@ static int32_t smlParseTSFromJSONObj(SSmlHandle *info, cJSON *root, int64_t *tsV break; case 'u': case 'U': - //microseconds + // microseconds timeDouble = timeDouble * 1e3; - if(smlDoubleToInt64OverFlow(timeDouble)){ + if (smlDoubleToInt64OverFlow(timeDouble)) { smlBuildInvalidDataMsg(&info->msgBuf, "timestamp is too large", NULL); return TSDB_CODE_TSC_INVALID_TIME_STAMP; } @@ -1611,7 +1635,7 @@ static int32_t smlParseTSFromJSONObj(SSmlHandle *info, cJSON *root, int64_t *tsV break; case 'n': case 'N': - //nanoseconds + // nanoseconds *tsVal = timeDouble; break; default: @@ -1634,45 +1658,45 @@ static uint8_t smlGetTimestampLen(int64_t num) { } static int32_t smlParseTSFromJSON(SSmlHandle *info, cJSON *root, SArray *cols) { - //Timestamp must be the first KV to parse + // Timestamp must be the first KV to parse int64_t tsVal = 0; cJSON *timestamp = cJSON_GetObjectItem(root, "timestamp"); if (cJSON_IsNumber(timestamp)) { - //timestamp value 0 indicates current system time + // timestamp value 0 indicates current system time double timeDouble = timestamp->valuedouble; - if(smlDoubleToInt64OverFlow(timeDouble)){ + if (smlDoubleToInt64OverFlow(timeDouble)) { smlBuildInvalidDataMsg(&info->msgBuf, "timestamp is too large", NULL); return TSDB_CODE_TSC_INVALID_TIME_STAMP; } - if(timeDouble < 0){ + if (timeDouble < 0) { return TSDB_CODE_TSC_INVALID_TIME_STAMP; } uint8_t tsLen = smlGetTimestampLen((int64_t)timeDouble); if (tsLen == TSDB_TIME_PRECISION_SEC_DIGITS) { timeDouble = timeDouble * 1e9; - if(smlDoubleToInt64OverFlow(timeDouble)){ + if (smlDoubleToInt64OverFlow(timeDouble)) { smlBuildInvalidDataMsg(&info->msgBuf, "timestamp is too large", NULL); return TSDB_CODE_TSC_INVALID_TIME_STAMP; } tsVal = timeDouble; } else if (tsLen == TSDB_TIME_PRECISION_MILLI_DIGITS) { timeDouble = timeDouble * 1e6; - if(smlDoubleToInt64OverFlow(timeDouble)){ + if (smlDoubleToInt64OverFlow(timeDouble)) { smlBuildInvalidDataMsg(&info->msgBuf, "timestamp is too large", NULL); return TSDB_CODE_TSC_INVALID_TIME_STAMP; } tsVal = timeDouble; - } else if(timeDouble == 0){ + } else if (timeDouble == 0) { tsVal = taosGetTimestampNs(); - }else { + } else { return TSDB_CODE_TSC_INVALID_TIME_STAMP; } } else if (cJSON_IsObject(timestamp)) { int32_t ret = smlParseTSFromJSONObj(info, timestamp, &tsVal); if (ret != TSDB_CODE_SUCCESS) { - uError("SML:0x%"PRIx64" Failed to parse timestamp from JSON Obj", info->id); + uError("SML:0x%" PRIx64 " Failed to parse timestamp from JSON Obj", info->id); return ret; } } else { @@ -1681,7 +1705,7 @@ static int32_t smlParseTSFromJSON(SSmlHandle *info, cJSON *root, SArray *cols) { // add ts to SSmlKv *kv = (SSmlKv *)taosMemoryCalloc(sizeof(SSmlKv), 1); - if(!kv){ + if (!kv) { return TSDB_CODE_OUT_OF_MEMORY; } kv->key = TS; @@ -1689,12 +1713,11 @@ static int32_t smlParseTSFromJSON(SSmlHandle *info, cJSON *root, SArray *cols) { kv->i = tsVal; kv->type = TSDB_DATA_TYPE_TIMESTAMP; kv->length = (int16_t)tDataTypes[kv->type].bytes; - if(cols) taosArrayPush(cols, &kv); + if (cols) taosArrayPush(cols, &kv); return TSDB_CODE_SUCCESS; - } -static int32_t smlConvertJSONBool(SSmlKv *pVal, char* typeStr, cJSON *value) { +static int32_t smlConvertJSONBool(SSmlKv *pVal, char *typeStr, cJSON *value) { if (strcasecmp(typeStr, "bool") != 0) { uError("OTD:invalid type(%s) for JSON Bool", typeStr); return TSDB_CODE_TSC_INVALID_JSON_TYPE; @@ -1706,10 +1729,9 @@ static int32_t smlConvertJSONBool(SSmlKv *pVal, char* typeStr, cJSON *value) { return TSDB_CODE_SUCCESS; } -static int32_t smlConvertJSONNumber(SSmlKv *pVal, char* typeStr, cJSON *value) { - //tinyint - if (strcasecmp(typeStr, "i8") == 0 || - strcasecmp(typeStr, "tinyint") == 0) { +static int32_t smlConvertJSONNumber(SSmlKv *pVal, char *typeStr, cJSON *value) { + // tinyint + if (strcasecmp(typeStr, "i8") == 0 || strcasecmp(typeStr, "tinyint") == 0) { if (!IS_VALID_TINYINT(value->valuedouble)) { uError("OTD:JSON value(%f) cannot fit in type(tinyint)", value->valuedouble); return TSDB_CODE_TSC_VALUE_OUT_OF_RANGE; @@ -1719,9 +1741,8 @@ static int32_t smlConvertJSONNumber(SSmlKv *pVal, char* typeStr, cJSON *value) { pVal->i = value->valuedouble; return TSDB_CODE_SUCCESS; } - //smallint - if (strcasecmp(typeStr, "i16") == 0 || - strcasecmp(typeStr, "smallint") == 0) { + // smallint + if (strcasecmp(typeStr, "i16") == 0 || strcasecmp(typeStr, "smallint") == 0) { if (!IS_VALID_SMALLINT(value->valuedouble)) { uError("OTD:JSON value(%f) cannot fit in type(smallint)", value->valuedouble); return TSDB_CODE_TSC_VALUE_OUT_OF_RANGE; @@ -1731,9 +1752,8 @@ static int32_t smlConvertJSONNumber(SSmlKv *pVal, char* typeStr, cJSON *value) { pVal->i = value->valuedouble; return TSDB_CODE_SUCCESS; } - //int - if (strcasecmp(typeStr, "i32") == 0 || - strcasecmp(typeStr, "int") == 0) { + // int + if (strcasecmp(typeStr, "i32") == 0 || strcasecmp(typeStr, "int") == 0) { if (!IS_VALID_INT(value->valuedouble)) { uError("OTD:JSON value(%f) cannot fit in type(int)", value->valuedouble); return TSDB_CODE_TSC_VALUE_OUT_OF_RANGE; @@ -1743,23 +1763,21 @@ static int32_t smlConvertJSONNumber(SSmlKv *pVal, char* typeStr, cJSON *value) { pVal->i = value->valuedouble; return TSDB_CODE_SUCCESS; } - //bigint - if (strcasecmp(typeStr, "i64") == 0 || - strcasecmp(typeStr, "bigint") == 0) { + // bigint + if (strcasecmp(typeStr, "i64") == 0 || strcasecmp(typeStr, "bigint") == 0) { pVal->type = TSDB_DATA_TYPE_BIGINT; pVal->length = (int16_t)tDataTypes[pVal->type].bytes; - if(value->valuedouble >= (double)INT64_MAX){ + if (value->valuedouble >= (double)INT64_MAX) { pVal->i = INT64_MAX; - }else if(value->valuedouble <= (double)INT64_MIN){ + } else if (value->valuedouble <= (double)INT64_MIN) { pVal->i = INT64_MIN; - }else{ + } else { pVal->i = value->valuedouble; } return TSDB_CODE_SUCCESS; } - //float - if (strcasecmp(typeStr, "f32") == 0 || - strcasecmp(typeStr, "float") == 0) { + // float + if (strcasecmp(typeStr, "f32") == 0 || strcasecmp(typeStr, "float") == 0) { if (!IS_VALID_FLOAT(value->valuedouble)) { uError("OTD:JSON value(%f) cannot fit in type(float)", value->valuedouble); return TSDB_CODE_TSC_VALUE_OUT_OF_RANGE; @@ -1769,21 +1787,20 @@ static int32_t smlConvertJSONNumber(SSmlKv *pVal, char* typeStr, cJSON *value) { pVal->f = value->valuedouble; return TSDB_CODE_SUCCESS; } - //double - if (strcasecmp(typeStr, "f64") == 0 || - strcasecmp(typeStr, "double") == 0) { + // double + if (strcasecmp(typeStr, "f64") == 0 || strcasecmp(typeStr, "double") == 0) { pVal->type = TSDB_DATA_TYPE_DOUBLE; pVal->length = (int16_t)tDataTypes[pVal->type].bytes; pVal->d = value->valuedouble; return TSDB_CODE_SUCCESS; } - //if reach here means type is unsupported + // if reach here means type is unsupported uError("OTD:invalid type(%s) for JSON Number", typeStr); return TSDB_CODE_TSC_INVALID_JSON_TYPE; } -static int32_t smlConvertJSONString(SSmlKv *pVal, char* typeStr, cJSON *value) { +static int32_t smlConvertJSONString(SSmlKv *pVal, char *typeStr, cJSON *value) { if (strcasecmp(typeStr, "binary") == 0) { pVal->type = TSDB_DATA_TYPE_BINARY; } else if (strcasecmp(typeStr, "nchar") == 0) { @@ -1864,7 +1881,7 @@ static int32_t smlParseValueFromJSON(cJSON *root, SSmlKv *kv) { * user configured parameter tsDefaultJSONStrType */ - char *tsDefaultJSONStrType = "nchar"; //todo + char *tsDefaultJSONStrType = "nchar"; // todo smlConvertJSONString(kv, tsDefaultJSONStrType, root); break; } @@ -1890,10 +1907,10 @@ static int32_t smlParseColsFromJSON(cJSON *root, SArray *cols) { } SSmlKv *kv = (SSmlKv *)taosMemoryCalloc(sizeof(SSmlKv), 1); - if(!kv){ + if (!kv) { return TSDB_CODE_OUT_OF_MEMORY; } - if(cols) taosArrayPush(cols, &kv); + if (cols) taosArrayPush(cols, &kv); kv->key = VALUE; kv->keyLen = VALUE_LEN; @@ -1904,7 +1921,8 @@ static int32_t smlParseColsFromJSON(cJSON *root, SArray *cols) { return TSDB_CODE_SUCCESS; } -static int32_t smlParseTagsFromJSON(cJSON *root, SArray *pKVs, char *childTableName, SHashObj *dumplicateKey, SSmlMsgBuf *msg) { +static int32_t smlParseTagsFromJSON(cJSON *root, SArray *pKVs, char *childTableName, SHashObj *dumplicateKey, + SSmlMsgBuf *msg) { int32_t ret = TSDB_CODE_SUCCESS; cJSON *tags = cJSON_GetObjectItem(root, "tags"); @@ -1912,7 +1930,7 @@ static int32_t smlParseTagsFromJSON(cJSON *root, SArray *pKVs, char *childTableN return TSDB_CODE_TSC_INVALID_JSON; } - size_t childTableNameLen = strlen(tsSmlChildTableName); + size_t childTableNameLen = strlen(tsSmlChildTableName); int32_t tagNum = cJSON_GetArraySize(tags); for (int32_t i = 0; i < tagNum; ++i) { cJSON *tag = cJSON_GetArrayItem(tags, i); @@ -1924,13 +1942,13 @@ static int32_t smlParseTagsFromJSON(cJSON *root, SArray *pKVs, char *childTableN uError("OTD:Tag key length is 0 or too large than 64"); return TSDB_CODE_TSC_INVALID_COLUMN_LENGTH; } - //check duplicate keys + // check duplicate keys if (smlCheckDuplicateKey(tag->string, keyLen, dumplicateKey)) { return TSDB_CODE_TSC_DUP_TAG_NAMES; } - //handle child table name - if(childTableNameLen != 0 && strcmp(tag->string, tsSmlChildTableName) == 0){ + // handle child table name + if (childTableNameLen != 0 && strcmp(tag->string, tsSmlChildTableName) == 0) { if (!cJSON_IsString(tag)) { uError("OTD:ID must be JSON string"); return TSDB_CODE_TSC_INVALID_JSON; @@ -1942,16 +1960,16 @@ static int32_t smlParseTagsFromJSON(cJSON *root, SArray *pKVs, char *childTableN // add kv to SSmlKv SSmlKv *kv = (SSmlKv *)taosMemoryCalloc(sizeof(SSmlKv), 1); - if(!kv) return TSDB_CODE_OUT_OF_MEMORY; - if(pKVs) taosArrayPush(pKVs, &kv); + if (!kv) return TSDB_CODE_OUT_OF_MEMORY; + if (pKVs) taosArrayPush(pKVs, &kv); - //key + // key kv->keyLen = keyLen; ret = smlJsonCreateSring(&kv->key, tag->string, kv->keyLen); if (ret != TSDB_CODE_SUCCESS) { return ret; } - //value + // value ret = smlParseValueFromJSON(tag, kv); if (ret != TSDB_CODE_SUCCESS) { return ret; @@ -1959,105 +1977,103 @@ static int32_t smlParseTagsFromJSON(cJSON *root, SArray *pKVs, char *childTableN } return ret; - } static int32_t smlParseJSONString(SSmlHandle *info, cJSON *root, SSmlTableInfo *tinfo, SArray *cols) { int32_t ret = TSDB_CODE_SUCCESS; if (!cJSON_IsObject(root)) { - uError("OTD:0x%"PRIx64" data point needs to be JSON object", info->id); + uError("OTD:0x%" PRIx64 " data point needs to be JSON object", info->id); return TSDB_CODE_TSC_INVALID_JSON; } int32_t size = cJSON_GetArraySize(root); - //outmost json fields has to be exactly 4 + // outmost json fields has to be exactly 4 if (size != OTD_JSON_FIELDS_NUM) { - uError("OTD:0x%"PRIx64" Invalid number of JSON fields in data point %d", info->id, size); + uError("OTD:0x%" PRIx64 " Invalid number of JSON fields in data point %d", info->id, size); return TSDB_CODE_TSC_INVALID_JSON; } - //Parse metric + // Parse metric ret = smlParseMetricFromJSON(info, root, tinfo); if (ret != TSDB_CODE_SUCCESS) { - uError("OTD:0x%"PRIx64" Unable to parse metric from JSON payload", info->id); + uError("OTD:0x%" PRIx64 " Unable to parse metric from JSON payload", info->id); return ret; } - uDebug("OTD:0x%"PRIx64" Parse metric from JSON payload finished", info->id); + uDebug("OTD:0x%" PRIx64 " Parse metric from JSON payload finished", info->id); - //Parse timestamp + // Parse timestamp ret = smlParseTSFromJSON(info, root, cols); if (ret) { - uError("OTD:0x%"PRIx64" Unable to parse timestamp from JSON payload", info->id); + uError("OTD:0x%" PRIx64 " Unable to parse timestamp from JSON payload", info->id); return ret; } - uDebug("OTD:0x%"PRIx64" Parse timestamp from JSON payload finished", info->id); + uDebug("OTD:0x%" PRIx64 " Parse timestamp from JSON payload finished", info->id); - //Parse metric value + // Parse metric value ret = smlParseColsFromJSON(root, cols); if (ret) { - uError("OTD:0x%"PRIx64" Unable to parse metric value from JSON payload", info->id); + uError("OTD:0x%" PRIx64 " Unable to parse metric value from JSON payload", info->id); return ret; } - uDebug("OTD:0x%"PRIx64" Parse metric value from JSON payload finished", info->id); + uDebug("OTD:0x%" PRIx64 " Parse metric value from JSON payload finished", info->id); - //Parse tags + // Parse tags ret = smlParseTagsFromJSON(root, tinfo->tags, tinfo->childTableName, info->dumplicateKey, &info->msgBuf); if (ret) { - uError("OTD:0x%"PRIx64" Unable to parse tags from JSON payload", info->id); + uError("OTD:0x%" PRIx64 " Unable to parse tags from JSON payload", info->id); return ret; } - uDebug("OTD:0x%"PRIx64" Parse tags from JSON payload finished", info->id); + uDebug("OTD:0x%" PRIx64 " Parse tags from JSON payload finished", info->id); return TSDB_CODE_SUCCESS; } /************* TSDB_SML_JSON_PROTOCOL function end **************/ - - -static int32_t smlParseInfluxLine(SSmlHandle* info, const char* sql) { +static int32_t smlParseInfluxLine(SSmlHandle *info, const char *sql) { SSmlLineInfo elements = {0}; - int ret = smlParseInfluxString(sql, &elements, &info->msgBuf); - if(ret != TSDB_CODE_SUCCESS){ - uError("SML:0x%"PRIx64" smlParseInfluxLine failed", info->id); + int ret = smlParseInfluxString(sql, &elements, &info->msgBuf); + if (ret != TSDB_CODE_SUCCESS) { + uError("SML:0x%" PRIx64 " smlParseInfluxLine failed", info->id); return ret; } SArray *cols = NULL; - if(info->dataFormat){ // if dataFormat, cols need new memory to save data + if (info->dataFormat) { // if dataFormat, cols need new memory to save data cols = taosArrayInit(16, POINTER_BYTES); if (cols == NULL) { - uError("SML:0x%"PRIx64" smlParseInfluxLine failed to allocate memory", info->id); + uError("SML:0x%" PRIx64 " smlParseInfluxLine failed to allocate memory", info->id); return TSDB_CODE_TSC_OUT_OF_MEMORY; } - }else{ // if dataFormat is false, cols do not need to save data, there is another new memory to save data + } else { // if dataFormat is false, cols do not need to save data, there is another new memory to save data cols = info->colsContainer; } ret = smlParseTS(info, elements.timestamp, elements.timestampLen, cols); - if(ret != TSDB_CODE_SUCCESS){ - uError("SML:0x%"PRIx64" smlParseTS failed", info->id); - if(info->dataFormat) taosArrayDestroy(cols); + if (ret != TSDB_CODE_SUCCESS) { + uError("SML:0x%" PRIx64 " smlParseTS failed", info->id); + if (info->dataFormat) taosArrayDestroy(cols); return ret; } ret = smlParseCols(elements.cols, elements.colsLen, cols, NULL, false, info->dumplicateKey, &info->msgBuf); - if(ret != TSDB_CODE_SUCCESS){ - uError("SML:0x%"PRIx64" smlParseCols parse cloums fields failed", info->id); + if (ret != TSDB_CODE_SUCCESS) { + uError("SML:0x%" PRIx64 " smlParseCols parse cloums fields failed", info->id); smlDestroyCols(cols); - if(info->dataFormat) taosArrayDestroy(cols); + if (info->dataFormat) taosArrayDestroy(cols); return ret; } - if(taosArrayGetSize(cols) > TSDB_MAX_COLUMNS){ + if (taosArrayGetSize(cols) > TSDB_MAX_COLUMNS) { smlBuildInvalidDataMsg(&info->msgBuf, "too many columns than 4096", NULL); return TSDB_CODE_SML_INVALID_DATA; } - bool hasTable = true; - SSmlTableInfo *tinfo = NULL; - SSmlTableInfo **oneTable = (SSmlTableInfo **)taosHashGet(info->childTables, elements.measure, elements.measureTagsLen); - if(!oneTable){ + bool hasTable = true; + SSmlTableInfo *tinfo = NULL; + SSmlTableInfo **oneTable = + (SSmlTableInfo **)taosHashGet(info->childTables, elements.measure, elements.measureTagsLen); + if (!oneTable) { tinfo = smlBuildTableInfo(); - if(!tinfo){ + if (!tinfo) { return TSDB_CODE_TSC_OUT_OF_MEMORY; } taosHashPut(info->childTables, elements.measure, elements.measureTagsLen, &tinfo, POINTER_BYTES); @@ -2066,89 +2082,89 @@ static int32_t smlParseInfluxLine(SSmlHandle* info, const char* sql) { } ret = smlDealCols(*oneTable, info->dataFormat, cols); - if(ret != TSDB_CODE_SUCCESS){ + if (ret != TSDB_CODE_SUCCESS) { return ret; } - if(!hasTable){ - ret = smlParseCols(elements.tags, elements.tagsLen, (*oneTable)->tags, (*oneTable)->childTableName, true, info->dumplicateKey, &info->msgBuf); - if(ret != TSDB_CODE_SUCCESS){ - uError("SML:0x%"PRIx64" smlParseCols parse tag fields failed", info->id); + if (!hasTable) { + ret = smlParseCols(elements.tags, elements.tagsLen, (*oneTable)->tags, (*oneTable)->childTableName, true, + info->dumplicateKey, &info->msgBuf); + if (ret != TSDB_CODE_SUCCESS) { + uError("SML:0x%" PRIx64 " smlParseCols parse tag fields failed", info->id); return ret; } - if(taosArrayGetSize((*oneTable)->tags) > TSDB_MAX_TAGS){ + if (taosArrayGetSize((*oneTable)->tags) > TSDB_MAX_TAGS) { smlBuildInvalidDataMsg(&info->msgBuf, "too many tags than 128", NULL); return TSDB_CODE_SML_INVALID_DATA; } (*oneTable)->sTableName = elements.measure; (*oneTable)->sTableNameLen = elements.measureLen; - if(strlen((*oneTable)->childTableName) == 0){ - RandTableName rName = { (*oneTable)->tags, (*oneTable)->sTableName, (uint8_t)(*oneTable)->sTableNameLen, - (*oneTable)->childTableName, 0 }; + if (strlen((*oneTable)->childTableName) == 0) { + RandTableName rName = {(*oneTable)->tags, (*oneTable)->sTableName, (uint8_t)(*oneTable)->sTableNameLen, + (*oneTable)->childTableName, 0}; buildChildTableName(&rName); (*oneTable)->uid = rName.uid; - }else{ - (*oneTable)->uid = *(uint64_t*)((*oneTable)->childTableName); + } else { + (*oneTable)->uid = *(uint64_t *)((*oneTable)->childTableName); } - } - SSmlSTableMeta** tableMeta = (SSmlSTableMeta**)taosHashGet(info->superTables, elements.measure, elements.measureLen); - if(tableMeta){ // update meta + SSmlSTableMeta **tableMeta = (SSmlSTableMeta **)taosHashGet(info->superTables, elements.measure, elements.measureLen); + if (tableMeta) { // update meta ret = smlUpdateMeta((*tableMeta)->colHash, (*tableMeta)->cols, cols, &info->msgBuf); - if(!hasTable && ret){ + if (!hasTable && ret) { ret = smlUpdateMeta((*tableMeta)->tagHash, (*tableMeta)->tags, (*oneTable)->tags, &info->msgBuf); } - if(!ret){ - uError("SML:0x%"PRIx64" smlUpdateMeta failed", info->id); + if (!ret) { + uError("SML:0x%" PRIx64 " smlUpdateMeta failed", info->id); return TSDB_CODE_SML_INVALID_DATA; } - }else{ + } else { SSmlSTableMeta *meta = smlBuildSTableMeta(); smlInsertMeta(meta->tagHash, meta->tags, (*oneTable)->tags); smlInsertMeta(meta->colHash, meta->cols, cols); taosHashPut(info->superTables, elements.measure, elements.measureLen, &meta, POINTER_BYTES); } - if(!info->dataFormat){ + if (!info->dataFormat) { taosArrayClear(info->colsContainer); } taosHashClear(info->dumplicateKey); return TSDB_CODE_SUCCESS; } -static int32_t smlParseTelnetLine(SSmlHandle* info, void *data) { - int ret = TSDB_CODE_SUCCESS; +static int32_t smlParseTelnetLine(SSmlHandle *info, void *data) { + int ret = TSDB_CODE_SUCCESS; SSmlTableInfo *tinfo = smlBuildTableInfo(); - if(!tinfo){ + if (!tinfo) { return TSDB_CODE_TSC_OUT_OF_MEMORY; } SArray *cols = taosArrayInit(16, POINTER_BYTES); if (cols == NULL) { - uError("SML:0x%"PRIx64" smlParseTelnetLine failed to allocate memory", info->id); + uError("SML:0x%" PRIx64 " smlParseTelnetLine failed to allocate memory", info->id); return TSDB_CODE_TSC_OUT_OF_MEMORY; } - if(info->protocol == TSDB_SML_TELNET_PROTOCOL){ - ret = smlParseTelnetString(info, (const char*)data, tinfo, cols); - }else if(info->protocol == TSDB_SML_JSON_PROTOCOL){ + if (info->protocol == TSDB_SML_TELNET_PROTOCOL) { + ret = smlParseTelnetString(info, (const char *)data, tinfo, cols); + } else if (info->protocol == TSDB_SML_JSON_PROTOCOL) { ret = smlParseJSONString(info, (cJSON *)data, tinfo, cols); - }else{ + } else { ASSERT(0); } - if(ret != TSDB_CODE_SUCCESS){ - uError("SML:0x%"PRIx64" smlParseTelnetLine failed", info->id); + if (ret != TSDB_CODE_SUCCESS) { + uError("SML:0x%" PRIx64 " smlParseTelnetLine failed", info->id); smlDestroyTableInfo(info, tinfo); smlDestroyCols(cols); taosArrayDestroy(cols); return ret; } - if(taosArrayGetSize(tinfo->tags) <= 0 || taosArrayGetSize(tinfo->tags) > TSDB_MAX_TAGS){ + if (taosArrayGetSize(tinfo->tags) <= 0 || taosArrayGetSize(tinfo->tags) > TSDB_MAX_TAGS) { smlBuildInvalidDataMsg(&info->msgBuf, "invalidate tags length:[1,128]", NULL); smlDestroyTableInfo(info, tinfo); smlDestroyCols(cols); @@ -2157,38 +2173,38 @@ static int32_t smlParseTelnetLine(SSmlHandle* info, void *data) { } taosHashClear(info->dumplicateKey); - if(strlen(tinfo->childTableName) == 0){ - RandTableName rName = { tinfo->tags, tinfo->sTableName, (uint8_t)tinfo->sTableNameLen, - tinfo->childTableName, 0 }; + if (strlen(tinfo->childTableName) == 0) { + RandTableName rName = {tinfo->tags, tinfo->sTableName, (uint8_t)tinfo->sTableNameLen, tinfo->childTableName, 0}; buildChildTableName(&rName); tinfo->uid = rName.uid; - }else{ - tinfo->uid = *(uint64_t*)(tinfo->childTableName); // generate uid by name simple + } else { + tinfo->uid = *(uint64_t *)(tinfo->childTableName); // generate uid by name simple } - - bool hasTable = true; - SSmlTableInfo **oneTable = (SSmlTableInfo **)taosHashGet(info->childTables, tinfo->childTableName, strlen(tinfo->childTableName)); - if(!oneTable) { + bool hasTable = true; + SSmlTableInfo **oneTable = + (SSmlTableInfo **)taosHashGet(info->childTables, tinfo->childTableName, strlen(tinfo->childTableName)); + if (!oneTable) { taosHashPut(info->childTables, tinfo->childTableName, strlen(tinfo->childTableName), &tinfo, POINTER_BYTES); oneTable = &tinfo; hasTable = false; - }else{ + } else { smlDestroyTableInfo(info, tinfo); } taosArrayPush((*oneTable)->cols, &cols); - SSmlSTableMeta** tableMeta = (SSmlSTableMeta** )taosHashGet(info->superTables, (*oneTable)->sTableName, (*oneTable)->sTableNameLen); - if(tableMeta){ // update meta + SSmlSTableMeta **tableMeta = + (SSmlSTableMeta **)taosHashGet(info->superTables, (*oneTable)->sTableName, (*oneTable)->sTableNameLen); + if (tableMeta) { // update meta ret = smlUpdateMeta((*tableMeta)->colHash, (*tableMeta)->cols, cols, &info->msgBuf); - if(!hasTable && ret){ + if (!hasTable && ret) { ret = smlUpdateMeta((*tableMeta)->tagHash, (*tableMeta)->tags, (*oneTable)->tags, &info->msgBuf); } - if(!ret){ - uError("SML:0x%"PRIx64" smlUpdateMeta failed", info->id); + if (!ret) { + uError("SML:0x%" PRIx64 " smlUpdateMeta failed", info->id); return TSDB_CODE_SML_INVALID_DATA; } - }else{ + } else { SSmlSTableMeta *meta = smlBuildSTableMeta(); smlInsertMeta(meta->tagHash, meta->tags, (*oneTable)->tags); smlInsertMeta(meta->colHash, meta->cols, cols); @@ -2198,27 +2214,27 @@ static int32_t smlParseTelnetLine(SSmlHandle* info, void *data) { return TSDB_CODE_SUCCESS; } -static int32_t smlParseJSON(SSmlHandle *info, char* payload) { +static int32_t smlParseJSON(SSmlHandle *info, char *payload) { int32_t payloadNum = 0; int32_t ret = TSDB_CODE_SUCCESS; if (payload == NULL) { - uError("SML:0x%"PRIx64" empty JSON Payload", info->id); + uError("SML:0x%" PRIx64 " empty JSON Payload", info->id); return TSDB_CODE_TSC_INVALID_JSON; } cJSON *root = cJSON_Parse(payload); if (root == NULL) { - uError("SML:0x%"PRIx64" parse json failed:%s", info->id, payload); + uError("SML:0x%" PRIx64 " parse json failed:%s", info->id, payload); return TSDB_CODE_TSC_INVALID_JSON; } - //multiple data points must be sent in JSON array + // multiple data points must be sent in JSON array if (cJSON_IsObject(root)) { payloadNum = 1; } else if (cJSON_IsArray(root)) { payloadNum = cJSON_GetArraySize(root); } else { - uError("SML:0x%"PRIx64" Invalid JSON Payload", info->id); + uError("SML:0x%" PRIx64 " Invalid JSON Payload", info->id); ret = TSDB_CODE_TSC_INVALID_JSON; goto end; } @@ -2226,8 +2242,8 @@ static int32_t smlParseJSON(SSmlHandle *info, char* payload) { for (int32_t i = 0; i < payloadNum; ++i) { cJSON *dataPoint = (payloadNum == 1 && cJSON_IsObject(root)) ? root : cJSON_GetArrayItem(root, i); ret = smlParseTelnetLine(info, dataPoint); - if(ret != TSDB_CODE_SUCCESS){ - uError("SML:0x%"PRIx64" Invalid JSON Payload", info->id); + if (ret != TSDB_CODE_SUCCESS) { + uError("SML:0x%" PRIx64 " Invalid JSON Payload", info->id); goto end; } } @@ -2237,12 +2253,12 @@ end: return ret; } -static int32_t smlInsertData(SSmlHandle* info) { +static int32_t smlInsertData(SSmlHandle *info) { int32_t code = TSDB_CODE_SUCCESS; - SSmlTableInfo** oneTable = (SSmlTableInfo**)taosHashIterate(info->childTables, NULL); + SSmlTableInfo **oneTable = (SSmlTableInfo **)taosHashIterate(info->childTables, NULL); while (oneTable) { - SSmlTableInfo* tableData = *oneTable; + SSmlTableInfo *tableData = *oneTable; SName pName = {TSDB_TABLE_NAME_T, info->taos->acctId, {0}, {0}}; strcpy(pName.dbname, info->pRequest->pDb); @@ -2253,56 +2269,59 @@ static int32_t smlInsertData(SSmlHandle* info) { conn.requestId = info->pRequest->requestId; conn.requestObjRefId = info->pRequest->self; conn.mgmtEps = getEpSet_s(&info->taos->pAppInfo->mgmtEp); - + SVgroupInfo vg; code = catalogGetTableHashVgroup(info->pCatalog, &conn, &pName, &vg); if (code != TSDB_CODE_SUCCESS) { - uError("SML:0x%"PRIx64" catalogGetTableHashVgroup failed. table name: %s", info->id, tableData->childTableName); + uError("SML:0x%" PRIx64 " catalogGetTableHashVgroup failed. table name: %s", info->id, tableData->childTableName); return code; } - taosHashPut(info->pVgHash, (const char*)&vg.vgId, sizeof(vg.vgId), (char*)&vg, sizeof(vg)); + taosHashPut(info->pVgHash, (const char *)&vg.vgId, sizeof(vg.vgId), (char *)&vg, sizeof(vg)); - SSmlSTableMeta** pMeta = (SSmlSTableMeta** )taosHashGet(info->superTables, tableData->sTableName, tableData->sTableNameLen); - ASSERT (NULL != pMeta && NULL != *pMeta); + SSmlSTableMeta **pMeta = + (SSmlSTableMeta **)taosHashGet(info->superTables, tableData->sTableName, tableData->sTableNameLen); + ASSERT(NULL != pMeta && NULL != *pMeta); // use tablemeta of stable to save vgid and uid of child table (*pMeta)->tableMeta->vgId = vg.vgId; - (*pMeta)->tableMeta->uid = tableData->uid; // one table merge data block together according uid + (*pMeta)->tableMeta->uid = tableData->uid; // one table merge data block together according uid code = smlBindData(info->exec, tableData->tags, (*pMeta)->cols, tableData->cols, info->dataFormat, (*pMeta)->tableMeta, tableData->childTableName, info->msgBuf.buf, info->msgBuf.len); - if(code != TSDB_CODE_SUCCESS){ - uError("SML:0x%"PRIx64" smlBindData failed", info->id); + if (code != TSDB_CODE_SUCCESS) { + uError("SML:0x%" PRIx64 " smlBindData failed", info->id); return code; } - oneTable = (SSmlTableInfo**)taosHashIterate(info->childTables, oneTable); + oneTable = (SSmlTableInfo **)taosHashIterate(info->childTables, oneTable); } code = smlBuildOutput(info->exec, info->pVgHash); if (code != TSDB_CODE_SUCCESS) { - uError("SML:0x%"PRIx64" smlBuildOutput failed", info->id); + uError("SML:0x%" PRIx64 " smlBuildOutput failed", info->id); return code; } info->cost.insertRpcTime = taosGetTimestampUs(); - //launchQueryImpl(info->pRequest, info->pQuery, false, NULL); -// info->affectedRows = taos_affected_rows(info->pRequest); -// return info->pRequest->code; + // launchQueryImpl(info->pRequest, info->pQuery, false, NULL); + // info->affectedRows = taos_affected_rows(info->pRequest); + // return info->pRequest->code; launchAsyncQuery(info->pRequest, info->pQuery); return TSDB_CODE_SUCCESS; } -static void smlPrintStatisticInfo(SSmlHandle *info){ - uError("SML:0x%"PRIx64" smlInsertLines result, code:%d,lineNum:%d,stable num:%d,ctable num:%d,create stable num:%d \ - parse cost:%"PRId64",schema cost:%"PRId64",bind cost:%"PRId64",rpc cost:%"PRId64",total cost:%"PRId64"", info->id, info->cost.code, - info->cost.lineNum, info->cost.numOfSTables, info->cost.numOfCTables, info->cost.numOfCreateSTables, - info->cost.schemaTime-info->cost.parseTime, info->cost.insertBindTime-info->cost.schemaTime, - info->cost.insertRpcTime-info->cost.insertBindTime, info->cost.endTime-info->cost.insertRpcTime, - info->cost.endTime-info->cost.parseTime); +static void smlPrintStatisticInfo(SSmlHandle *info) { + uError("SML:0x%" PRIx64 + " smlInsertLines result, code:%d,lineNum:%d,stable num:%d,ctable num:%d,create stable num:%d \ + parse cost:%" PRId64 ",schema cost:%" PRId64 ",bind cost:%" PRId64 ",rpc cost:%" PRId64 ",total cost:%" PRId64 + "", + info->id, info->cost.code, info->cost.lineNum, info->cost.numOfSTables, info->cost.numOfCTables, + info->cost.numOfCreateSTables, info->cost.schemaTime - info->cost.parseTime, + info->cost.insertBindTime - info->cost.schemaTime, info->cost.insertRpcTime - info->cost.insertBindTime, + info->cost.endTime - info->cost.insertRpcTime, info->cost.endTime - info->cost.parseTime); } -static int32_t smlParseLine(SSmlHandle *info, char* lines[], int numLines){ +static int32_t smlParseLine(SSmlHandle *info, char *lines[], int numLines) { int32_t code = TSDB_CODE_SUCCESS; if (info->protocol == TSDB_SML_JSON_PROTOCOL) { code = smlParseJSON(info, *lines); @@ -2314,11 +2333,11 @@ static int32_t smlParseLine(SSmlHandle *info, char* lines[], int numLines){ } for (int32_t i = 0; i < numLines; ++i) { - if(info->protocol == TSDB_SML_LINE_PROTOCOL){ + if (info->protocol == TSDB_SML_LINE_PROTOCOL) { code = smlParseInfluxLine(info, lines[i]); - }else if(info->protocol == TSDB_SML_TELNET_PROTOCOL){ + } else if (info->protocol == TSDB_SML_TELNET_PROTOCOL) { code = smlParseTelnetLine(info, lines[i]); - }else{ + } else { ASSERT(0); } if (code != TSDB_CODE_SUCCESS) { @@ -2329,7 +2348,7 @@ static int32_t smlParseLine(SSmlHandle *info, char* lines[], int numLines){ return code; } -static int smlProcess(SSmlHandle *info, char* lines[], int numLines) { +static int smlProcess(SSmlHandle *info, char *lines[], int numLines) { int32_t code = TSDB_CODE_SUCCESS; int32_t retryNum = 0; @@ -2337,7 +2356,7 @@ static int smlProcess(SSmlHandle *info, char* lines[], int numLines) { code = smlParseLine(info, lines, numLines); if (code != 0) { - uError("SML:0x%"PRIx64" smlParseLine error : %s", info->id, tstrerror(code)); + uError("SML:0x%" PRIx64 " smlParseLine error : %s", info->id, tstrerror(code)); return code; } @@ -2347,35 +2366,35 @@ static int smlProcess(SSmlHandle *info, char* lines[], int numLines) { info->cost.schemaTime = taosGetTimestampUs(); - do{ + do { code = smlModifyDBSchemas(info); if (code == 0) break; } while (retryNum++ < taosHashGetSize(info->superTables) * MAX_RETRY_TIMES); if (code != 0) { - uError("SML:0x%"PRIx64" smlModifyDBSchemas error : %s", info->id, tstrerror(code)); + uError("SML:0x%" PRIx64 " smlModifyDBSchemas error : %s", info->id, tstrerror(code)); return code; } info->cost.insertBindTime = taosGetTimestampUs(); code = smlInsertData(info); if (code != 0) { - uError("SML:0x%"PRIx64" smlInsertData error : %s", info->id, tstrerror(code)); + uError("SML:0x%" PRIx64 " smlInsertData error : %s", info->id, tstrerror(code)); return code; } return code; } -static int32_t isSchemalessDb(STscObj *taos, SRequestObj* request){ - SCatalog* catalog = NULL; - int32_t code = catalogGetHandle(((STscObj *)taos)->pAppInfo->clusterId, &catalog); - if(code != TSDB_CODE_SUCCESS){ +static int32_t isSchemalessDb(STscObj *taos, SRequestObj *request) { + SCatalog *catalog = NULL; + int32_t code = catalogGetHandle(((STscObj *)taos)->pAppInfo->clusterId, &catalog); + if (code != TSDB_CODE_SUCCESS) { uError("SML get catalog error %d", code); return code; } - SName name; + SName name; tNameSetDbName(&name, taos->acctId, taos->db, strlen(taos->db)); char dbFname[TSDB_DB_FNAME_LEN] = {0}; tNameGetFullDbName(&name, dbFname); @@ -2392,20 +2411,20 @@ static int32_t isSchemalessDb(STscObj *taos, SRequestObj* request){ return code; } taosArrayDestroy(pInfo.pRetensions); - - if (!pInfo.schemaless){ + + if (!pInfo.schemaless) { return TSDB_CODE_SML_INVALID_DB_CONF; } return TSDB_CODE_SUCCESS; } -static void smlInsertCallback(void* param, void* res, int32_t code) { +static void smlInsertCallback(void *param, void *res, int32_t code) { SRequestObj *pRequest = (SRequestObj *)res; - SSmlHandle* info = (SSmlHandle *)param; + SSmlHandle *info = (SSmlHandle *)param; - uDebug("SML:0x%"PRIx64" result. code:%d, msg:%s", info->id, pRequest->code, pRequest->msgBuf); + uDebug("SML:0x%" PRIx64 " result. code:%d, msg:%s", info->id, pRequest->code, pRequest->msgBuf); // lock - if(code != TSDB_CODE_SUCCESS){ + if (code != TSDB_CODE_SUCCESS) { taosThreadSpinLock(&info->params->lock); info->params->request->code = code; taosThreadSpinUnlock(&info->params->lock); @@ -2414,13 +2433,13 @@ static void smlInsertCallback(void* param, void* res, int32_t code) { printf("SML:0x%" PRIx64 " insert finished, code: %d, total: %d\n", info->id, code, info->affectedRows); Params *pParam = info->params; - bool isLast = info->isLast; + bool isLast = info->isLast; info->cost.endTime = taosGetTimestampUs(); info->cost.code = code; smlPrintStatisticInfo(info); smlDestroyInfo(info); - if(isLast){ + if (isLast) { tsem_post(&pParam->sem); } } @@ -2446,9 +2465,9 @@ static void smlInsertCallback(void* param, void* res, int32_t code) { * */ -TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int protocol, int precision) { - SRequestObj* request = (SRequestObj*)createRequest((STscObj *)taos, TSDB_SQL_INSERT); - if(!request){ +TAOS_RES *taos_schemaless_insert(TAOS *taos, char *lines[], int numLines, int protocol, int precision) { + SRequestObj *request = (SRequestObj *)createRequest((STscObj *)taos, TSDB_SQL_INSERT); + if (!request) { uError("SML:taos_schemaless_insert error request is null"); return NULL; } @@ -2456,19 +2475,19 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr ((STscObj *)taos)->schemalessType = 1; SSmlMsgBuf msg = {ERROR_MSG_BUF_DEFAULT_SIZE, request->msgBuf}; - int cnt = ceil(((double)numLines)/LINE_BATCH); + int cnt = ceil(((double)numLines) / LINE_BATCH); Params params; params.request = request; tsem_init(¶ms.sem, 0, 0); taosThreadSpinInit(&(params.lock), 0); - if(request->pDb == NULL){ + if (request->pDb == NULL) { request->code = TSDB_CODE_PAR_DB_NOT_SPECIFIED; smlBuildInvalidDataMsg(&msg, "Database not specified", NULL); goto end; } - if(isSchemalessDb(((STscObj *)taos), request) != TSDB_CODE_SUCCESS){ + if (isSchemalessDb(((STscObj *)taos), request) != TSDB_CODE_SUCCESS) { request->code = TSDB_CODE_SML_INVALID_DB_CONF; smlBuildInvalidDataMsg(&msg, "Cannot write data to a non schemaless database", NULL); goto end; @@ -2480,27 +2499,28 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr goto end; } - if(protocol < TSDB_SML_LINE_PROTOCOL || protocol > TSDB_SML_JSON_PROTOCOL){ + if (protocol < TSDB_SML_LINE_PROTOCOL || protocol > TSDB_SML_JSON_PROTOCOL) { request->code = TSDB_CODE_SML_INVALID_PROTOCOL_TYPE; smlBuildInvalidDataMsg(&msg, "protocol invalidate", NULL); goto end; } - if(protocol == TSDB_SML_LINE_PROTOCOL && (precision < TSDB_SML_TIMESTAMP_NOT_CONFIGURED || precision > TSDB_SML_TIMESTAMP_NANO_SECONDS)){ + if (protocol == TSDB_SML_LINE_PROTOCOL && + (precision < TSDB_SML_TIMESTAMP_NOT_CONFIGURED || precision > TSDB_SML_TIMESTAMP_NANO_SECONDS)) { request->code = TSDB_CODE_SML_INVALID_PRECISION_TYPE; smlBuildInvalidDataMsg(&msg, "precision invalidate for line protocol", NULL); goto end; } for (int i = 0; i < cnt; ++i) { - SRequestObj* req = (SRequestObj*)createRequest((STscObj *)taos, TSDB_SQL_INSERT); - if(!req){ + SRequestObj *req = (SRequestObj *)createRequest((STscObj *)taos, TSDB_SQL_INSERT); + if (!req) { request->code = TSDB_CODE_OUT_OF_MEMORY; uError("SML:taos_schemaless_insert error request is null"); goto end; } - SSmlHandle* info = smlBuildSmlInfo(taos, req, (SMLProtocolType)protocol, precision); - if(!info){ + SSmlHandle *info = smlBuildSmlInfo(taos, req, (SMLProtocolType)protocol, precision); + if (!info) { request->code = TSDB_CODE_OUT_OF_MEMORY; uError("SML:taos_schemaless_insert error SSmlHandle is null"); goto end; @@ -2508,10 +2528,10 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr int32_t perBatch = LINE_BATCH; - if(numLines > perBatch){ + if (numLines > perBatch) { numLines -= perBatch; info->isLast = false; - }else{ + } else { perBatch = numLines; numLines = 0; info->isLast = true; @@ -2520,10 +2540,10 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr info->params = ¶ms; info->affectedRows = perBatch; info->pRequest->body.queryFp = smlInsertCallback; - info->pRequest->body.param = info; + info->pRequest->body.param = info; int32_t code = smlProcess(info, lines, perBatch); lines += perBatch; - if (code != TSDB_CODE_SUCCESS){ + if (code != TSDB_CODE_SUCCESS) { info->pRequest->body.queryFp(info, req, code); } } @@ -2532,9 +2552,8 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr end: taosThreadSpinDestroy(¶ms.lock); tsem_destroy(¶ms.sem); -// ((STscObj *)taos)->schemalessType = 0; + // ((STscObj *)taos)->schemalessType = 0; ((STscObj *)taos)->schemalessType = 1; uDebug("resultend:%s", request->msgBuf); - return (TAOS_RES*)request; + return (TAOS_RES *)request; } - diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index d16ab57ea9272ea8fb748672a1b6beb94fd96e28..2ba225378083fb26c1124ce15da334818fcd2228 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -692,6 +692,7 @@ int32_t tDeserializeSMAlterStbReq(void *buf, int32_t bufLen, SMAlterStbReq *pReq void tFreeSMAltertbReq(SMAlterStbReq *pReq) { taosArrayDestroy(pReq->pFields); pReq->pFields = NULL; + taosMemoryFreeClear(pReq->comment); } int32_t tSerializeSEpSet(void *buf, int32_t bufLen, const SEpSet *pEpset) { @@ -3506,6 +3507,33 @@ int32_t tDeserializeSDCreateMnodeReq(void *buf, int32_t bufLen, SDCreateMnodeReq return 0; } +int32_t tSerializeSSetStandbyReq(void *buf, int32_t bufLen, SSetStandbyReq *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->standby) < 0) return -1; + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSSetStandbyReq(void *buf, int32_t bufLen, SSetStandbyReq *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->standby) < 0) return -1; + tEndDecode(&decoder); + + tDecoderClear(&decoder); + return 0; +} + int32_t tSerializeSAuthReq(void *buf, int32_t bufLen, SAuthReq *pReq) { SEncoder encoder = {0}; tEncoderInit(&encoder, buf, bufLen); @@ -4064,6 +4092,7 @@ int32_t tSerializeSCMCreateStreamReq(void *buf, int32_t bufLen, const SCMCreateS if (tEncodeI32(&encoder, sqlLen) < 0) return -1; if (tEncodeI32(&encoder, astLen) < 0) return -1; if (tEncodeI8(&encoder, pReq->triggerType) < 0) return -1; + if (tEncodeI64(&encoder, pReq->maxDelay) < 0) return -1; if (tEncodeI64(&encoder, pReq->watermark) < 0) return -1; if (sqlLen > 0 && tEncodeCStr(&encoder, pReq->sql) < 0) return -1; if (astLen > 0 && tEncodeCStr(&encoder, pReq->ast) < 0) return -1; @@ -4090,6 +4119,7 @@ int32_t tDeserializeSCMCreateStreamReq(void *buf, int32_t bufLen, SCMCreateStrea if (tDecodeI32(&decoder, &sqlLen) < 0) return -1; if (tDecodeI32(&decoder, &astLen) < 0) return -1; if (tDecodeI8(&decoder, &pReq->triggerType) < 0) return -1; + if (tDecodeI64(&decoder, &pReq->maxDelay) < 0) return -1; if (tDecodeI64(&decoder, &pReq->watermark) < 0) return -1; if (sqlLen > 0) { diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c index 2589bbd690788e41628b432fa1737c840438af2e..c47988e1ef6a1ba98755af7ace3f8c13a8ba13fc 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c @@ -155,6 +155,7 @@ SArray *mmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_MND_CREATE_MNODE, mmPutNodeMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_ALTER_MNODE, mmPutNodeMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_ALTER_MNODE_RSP, mmPutNodeMsgToWriteQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_MND_SET_STANDBY_RSP, mmPutNodeMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_DROP_MNODE, mmPutNodeMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_CREATE_QNODE, mmPutNodeMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_DROP_QNODE, mmPutNodeMsgToWriteQueue, 0) == NULL) goto _OVER; @@ -235,6 +236,7 @@ SArray *mmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_SYNC_APPEND_ENTRIES_REPLY, mmPutNodeMsgToSyncQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_SNAPSHOT_SEND, mmPutNodeMsgToSyncQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_SNAPSHOT_RSP, mmPutNodeMsgToSyncQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_MND_SET_STANDBY, mmPutNodeMsgToSyncQueue, 0) == NULL) goto _OVER; code = 0; diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c index d8a61461dd2b1d4b0ada94b73bb54d48af3b450c..7a73d3c36071316355d350e131f678d9bd656853 100644 --- a/source/dnode/mnode/impl/src/mndMain.c +++ b/source/dnode/mnode/impl/src/mndMain.c @@ -428,7 +428,6 @@ int32_t mndProcessSyncMsg(SRpcMsg *pMsg) { SyncClientRequest *pSyncMsg = syncClientRequestFromRpcMsg2(pMsg); code = syncNodeOnClientRequestCb(pSyncNode, pSyncMsg); syncClientRequestDestroy(pSyncMsg); - } else if (pMsg->msgType == TDMT_SYNC_REQUEST_VOTE) { SyncRequestVote *pSyncMsg = syncRequestVoteFromRpcMsg2(pMsg); code = syncNodeOnRequestVoteSnapshotCb(pSyncNode, pSyncMsg); @@ -445,7 +444,6 @@ int32_t mndProcessSyncMsg(SRpcMsg *pMsg) { SyncAppendEntriesReply *pSyncMsg = syncAppendEntriesReplyFromRpcMsg2(pMsg); code = syncNodeOnAppendEntriesReplySnapshotCb(pSyncNode, pSyncMsg); syncAppendEntriesReplyDestroy(pSyncMsg); - } else if (pMsg->msgType == TDMT_SYNC_SNAPSHOT_SEND) { SyncSnapshotSend *pSyncMsg = syncSnapshotSendFromRpcMsg2(pMsg); code = syncNodeOnSnapshotSendCb(pSyncNode, pSyncMsg); @@ -454,12 +452,14 @@ int32_t mndProcessSyncMsg(SRpcMsg *pMsg) { SyncSnapshotRsp *pSyncMsg = syncSnapshotRspFromRpcMsg2(pMsg); code = syncNodeOnSnapshotRspCb(pSyncNode, pSyncMsg); syncSnapshotRspDestroy(pSyncMsg); - + } else if (pMsg->msgType == TDMT_MND_SET_STANDBY) { + code = syncSetStandby(pMgmt->sync); + SRpcMsg rsp = {.code = code, .info = pMsg->info}; + tmsgSendRsp(&rsp); } else { mError("failed to process msg:%p since invalid type:%s", pMsg, TMSG_INFO(pMsg->msgType)); code = TAOS_SYNC_PROPOSE_OTHER_ERROR; } - } else { if (pMsg->msgType == TDMT_SYNC_TIMEOUT) { SyncTimeout *pSyncMsg = syncTimeoutFromRpcMsg2(pMsg); @@ -493,6 +493,10 @@ int32_t mndProcessSyncMsg(SRpcMsg *pMsg) { SyncAppendEntriesReply *pSyncMsg = syncAppendEntriesReplyFromRpcMsg2(pMsg); code = syncNodeOnAppendEntriesReplyCb(pSyncNode, pSyncMsg); syncAppendEntriesReplyDestroy(pSyncMsg); + } else if (pMsg->msgType == TDMT_MND_SET_STANDBY) { + code = syncSetStandby(pMgmt->sync); + SRpcMsg rsp = {.code = code, .info = pMsg->info}; + tmsgSendRsp(&rsp); } else { mError("failed to process msg:%p since invalid type:%s", pMsg, TMSG_INFO(pMsg->msgType)); code = TAOS_SYNC_PROPOSE_OTHER_ERROR; diff --git a/source/dnode/mnode/impl/src/mndMnode.c b/source/dnode/mnode/impl/src/mndMnode.c index c5a4282b3bdfcee8454bb341c9c4c7c99dfceb75..95a2c3d9352f90601c06888354d1e605d45f0f35 100644 --- a/source/dnode/mnode/impl/src/mndMnode.c +++ b/source/dnode/mnode/impl/src/mndMnode.c @@ -55,6 +55,7 @@ int32_t mndInitMnode(SMnode *pMnode) { mndSetMsgHandle(pMnode, TDMT_MND_ALTER_MNODE_RSP, mndTransProcessRsp); mndSetMsgHandle(pMnode, TDMT_MND_DROP_MNODE, mndProcessDropMnodeReq); mndSetMsgHandle(pMnode, TDMT_DND_DROP_MNODE_RSP, mndTransProcessRsp); + mndSetMsgHandle(pMnode, TDMT_MND_SET_STANDBY_RSP, mndTransProcessRsp); mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_MNODE, mndRetrieveMnodes); mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_MNODE, mndCancelGetNextMnode); @@ -460,6 +461,7 @@ static int32_t mndSetDropMnodeRedoActions(SMnode *pMnode, STrans *pTrans, SDnode int32_t numOfReplicas = 0; SDAlterMnodeReq alterReq = {0}; SDDropMnodeReq dropReq = {0}; + SSetStandbyReq standbyReq = {0}; SEpSet alterEpset = {0}; SEpSet dropEpSet = {0}; @@ -494,6 +496,31 @@ static int32_t mndSetDropMnodeRedoActions(SMnode *pMnode, STrans *pTrans, SDnode dropEpSet.eps[0].port = pDnode->port; memcpy(dropEpSet.eps[0].fqdn, pDnode->fqdn, TSDB_FQDN_LEN); + standbyReq.dnodeId = pDnode->id; + standbyReq.standby = 1; + + { + int32_t contLen = tSerializeSSetStandbyReq(NULL, 0, &standbyReq) + sizeof(SMsgHead); + void *pReq = taosMemoryMalloc(contLen); + tSerializeSSetStandbyReq((char*)pReq + sizeof(SMsgHead), contLen, &standbyReq); + SMsgHead *pHead = pReq; + pHead->contLen = htonl(contLen); + pHead->vgId = htonl(MNODE_HANDLE); + + STransAction action = { + .epSet = dropEpSet, + .pCont = pReq, + .contLen = contLen, + .msgType = TDMT_MND_SET_STANDBY, + .acceptableCode = TSDB_CODE_NODE_NOT_DEPLOYED, + }; + + if (mndTransAppendRedoAction(pTrans, &action) != 0) { + taosMemoryFree(pReq); + return -1; + } + } + { int32_t contLen = tSerializeSDCreateMnodeReq(NULL, 0, &alterReq); void *pReq = taosMemoryMalloc(contLen); diff --git a/source/dnode/mnode/impl/src/mndScheduler.c b/source/dnode/mnode/impl/src/mndScheduler.c index 2454a4686d68fe00de8e0062a25f4e49bffa815a..a3b7754a4edac3d6c1d9d122b2d4c794096cfddf 100644 --- a/source/dnode/mnode/impl/src/mndScheduler.c +++ b/source/dnode/mnode/impl/src/mndScheduler.c @@ -77,7 +77,7 @@ int32_t mndConvertRsmaTask(char** pDst, int32_t* pDstLen, const char* ast, int64 terrno = TSDB_CODE_QRY_INVALID_INPUT; goto END; } - SNodeListNode* inner = nodesListGetNode(pPlan->pSubplans, 0); + SNodeListNode* inner = (SNodeListNode*)nodesListGetNode(pPlan->pSubplans, 0); int32_t opNum = LIST_LENGTH(inner->pNodeList); if (opNum != 1) { @@ -85,7 +85,7 @@ int32_t mndConvertRsmaTask(char** pDst, int32_t* pDstLen, const char* ast, int64 goto END; } - SSubplan* plan = nodesListGetNode(inner->pNodeList, 0); + SSubplan* plan = (SSubplan*)nodesListGetNode(inner->pNodeList, 0); if (qSubPlanToString(plan, pDst, pDstLen) < 0) { terrno = TSDB_CODE_QRY_INVALID_INPUT; goto END; @@ -93,7 +93,7 @@ int32_t mndConvertRsmaTask(char** pDst, int32_t* pDstLen, const char* ast, int64 END: if (pAst) nodesDestroyNode(pAst); - if (pPlan) nodesDestroyNode(pPlan); + if (pPlan) nodesDestroyNode((SNode*)pPlan); return terrno; } @@ -378,8 +378,8 @@ int32_t mndScheduleStream(SMnode* pMnode, STrans* pTrans, SStreamObj* pStream) { SArray* taskInnerLevel = taosArrayInit(0, sizeof(void*)); taosArrayPush(pStream->tasks, &taskInnerLevel); - SNodeListNode* inner = nodesListGetNode(pPlan->pSubplans, 0); - SSubplan* plan = nodesListGetNode(inner->pNodeList, 0); + SNodeListNode* inner = (SNodeListNode*)nodesListGetNode(pPlan->pSubplans, 0); + SSubplan* plan = (SSubplan*)nodesListGetNode(inner->pNodeList, 0); ASSERT(plan->subplanType == SUBPLAN_TYPE_MERGE); pFinalTask = tNewSStreamTask(pStream->uid); @@ -407,8 +407,8 @@ int32_t mndScheduleStream(SMnode* pMnode, STrans* pTrans, SStreamObj* pStream) { SArray* taskSourceLevel = taosArrayInit(0, sizeof(void*)); taosArrayPush(pStream->tasks, &taskSourceLevel); - SNodeListNode* inner = nodesListGetNode(pPlan->pSubplans, 1); - SSubplan* plan = nodesListGetNode(inner->pNodeList, 0); + SNodeListNode* inner = (SNodeListNode*)nodesListGetNode(pPlan->pSubplans, 1); + SSubplan* plan = (SSubplan*)nodesListGetNode(inner->pNodeList, 0); ASSERT(plan->subplanType == SUBPLAN_TYPE_SCAN); void* pIter = NULL; @@ -449,9 +449,9 @@ int32_t mndScheduleStream(SMnode* pMnode, STrans* pTrans, SStreamObj* pStream) { SArray* taskOneLevel = taosArrayInit(0, sizeof(void*)); taosArrayPush(pStream->tasks, &taskOneLevel); - SNodeListNode* inner = nodesListGetNode(pPlan->pSubplans, 0); + SNodeListNode* inner = (SNodeListNode*)nodesListGetNode(pPlan->pSubplans, 0); ASSERT(LIST_LENGTH(inner->pNodeList) == 1); - SSubplan* plan = nodesListGetNode(inner->pNodeList, 0); + SSubplan* plan = (SSubplan*)nodesListGetNode(inner->pNodeList, 0); ASSERT(plan->subplanType == SUBPLAN_TYPE_SCAN); void* pIter = NULL; @@ -509,7 +509,7 @@ int32_t mndSchedInitSubEp(SMnode* pMnode, const SMqTopicObj* pTopic, SMqSubscrib return -1; } - SNodeListNode* inner = nodesListGetNode(pPlan->pSubplans, 0); + SNodeListNode* inner = (SNodeListNode*)nodesListGetNode(pPlan->pSubplans, 0); int32_t opNum = LIST_LENGTH(inner->pNodeList); if (opNum != 1) { @@ -517,7 +517,7 @@ int32_t mndSchedInitSubEp(SMnode* pMnode, const SMqTopicObj* pTopic, SMqSubscrib terrno = TSDB_CODE_MND_INVALID_TOPIC_QUERY; return -1; } - plan = nodesListGetNode(inner->pNodeList, 0); + plan = (SSubplan*)nodesListGetNode(inner->pNodeList, 0); } ASSERT(pSub->unassignedVgs); diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c index a331534a9343a66bf43b22487f60ddbae224786c..96d199fcb6e6a79b61f58ce1e96f7c2e2aea2ea8 100644 --- a/source/dnode/mnode/impl/src/mndStream.c +++ b/source/dnode/mnode/impl/src/mndStream.c @@ -235,10 +235,10 @@ static int32_t mndStreamGetPlanString(const char *ast, int8_t triggerType, int64 } if (TSDB_CODE_SUCCESS == code) { - code = nodesNodeToString(pPlan, false, pStr, NULL); + code = nodesNodeToString((SNode*)pPlan, false, pStr, NULL); } nodesDestroyNode(pAst); - nodesDestroyNode(pPlan); + nodesDestroyNode((SNode*)pPlan); terrno = code; return code; } diff --git a/source/dnode/mnode/impl/src/mndTopic.c b/source/dnode/mnode/impl/src/mndTopic.c index c8333c32f08e179d77207a8d337ad3849a383b41..3247008d584546f123a1a9c91f53782ddb8d5e28 100644 --- a/source/dnode/mnode/impl/src/mndTopic.c +++ b/source/dnode/mnode/impl/src/mndTopic.c @@ -387,7 +387,7 @@ static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq * return -1; } - if (nodesNodeToString(pPlan, false, &topicObj.physicalPlan, NULL) != 0) { + if (nodesNodeToString((SNode*)pPlan, false, &topicObj.physicalPlan, NULL) != 0) { mError("topic:%s, failed to create since %s", pCreate->name, terrstr()); taosMemoryFree(topicObj.ast); taosMemoryFree(topicObj.sql); diff --git a/source/libs/command/src/explain.c b/source/libs/command/src/explain.c index 960f8dc9ac89166311798bcbbf772bf9a9f38016..79861dfa05549a2f5faaa903b7d01bedfe73cd43 100644 --- a/source/libs/command/src/explain.c +++ b/source/libs/command/src/explain.c @@ -211,7 +211,7 @@ int32_t qExplainGenerateResChildren(SPhysiNode *pNode, SExplainGroup *group, SNo SExplainResNode *pResNode = NULL; FOREACH(node, pPhysiChildren) { QRY_ERR_RET(qExplainGenerateResNode((SPhysiNode *)node, group, &pResNode)); - QRY_ERR_RET(nodesListAppend(*pChildren, pResNode)); + QRY_ERR_RET(nodesListAppend(*pChildren, (SNode*)pResNode)); } return TSDB_CODE_SUCCESS; @@ -715,7 +715,7 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, i EXPLAIN_ROW_NEW(level + 1, "Sort Key: "); if (pResNode->pExecInfo) { for (int32_t i = 0; i < LIST_LENGTH(pSortNode->pSortKeys); ++i) { - SOrderByExprNode *ptn = nodesListGetNode(pSortNode->pSortKeys, i); + SOrderByExprNode *ptn = (SOrderByExprNode*)nodesListGetNode(pSortNode->pSortKeys, i); EXPLAIN_ROW_APPEND("%s ", nodesGetNameFromColumnNode(ptn->pExpr)); } } @@ -1039,7 +1039,7 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, i EXPLAIN_ROW_NEW(level + 1, "Merge Key: "); if (pResNode->pExecInfo) { for (int32_t i = 0; i < LIST_LENGTH(pMergeNode->pMergeKeys); ++i) { - SOrderByExprNode *ptn = nodesListGetNode(pMergeNode->pMergeKeys, i); + SOrderByExprNode *ptn = (SOrderByExprNode*)nodesListGetNode(pMergeNode->pMergeKeys, i); EXPLAIN_ROW_APPEND("%s ", nodesGetNameFromColumnNode(ptn->pExpr)); } } @@ -1078,7 +1078,7 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, i EXPLAIN_ROW_NEW(level + 1, EXPLAIN_MERGE_KEYS_FORMAT); for (int32_t i = 0; i < LIST_LENGTH(pMergeNode->pMergeKeys); ++i) { - SOrderByExprNode *ptn = nodesListGetNode(pMergeNode->pMergeKeys, i); + SOrderByExprNode *ptn = (SOrderByExprNode*)nodesListGetNode(pMergeNode->pMergeKeys, i); EXPLAIN_ROW_APPEND("%s ", nodesGetNameFromColumnNode(ptn->pExpr)); } EXPLAIN_ROW_END(); diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 789fe9929ba27e7e71f10fc21d8188f6813cd8d9..474b700868ff0a4333b834edc4ac53cfbbe71bc2 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -202,7 +202,7 @@ SSDataBlock* createResDataBlock(SDataBlockDescNode* pNode) { for (int32_t i = 0; i < numOfCols; ++i) { SColumnInfoData idata = {{0}}; - SSlotDescNode* pDescNode = nodesListGetNode(pNode->pSlots, i); + SSlotDescNode* pDescNode = (SSlotDescNode*)nodesListGetNode(pNode->pSlots, i); // if (!pDescNode->output) { // todo disable it temporarily // continue; // } @@ -2920,7 +2920,7 @@ static int32_t initExchangeOperator(SExchangePhysiNode* pExNode, SExchangeInfo* } for (int32_t i = 0; i < numOfSources; ++i) { - SNodeListNode* pNode = nodesListGetNode((SNodeList*)pExNode->pSrcEndPoints, i); + SNodeListNode* pNode = (SNodeListNode*)nodesListGetNode((SNodeList*)pExNode->pSrcEndPoints, i); taosArrayPush(pInfo->pSources, pNode); } @@ -4494,7 +4494,7 @@ SExprInfo* createExprInfo(SNodeList* pNodeList, SNodeList* pGroupKeys, int32_t* if (NULL == res) { // todo handle error } else { res->node.resType = (SDataType){.bytes = sizeof(int64_t), .type = TSDB_DATA_TYPE_BIGINT}; - nodesListAppend(pFuncNode->pParameterList, res); + nodesListAppend(pFuncNode->pParameterList, (SNode*)res); } } #endif diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index 9a7045110ca0926f9a246d6cb96bccd2a9b82e52..01514740080655f0ba50ec396c3e476538ef0d79 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -1378,7 +1378,7 @@ void destroyStreamFinalIntervalOperatorInfo(void* param, int32_t numOfOutput) { taosMemoryFreeClear(pChildOp); } } - nodesDestroyNode(pInfo->pPhyNode); + nodesDestroyNode((SNode*)pInfo->pPhyNode); } static bool allInvertible(SqlFunctionCtx* pFCtx, int32_t numOfCols) { @@ -2157,7 +2157,7 @@ SOperatorInfo* createStreamFinalIntervalOperatorInfo(SOperatorInfo* downstream, pInfo->pUpdateRes = createResDataBlock(pPhyNode->pOutputDataBlockDesc); pInfo->pUpdateRes->info.type = STREAM_REPROCESS; blockDataEnsureCapacity(pInfo->pUpdateRes, 128); - pInfo->pPhyNode = nodesCloneNode(pPhyNode); + pInfo->pPhyNode = (SPhysiNode*)nodesCloneNode((SNode*)pPhyNode); pOperator->name = "StreamFinalIntervalOperator"; pOperator->operatorType = QUERY_NODE_PHYSICAL_PLAN_STREAM_FINAL_INTERVAL; diff --git a/source/libs/function/inc/functionMgtInt.h b/source/libs/function/inc/functionMgtInt.h index d1af6b605187e0e761c59293e4090408a0ca19a4..6fefcceb872d5da35ce94d6fe55fed8cec0f68bd 100644 --- a/source/libs/function/inc/functionMgtInt.h +++ b/source/libs/function/inc/functionMgtInt.h @@ -42,6 +42,7 @@ extern "C" { #define FUNC_MGT_SELECT_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(13) #define FUNC_MGT_REPEAT_SCAN_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(14) #define FUNC_MGT_FORBID_FILL_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(15) +#define FUNC_MGT_FORBID_STREAM_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(16) #define FUNC_MGT_TEST_MASK(val, mask) (((val) & (mask)) != 0) diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index 3bfb60ec7c0ac36a2bc2bcbbf52372dfcf914849..0a6d99c52d4672b6aefc115e0bb85c0ddc882f3e 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -1309,7 +1309,7 @@ void static addTimezoneParam(SNodeList* pList) { varDataSetLen(pVal->datum.p, len); strncpy(varDataVal(pVal->datum.p), pVal->literal, len); - nodesListAppend(pList, pVal); + nodesListAppend(pList, (SNode*)pVal); } static int32_t translateToIso8601(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { @@ -1398,7 +1398,7 @@ static int32_t translateToJson(SFunctionNode* pFunc, char* pErrBuf, int32_t len) return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); } - SExprNode* pPara = nodesListGetNode(pFunc->pParameterList, 0); + SExprNode* pPara = (SExprNode*)nodesListGetNode(pFunc->pParameterList, 0); if (QUERY_NODE_VALUE != nodeType(pPara) || (!IS_VAR_DATA_TYPE(pPara->resType.type))) { return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); } @@ -1691,8 +1691,8 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .finalizeFunc = elapsedFinalize, .invertFunc = NULL, .combineFunc = elapsedCombine, - .pPartialFunc = "_elapsed_partial", - .pMergeFunc = "_elapsed_merge" + //.pPartialFunc = "_elapsed_partial", + //.pMergeFunc = "_elapsed_merge" }, { .name = "_elapsed_partial", diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index 032333228ae313e96f156a7be9dbc97c53fbab00..f2c5df8fc299ff6fe4f29c2f2e2d0efaafa9789f 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -14,7 +14,6 @@ */ #include "builtinsimpl.h" -#include "tglobal.h" #include "cJSON.h" #include "function.h" #include "querynodes.h" @@ -22,23 +21,23 @@ #include "tcompare.h" #include "tdatablock.h" #include "tdigest.h" +#include "tglobal.h" #include "thistogram.h" #include "tpercentile.h" -#define HISTOGRAM_MAX_BINS_NUM 1000 -#define MAVG_MAX_POINTS_NUM 1000 -#define SAMPLE_MAX_POINTS_NUM 1000 -#define TAIL_MAX_POINTS_NUM 100 -#define TAIL_MAX_OFFSET 100 - -#define UNIQUE_MAX_RESULT_SIZE (1024*1024*10) +#define HISTOGRAM_MAX_BINS_NUM 1000 +#define MAVG_MAX_POINTS_NUM 1000 +#define SAMPLE_MAX_POINTS_NUM 1000 +#define TAIL_MAX_POINTS_NUM 100 +#define TAIL_MAX_OFFSET 100 -#define HLL_BUCKET_BITS 14 // The bits of the bucket -#define HLL_DATA_BITS (64-HLL_BUCKET_BITS) -#define HLL_BUCKETS (1<initialized) { @@ -335,15 +321,14 @@ int32_t functionFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { int32_t firstCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { SResultRowEntryInfo* pDResInfo = GET_RES_INFO(pDestCtx); - char* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); - int32_t type = pDestCtx->input.pData[0]->info.type; - int32_t bytes = pDestCtx->input.pData[0]->info.bytes; + char* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); + int32_t type = pDestCtx->input.pData[0]->info.type; + int32_t bytes = pDestCtx->input.pData[0]->info.bytes; SResultRowEntryInfo* pSResInfo = GET_RES_INFO(pSourceCtx); - char* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); + char* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); - if (pSResInfo->numOfRes != 0 && - (pDResInfo->numOfRes == 0 || *(TSKEY*)(pDBuf + bytes) > *(TSKEY*)(pSBuf + bytes)) ) { + if (pSResInfo->numOfRes != 0 && (pDResInfo->numOfRes == 0 || *(TSKEY*)(pDBuf + bytes) > *(TSKEY*)(pSBuf + bytes))) { memcpy(pDBuf, pSBuf, bytes); *(TSKEY*)(pDBuf + bytes) = *(TSKEY*)(pSBuf + bytes); pDResInfo->numOfRes = 1; @@ -415,14 +400,14 @@ static FORCE_INLINE int32_t getNumOfElems(SqlFunctionCtx* pCtx) { int32_t countFunction(SqlFunctionCtx* pCtx) { int32_t numOfElem = getNumOfElems(pCtx); - SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); + SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); SInputColumnInfoData* pInput = &pCtx->input; int32_t type = pInput->pData[0]->info.type; char* buf = GET_ROWCELL_INTERBUF(pResInfo); if (IS_NULL_TYPE(type)) { - //select count(NULL) returns 0 + // select count(NULL) returns 0 numOfElem = 1; *((int64_t*)buf) = 0; } else { @@ -451,7 +436,7 @@ int32_t countInvertFunction(SqlFunctionCtx* pCtx) { int32_t combineFunction(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { SResultRowEntryInfo* pDResInfo = GET_RES_INFO(pDestCtx); - char* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); + char* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); SResultRowEntryInfo* pSResInfo = GET_RES_INFO(pSourceCtx); char* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); @@ -490,8 +475,8 @@ int32_t sumFunction(SqlFunctionCtx* pCtx) { // Only the pre-computing information loaded and actual data does not loaded SInputColumnInfoData* pInput = &pCtx->input; - SColumnDataAgg* pAgg = pInput->pColumnDataAgg[0]; - int32_t type = pInput->pData[0]->info.type; + SColumnDataAgg* pAgg = pInput->pColumnDataAgg[0]; + int32_t type = pInput->pData[0]->info.type; SSumRes* pSumRes = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); @@ -545,7 +530,7 @@ int32_t sumFunction(SqlFunctionCtx* pCtx) { } } - //check for overflow + // check for overflow if (IS_FLOAT_TYPE(type) && (isinf(pSumRes->dsum) || isnan(pSumRes->dsum))) { GET_RES_INFO(pCtx)->isNullRes = 1; } @@ -617,11 +602,11 @@ int32_t sumInvertFunction(SqlFunctionCtx* pCtx) { int32_t sumCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { SResultRowEntryInfo* pDResInfo = GET_RES_INFO(pDestCtx); - SSumRes* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); - int32_t type = pDestCtx->input.pData[0]->info.type; + SSumRes* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); + int32_t type = pDestCtx->input.pData[0]->info.type; SResultRowEntryInfo* pSResInfo = GET_RES_INFO(pSourceCtx); - SSumRes* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); + SSumRes* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); if (IS_SIGNED_NUMERIC_TYPE(type) || type == TSDB_DATA_TYPE_BOOL) { pDBuf->isum += pSBuf->isum; @@ -772,18 +757,18 @@ _avg_over: return TSDB_CODE_SUCCESS; } -#define LIST_AVG_N(sumT, T) \ - do { \ - T* plist = (T*)pCol->pData; \ - for (int32_t i = start; i < numOfRows + pInput->startRowIndex; ++i) { \ - if (pCol->hasNull && colDataIsNull_f(pCol->nullbitmap, i)) { \ - continue; \ - } \ - \ - numOfElem += 1; \ - pAvgRes->count -= 1; \ - sumT -= plist[i]; \ - } \ +#define LIST_AVG_N(sumT, T) \ + do { \ + T* plist = (T*)pCol->pData; \ + for (int32_t i = start; i < numOfRows + pInput->startRowIndex; ++i) { \ + if (pCol->hasNull && colDataIsNull_f(pCol->nullbitmap, i)) { \ + continue; \ + } \ + \ + numOfElem += 1; \ + pAvgRes->count -= 1; \ + sumT -= plist[i]; \ + } \ } while (0) int32_t avgInvertFunction(SqlFunctionCtx* pCtx) { @@ -837,11 +822,11 @@ int32_t avgInvertFunction(SqlFunctionCtx* pCtx) { int32_t avgCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { SResultRowEntryInfo* pDResInfo = GET_RES_INFO(pDestCtx); - SAvgRes* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); - int32_t type = pDestCtx->input.pData[0]->info.type; + SAvgRes* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); + int32_t type = pDestCtx->input.pData[0]->info.type; SResultRowEntryInfo* pSResInfo = GET_RES_INFO(pSourceCtx); - SAvgRes* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); + SAvgRes* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); if (IS_INTEGER_TYPE(type)) { pDBuf->sum.isum += pSBuf->sum.isum; @@ -856,7 +841,7 @@ int32_t avgCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { int32_t avgFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { SInputColumnInfoData* pInput = &pCtx->input; - int32_t type = pInput->pData[0]->info.type; + int32_t type = pInput->pData[0]->info.type; SAvgRes* pAvgRes = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); if (IS_INTEGER_TYPE(type)) { @@ -865,7 +850,7 @@ int32_t avgFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { pAvgRes->result = pAvgRes->sum.dsum / ((double)pAvgRes->count); } - //check for overflow + // check for overflow if (isinf(pAvgRes->result) || isnan(pAvgRes->result)) { GET_RES_INFO(pCtx)->isNullRes = 1; } @@ -878,7 +863,7 @@ EFuncDataRequired statisDataRequired(SFunctionNode* pFunc, STimeWindow* pTimeWin } typedef struct SMinmaxResInfo { - bool assign; // assign the first value or not + bool assign; // assign the first value or not int64_t v; STuplePos tuplePos; } SMinmaxResInfo; @@ -912,7 +897,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) { int32_t type = pCol->info.type; SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); - SMinmaxResInfo *pBuf = GET_ROWCELL_INTERBUF(pResInfo); + SMinmaxResInfo* pBuf = GET_ROWCELL_INTERBUF(pResInfo); if (IS_NULL_TYPE(type)) { GET_RES_INFO(pCtx)->isNullRes = 1; @@ -1288,7 +1273,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) { numOfElems += 1; } } else if (type == TSDB_DATA_TYPE_FLOAT) { - float* pData = (float*)pCol->pData; + float* pData = (float*)pCol->pData; double* val = (double*)&pBuf->v; for (int32_t i = start; i < start + numOfRows; ++i) { @@ -1336,7 +1321,8 @@ int32_t maxFunction(SqlFunctionCtx* pCtx) { return TSDB_CODE_SUCCESS; } -static void setSelectivityValue(SqlFunctionCtx* pCtx, SSDataBlock* pBlock, const STuplePos *pTuplePos, int32_t rowIndex); +static void setSelectivityValue(SqlFunctionCtx* pCtx, SSDataBlock* pBlock, const STuplePos* pTuplePos, + int32_t rowIndex); int32_t minmaxFunctionFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { SResultRowEntryInfo* pEntryInfo = GET_RES_INFO(pCtx); @@ -1350,7 +1336,7 @@ int32_t minmaxFunctionFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { pEntryInfo->isNullRes = (pEntryInfo->numOfRes == 0); if (pCol->info.type == TSDB_DATA_TYPE_FLOAT) { - float v = *(double*) &pRes->v; + float v = *(double*)&pRes->v; colDataAppend(pCol, currentRow, (const char*)&v, pEntryInfo->isNullRes); } else { colDataAppend(pCol, currentRow, (const char*)&pRes->v, pEntryInfo->isNullRes); @@ -1363,7 +1349,7 @@ int32_t minmaxFunctionFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { return pEntryInfo->numOfRes; } -void setSelectivityValue(SqlFunctionCtx* pCtx, SSDataBlock* pBlock, const STuplePos *pTuplePos, int32_t rowIndex) { +void setSelectivityValue(SqlFunctionCtx* pCtx, SSDataBlock* pBlock, const STuplePos* pTuplePos, int32_t rowIndex) { int32_t pageId = pTuplePos->pageId; int32_t offset = pTuplePos->offset; if (pTuplePos->pageId != -1) { @@ -1398,7 +1384,7 @@ void setSelectivityValue(SqlFunctionCtx* pCtx, SSDataBlock* pBlock, const STuple void releaseSource(STuplePos* pPos) { if (pPos->pageId == -1) { - return ; + return; } // Todo(liuyao) relase row } @@ -1411,18 +1397,17 @@ void replaceTupleData(STuplePos* pDestPos, STuplePos* pSourcePos) { int32_t minMaxCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx, int32_t isMinFunc) { SResultRowEntryInfo* pDResInfo = GET_RES_INFO(pDestCtx); SMinmaxResInfo* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); - int32_t type = pDestCtx->input.pData[0]->info.type; + int32_t type = pDestCtx->input.pData[0]->info.type; SResultRowEntryInfo* pSResInfo = GET_RES_INFO(pSourceCtx); SMinmaxResInfo* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); if (IS_FLOAT_TYPE(type)) { - if (pSBuf->assign && - ( (((*(double*)&pDBuf->v) < (*(double*)&pSBuf->v)) ^ isMinFunc) || !pDBuf->assign ) ) { - *(double*) &pDBuf->v = *(double*) &pSBuf->v; + if (pSBuf->assign && ((((*(double*)&pDBuf->v) < (*(double*)&pSBuf->v)) ^ isMinFunc) || !pDBuf->assign)) { + *(double*)&pDBuf->v = *(double*)&pSBuf->v; replaceTupleData(&pDBuf->tuplePos, &pSBuf->tuplePos); } } else { - if ( pSBuf->assign && ( ((pDBuf->v < pSBuf->v) ^ isMinFunc) || !pDBuf->assign ) ) { + if (pSBuf->assign && (((pDBuf->v < pSBuf->v) ^ isMinFunc) || !pDBuf->assign)) { pDBuf->v = pSBuf->v; replaceTupleData(&pDBuf->tuplePos, &pSBuf->tuplePos); } @@ -1590,7 +1575,7 @@ _stddev_over: pStddevRes->quadraticISum -= plist[i] * plist[i]; \ } \ } while (0) - + int32_t stddevInvertFunction(SqlFunctionCtx* pCtx) { int32_t numOfElem = 0; @@ -1658,11 +1643,11 @@ int32_t stddevFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { int32_t stddevCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { SResultRowEntryInfo* pDResInfo = GET_RES_INFO(pDestCtx); - SStddevRes* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); - int32_t type = pDestCtx->input.pData[0]->info.type; + SStddevRes* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); + int32_t type = pDestCtx->input.pData[0]->info.type; SResultRowEntryInfo* pSResInfo = GET_RES_INFO(pSourceCtx); - SStddevRes* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); + SStddevRes* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); if (IS_INTEGER_TYPE(type)) { pDBuf->isum += pSBuf->isum; @@ -1688,10 +1673,8 @@ bool leastSQRFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInf SLeastSQRInfo* pInfo = GET_ROWCELL_INTERBUF(pResultInfo); - pInfo->startVal = IS_FLOAT_TYPE(pCtx->param[1].param.nType) ? pCtx->param[1].param.d : - (double)pCtx->param[1].param.i; - pInfo->stepVal = IS_FLOAT_TYPE(pCtx->param[2].param.nType) ? pCtx->param[2].param.d : - (double)pCtx->param[2].param.i; + pInfo->startVal = IS_FLOAT_TYPE(pCtx->param[1].param.nType) ? pCtx->param[1].param.d : (double)pCtx->param[1].param.i; + pInfo->stepVal = IS_FLOAT_TYPE(pCtx->param[2].param.nType) ? pCtx->param[2].param.d : (double)pCtx->param[2].param.i; return true; } @@ -1818,9 +1801,9 @@ int32_t leastSQRFunction(SqlFunctionCtx* pCtx) { int32_t leastSQRFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); - SLeastSQRInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - int32_t slotId = pCtx->pExpr->base.resSchema.slotId; - SColumnInfoData* pCol = taosArrayGet(pBlock->pDataBlock, slotId); + SLeastSQRInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); + int32_t slotId = pCtx->pExpr->base.resSchema.slotId; + SColumnInfoData* pCol = taosArrayGet(pBlock->pDataBlock, slotId); int32_t currentRow = pBlock->info.rows; @@ -1842,8 +1825,9 @@ int32_t leastSQRFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { param12 /= param[1][1]; - char buf[64] = {0}; - size_t len = snprintf(varDataVal(buf), sizeof(buf) - VARSTR_HEADER_SIZE, "{slop:%.6lf, intercept:%.6lf}", param02, param12); + char buf[64] = {0}; + size_t len = + snprintf(varDataVal(buf), sizeof(buf) - VARSTR_HEADER_SIZE, "{slop:%.6lf, intercept:%.6lf}", param02, param12); varDataSetLen(buf, len); colDataAppend(pCol, currentRow, buf, pResInfo->isNullRes); @@ -1852,7 +1836,7 @@ int32_t leastSQRFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { } int32_t leastSQRInvertFunction(SqlFunctionCtx* pCtx) { - //TODO + // TODO return TSDB_CODE_SUCCESS; } @@ -1860,11 +1844,11 @@ int32_t leastSQRCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { SResultRowEntryInfo* pDResInfo = GET_RES_INFO(pDestCtx); SLeastSQRInfo* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); int32_t type = pDestCtx->input.pData[0]->info.type; - double (*pDparam)[3] = pDBuf->matrix; + double(*pDparam)[3] = pDBuf->matrix; SResultRowEntryInfo* pSResInfo = GET_RES_INFO(pSourceCtx); SLeastSQRInfo* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); - double (*pSparam)[3] = pSBuf->matrix; + double(*pSparam)[3] = pSBuf->matrix; for (int32_t i = 0; i < pSBuf->num; i++) { pDparam[0][0] += pDBuf->startVal * pDBuf->startVal; pDparam[0][1] += pDBuf->startVal; @@ -2002,19 +1986,21 @@ int32_t percentileFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { } bool getApercentileFuncEnv(SFunctionNode* pFunc, SFuncExecEnv* pEnv) { - int32_t bytesHist = (int32_t)(sizeof(SAPercentileInfo) + sizeof(SHistogramInfo) + sizeof(SHistBin) * (MAX_HISTOGRAM_BIN + 1)); + int32_t bytesHist = + (int32_t)(sizeof(SAPercentileInfo) + sizeof(SHistogramInfo) + sizeof(SHistBin) * (MAX_HISTOGRAM_BIN + 1)); int32_t bytesDigest = (int32_t)(sizeof(SAPercentileInfo) + TDIGEST_SIZE(COMPRESSION)); pEnv->calcMemSize = TMAX(bytesHist, bytesDigest); return true; } int32_t getApercentileMaxSize() { - int32_t bytesHist = (int32_t)(sizeof(SAPercentileInfo) + sizeof(SHistogramInfo) + sizeof(SHistBin) * (MAX_HISTOGRAM_BIN + 1)); + int32_t bytesHist = + (int32_t)(sizeof(SAPercentileInfo) + sizeof(SHistogramInfo) + sizeof(SHistBin) * (MAX_HISTOGRAM_BIN + 1)); int32_t bytesDigest = (int32_t)(sizeof(SAPercentileInfo) + TDIGEST_SIZE(COMPRESSION)); return TMAX(bytesHist, bytesDigest); } -static int8_t getApercentileAlgo(char *algoStr) { +static int8_t getApercentileAlgo(char* algoStr) { int8_t algoType; if (strcasecmp(algoStr, "default") == 0) { algoType = APERCT_ALGO_DEFAULT; @@ -2028,8 +2014,8 @@ static int8_t getApercentileAlgo(char *algoStr) { } static void buildHistogramInfo(SAPercentileInfo* pInfo) { - pInfo->pHisto = (SHistogramInfo*) ((char*)pInfo + sizeof(SAPercentileInfo)); - pInfo->pHisto->elems = (SHistBin*) ((char*)pInfo->pHisto + sizeof(SHistogramInfo)); + pInfo->pHisto = (SHistogramInfo*)((char*)pInfo + sizeof(SAPercentileInfo)); + pInfo->pHisto->elems = (SHistBin*)((char*)pInfo->pHisto + sizeof(SHistogramInfo)); } static void buildTDigestInfo(SAPercentileInfo* pInfo) { @@ -2055,7 +2041,7 @@ bool apercentileFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResult } } - char *tmp = (char *)pInfo + sizeof(SAPercentileInfo); + char* tmp = (char*)pInfo + sizeof(SAPercentileInfo); if (pInfo->algo == APERCT_ALGO_TDIGEST) { pInfo->pTDigest = tdigestNewFrom(tmp, COMPRESSION); } else { @@ -2071,7 +2057,7 @@ int32_t apercentileFunction(SqlFunctionCtx* pCtx) { SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); SInputColumnInfoData* pInput = &pCtx->input; - //SColumnDataAgg* pAgg = pInput->pColumnDataAgg[0]; + // SColumnDataAgg* pAgg = pInput->pColumnDataAgg[0]; SColumnInfoData* pCol = pInput->pData[0]; int32_t type = pCol->info.type; @@ -2087,8 +2073,8 @@ int32_t apercentileFunction(SqlFunctionCtx* pCtx) { numOfElems += 1; char* data = colDataGetData(pCol, i); - double v = 0; // value - int64_t w = 1; // weigth + double v = 0; // value + int64_t w = 1; // weigth GET_TYPED_DATA(v, double, type, data); tdigestAdd(pInfo->pTDigest, v, w); } @@ -2117,14 +2103,14 @@ static void apercentileTransferInfo(SAPercentileInfo* pInput, SAPercentileInfo* buildTDigestInfo(pInput); tdigestAutoFill(pInput->pTDigest, COMPRESSION); - if(pInput->pTDigest->num_centroids == 0 && pInput->pTDigest->num_buffered_pts == 0) { + if (pInput->pTDigest->num_centroids == 0 && pInput->pTDigest->num_buffered_pts == 0) { return; } buildTDigestInfo(pOutput); - TDigest *pTDigest = pOutput->pTDigest; + TDigest* pTDigest = pOutput->pTDigest; - if(pTDigest->num_centroids <= 0) { + if (pTDigest->num_centroids <= 0) { memcpy(pTDigest, pInput->pTDigest, (size_t)TDIGEST_SIZE(COMPRESSION)); tdigestAutoFill(pTDigest, COMPRESSION); } else { @@ -2137,16 +2123,16 @@ static void apercentileTransferInfo(SAPercentileInfo* pInput, SAPercentileInfo* } buildHistogramInfo(pOutput); - SHistogramInfo *pHisto = pOutput->pHisto; + SHistogramInfo* pHisto = pOutput->pHisto; if (pHisto->numOfElems <= 0) { memcpy(pHisto, pInput->pHisto, sizeof(SHistogramInfo) + sizeof(SHistBin) * (MAX_HISTOGRAM_BIN + 1)); - pHisto->elems = (SHistBin*) ((char *)pHisto + sizeof(SHistogramInfo)); + pHisto->elems = (SHistBin*)((char*)pHisto + sizeof(SHistogramInfo)); } else { - pHisto->elems = (SHistBin*) ((char *)pHisto + sizeof(SHistogramInfo)); - SHistogramInfo *pRes = tHistogramMerge(pHisto, pInput->pHisto, MAX_HISTOGRAM_BIN); + pHisto->elems = (SHistBin*)((char*)pHisto + sizeof(SHistogramInfo)); + SHistogramInfo* pRes = tHistogramMerge(pHisto, pInput->pHisto, MAX_HISTOGRAM_BIN); memcpy(pHisto, pRes, sizeof(SHistogramInfo) + sizeof(SHistBin) * MAX_HISTOGRAM_BIN); - pHisto->elems = (SHistBin*) ((char *)pHisto + sizeof(SHistogramInfo)); + pHisto->elems = (SHistBin*)((char*)pHisto + sizeof(SHistogramInfo)); tHistogramDestroy(&pRes); } } @@ -2162,9 +2148,9 @@ int32_t apercentileFunctionMerge(SqlFunctionCtx* pCtx) { SAPercentileInfo* pInfo = GET_ROWCELL_INTERBUF(pResInfo); - int32_t start = pInput->startRowIndex; - char* data = colDataGetData(pCol, start); - SAPercentileInfo* pInputInfo = (SAPercentileInfo *)varDataVal(data); + int32_t start = pInput->startRowIndex; + char* data = colDataGetData(pCol, start); + SAPercentileInfo* pInputInfo = (SAPercentileInfo*)varDataVal(data); apercentileTransferInfo(pInputInfo, pInfo); @@ -2174,24 +2160,24 @@ int32_t apercentileFunctionMerge(SqlFunctionCtx* pCtx) { int32_t apercentileFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); - SAPercentileInfo* pInfo = (SAPercentileInfo*)GET_ROWCELL_INTERBUF(pResInfo); + SAPercentileInfo* pInfo = (SAPercentileInfo*)GET_ROWCELL_INTERBUF(pResInfo); if (pInfo->algo == APERCT_ALGO_TDIGEST) { if (pInfo->pTDigest->size > 0) { pInfo->result = tdigestQuantile(pInfo->pTDigest, pInfo->percent / 100); } else { // no need to free - //setNull(pCtx->pOutput, pCtx->outputType, pCtx->outputBytes); + // setNull(pCtx->pOutput, pCtx->outputType, pCtx->outputBytes); return TSDB_CODE_SUCCESS; } } else { if (pInfo->pHisto->numOfElems > 0) { - double ratio[] = {pInfo->percent}; - double *res = tHistogramUniform(pInfo->pHisto, ratio, 1); + double ratio[] = {pInfo->percent}; + double* res = tHistogramUniform(pInfo->pHisto, ratio, 1); pInfo->result = *res; - //memcpy(pCtx->pOutput, res, sizeof(double)); + // memcpy(pCtx->pOutput, res, sizeof(double)); taosMemoryFree(res); } else { // no need to free - //setNull(pCtx->pOutput, pCtx->outputType, pCtx->outputBytes); + // setNull(pCtx->pOutput, pCtx->outputType, pCtx->outputBytes); return TSDB_CODE_SUCCESS; } } @@ -2201,10 +2187,10 @@ int32_t apercentileFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { int32_t apercentilePartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); - SAPercentileInfo* pInfo = (SAPercentileInfo*)GET_ROWCELL_INTERBUF(pResInfo); + SAPercentileInfo* pInfo = (SAPercentileInfo*)GET_ROWCELL_INTERBUF(pResInfo); int32_t resultBytes = getApercentileMaxSize(); - char *res = taosMemoryCalloc(resultBytes + VARSTR_HEADER_SIZE, sizeof(char)); + char* res = taosMemoryCalloc(resultBytes + VARSTR_HEADER_SIZE, sizeof(char)); if (pInfo->algo == APERCT_ALGO_TDIGEST) { if (pInfo->pTDigest->size > 0) { @@ -2243,7 +2229,7 @@ int32_t apercentileCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) } else { SHistogramInfo* pTmp = tHistogramMerge(pDBuf->pHisto, pSBuf->pHisto, MAX_HISTOGRAM_BIN); memcpy(pDBuf->pHisto, pTmp, sizeof(SHistogramInfo) + sizeof(SHistBin) * (MAX_HISTOGRAM_BIN + 1)); - pDBuf->pHisto->elems = (SHistBin*) ((char *)pDBuf->pHisto + sizeof(SHistogramInfo)); + pDBuf->pHisto->elems = (SHistBin*)((char*)pDBuf->pHisto + sizeof(SHistogramInfo)); tHistogramDestroy(&pTmp); } pDResInfo->numOfRes = TMAX(pDResInfo->numOfRes, pSResInfo->numOfRes); @@ -2255,13 +2241,13 @@ int32_t getFirstLastInfoSize(int32_t resBytes) { } bool getFirstLastFuncEnv(SFunctionNode* pFunc, SFuncExecEnv* pEnv) { - SColumnNode* pNode = nodesListGetNode(pFunc->pParameterList, 0); + SColumnNode* pNode = (SColumnNode *)nodesListGetNode(pFunc->pParameterList, 0); pEnv->calcMemSize = sizeof(SFirstLastRes) + pNode->node.resType.bytes + sizeof(int64_t); return true; } bool getSelectivityFuncEnv(SFunctionNode* pFunc, SFuncExecEnv* pEnv) { - SColumnNode* pNode = nodesListGetNode(pFunc->pParameterList, 0); + SColumnNode* pNode = (SColumnNode*)nodesListGetNode(pFunc->pParameterList, 0); pEnv->calcMemSize = pNode->node.resType.bytes; return true; } @@ -2431,7 +2417,7 @@ int32_t lastFunction(SqlFunctionCtx* pCtx) { return TSDB_CODE_SUCCESS; } -static void firstLastTransferInfo(SFirstLastRes* pInput, SFirstLastRes* pOutput) { +static void firstLastTransferInfo(SFirstLastRes* pInput, SFirstLastRes* pOutput, bool isFirst) { if (!pInput->hasResult) { return; } @@ -2439,8 +2425,14 @@ static void firstLastTransferInfo(SFirstLastRes* pInput, SFirstLastRes* pOutput) TSKEY *tsIn = (TSKEY*)(pInput->buf + pInput->bytes); TSKEY *tsOut = (TSKEY*)(pOutput->buf + pInput->bytes); if (pOutput->hasResult) { - if (*tsIn > *tsOut) { - return; + if (isFirst) { + if (*tsIn > *tsOut) { + return; + } + } else { + if (*tsIn < *tsOut) { + return; + } } } *tsOut = *tsIn; @@ -2449,7 +2441,7 @@ static void firstLastTransferInfo(SFirstLastRes* pInput, SFirstLastRes* pOutput) return; } -int32_t firstFunctionMerge(SqlFunctionCtx *pCtx) { +static int32_t firstLastFunctionMergeImpl(SqlFunctionCtx *pCtx, bool isFirstQuery) { SInputColumnInfoData* pInput = &pCtx->input; SColumnInfoData* pCol = pInput->pData[0]; ASSERT(pCol->info.type == TSDB_DATA_TYPE_BINARY); @@ -2460,13 +2452,21 @@ int32_t firstFunctionMerge(SqlFunctionCtx *pCtx) { char* data = colDataGetData(pCol, start); SFirstLastRes* pInputInfo = (SFirstLastRes *)varDataVal(data); - firstLastTransferInfo(pInputInfo, pInfo); + firstLastTransferInfo(pInputInfo, pInfo, isFirstQuery); SET_VAL(GET_RES_INFO(pCtx), 1, 1); return TSDB_CODE_SUCCESS; } +int32_t firstFunctionMerge(SqlFunctionCtx *pCtx) { + return firstLastFunctionMergeImpl(pCtx, true); +} + +int32_t lastFunctionMerge(SqlFunctionCtx *pCtx) { + return firstLastFunctionMergeImpl(pCtx, false); +} + int32_t firstLastFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { int32_t slotId = pCtx->pExpr->base.resSchema.slotId; SColumnInfoData* pCol = taosArrayGet(pBlock->pDataBlock, slotId); @@ -2500,15 +2500,14 @@ int32_t firstLastPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { int32_t lastCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { SResultRowEntryInfo* pDResInfo = GET_RES_INFO(pDestCtx); - char* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); - int32_t type = pDestCtx->input.pData[0]->info.type; - int32_t bytes = pDestCtx->input.pData[0]->info.bytes; + char* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); + int32_t type = pDestCtx->input.pData[0]->info.type; + int32_t bytes = pDestCtx->input.pData[0]->info.bytes; SResultRowEntryInfo* pSResInfo = GET_RES_INFO(pSourceCtx); - char* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); + char* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); - if (pSResInfo->numOfRes != 0 && - (pDResInfo->numOfRes == 0 || *(TSKEY*)(pDBuf + bytes) < *(TSKEY*)(pSBuf + bytes)) ) { + if (pSResInfo->numOfRes != 0 && (pDResInfo->numOfRes == 0 || *(TSKEY*)(pDBuf + bytes) < *(TSKEY*)(pSBuf + bytes))) { memcpy(pDBuf, pSBuf, bytes); *(TSKEY*)(pDBuf + bytes) = *(TSKEY*)(pSBuf + bytes); pDResInfo->numOfRes = 1; @@ -2536,31 +2535,38 @@ bool diffFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResInfo) { } static void doSetPrevVal(SDiffInfo* pDiffInfo, int32_t type, const char* pv) { - switch(type) { + switch (type) { case TSDB_DATA_TYPE_BOOL: case TSDB_DATA_TYPE_TINYINT: - pDiffInfo->prev.i64 = *(int8_t*) pv; break; + pDiffInfo->prev.i64 = *(int8_t*)pv; + break; case TSDB_DATA_TYPE_INT: - pDiffInfo->prev.i64 = *(int32_t*) pv; break; + pDiffInfo->prev.i64 = *(int32_t*)pv; + break; case TSDB_DATA_TYPE_SMALLINT: - pDiffInfo->prev.i64 = *(int16_t*) pv; break; + pDiffInfo->prev.i64 = *(int16_t*)pv; + break; case TSDB_DATA_TYPE_BIGINT: - pDiffInfo->prev.i64 = *(int64_t*) pv; break; + pDiffInfo->prev.i64 = *(int64_t*)pv; + break; case TSDB_DATA_TYPE_FLOAT: - pDiffInfo->prev.d64 = *(float *) pv; break; + pDiffInfo->prev.d64 = *(float*)pv; + break; case TSDB_DATA_TYPE_DOUBLE: - pDiffInfo->prev.d64 = *(double*) pv; break; + pDiffInfo->prev.d64 = *(double*)pv; + break; default: ASSERT(0); } } -static void doHandleDiff(SDiffInfo* pDiffInfo, int32_t type, const char* pv, SColumnInfoData* pOutput, int32_t pos, int32_t order) { - int32_t factor = (order == TSDB_ORDER_ASC)? 1:-1; +static void doHandleDiff(SDiffInfo* pDiffInfo, int32_t type, const char* pv, SColumnInfoData* pOutput, int32_t pos, + int32_t order) { + int32_t factor = (order == TSDB_ORDER_ASC) ? 1 : -1; switch (type) { case TSDB_DATA_TYPE_INT: { int32_t v = *(int32_t*)pv; - int64_t delta = factor*(v - pDiffInfo->prev.i64); // direct previous may be null + int64_t delta = factor * (v - pDiffInfo->prev.i64); // direct previous may be null if (delta < 0 && pDiffInfo->ignoreNegative) { colDataSetNull_f(pOutput->nullbitmap, pos); } else { @@ -2571,8 +2577,8 @@ static void doHandleDiff(SDiffInfo* pDiffInfo, int32_t type, const char* pv, SCo } case TSDB_DATA_TYPE_BOOL: case TSDB_DATA_TYPE_TINYINT: { - int8_t v = *(int8_t*)pv; - int64_t delta = factor*(v - pDiffInfo->prev.i64); // direct previous may be null + int8_t v = *(int8_t*)pv; + int64_t delta = factor * (v - pDiffInfo->prev.i64); // direct previous may be null if (delta < 0 && pDiffInfo->ignoreNegative) { colDataSetNull_f(pOutput->nullbitmap, pos); } else { @@ -2583,7 +2589,7 @@ static void doHandleDiff(SDiffInfo* pDiffInfo, int32_t type, const char* pv, SCo } case TSDB_DATA_TYPE_SMALLINT: { int16_t v = *(int16_t*)pv; - int64_t delta = factor*(v - pDiffInfo->prev.i64); // direct previous may be null + int64_t delta = factor * (v - pDiffInfo->prev.i64); // direct previous may be null if (delta < 0 && pDiffInfo->ignoreNegative) { colDataSetNull_f(pOutput->nullbitmap, pos); } else { @@ -2594,7 +2600,7 @@ static void doHandleDiff(SDiffInfo* pDiffInfo, int32_t type, const char* pv, SCo } case TSDB_DATA_TYPE_BIGINT: { int64_t v = *(int64_t*)pv; - int64_t delta = factor*(v - pDiffInfo->prev.i64); // direct previous may be null + int64_t delta = factor * (v - pDiffInfo->prev.i64); // direct previous may be null if (delta < 0 && pDiffInfo->ignoreNegative) { colDataSetNull_f(pOutput->nullbitmap, pos); } else { @@ -2604,9 +2610,9 @@ static void doHandleDiff(SDiffInfo* pDiffInfo, int32_t type, const char* pv, SCo break; } case TSDB_DATA_TYPE_FLOAT: { - float v = *(float*)pv; - double delta = factor*(v - pDiffInfo->prev.d64); // direct previous may be null - if ((delta < 0 && pDiffInfo->ignoreNegative) || isinf(delta) || isnan(delta)) { //check for overflow + float v = *(float*)pv; + double delta = factor * (v - pDiffInfo->prev.d64); // direct previous may be null + if ((delta < 0 && pDiffInfo->ignoreNegative) || isinf(delta) || isnan(delta)) { // check for overflow colDataSetNull_f(pOutput->nullbitmap, pos); } else { colDataAppendDouble(pOutput, pos, &delta); @@ -2616,8 +2622,8 @@ static void doHandleDiff(SDiffInfo* pDiffInfo, int32_t type, const char* pv, SCo } case TSDB_DATA_TYPE_DOUBLE: { double v = *(double*)pv; - double delta = factor*(v - pDiffInfo->prev.d64); // direct previous may be null - if ((delta < 0 && pDiffInfo->ignoreNegative) || isinf(delta) || isnan(delta)) { //check for overflow + double delta = factor * (v - pDiffInfo->prev.d64); // direct previous may be null + if ((delta < 0 && pDiffInfo->ignoreNegative) || isinf(delta) || isnan(delta)) { // check for overflow colDataSetNull_f(pOutput->nullbitmap, pos); } else { colDataAppendDouble(pOutput, pos, &delta); @@ -2640,7 +2646,7 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) { SColumnInfoData* pTsOutput = pCtx->pTsOutput; int32_t numOfElems = 0; - TSKEY* tsList = (int64_t*)pInput->pPTS->pData; + TSKEY* tsList = (int64_t*)pInput->pPTS->pData; int32_t startOffset = pCtx->offset; SColumnInfoData* pOutput = (SColumnInfoData*)pCtx->pOutput; @@ -2717,9 +2723,7 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) { return numOfElems; } -int32_t getTopBotInfoSize(int64_t numOfItems) { - return sizeof(STopBotRes) + numOfItems * sizeof(STopBotResItem); -} +int32_t getTopBotInfoSize(int64_t numOfItems) { return sizeof(STopBotRes) + numOfItems * sizeof(STopBotResItem); } bool getTopBotFuncEnv(SFunctionNode* pFunc, SFuncExecEnv* pEnv) { SValueNode* pkNode = (SValueNode*)nodesListGetNode(pFunc->pParameterList, 1); @@ -2728,7 +2732,7 @@ bool getTopBotFuncEnv(SFunctionNode* pFunc, SFuncExecEnv* pEnv) { } bool getTopBotMergeFuncEnv(SFunctionNode* pFunc, SFuncExecEnv* pEnv) { - //intermediate result is binary and length contains VAR header size + // intermediate result is binary and length contains VAR header size pEnv->calcMemSize = pFunc->node.resType.bytes; return true; } @@ -2738,7 +2742,7 @@ bool topBotFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResInfo) { return false; } - STopBotRes* pRes = GET_ROWCELL_INTERBUF(pResInfo); + STopBotRes* pRes = GET_ROWCELL_INTERBUF(pResInfo); SInputColumnInfoData* pInput = &pCtx->input; pRes->maxSize = pCtx->param[1].param.i; @@ -2814,38 +2818,37 @@ static void topBotTransferInfo(SqlFunctionCtx* pCtx, STopBotRes* pInput, bool is } int32_t topFunctionMerge(SqlFunctionCtx* pCtx) { - SResultRowEntryInfo* pEntryInfo = GET_RES_INFO(pCtx); + SResultRowEntryInfo* pEntryInfo = GET_RES_INFO(pCtx); SInputColumnInfoData* pInput = &pCtx->input; - SColumnInfoData* pCol = pInput->pData[0]; + SColumnInfoData* pCol = pInput->pData[0]; ASSERT(pCol->info.type == TSDB_DATA_TYPE_BINARY); - int32_t start = pInput->startRowIndex; - char* data = colDataGetData(pCol, start); - STopBotRes* pInputInfo = (STopBotRes *)varDataVal(data); + int32_t start = pInput->startRowIndex; + char* data = colDataGetData(pCol, start); + STopBotRes* pInputInfo = (STopBotRes*)varDataVal(data); STopBotRes* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); pInfo->maxSize = pInputInfo->maxSize; - pInfo->type = pInputInfo->type; + pInfo->type = pInputInfo->type; topBotTransferInfo(pCtx, pInputInfo, true); SET_VAL(GET_RES_INFO(pCtx), pEntryInfo->numOfRes, pEntryInfo->numOfRes); return TSDB_CODE_SUCCESS; } - int32_t bottomFunctionMerge(SqlFunctionCtx* pCtx) { - SResultRowEntryInfo* pEntryInfo = GET_RES_INFO(pCtx); + SResultRowEntryInfo* pEntryInfo = GET_RES_INFO(pCtx); SInputColumnInfoData* pInput = &pCtx->input; - SColumnInfoData* pCol = pInput->pData[0]; + SColumnInfoData* pCol = pInput->pData[0]; ASSERT(pCol->info.type == TSDB_DATA_TYPE_BINARY); - int32_t start = pInput->startRowIndex; - char* data = colDataGetData(pCol, start); - STopBotRes* pInputInfo = (STopBotRes *)varDataVal(data); + int32_t start = pInput->startRowIndex; + char* data = colDataGetData(pCol, start); + STopBotRes* pInputInfo = (STopBotRes*)varDataVal(data); STopBotRes* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); pInfo->maxSize = pInputInfo->maxSize; - pInfo->type = pInputInfo->type; + pInfo->type = pInputInfo->type; topBotTransferInfo(pCtx, pInputInfo, false); SET_VAL(GET_RES_INFO(pCtx), pEntryInfo->numOfRes, pEntryInfo->numOfRes); @@ -2905,15 +2908,12 @@ void doAddIntoResult(SqlFunctionCtx* pCtx, void* pData, int32_t rowIndex, SSData taosheapsort((void*)pItems, sizeof(STopBotResItem), pEntryInfo->numOfRes, (const void*)&type, topBotResComparFn, !isTopQuery); } else { // replace the minimum value in the result - if ((isTopQuery && ( - (IS_SIGNED_NUMERIC_TYPE(type) && val.i > pItems[0].v.i) || - (IS_UNSIGNED_NUMERIC_TYPE(type) && val.u > pItems[0].v.u) || - (IS_FLOAT_TYPE(type) && val.d > pItems[0].v.d))) - || (!isTopQuery && ( - (IS_SIGNED_NUMERIC_TYPE(type) && val.i < pItems[0].v.i) || - (IS_UNSIGNED_NUMERIC_TYPE(type) && val.u < pItems[0].v.u) || - (IS_FLOAT_TYPE(type) && val.d < pItems[0].v.d)) - )) { + if ((isTopQuery && ((IS_SIGNED_NUMERIC_TYPE(type) && val.i > pItems[0].v.i) || + (IS_UNSIGNED_NUMERIC_TYPE(type) && val.u > pItems[0].v.u) || + (IS_FLOAT_TYPE(type) && val.d > pItems[0].v.d))) || + (!isTopQuery && ((IS_SIGNED_NUMERIC_TYPE(type) && val.i < pItems[0].v.i) || + (IS_UNSIGNED_NUMERIC_TYPE(type) && val.u < pItems[0].v.u) || + (IS_FLOAT_TYPE(type) && val.d < pItems[0].v.d)))) { // replace the old data and the coresponding tuple data STopBotResItem* pItem = &pItems[0]; pItem->v = val; @@ -3032,9 +3032,7 @@ int32_t topBotFinalizeImpl(SqlFunctionCtx* pCtx, SSDataBlock* pBlock, bool isMer return pEntryInfo->numOfRes; } -int32_t topBotFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { - return topBotFinalizeImpl(pCtx, pBlock, false); -} +int32_t topBotFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { return topBotFinalizeImpl(pCtx, pBlock, false); } int32_t topBotMergeFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { return topBotFinalizeImpl(pCtx, pBlock, true); @@ -3042,9 +3040,9 @@ int32_t topBotMergeFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { int32_t topBotPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { SResultRowEntryInfo* pEntryInfo = GET_RES_INFO(pCtx); - STopBotRes* pRes = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - int32_t resultBytes = getTopBotInfoSize(pRes->maxSize); - char *res = taosMemoryCalloc(resultBytes + VARSTR_HEADER_SIZE, sizeof(char)); + STopBotRes* pRes = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); + int32_t resultBytes = getTopBotInfoSize(pRes->maxSize); + char* res = taosMemoryCalloc(resultBytes + VARSTR_HEADER_SIZE, sizeof(char)); memcpy(varDataVal(res), pRes, resultBytes); varDataSetLen(res, resultBytes); @@ -3058,11 +3056,10 @@ int32_t topBotPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { return 1; } -void addResult(SqlFunctionCtx* pCtx, STopBotResItem* pSourceItem, int16_t type, - bool isTopQuery) { +void addResult(SqlFunctionCtx* pCtx, STopBotResItem* pSourceItem, int16_t type, bool isTopQuery) { SResultRowEntryInfo* pEntryInfo = GET_RES_INFO(pCtx); - STopBotRes* pRes = getTopBotOutputInfo(pCtx); - STopBotResItem* pItems = pRes->pItems; + STopBotRes* pRes = getTopBotOutputInfo(pCtx); + STopBotResItem* pItems = pRes->pItems; assert(pItems != NULL); // not full yet @@ -3078,15 +3075,12 @@ void addResult(SqlFunctionCtx* pCtx, STopBotResItem* pSourceItem, int16_t type, taosheapsort((void*)pItems, sizeof(STopBotResItem), pEntryInfo->numOfRes, (const void*)&type, topBotResComparFn, !isTopQuery); } else { // replace the minimum value in the result - if ((isTopQuery && ( - (IS_SIGNED_NUMERIC_TYPE(type) && pSourceItem->v.i > pItems[0].v.i) || - (IS_UNSIGNED_NUMERIC_TYPE(type) && pSourceItem->v.u > pItems[0].v.u) || - (IS_FLOAT_TYPE(type) && pSourceItem->v.d > pItems[0].v.d))) - || (!isTopQuery && ( - (IS_SIGNED_NUMERIC_TYPE(type) && pSourceItem->v.i < pItems[0].v.i) || - (IS_UNSIGNED_NUMERIC_TYPE(type) && pSourceItem->v.u < pItems[0].v.u) || - (IS_FLOAT_TYPE(type) && pSourceItem->v.d < pItems[0].v.d)) - )) { + if ((isTopQuery && ((IS_SIGNED_NUMERIC_TYPE(type) && pSourceItem->v.i > pItems[0].v.i) || + (IS_UNSIGNED_NUMERIC_TYPE(type) && pSourceItem->v.u > pItems[0].v.u) || + (IS_FLOAT_TYPE(type) && pSourceItem->v.d > pItems[0].v.d))) || + (!isTopQuery && ((IS_SIGNED_NUMERIC_TYPE(type) && pSourceItem->v.i < pItems[0].v.i) || + (IS_UNSIGNED_NUMERIC_TYPE(type) && pSourceItem->v.u < pItems[0].v.u) || + (IS_FLOAT_TYPE(type) && pSourceItem->v.d < pItems[0].v.d)))) { // replace the old data and the coresponding tuple data STopBotResItem* pItem = &pItems[0]; pItem->v = pSourceItem->v; @@ -3101,7 +3095,7 @@ void addResult(SqlFunctionCtx* pCtx, STopBotResItem* pSourceItem, int16_t type, } int32_t topCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { - int32_t type = pDestCtx->input.pData[0]->info.type; + int32_t type = pDestCtx->input.pData[0]->info.type; SResultRowEntryInfo* pSResInfo = GET_RES_INFO(pSourceCtx); STopBotRes* pSBuf = getTopBotOutputInfo(pSourceCtx); for (int32_t i = 0; i < pSResInfo->numOfRes; i++) { @@ -3111,7 +3105,7 @@ int32_t topCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { } int32_t bottomCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { - int32_t type = pDestCtx->input.pData[0]->info.type; + int32_t type = pDestCtx->input.pData[0]->info.type; SResultRowEntryInfo* pSResInfo = GET_RES_INFO(pSourceCtx); STopBotRes* pSBuf = getTopBotOutputInfo(pSourceCtx); for (int32_t i = 0; i < pSResInfo->numOfRes; i++) { @@ -3120,16 +3114,14 @@ int32_t bottomCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { return TSDB_CODE_SUCCESS; } -int32_t getSpreadInfoSize() { - return (int32_t)sizeof(SSpreadInfo); -} +int32_t getSpreadInfoSize() { return (int32_t)sizeof(SSpreadInfo); } bool getSpreadFuncEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv) { pEnv->calcMemSize = sizeof(SSpreadInfo); return true; } -bool spreadFunctionSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo* pResultInfo) { +bool spreadFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInfo) { if (!functionSetup(pCtx, pResultInfo)) { return false; } @@ -3141,13 +3133,13 @@ bool spreadFunctionSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo* pResultInfo) return true; } -int32_t spreadFunction(SqlFunctionCtx *pCtx) { +int32_t spreadFunction(SqlFunctionCtx* pCtx) { int32_t numOfElems = 0; // Only the pre-computing information loaded and actual data does not loaded SInputColumnInfoData* pInput = &pCtx->input; - SColumnDataAgg *pAgg = pInput->pColumnDataAgg[0]; - int32_t type = pInput->pData[0]->info.type; + SColumnDataAgg* pAgg = pInput->pColumnDataAgg[0]; + int32_t type = pInput->pData[0]->info.type; SSpreadInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); @@ -3179,7 +3171,7 @@ int32_t spreadFunction(SqlFunctionCtx *pCtx) { } else { // computing based on the true data block SColumnInfoData* pCol = pInput->pData[0]; - int32_t start = pInput->startRowIndex; + int32_t start = pInput->startRowIndex; int32_t numOfRows = pInput->numOfRows; // check the valid data one by one @@ -3188,7 +3180,7 @@ int32_t spreadFunction(SqlFunctionCtx *pCtx) { continue; } - char *data = colDataGetData(pCol, i); + char* data = colDataGetData(pCol, i); double v = 0; GET_TYPED_DATA(v, double, type, data); @@ -3225,17 +3217,17 @@ static void spreadTransferInfo(SSpreadInfo* pInput, SSpreadInfo* pOutput) { } } -int32_t spreadFunctionMerge(SqlFunctionCtx *pCtx) { +int32_t spreadFunctionMerge(SqlFunctionCtx* pCtx) { SInputColumnInfoData* pInput = &pCtx->input; - SColumnInfoData* pCol = pInput->pData[0]; + SColumnInfoData* pCol = pInput->pData[0]; ASSERT(pCol->info.type == TSDB_DATA_TYPE_BINARY); SSpreadInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); SSpreadInfo* pInputInfo; int32_t start = pInput->startRowIndex; - char* data = colDataGetData(pCol, start); - pInputInfo = (SSpreadInfo *)varDataVal(data); + char* data = colDataGetData(pCol, start); + pInputInfo = (SSpreadInfo*)varDataVal(data); spreadTransferInfo(pInputInfo, pInfo); @@ -3255,8 +3247,8 @@ int32_t spreadFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { int32_t spreadPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); SSpreadInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - int32_t resultBytes = getSpreadInfoSize(); - char *res = taosMemoryCalloc(resultBytes + VARSTR_HEADER_SIZE, sizeof(char)); + int32_t resultBytes = getSpreadInfoSize(); + char* res = taosMemoryCalloc(resultBytes + VARSTR_HEADER_SIZE, sizeof(char)); memcpy(varDataVal(res), pInfo, resultBytes); varDataSetLen(res, resultBytes); @@ -3272,25 +3264,23 @@ int32_t spreadPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { int32_t spreadCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { SResultRowEntryInfo* pDResInfo = GET_RES_INFO(pDestCtx); - SSpreadInfo* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); + SSpreadInfo* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); SResultRowEntryInfo* pSResInfo = GET_RES_INFO(pSourceCtx); - SSpreadInfo* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); + SSpreadInfo* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); spreadTransferInfo(pSBuf, pDBuf); pDResInfo->numOfRes = TMAX(pDResInfo->numOfRes, pSResInfo->numOfRes); return TSDB_CODE_SUCCESS; } -int32_t getElapsedInfoSize() { - return (int32_t)sizeof(SElapsedInfo); -} +int32_t getElapsedInfoSize() { return (int32_t)sizeof(SElapsedInfo); } bool getElapsedFuncEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv) { pEnv->calcMemSize = sizeof(SElapsedInfo); return true; } -bool elapsedFunctionSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo* pResultInfo) { +bool elapsedFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInfo) { if (!functionSetup(pCtx, pResultInfo)) { return false; } @@ -3309,16 +3299,16 @@ bool elapsedFunctionSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo* pResultInfo return true; } -int32_t elapsedFunction(SqlFunctionCtx *pCtx) { +int32_t elapsedFunction(SqlFunctionCtx* pCtx) { int32_t numOfElems = 0; // Only the pre-computing information loaded and actual data does not loaded SInputColumnInfoData* pInput = &pCtx->input; - SColumnDataAgg *pAgg = pInput->pColumnDataAgg[0]; + SColumnDataAgg* pAgg = pInput->pColumnDataAgg[0]; SElapsedInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - numOfElems = pInput->numOfRows; //since this is the primary timestamp, no need to exclude NULL values + numOfElems = pInput->numOfRows; // since this is the primary timestamp, no need to exclude NULL values if (numOfElems == 0) { goto _elapsed_over; } @@ -3350,11 +3340,12 @@ int32_t elapsedFunction(SqlFunctionCtx *pCtx) { SColumnInfoData* pCol = pInput->pData[0]; - int32_t start = pInput->startRowIndex; - TSKEY* ptsList = (int64_t*)colDataGetData(pCol, start); + int32_t start = pInput->startRowIndex; + TSKEY* ptsList = (int64_t*)colDataGetData(pCol, start); if (pCtx->order == TSDB_ORDER_DESC) { if (pCtx->start.key == INT64_MIN) { - pInfo->max = (pInfo->max < ptsList[start + pInput->numOfRows - 1]) ? ptsList[start + pInput->numOfRows - 1] : pInfo->max; + pInfo->max = + (pInfo->max < ptsList[start + pInput->numOfRows - 1]) ? ptsList[start + pInput->numOfRows - 1] : pInfo->max; } else { pInfo->max = pCtx->start.key + 1; } @@ -3397,16 +3388,16 @@ static void elapsedTransferInfo(SElapsedInfo* pInput, SElapsedInfo* pOutput) { } } -int32_t elapsedFunctionMerge(SqlFunctionCtx *pCtx) { +int32_t elapsedFunctionMerge(SqlFunctionCtx* pCtx) { SInputColumnInfoData* pInput = &pCtx->input; - SColumnInfoData* pCol = pInput->pData[0]; + SColumnInfoData* pCol = pInput->pData[0]; ASSERT(pCol->info.type == TSDB_DATA_TYPE_BINARY); SElapsedInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - int32_t start = pInput->startRowIndex; - char* data = colDataGetData(pCol, start); - SElapsedInfo* pInputInfo = (SElapsedInfo *)varDataVal(data); + int32_t start = pInput->startRowIndex; + char* data = colDataGetData(pCol, start); + SElapsedInfo* pInputInfo = (SElapsedInfo*)varDataVal(data); elapsedTransferInfo(pInputInfo, pInfo); @@ -3416,7 +3407,7 @@ int32_t elapsedFunctionMerge(SqlFunctionCtx *pCtx) { int32_t elapsedFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { SElapsedInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - double result = (double)pInfo->max - (double)pInfo->min; + double result = (double)pInfo->max - (double)pInfo->min; result = (result >= 0) ? result : -result; pInfo->result = result / pInfo->timeUnit; return functionFinalize(pCtx, pBlock); @@ -3424,9 +3415,9 @@ int32_t elapsedFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { int32_t elapsedPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); - SElapsedInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - int32_t resultBytes = getElapsedInfoSize(); - char *res = taosMemoryCalloc(resultBytes + VARSTR_HEADER_SIZE, sizeof(char)); + SElapsedInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); + int32_t resultBytes = getElapsedInfoSize(); + char* res = taosMemoryCalloc(resultBytes + VARSTR_HEADER_SIZE, sizeof(char)); memcpy(varDataVal(res), pInfo, resultBytes); varDataSetLen(res, resultBytes); @@ -3442,10 +3433,10 @@ int32_t elapsedPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { int32_t elapsedCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { SResultRowEntryInfo* pDResInfo = GET_RES_INFO(pDestCtx); - SElapsedInfo* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); + SElapsedInfo* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); SResultRowEntryInfo* pSResInfo = GET_RES_INFO(pSourceCtx); - SElapsedInfo* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); + SElapsedInfo* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); elapsedTransferInfo(pSBuf, pDBuf); pDResInfo->numOfRes = TMAX(pDResInfo->numOfRes, pSResInfo->numOfRes); @@ -3461,7 +3452,7 @@ bool getHistogramFuncEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv) return true; } -static int8_t getHistogramBinType(char *binTypeStr) { +static int8_t getHistogramBinType(char* binTypeStr) { int8_t binType; if (strcasecmp(binTypeStr, "user_input") == 0) { binType = USER_INPUT_BIN; @@ -3476,7 +3467,7 @@ static int8_t getHistogramBinType(char *binTypeStr) { return binType; } -static bool getHistogramBinDesc(SHistoFuncInfo *pInfo, char *binDescStr, int8_t binType, bool normalized) { +static bool getHistogramBinDesc(SHistoFuncInfo* pInfo, char* binDescStr, int8_t binType, bool normalized) { cJSON* binDesc = cJSON_Parse(binDescStr); int32_t numOfBins; double* intervals; @@ -3487,17 +3478,17 @@ static bool getHistogramBinDesc(SHistoFuncInfo *pInfo, char *binDescStr, int8_t return false; } - cJSON* start = cJSON_GetObjectItem(binDesc, "start"); - cJSON* factor = cJSON_GetObjectItem(binDesc, "factor"); - cJSON* width = cJSON_GetObjectItem(binDesc, "width"); - cJSON* count = cJSON_GetObjectItem(binDesc, "count"); + cJSON* start = cJSON_GetObjectItem(binDesc, "start"); + cJSON* factor = cJSON_GetObjectItem(binDesc, "factor"); + cJSON* width = cJSON_GetObjectItem(binDesc, "width"); + cJSON* count = cJSON_GetObjectItem(binDesc, "count"); cJSON* infinity = cJSON_GetObjectItem(binDesc, "infinity"); if (!cJSON_IsNumber(start) || !cJSON_IsNumber(count) || !cJSON_IsBool(infinity)) { return false; } - if (count->valueint <= 0 || count->valueint > 1000) { // limit count to 1000 + if (count->valueint <= 0 || count->valueint > 1000) { // limit count to 1000 return false; } @@ -3591,7 +3582,7 @@ static bool getHistogramBinDesc(SHistoFuncInfo *pInfo, char *binDescStr, int8_t return false; } - pInfo->numOfBins = numOfBins - 1; + pInfo->numOfBins = numOfBins - 1; pInfo->normalized = normalized; for (int32_t i = 0; i < pInfo->numOfBins; ++i) { pInfo->bins[i].lower = intervals[i] < intervals[i + 1] ? intervals[i] : intervals[i + 1]; @@ -3603,12 +3594,12 @@ static bool getHistogramBinDesc(SHistoFuncInfo *pInfo, char *binDescStr, int8_t return true; } -bool histogramFunctionSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo *pResultInfo) { +bool histogramFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInfo) { if (!functionSetup(pCtx, pResultInfo)) { return false; } - SHistoFuncInfo *pInfo = GET_ROWCELL_INTERBUF(pResultInfo); + SHistoFuncInfo* pInfo = GET_ROWCELL_INTERBUF(pResultInfo); pInfo->numOfBins = 0; pInfo->totalCount = 0; pInfo->normalized = 0; @@ -3617,7 +3608,7 @@ bool histogramFunctionSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo *pResultIn if (binType == UNKNOWN_BIN) { return false; } - char* binDesc = varDataVal(pCtx->param[2].param.pz); + char* binDesc = varDataVal(pCtx->param[2].param.pz); int64_t normalized = pCtx->param[3].param.i; if (normalized != 0 && normalized != 1) { return false; @@ -3629,7 +3620,7 @@ bool histogramFunctionSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo *pResultIn return true; } -int32_t histogramFunction(SqlFunctionCtx *pCtx) { +int32_t histogramFunction(SqlFunctionCtx* pCtx) { SHistoFuncInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); SInputColumnInfoData* pInput = &pCtx->input; @@ -3648,7 +3639,7 @@ int32_t histogramFunction(SqlFunctionCtx *pCtx) { numOfElems++; - char* data = colDataGetData(pCol, i); + char* data = colDataGetData(pCol, i); double v; GET_TYPED_DATA(v, double, type, data); @@ -3659,7 +3650,6 @@ int32_t histogramFunction(SqlFunctionCtx *pCtx) { break; } } - } SET_VAL(GET_RES_INFO(pCtx), numOfElems, pInfo->numOfBins); @@ -3668,7 +3658,7 @@ int32_t histogramFunction(SqlFunctionCtx *pCtx) { static void histogramTransferInfo(SHistoFuncInfo* pInput, SHistoFuncInfo* pOutput) { pOutput->normalized = pInput->normalized; - pOutput->numOfBins = pInput->numOfBins; + pOutput->numOfBins = pInput->numOfBins; pOutput->totalCount += pInput->totalCount; for (int32_t k = 0; k < pOutput->numOfBins; ++k) { pOutput->bins[k].lower = pInput->bins[k].lower; @@ -3677,16 +3667,16 @@ static void histogramTransferInfo(SHistoFuncInfo* pInput, SHistoFuncInfo* pOutpu } } -int32_t histogramFunctionMerge(SqlFunctionCtx *pCtx) { +int32_t histogramFunctionMerge(SqlFunctionCtx* pCtx) { SInputColumnInfoData* pInput = &pCtx->input; - SColumnInfoData* pCol = pInput->pData[0]; + SColumnInfoData* pCol = pInput->pData[0]; ASSERT(pCol->info.type == TSDB_DATA_TYPE_BINARY); SHistoFuncInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - int32_t start = pInput->startRowIndex; - char* data = colDataGetData(pCol, start); - SHistoFuncInfo* pInputInfo = (SHistoFuncInfo *)varDataVal(data); + int32_t start = pInput->startRowIndex; + char* data = colDataGetData(pCol, start); + SHistoFuncInfo* pInputInfo = (SHistoFuncInfo*)varDataVal(data); histogramTransferInfo(pInputInfo, pInfo); @@ -3696,15 +3686,15 @@ int32_t histogramFunctionMerge(SqlFunctionCtx *pCtx) { int32_t histogramFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); - SHistoFuncInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - int32_t slotId = pCtx->pExpr->base.resSchema.slotId; - SColumnInfoData* pCol = taosArrayGet(pBlock->pDataBlock, slotId); + SHistoFuncInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); + int32_t slotId = pCtx->pExpr->base.resSchema.slotId; + SColumnInfoData* pCol = taosArrayGet(pBlock->pDataBlock, slotId); int32_t currentRow = pBlock->info.rows; if (pInfo->normalized) { for (int32_t k = 0; k < pResInfo->numOfRes; ++k) { - if(pInfo->totalCount != 0) { + if (pInfo->totalCount != 0) { pInfo->bins[k].percentage = pInfo->bins[k].count / (double)pInfo->totalCount; } else { pInfo->bins[k].percentage = 0; @@ -3714,13 +3704,13 @@ int32_t histogramFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { for (int32_t i = 0; i < pResInfo->numOfRes; ++i) { int32_t len; - char buf[512] = {0}; + char buf[512] = {0}; if (!pInfo->normalized) { - len = sprintf(varDataVal(buf), "{\"lower_bin\":%g, \"upper_bin\":%g, \"count\":%"PRId64"}", - pInfo->bins[i].lower, pInfo->bins[i].upper, pInfo->bins[i].count); + len = sprintf(varDataVal(buf), "{\"lower_bin\":%g, \"upper_bin\":%g, \"count\":%" PRId64 "}", + pInfo->bins[i].lower, pInfo->bins[i].upper, pInfo->bins[i].count); } else { - len = sprintf(varDataVal(buf), "{\"lower_bin\":%g, \"upper_bin\":%g, \"count\":%lf}", - pInfo->bins[i].lower, pInfo->bins[i].upper, pInfo->bins[i].percentage); + len = sprintf(varDataVal(buf), "{\"lower_bin\":%g, \"upper_bin\":%g, \"count\":%lf}", pInfo->bins[i].lower, + pInfo->bins[i].upper, pInfo->bins[i].percentage); } varDataSetLen(buf, len); colDataAppend(pCol, currentRow, buf, false); @@ -3732,8 +3722,8 @@ int32_t histogramFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { int32_t histogramPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { SHistoFuncInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - int32_t resultBytes = getHistogramInfoSize(); - char *res = taosMemoryCalloc(resultBytes + VARSTR_HEADER_SIZE, sizeof(char)); + int32_t resultBytes = getHistogramInfoSize(); + char* res = taosMemoryCalloc(resultBytes + VARSTR_HEADER_SIZE, sizeof(char)); memcpy(varDataVal(res), pInfo, resultBytes); varDataSetLen(res, resultBytes); @@ -3759,23 +3749,21 @@ int32_t histogramCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { return TSDB_CODE_SUCCESS; } -int32_t getHLLInfoSize() { - return (int32_t)sizeof(SHLLInfo); -} +int32_t getHLLInfoSize() { return (int32_t)sizeof(SHLLInfo); } bool getHLLFuncEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv) { pEnv->calcMemSize = sizeof(SHLLInfo); return true; } -static uint8_t hllCountNum(void* data, int32_t bytes, int32_t *buk) { +static uint8_t hllCountNum(void* data, int32_t bytes, int32_t* buk) { uint64_t hash = MurmurHash3_64(data, bytes); - int32_t index = hash & HLL_BUCKET_MASK; + int32_t index = hash & HLL_BUCKET_MASK; hash >>= HLL_BUCKET_BITS; hash |= ((uint64_t)1 << HLL_DATA_BITS); uint64_t bit = 1; - uint8_t count = 1; - while((hash & bit) == 0) { + uint8_t count = 1; + while ((hash & bit) == 0) { count++; bit <<= 1; } @@ -3783,15 +3771,15 @@ static uint8_t hllCountNum(void* data, int32_t bytes, int32_t *buk) { return count; } -static void hllBucketHisto(uint8_t *buckets, int32_t* bucketHisto) { - uint64_t *word = (uint64_t*) buckets; - uint8_t *bytes; +static void hllBucketHisto(uint8_t* buckets, int32_t* bucketHisto) { + uint64_t* word = (uint64_t*)buckets; + uint8_t* bytes; - for (int32_t j = 0; j < HLL_BUCKETS>>3; j++) { + for (int32_t j = 0; j < HLL_BUCKETS >> 3; j++) { if (*word == 0) { bucketHisto[0] += 8; } else { - bytes = (uint8_t*) word; + bytes = (uint8_t*)word; bucketHisto[bytes[0]]++; bucketHisto[bytes[1]]++; bucketHisto[bytes[2]]++; @@ -3813,8 +3801,8 @@ static double hllTau(double x) { x = sqrt(x); zPrime = z; y *= 0.5; - z -= pow(1 - x, 2)*y; - } while(zPrime != z); + z -= pow(1 - x, 2) * y; + } while (zPrime != z); return z / 3; } @@ -3828,35 +3816,36 @@ static double hllSigma(double x) { zPrime = z; z += x * y; y += y; - } while(zPrime != z); + } while (zPrime != z); return z; } -// estimate the cardinality, the algorithm refer this paper: "New cardinality estimation algorithms for HyperLogLog sketches" -static uint64_t hllCountCnt(uint8_t *buckets) { - double m = HLL_BUCKETS; +// estimate the cardinality, the algorithm refer this paper: "New cardinality estimation algorithms for HyperLogLog +// sketches" +static uint64_t hllCountCnt(uint8_t* buckets) { + double m = HLL_BUCKETS; int32_t buckethisto[64] = {0}; - hllBucketHisto(buckets,buckethisto); + hllBucketHisto(buckets, buckethisto); - double z = m * hllTau((m-buckethisto[HLL_DATA_BITS+1])/(double)m); + double z = m * hllTau((m - buckethisto[HLL_DATA_BITS + 1]) / (double)m); for (int j = HLL_DATA_BITS; j >= 1; --j) { z += buckethisto[j]; z *= 0.5; } - z += m * hllSigma(buckethisto[0]/(double)m); - double E = (double)llroundl(HLL_ALPHA_INF*m*m/z); + z += m * hllSigma(buckethisto[0] / (double)m); + double E = (double)llroundl(HLL_ALPHA_INF * m * m / z); - return (uint64_t) E; + return (uint64_t)E; } -int32_t hllFunction(SqlFunctionCtx *pCtx) { +int32_t hllFunction(SqlFunctionCtx* pCtx) { SHLLInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); SInputColumnInfoData* pInput = &pCtx->input; SColumnInfoData* pCol = pInput->pData[0]; - int32_t type = pCol->info.type; + int32_t type = pCol->info.type; int32_t bytes = pCol->info.bytes; int32_t start = pInput->startRowIndex; @@ -3896,16 +3885,16 @@ static void hllTransferInfo(SHLLInfo* pInput, SHLLInfo* pOutput) { } } -int32_t hllFunctionMerge(SqlFunctionCtx *pCtx) { +int32_t hllFunctionMerge(SqlFunctionCtx* pCtx) { SInputColumnInfoData* pInput = &pCtx->input; - SColumnInfoData* pCol = pInput->pData[0]; + SColumnInfoData* pCol = pInput->pData[0]; ASSERT(pCol->info.type == TSDB_DATA_TYPE_BINARY); SHLLInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - int32_t start = pInput->startRowIndex; - char* data = colDataGetData(pCol, start); - SHLLInfo* pInputInfo = (SHLLInfo *)varDataVal(data); + int32_t start = pInput->startRowIndex; + char* data = colDataGetData(pCol, start); + SHLLInfo* pInputInfo = (SHLLInfo*)varDataVal(data); hllTransferInfo(pInputInfo, pInfo); @@ -3914,7 +3903,7 @@ int32_t hllFunctionMerge(SqlFunctionCtx *pCtx) { } int32_t hllFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { - SResultRowEntryInfo *pInfo = GET_RES_INFO(pCtx); + SResultRowEntryInfo* pInfo = GET_RES_INFO(pCtx); SHLLInfo* pHllInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); pHllInfo->result = hllCountCnt(pHllInfo->buckets); @@ -3927,9 +3916,9 @@ int32_t hllFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { int32_t hllPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); - SHLLInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - int32_t resultBytes = getHLLInfoSize(); - char *res = taosMemoryCalloc(resultBytes + VARSTR_HEADER_SIZE, sizeof(char)); + SHLLInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); + int32_t resultBytes = getHLLInfoSize(); + char* res = taosMemoryCalloc(resultBytes + VARSTR_HEADER_SIZE, sizeof(char)); memcpy(varDataVal(res), pInfo, resultBytes); varDataSetLen(res, resultBytes); @@ -3945,10 +3934,10 @@ int32_t hllPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { int32_t hllCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { SResultRowEntryInfo* pDResInfo = GET_RES_INFO(pDestCtx); - SHLLInfo* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); + SHLLInfo* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); SResultRowEntryInfo* pSResInfo = GET_RES_INFO(pSourceCtx); - SHLLInfo* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); + SHLLInfo* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); hllTransferInfo(pSBuf, pDBuf); pDResInfo->numOfRes = TMAX(pDResInfo->numOfRes, pSResInfo->numOfRes); @@ -3960,7 +3949,7 @@ bool getStateFuncEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv) { return true; } -static int8_t getStateOpType(char *opStr) { +static int8_t getStateOpType(char* opStr) { int8_t opType; if (strcasecmp(opStr, "LT") == 0) { opType = STATE_OPER_LT; @@ -3981,88 +3970,86 @@ static int8_t getStateOpType(char *opStr) { return opType; } -#define GET_STATE_VAL(param) \ - ((param.nType == TSDB_DATA_TYPE_BIGINT) ? (param.i) : (param.d)) - -#define STATE_COMP(_op, _lval, _param) \ - STATE_COMP_IMPL(_op, _lval, GET_STATE_VAL(_param)) - -#define STATE_COMP_IMPL(_op, _lval, _rval) \ - do { \ - switch(_op) { \ - case STATE_OPER_LT: \ - return ((_lval) < (_rval)); \ - break; \ - case STATE_OPER_GT: \ - return ((_lval) > (_rval)); \ - break; \ - case STATE_OPER_LE: \ - return ((_lval) <= (_rval)); \ - break; \ - case STATE_OPER_GE: \ - return ((_lval) >= (_rval)); \ - break; \ - case STATE_OPER_NE: \ - return ((_lval) != (_rval)); \ - break; \ - case STATE_OPER_EQ: \ - return ((_lval) == (_rval)); \ - break; \ - default: \ - break; \ - } \ +#define GET_STATE_VAL(param) ((param.nType == TSDB_DATA_TYPE_BIGINT) ? (param.i) : (param.d)) + +#define STATE_COMP(_op, _lval, _param) STATE_COMP_IMPL(_op, _lval, GET_STATE_VAL(_param)) + +#define STATE_COMP_IMPL(_op, _lval, _rval) \ + do { \ + switch (_op) { \ + case STATE_OPER_LT: \ + return ((_lval) < (_rval)); \ + break; \ + case STATE_OPER_GT: \ + return ((_lval) > (_rval)); \ + break; \ + case STATE_OPER_LE: \ + return ((_lval) <= (_rval)); \ + break; \ + case STATE_OPER_GE: \ + return ((_lval) >= (_rval)); \ + break; \ + case STATE_OPER_NE: \ + return ((_lval) != (_rval)); \ + break; \ + case STATE_OPER_EQ: \ + return ((_lval) == (_rval)); \ + break; \ + default: \ + break; \ + } \ } while (0) static bool checkStateOp(int8_t op, SColumnInfoData* pCol, int32_t index, SVariant param) { char* data = colDataGetData(pCol, index); - switch(pCol->info.type) { + switch (pCol->info.type) { case TSDB_DATA_TYPE_TINYINT: { - int8_t v = *(int8_t *)data; + int8_t v = *(int8_t*)data; STATE_COMP(op, v, param); break; } case TSDB_DATA_TYPE_UTINYINT: { - uint8_t v = *(uint8_t *)data; + uint8_t v = *(uint8_t*)data; STATE_COMP(op, v, param); break; } case TSDB_DATA_TYPE_SMALLINT: { - int16_t v = *(int16_t *)data; + int16_t v = *(int16_t*)data; STATE_COMP(op, v, param); break; } case TSDB_DATA_TYPE_USMALLINT: { - uint16_t v = *(uint16_t *)data; + uint16_t v = *(uint16_t*)data; STATE_COMP(op, v, param); break; } case TSDB_DATA_TYPE_INT: { - int32_t v = *(int32_t *)data; + int32_t v = *(int32_t*)data; STATE_COMP(op, v, param); break; } case TSDB_DATA_TYPE_UINT: { - uint32_t v = *(uint32_t *)data; + uint32_t v = *(uint32_t*)data; STATE_COMP(op, v, param); break; } case TSDB_DATA_TYPE_BIGINT: { - int64_t v = *(int64_t *)data; + int64_t v = *(int64_t*)data; STATE_COMP(op, v, param); break; } case TSDB_DATA_TYPE_UBIGINT: { - uint64_t v = *(uint64_t *)data; + uint64_t v = *(uint64_t*)data; STATE_COMP(op, v, param); break; } case TSDB_DATA_TYPE_FLOAT: { - float v = *(float *)data; + float v = *(float*)data; STATE_COMP(op, v, param); break; } case TSDB_DATA_TYPE_DOUBLE: { - double v = *(double *)data; + double v = *(double*)data; STATE_COMP(op, v, param); break; } @@ -4081,7 +4068,7 @@ int32_t stateCountFunction(SqlFunctionCtx* pCtx) { SColumnInfoData* pInputCol = pInput->pData[0]; - int32_t numOfElems = 0; + int32_t numOfElems = 0; SColumnInfoData* pOutput = (SColumnInfoData*)pCtx->pOutput; int8_t op = getStateOpType(varDataVal(pCtx->param[1].param.pz)); @@ -4096,14 +4083,14 @@ int32_t stateCountFunction(SqlFunctionCtx* pCtx) { continue; } - bool ret = checkStateOp(op, pInputCol, i, pCtx->param[2].param); + bool ret = checkStateOp(op, pInputCol, i, pCtx->param[2].param); int64_t output = -1; if (ret) { output = ++pInfo->count; } else { pInfo->count = 0; } - colDataAppend(pOutput, i, (char *)&output, false); + colDataAppend(pOutput, i, (char*)&output, false); } return numOfElems; @@ -4114,16 +4101,16 @@ int32_t stateDurationFunction(SqlFunctionCtx* pCtx) { SStateInfo* pInfo = GET_ROWCELL_INTERBUF(pResInfo); SInputColumnInfoData* pInput = &pCtx->input; - TSKEY* tsList = (int64_t*)pInput->pPTS->pData; + TSKEY* tsList = (int64_t*)pInput->pPTS->pData; SColumnInfoData* pInputCol = pInput->pData[0]; - int32_t numOfElems = 0; + int32_t numOfElems = 0; SColumnInfoData* pOutput = (SColumnInfoData*)pCtx->pOutput; - //TODO: process timeUnit for different db precisions + // TODO: process timeUnit for different db precisions int32_t timeUnit = 1000; - if (pCtx->numOfParams == 5) { //TODO: param number incorrect + if (pCtx->numOfParams == 5) { // TODO: param number incorrect timeUnit = pCtx->param[3].param.i; } @@ -4139,7 +4126,7 @@ int32_t stateDurationFunction(SqlFunctionCtx* pCtx) { continue; } - bool ret = checkStateOp(op, pInputCol, i, pCtx->param[2].param); + bool ret = checkStateOp(op, pInputCol, i, pCtx->param[2].param); int64_t output = -1; if (ret) { if (pInfo->durationStart == 0) { @@ -4151,7 +4138,7 @@ int32_t stateDurationFunction(SqlFunctionCtx* pCtx) { } else { pInfo->durationStart = 0; } - colDataAppend(pOutput, i, (char *)&output, false); + colDataAppend(pOutput, i, (char*)&output, false); } return numOfElems; @@ -4167,7 +4154,7 @@ int32_t csumFunction(SqlFunctionCtx* pCtx) { SSumRes* pSumRes = GET_ROWCELL_INTERBUF(pResInfo); SInputColumnInfoData* pInput = &pCtx->input; - TSKEY* tsList = (int64_t*)pInput->pPTS->pData; + TSKEY* tsList = (int64_t*)pInput->pPTS->pData; SColumnInfoData* pInputCol = pInput->pData[0]; SColumnInfoData* pTsOutput = pCtx->pTsOutput; @@ -4179,7 +4166,7 @@ int32_t csumFunction(SqlFunctionCtx* pCtx) { for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; i += 1) { int32_t pos = startOffset + numOfElems; if (colDataIsNull_f(pInputCol->nullbitmap, i)) { - //colDataAppendNULL(pOutput, i); + // colDataAppendNULL(pOutput, i); continue; } @@ -4188,25 +4175,25 @@ int32_t csumFunction(SqlFunctionCtx* pCtx) { int64_t v; GET_TYPED_DATA(v, int64_t, type, data); pSumRes->isum += v; - colDataAppend(pOutput, pos, (char *)&pSumRes->isum, false); + colDataAppend(pOutput, pos, (char*)&pSumRes->isum, false); } else if (IS_UNSIGNED_NUMERIC_TYPE(type)) { uint64_t v; GET_TYPED_DATA(v, uint64_t, type, data); pSumRes->usum += v; - colDataAppend(pOutput, pos, (char *)&pSumRes->usum, false); + colDataAppend(pOutput, pos, (char*)&pSumRes->usum, false); } else if (IS_FLOAT_TYPE(type)) { double v; GET_TYPED_DATA(v, double, type, data); pSumRes->dsum += v; - //check for overflow + // check for overflow if (isinf(pSumRes->dsum) || isnan(pSumRes->dsum)) { colDataAppendNULL(pOutput, pos); - } else { - colDataAppend(pOutput, pos, (char *)&pSumRes->dsum, false); + } else { + colDataAppend(pOutput, pos, (char*)&pSumRes->dsum, false); } } - //TODO: remove this after pTsOutput is handled + // TODO: remove this after pTsOutput is handled if (pTsOutput != NULL) { colDataAppendInt64(pTsOutput, pos, &tsList[i]); } @@ -4222,12 +4209,12 @@ bool getMavgFuncEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv) { return true; } -bool mavgFunctionSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo *pResultInfo) { +bool mavgFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInfo) { if (!functionSetup(pCtx, pResultInfo)) { return false; } - SMavgInfo *pInfo = GET_ROWCELL_INTERBUF(pResultInfo); + SMavgInfo* pInfo = GET_ROWCELL_INTERBUF(pResultInfo); pInfo->pos = 0; pInfo->sum = 0; pInfo->numOfPoints = pCtx->param[1].param.i; @@ -4244,7 +4231,7 @@ int32_t mavgFunction(SqlFunctionCtx* pCtx) { SMavgInfo* pInfo = GET_ROWCELL_INTERBUF(pResInfo); SInputColumnInfoData* pInput = &pCtx->input; - TSKEY* tsList = (int64_t*)pInput->pPTS->pData; + TSKEY* tsList = (int64_t*)pInput->pPTS->pData; SColumnInfoData* pInputCol = pInput->pData[0]; SColumnInfoData* pTsOutput = pCtx->pTsOutput; @@ -4256,11 +4243,11 @@ int32_t mavgFunction(SqlFunctionCtx* pCtx) { for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; i += 1) { int32_t pos = startOffset + numOfElems; if (colDataIsNull_f(pInputCol->nullbitmap, i)) { - //colDataAppendNULL(pOutput, i); + // colDataAppendNULL(pOutput, i); continue; } - char* data = colDataGetData(pInputCol, i); + char* data = colDataGetData(pInputCol, i); double v; GET_TYPED_DATA(v, double, type, data); @@ -4269,7 +4256,7 @@ int32_t mavgFunction(SqlFunctionCtx* pCtx) { pInfo->sum += v; } else { if (!pInfo->pointsMeet && (pInfo->pos == pInfo->numOfPoints - 1)) { - pInfo->sum +=v; + pInfo->sum += v; pInfo->pointsMeet = true; } else { pInfo->sum = pInfo->sum + v - pInfo->points[pInfo->pos]; @@ -4277,14 +4264,14 @@ int32_t mavgFunction(SqlFunctionCtx* pCtx) { pInfo->points[pInfo->pos] = v; double result = pInfo->sum / pInfo->numOfPoints; - //check for overflow + // check for overflow if (isinf(result) || isnan(result)) { colDataAppendNULL(pOutput, pos); - } else { - colDataAppend(pOutput, pos, (char *)&result, false); + } else { + colDataAppend(pOutput, pos, (char*)&result, false); } - //TODO: remove this after pTsOutput is handled + // TODO: remove this after pTsOutput is handled if (pTsOutput != NULL) { colDataAppendInt64(pTsOutput, pos, &tsList[i]); } @@ -4302,20 +4289,20 @@ int32_t mavgFunction(SqlFunctionCtx* pCtx) { bool getSampleFuncEnv(SFunctionNode* pFunc, SFuncExecEnv* pEnv) { SColumnNode* pCol = (SColumnNode*)nodesListGetNode(pFunc->pParameterList, 0); - SValueNode* pVal = (SValueNode*)nodesListGetNode(pFunc->pParameterList, 1); - int32_t numOfSamples = pVal->datum.i; + SValueNode* pVal = (SValueNode*)nodesListGetNode(pFunc->pParameterList, 1); + int32_t numOfSamples = pVal->datum.i; pEnv->calcMemSize = sizeof(SSampleInfo) + numOfSamples * (pCol->node.resType.bytes + sizeof(int64_t)); return true; } -bool sampleFunctionSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo *pResultInfo) { +bool sampleFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInfo) { if (!functionSetup(pCtx, pResultInfo)) { return false; } taosSeedRand(taosSafeRand()); - SSampleInfo *pInfo = GET_ROWCELL_INTERBUF(pResultInfo); + SSampleInfo* pInfo = GET_ROWCELL_INTERBUF(pResultInfo); pInfo->samples = pCtx->param[1].param.i; pInfo->totalPoints = 0; pInfo->numSampled = 0; @@ -4324,18 +4311,18 @@ bool sampleFunctionSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo *pResultInfo) if (pInfo->samples < 1 || pInfo->samples > SAMPLE_MAX_POINTS_NUM) { return false; } - pInfo->data = (char *)pInfo + sizeof(SSampleInfo); - pInfo->timestamp = (int64_t *)((char *)pInfo + sizeof(SSampleInfo) + pInfo->samples * pInfo->colBytes); + pInfo->data = (char*)pInfo + sizeof(SSampleInfo); + pInfo->timestamp = (int64_t*)((char*)pInfo + sizeof(SSampleInfo) + pInfo->samples * pInfo->colBytes); return true; } -static void sampleAssignResult(SSampleInfo* pInfo, char *data, TSKEY ts, int32_t index) { +static void sampleAssignResult(SSampleInfo* pInfo, char* data, TSKEY ts, int32_t index) { assignVal(pInfo->data + index * pInfo->colBytes, data, pInfo->colBytes, pInfo->colType); *(pInfo->timestamp + index) = ts; } -static void doReservoirSample(SSampleInfo* pInfo, char *data, TSKEY ts, int32_t index) { +static void doReservoirSample(SSampleInfo* pInfo, char* data, TSKEY ts, int32_t index) { pInfo->totalPoints++; if (pInfo->numSampled < pInfo->samples) { sampleAssignResult(pInfo, data, ts, pInfo->numSampled); @@ -4366,7 +4353,7 @@ int32_t sampleFunction(SqlFunctionCtx* pCtx) { } char* data = colDataGetData(pInputCol, i); - doReservoirSample(pInfo, data, /*tsList[i]*/0, i); + doReservoirSample(pInfo, data, /*tsList[i]*/ 0, i); } SET_VAL(pResInfo, pInfo->numSampled, pInfo->numSampled); @@ -4379,7 +4366,7 @@ int32_t sampleFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { SSampleInfo* pInfo = GET_ROWCELL_INTERBUF(pEntryInfo); pEntryInfo->complete = true; - int32_t slotId = pCtx->pExpr->base.resSchema.slotId; + int32_t slotId = pCtx->pExpr->base.resSchema.slotId; SColumnInfoData* pCol = taosArrayGet(pBlock->pDataBlock, slotId); int32_t currentRow = pBlock->info.rows; @@ -4393,17 +4380,17 @@ int32_t sampleFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { bool getTailFuncEnv(SFunctionNode* pFunc, SFuncExecEnv* pEnv) { SColumnNode* pCol = (SColumnNode*)nodesListGetNode(pFunc->pParameterList, 0); SValueNode* pVal = (SValueNode*)nodesListGetNode(pFunc->pParameterList, 1); - int32_t numOfPoints = pVal->datum.i; + int32_t numOfPoints = pVal->datum.i; pEnv->calcMemSize = sizeof(STailInfo) + numOfPoints * (POINTER_BYTES + sizeof(STailItem) + pCol->node.resType.bytes); return true; } -bool tailFunctionSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo *pResultInfo) { +bool tailFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInfo) { if (!functionSetup(pCtx, pResultInfo)) { return false; } - STailInfo *pInfo = GET_ROWCELL_INTERBUF(pResultInfo); + STailInfo* pInfo = GET_ROWCELL_INTERBUF(pResultInfo); pInfo->numAdded = 0; pInfo->numOfPoints = pCtx->param[1].param.i; if (pCtx->numOfParams == 4) { @@ -4418,19 +4405,19 @@ bool tailFunctionSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo *pResultInfo) { return false; } - pInfo->pItems = (STailItem **)((char *)pInfo + sizeof(STailInfo)); - char *pItem = (char *)pInfo->pItems + pInfo->numOfPoints * POINTER_BYTES; + pInfo->pItems = (STailItem**)((char*)pInfo + sizeof(STailInfo)); + char* pItem = (char*)pInfo->pItems + pInfo->numOfPoints * POINTER_BYTES; size_t unitSize = sizeof(STailItem) + pInfo->colBytes; for (int32_t i = 0; i < pInfo->numOfPoints; ++i) { - pInfo->pItems[i] = (STailItem *)(pItem + i * unitSize); + pInfo->pItems[i] = (STailItem*)(pItem + i * unitSize); pInfo->pItems[i]->isNull = false; } return true; } -static void tailAssignResult(STailItem* pItem, char *data, int32_t colBytes, TSKEY ts, bool isNull) { +static void tailAssignResult(STailItem* pItem, char* data, int32_t colBytes, TSKEY ts, bool isNull) { pItem->timestamp = ts; if (isNull) { pItem->isNull = true; @@ -4440,30 +4427,30 @@ static void tailAssignResult(STailItem* pItem, char *data, int32_t colBytes, TSK } } -static int32_t tailCompFn(const void *p1, const void *p2, const void *param) { - STailItem *d1 = *(STailItem **)p1; - STailItem *d2 = *(STailItem **)p2; +static int32_t tailCompFn(const void* p1, const void* p2, const void* param) { + STailItem* d1 = *(STailItem**)p1; + STailItem* d2 = *(STailItem**)p2; return compareInt64Val(&d1->timestamp, &d2->timestamp); } -static void doTailAdd(STailInfo* pInfo, char *data, TSKEY ts, bool isNull) { - STailItem **pList = pInfo->pItems; +static void doTailAdd(STailInfo* pInfo, char* data, TSKEY ts, bool isNull) { + STailItem** pList = pInfo->pItems; if (pInfo->numAdded < pInfo->numOfPoints) { tailAssignResult(pList[pInfo->numAdded], data, pInfo->colBytes, ts, isNull); - taosheapsort((void *)pList, sizeof(STailItem **), pInfo->numAdded + 1, NULL, tailCompFn, 0); + taosheapsort((void*)pList, sizeof(STailItem**), pInfo->numAdded + 1, NULL, tailCompFn, 0); pInfo->numAdded++; } else if (pList[0]->timestamp < ts) { tailAssignResult(pList[0], data, pInfo->colBytes, ts, isNull); - taosheapadjust((void *)pList, sizeof(STailItem **), 0, pInfo->numOfPoints - 1, NULL, tailCompFn, NULL, 0); + taosheapadjust((void*)pList, sizeof(STailItem**), 0, pInfo->numOfPoints - 1, NULL, tailCompFn, NULL, 0); } } int32_t tailFunction(SqlFunctionCtx* pCtx) { SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); - STailInfo* pInfo = GET_ROWCELL_INTERBUF(pResInfo); + STailInfo* pInfo = GET_ROWCELL_INTERBUF(pResInfo); SInputColumnInfoData* pInput = &pCtx->input; - TSKEY* tsList = (int64_t*)pInput->pPTS->pData; + TSKEY* tsList = (int64_t*)pInput->pPTS->pData; SColumnInfoData* pInputCol = pInput->pData[0]; SColumnInfoData* pOutput = (SColumnInfoData*)pCtx->pOutput; @@ -4475,7 +4462,6 @@ int32_t tailFunction(SqlFunctionCtx* pCtx) { pInfo->numOfPoints = TMIN(pInfo->numOfPoints, pInput->numOfRows - pInfo->offset); } for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex - pInfo->offset; i += 1) { - char* data = colDataGetData(pInputCol, i); doTailAdd(pInfo, data, tsList[i], colDataIsNull_s(pInputCol, i)); } @@ -4483,8 +4469,8 @@ int32_t tailFunction(SqlFunctionCtx* pCtx) { taosqsort(pInfo->pItems, pInfo->numOfPoints, POINTER_BYTES, NULL, tailCompFn); for (int32_t i = 0; i < pInfo->numOfPoints; ++i) { - int32_t pos = startOffset + i; - STailItem *pItem = pInfo->pItems[i]; + int32_t pos = startOffset + i; + STailItem* pItem = pInfo->pItems[i]; if (pItem->isNull) { colDataAppendNULL(pOutput, pos); } else { @@ -4497,7 +4483,7 @@ int32_t tailFunction(SqlFunctionCtx* pCtx) { int32_t tailFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { SResultRowEntryInfo* pEntryInfo = GET_RES_INFO(pCtx); - STailInfo* pInfo = GET_ROWCELL_INTERBUF(pEntryInfo); + STailInfo* pInfo = GET_ROWCELL_INTERBUF(pEntryInfo); pEntryInfo->complete = true; int32_t type = pCtx->input.pData[0]->info.type; @@ -4508,10 +4494,10 @@ int32_t tailFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { // todo assign the tag value and the corresponding row data int32_t currentRow = pBlock->info.rows; for (int32_t i = 0; i < pEntryInfo->numOfRes; ++i) { - STailItem *pItem = pInfo->pItems[i]; + STailItem* pItem = pInfo->pItems[i]; colDataAppend(pCol, currentRow, pItem->data, false); - //setSelectivityValue(pCtx, pBlock, &pInfo->pItems[i].tuplePos, currentRow); + // setSelectivityValue(pCtx, pBlock, &pInfo->pItems[i].tuplePos, currentRow); currentRow += 1; } @@ -4540,11 +4526,11 @@ bool uniqueFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResInfo) { return true; } -static void doUniqueAdd(SUniqueInfo* pInfo, char *data, TSKEY ts, bool isNull) { - //handle null elements +static void doUniqueAdd(SUniqueInfo* pInfo, char* data, TSKEY ts, bool isNull) { + // handle null elements if (isNull == true) { - int32_t size = sizeof(SUniqueItem) + pInfo->colBytes; - SUniqueItem *pItem = (SUniqueItem *)(pInfo->pItems + pInfo->numOfPoints * size); + int32_t size = sizeof(SUniqueItem) + pInfo->colBytes; + SUniqueItem* pItem = (SUniqueItem*)(pInfo->pItems + pInfo->numOfPoints * size); if (pInfo->hasNull == false && pItem->isNull == false) { pItem->timestamp = ts; pItem->isNull = true; @@ -4556,15 +4542,15 @@ static void doUniqueAdd(SUniqueInfo* pInfo, char *data, TSKEY ts, bool isNull) { return; } - int32_t hashKeyBytes = IS_VAR_DATA_TYPE(pInfo->colType) ? varDataTLen(data) : pInfo->colBytes; - SUniqueItem *pHashItem = taosHashGet(pInfo->pHash, data, hashKeyBytes); + int32_t hashKeyBytes = IS_VAR_DATA_TYPE(pInfo->colType) ? varDataTLen(data) : pInfo->colBytes; + SUniqueItem* pHashItem = taosHashGet(pInfo->pHash, data, hashKeyBytes); if (pHashItem == NULL) { - int32_t size = sizeof(SUniqueItem) + pInfo->colBytes; - SUniqueItem *pItem = (SUniqueItem *)(pInfo->pItems + pInfo->numOfPoints * size); + int32_t size = sizeof(SUniqueItem) + pInfo->colBytes; + SUniqueItem* pItem = (SUniqueItem*)(pInfo->pItems + pInfo->numOfPoints * size); pItem->timestamp = ts; memcpy(pItem->data, data, pInfo->colBytes); - taosHashPut(pInfo->pHash, data, hashKeyBytes, (char *)pItem, sizeof(SUniqueItem*)); + taosHashPut(pInfo->pHash, data, hashKeyBytes, (char*)pItem, sizeof(SUniqueItem*)); pInfo->numOfPoints++; } else if (pHashItem->timestamp > ts) { pHashItem->timestamp = ts; @@ -4576,7 +4562,7 @@ int32_t uniqueFunction(SqlFunctionCtx* pCtx) { SUniqueInfo* pInfo = GET_ROWCELL_INTERBUF(pResInfo); SInputColumnInfoData* pInput = &pCtx->input; - TSKEY* tsList = (int64_t*)pInput->pPTS->pData; + TSKEY* tsList = (int64_t*)pInput->pPTS->pData; SColumnInfoData* pInputCol = pInput->pData[0]; SColumnInfoData* pTsOutput = pCtx->pTsOutput; @@ -4594,7 +4580,7 @@ int32_t uniqueFunction(SqlFunctionCtx* pCtx) { } for (int32_t i = 0; i < pInfo->numOfPoints; ++i) { - SUniqueItem *pItem = (SUniqueItem *)(pInfo->pItems + i * (sizeof(SUniqueItem) + pInfo->colBytes)); + SUniqueItem* pItem = (SUniqueItem*)(pInfo->pItems + i * (sizeof(SUniqueItem) + pInfo->colBytes)); if (pItem->isNull == true) { colDataAppendNULL(pOutput, i); } else { @@ -4610,14 +4596,14 @@ int32_t uniqueFunction(SqlFunctionCtx* pCtx) { int32_t uniqueFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); - SUniqueInfo* pInfo = GET_ROWCELL_INTERBUF(pResInfo); - int32_t slotId = pCtx->pExpr->base.resSchema.slotId; - SColumnInfoData* pCol = taosArrayGet(pBlock->pDataBlock, slotId); + SUniqueInfo* pInfo = GET_ROWCELL_INTERBUF(pResInfo); + int32_t slotId = pCtx->pExpr->base.resSchema.slotId; + SColumnInfoData* pCol = taosArrayGet(pBlock->pDataBlock, slotId); for (int32_t i = 0; i < pResInfo->numOfRes; ++i) { - SUniqueItem *pItem = (SUniqueItem *)(pInfo->pItems + i * (sizeof(SUniqueItem) + pInfo->colBytes)); + SUniqueItem* pItem = (SUniqueItem*)(pInfo->pItems + i * (sizeof(SUniqueItem) + pInfo->colBytes)); colDataAppend(pCol, i, pItem->data, false); - //TODO: handle ts output + // TODO: handle ts output } return pResInfo->numOfRes; @@ -4634,43 +4620,43 @@ bool getTwaFuncEnv(struct SFunctionNode* pFunc, SFuncExecEnv* pEnv) { return true; } -bool twaFunctionSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo* pResultInfo) { +bool twaFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInfo) { if (!functionSetup(pCtx, pResultInfo)) { return false; } - STwaInfo *pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - pInfo->p.key = INT64_MIN; - pInfo->win = TSWINDOW_INITIALIZER; + STwaInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); + pInfo->p.key = INT64_MIN; + pInfo->win = TSWINDOW_INITIALIZER; return true; } static double twa_get_area(SPoint1 s, SPoint1 e) { - if ((s.val >= 0 && e.val >= 0)|| (s.val <=0 && e.val <= 0)) { + if ((s.val >= 0 && e.val >= 0) || (s.val <= 0 && e.val <= 0)) { return (s.val + e.val) * (e.key - s.key) / 2; } - double x = (s.key * e.val - e.key * s.val)/(e.val - s.val); + double x = (s.key * e.val - e.key * s.val) / (e.val - s.val); double val = (s.val * (x - s.key) + e.val * (e.key - x)) / 2; return val; } #define INIT_INTP_POINT(_p, _k, _v) \ - do { \ - (_p).key = (_k); \ - (_p).val = (_v); \ + do { \ + (_p).key = (_k); \ + (_p).val = (_v); \ } while (0) int32_t twaFunction(SqlFunctionCtx* pCtx) { SInputColumnInfoData* pInput = &pCtx->input; - SColumnInfoData* pInputCol = pInput->pData[0]; + SColumnInfoData* pInputCol = pInput->pData[0]; TSKEY* tsList = (int64_t*)pInput->pPTS->pData; - SResultRowEntryInfo *pResInfo = GET_RES_INFO(pCtx); + SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); - STwaInfo *pInfo = GET_ROWCELL_INTERBUF(pResInfo); - SPoint1 *last = &pInfo->p; + STwaInfo* pInfo = GET_ROWCELL_INTERBUF(pResInfo); + SPoint1* last = &pInfo->p; int32_t numOfElems = 0; int32_t i = pInput->startRowIndex; @@ -4699,9 +4685,9 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { SPoint1 st = {0}; // calculate the value of - switch(pInputCol->info.type) { + switch (pInputCol->info.type) { case TSDB_DATA_TYPE_TINYINT: { - int8_t *val = (int8_t*) colDataGetData(pInputCol, 0); + int8_t* val = (int8_t*)colDataGetData(pInputCol, 0); for (; i < pInput->numOfRows + pInput->startRowIndex; i += 1) { if (colDataIsNull_f(pInputCol->nullbitmap, i)) { continue; @@ -4715,7 +4701,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { } case TSDB_DATA_TYPE_SMALLINT: { - int16_t *val = (int16_t*) colDataGetData(pInputCol, 0); + int16_t* val = (int16_t*)colDataGetData(pInputCol, 0); for (; i < pInput->numOfRows + pInput->startRowIndex; i += 1) { if (colDataIsNull_f(pInputCol->nullbitmap, i)) { continue; @@ -4728,7 +4714,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { break; } case TSDB_DATA_TYPE_INT: { - int32_t *val = (int32_t*) colDataGetData(pInputCol, 0); + int32_t* val = (int32_t*)colDataGetData(pInputCol, 0); for (; i < pInput->numOfRows + pInput->startRowIndex; i += 1) { if (colDataIsNull_f(pInputCol->nullbitmap, i)) { continue; @@ -4741,7 +4727,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { break; } case TSDB_DATA_TYPE_BIGINT: { - int64_t *val = (int64_t*) colDataGetData(pInputCol, 0); + int64_t* val = (int64_t*)colDataGetData(pInputCol, 0); for (; i < pInput->numOfRows + pInput->startRowIndex; i += 1) { if (colDataIsNull_f(pInputCol->nullbitmap, i)) { continue; @@ -4754,7 +4740,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { break; } case TSDB_DATA_TYPE_FLOAT: { - float *val = (float*) colDataGetData(pInputCol, 0); + float* val = (float*)colDataGetData(pInputCol, 0); for (; i < pInput->numOfRows + pInput->startRowIndex; i += 1) { if (colDataIsNull_f(pInputCol->nullbitmap, i)) { continue; @@ -4767,7 +4753,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { break; } case TSDB_DATA_TYPE_DOUBLE: { - double *val = (double*) colDataGetData(pInputCol, 0); + double* val = (double*)colDataGetData(pInputCol, 0); for (; i < pInput->numOfRows + pInput->startRowIndex; i += 1) { if (colDataIsNull_f(pInputCol->nullbitmap, i)) { continue; @@ -4780,7 +4766,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { break; } case TSDB_DATA_TYPE_UTINYINT: { - uint8_t *val = (uint8_t*) colDataGetData(pInputCol, 0); + uint8_t* val = (uint8_t*)colDataGetData(pInputCol, 0); for (; i < pInput->numOfRows + pInput->startRowIndex; i += 1) { if (colDataIsNull_f(pInputCol->nullbitmap, i)) { continue; @@ -4793,7 +4779,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { break; } case TSDB_DATA_TYPE_USMALLINT: { - uint16_t *val = (uint16_t*) colDataGetData(pInputCol, 0); + uint16_t* val = (uint16_t*)colDataGetData(pInputCol, 0); for (; i < pInput->numOfRows + pInput->startRowIndex; i += 1) { if (colDataIsNull_f(pInputCol->nullbitmap, i)) { continue; @@ -4806,7 +4792,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { break; } case TSDB_DATA_TYPE_UINT: { - uint32_t *val = (uint32_t*) colDataGetData(pInputCol, 0); + uint32_t* val = (uint32_t*)colDataGetData(pInputCol, 0); for (; i < pInput->numOfRows + pInput->startRowIndex; i += 1) { if (colDataIsNull_f(pInputCol->nullbitmap, i)) { continue; @@ -4819,7 +4805,7 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { break; } case TSDB_DATA_TYPE_UBIGINT: { - uint64_t *val = (uint64_t*) colDataGetData(pInputCol, 0); + uint64_t* val = (uint64_t*)colDataGetData(pInputCol, 0); for (; i < pInput->numOfRows + pInput->startRowIndex; i += 1) { if (colDataIsNull_f(pInputCol->nullbitmap, i)) { continue; @@ -4832,16 +4818,17 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { break; } - default: ASSERT(0); + default: + ASSERT(0); } // the last interpolated time window value if (pCtx->end.key != INT64_MIN) { - pInfo->dOutput += twa_get_area(pInfo->p, pCtx->end); + pInfo->dOutput += twa_get_area(pInfo->p, pCtx->end); pInfo->p = pCtx->end; } - pInfo->win.ekey = pInfo->p.key; + pInfo->win.ekey = pInfo->p.key; SET_VAL(pResInfo, numOfElems, 1); return TSDB_CODE_SUCCESS; @@ -4852,18 +4839,18 @@ int32_t twaFunction(SqlFunctionCtx* pCtx) { * by next input data. The TWA function only applies to each table, so no merge procedure * is required, we simply copy to the resut ot interResBuffer. */ -//void twa_function_copy(SQLFunctionCtx *pCtx) { -// assert(pCtx->inputType == TSDB_DATA_TYPE_BINARY); -// SResultRowEntryInfo *pResInfo = GET_RES_INFO(pCtx); +// void twa_function_copy(SQLFunctionCtx *pCtx) { +// assert(pCtx->inputType == TSDB_DATA_TYPE_BINARY); +// SResultRowEntryInfo *pResInfo = GET_RES_INFO(pCtx); // -// memcpy(GET_ROWCELL_INTERBUF(pResInfo), pCtx->pInput, (size_t)pCtx->inputBytes); -// pResInfo->hasResult = ((STwaInfo *)pCtx->pInput)->hasResult; -//} +// memcpy(GET_ROWCELL_INTERBUF(pResInfo), pCtx->pInput, (size_t)pCtx->inputBytes); +// pResInfo->hasResult = ((STwaInfo *)pCtx->pInput)->hasResult; +// } -int32_t twaFinalize(struct SqlFunctionCtx *pCtx, SSDataBlock* pBlock) { - SResultRowEntryInfo *pResInfo = GET_RES_INFO(pCtx); +int32_t twaFinalize(struct SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { + SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); - STwaInfo *pInfo = (STwaInfo *)GET_ROWCELL_INTERBUF(pResInfo); + STwaInfo* pInfo = (STwaInfo*)GET_ROWCELL_INTERBUF(pResInfo); if (pResInfo->numOfRes == 0) { pResInfo->isNullRes = 1; } else { @@ -4879,11 +4866,11 @@ int32_t twaFinalize(struct SqlFunctionCtx *pCtx, SSDataBlock* pBlock) { return functionFinalize(pCtx, pBlock); } -int32_t blockDistFunction(SqlFunctionCtx *pCtx) { +int32_t blockDistFunction(SqlFunctionCtx* pCtx) { SInputColumnInfoData* pInput = &pCtx->input; - SColumnInfoData* pInputCol = pInput->pData[0]; + SColumnInfoData* pInputCol = pInput->pData[0]; - SResultRowEntryInfo *pResInfo = GET_RES_INFO(pCtx); + SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); STableBlockDistInfo* pDistInfo = GET_ROWCELL_INTERBUF(pResInfo); @@ -4904,7 +4891,7 @@ int32_t blockDistFunction(SqlFunctionCtx *pCtx) { pDistInfo->maxRows = p1.maxRows; } - for(int32_t i = 0; i < tListLen(pDistInfo->blockRowsHisto); ++i) { + for (int32_t i = 0; i < tListLen(pDistInfo->blockRowsHisto); ++i) { pDistInfo->blockRowsHisto[i] += p1.blockRowsHisto[i]; } @@ -4932,7 +4919,7 @@ int32_t tSerializeBlockDistInfo(void* buf, int32_t bufLen, const STableBlockDist if (tEncodeU32(&encoder, pInfo->numOfInmemRows) < 0) return -1; if (tEncodeU32(&encoder, pInfo->numOfSmallBlocks) < 0) return -1; - for(int32_t i = 0; i < tListLen(pInfo->blockRowsHisto); ++i) { + for (int32_t i = 0; i < tListLen(pInfo->blockRowsHisto); ++i) { if (tEncodeI32(&encoder, pInfo->blockRowsHisto[i]) < 0) return -1; } @@ -4963,7 +4950,7 @@ int32_t tDeserializeBlockDistInfo(void* buf, int32_t bufLen, STableBlockDistInfo if (tDecodeU32(&decoder, &pInfo->numOfInmemRows) < 0) return -1; if (tDecodeU32(&decoder, &pInfo->numOfSmallBlocks) < 0) return -1; - for(int32_t i = 0; i < tListLen(pInfo->blockRowsHisto); ++i) { + for (int32_t i = 0; i < tListLen(pInfo->blockRowsHisto); ++i) { if (tDecodeI32(&decoder, &pInfo->blockRowsHisto[i]) < 0) return -1; } @@ -4972,8 +4959,8 @@ int32_t tDeserializeBlockDistInfo(void* buf, int32_t bufLen, STableBlockDistInfo } int32_t blockDistFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { - SResultRowEntryInfo *pResInfo = GET_RES_INFO(pCtx); - char *pData = GET_ROWCELL_INTERBUF(pResInfo); + SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); + char* pData = GET_ROWCELL_INTERBUF(pResInfo); SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, 0); @@ -4982,41 +4969,35 @@ int32_t blockDistFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { STableBlockDistInfo info = {0}; tDeserializeBlockDistInfo(varDataVal(pData), varDataLen(pData), &info); - char st[256] = {0}; - int32_t len = sprintf(st+VARSTR_HEADER_SIZE, "Blocks=[%d] Size=[%.3fKb] Average_Block_size=[%.3fKb] Compression_Ratio=[%.3f]", info.numOfBlocks, - info.totalSize/1024.0, - info.totalSize/(info.numOfBlocks*1024.0), - info.totalSize/(info.totalRows*info.rowSize*1.0) - ); + char st[256] = {0}; + int32_t len = + sprintf(st + VARSTR_HEADER_SIZE, "Blocks=[%d] Size=[%.3fKb] Average_Block_size=[%.3fKb] Compression_Ratio=[%.3f]", + info.numOfBlocks, info.totalSize / 1024.0, info.totalSize / (info.numOfBlocks * 1024.0), + info.totalSize / (info.totalRows * info.rowSize * 1.0)); varDataSetLen(st, len); colDataAppend(pColInfo, row++, st, false); - len = sprintf(st+VARSTR_HEADER_SIZE, "Total_Rows=[%ld] MinRows=[%d] MaxRows=[%d] Averge_Rows=[%ld] Inmem_Rows=[%d]", - info.totalRows, - info.minRows, - info.maxRows, - info.totalRows/info.numOfBlocks, - info.numOfInmemRows - ); + len = sprintf(st + VARSTR_HEADER_SIZE, "Total_Rows=[%ld] MinRows=[%d] MaxRows=[%d] Averge_Rows=[%ld] Inmem_Rows=[%d]", + info.totalRows, info.minRows, info.maxRows, info.totalRows / info.numOfBlocks, info.numOfInmemRows); varDataSetLen(st, len); colDataAppend(pColInfo, row++, st, false); - len = sprintf(st + VARSTR_HEADER_SIZE, "Total_Tables=[%d] Total_Files=[%d] Total_Vgroups=[%d]", - info.numOfTables, - info.numOfFiles, 0); + len = sprintf(st + VARSTR_HEADER_SIZE, "Total_Tables=[%d] Total_Files=[%d] Total_Vgroups=[%d]", info.numOfTables, + info.numOfFiles, 0); varDataSetLen(st, len); colDataAppend(pColInfo, row++, st, false); - len = sprintf(st+VARSTR_HEADER_SIZE, "--------------------------------------------------------------------------------"); + len = sprintf(st + VARSTR_HEADER_SIZE, + "--------------------------------------------------------------------------------"); varDataSetLen(st, len); colDataAppend(pColInfo, row++, st, false); int32_t maxVal = 0; int32_t minVal = INT32_MAX; - for(int32_t i = 0; i < sizeof(info.blockRowsHisto)/sizeof(info.blockRowsHisto[0]); ++i) { + for (int32_t i = 0; i < sizeof(info.blockRowsHisto) / sizeof(info.blockRowsHisto[0]); ++i) { if (maxVal < info.blockRowsHisto[i]) { maxVal = info.blockRowsHisto[i]; } @@ -5029,10 +5010,10 @@ int32_t blockDistFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { int32_t delta = maxVal - minVal; int32_t step = delta / 50; - int32_t numOfBuckets = sizeof(info.blockRowsHisto)/sizeof(info.blockRowsHisto[0]); + int32_t numOfBuckets = sizeof(info.blockRowsHisto) / sizeof(info.blockRowsHisto[0]); int32_t bucketRange = (info.maxRows - info.minRows) / numOfBuckets; - for(int32_t i = 0; i < 20; ++i) { + for (int32_t i = 0; i < 20; ++i) { len += sprintf(st + VARSTR_HEADER_SIZE, "%04d |", info.defMinRows + bucketRange * (i + 1)); int32_t num = (info.blockRowsHisto[i] + step - 1) / step; @@ -5042,7 +5023,7 @@ int32_t blockDistFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { } double v = info.blockRowsHisto[i] * 100.0 / info.numOfBlocks; - len += sprintf(st+ VARSTR_HEADER_SIZE + len, " %d (%.3f%c)", info.blockRowsHisto[i], v, '%'); + len += sprintf(st + VARSTR_HEADER_SIZE + len, " %d (%.3f%c)", info.blockRowsHisto[i], v, '%'); printf("%s\n", st); varDataSetLen(st, len); diff --git a/source/libs/function/src/functionMgt.c b/source/libs/function/src/functionMgt.c index caae4c05f785825083856b3c84022b71692ebb7c..e9c916034d5587103f859fa3131aa9c1efce4096 100644 --- a/source/libs/function/src/functionMgt.c +++ b/source/libs/function/src/functionMgt.c @@ -161,6 +161,8 @@ bool fmIsUserDefinedFunc(int32_t funcId) { return funcId > FUNC_UDF_ID_START; } bool fmIsForbidFillFunc(int32_t funcId) { return isSpecificClassifyFunc(funcId, FUNC_MGT_FORBID_FILL_FUNC); } +bool fmIsForbidStreamFunc(int32_t funcId) { return isSpecificClassifyFunc(funcId, FUNC_MGT_FORBID_STREAM_FUNC); } + void fmFuncMgtDestroy() { void* m = gFunMgtService.pFuncNameHashTable; if (m != NULL && atomic_val_compare_exchange_ptr((void**)&gFunMgtService.pFuncNameHashTable, m, 0) == m) { @@ -239,7 +241,7 @@ static int32_t getFuncInfo(SFunctionNode* pFunc) { } static SFunctionNode* createFunction(const char* pName, SNodeList* pParameterList) { - SFunctionNode* pFunc = nodesMakeNode(QUERY_NODE_FUNCTION); + SFunctionNode* pFunc = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION); if (NULL == pFunc) { return NULL; } @@ -247,14 +249,14 @@ static SFunctionNode* createFunction(const char* pName, SNodeList* pParameterLis pFunc->pParameterList = pParameterList; if (TSDB_CODE_SUCCESS != getFuncInfo(pFunc)) { pFunc->pParameterList = NULL; - nodesDestroyNode(pFunc); + nodesDestroyNode((SNode*)pFunc); return NULL; } return pFunc; } static SColumnNode* createColumnByFunc(const SFunctionNode* pFunc) { - SColumnNode* pCol = nodesMakeNode(QUERY_NODE_COLUMN); + SColumnNode* pCol = (SColumnNode*)nodesMakeNode(QUERY_NODE_COLUMN); if (NULL == pCol) { return NULL; } @@ -291,7 +293,7 @@ static int32_t createPartialFunction(const SFunctionNode* pSrcFunc, SFunctionNod static int32_t createMergeFunction(const SFunctionNode* pSrcFunc, const SFunctionNode* pPartialFunc, SFunctionNode** pMergeFunc) { SNodeList* pParameterList = NULL; - nodesListMakeStrictAppend(&pParameterList, createColumnByFunc(pPartialFunc)); + nodesListMakeStrictAppend(&pParameterList, (SNode*)createColumnByFunc(pPartialFunc)); *pMergeFunc = createFunction(funcMgtBuiltins[pSrcFunc->funcId].pMergeFunc, pParameterList); if (NULL == *pMergeFunc) { nodesDestroyList(pParameterList); @@ -316,8 +318,8 @@ int32_t fmGetDistMethod(const SFunctionNode* pFunc, SFunctionNode** pPartialFunc } if (TSDB_CODE_SUCCESS != code) { - nodesDestroyNode(*pPartialFunc); - nodesDestroyNode(*pMergeFunc); + nodesDestroyNode((SNode*)*pPartialFunc); + nodesDestroyNode((SNode*)*pMergeFunc); } return code; diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c index 7e6a1f5e0cb980f104cf496db668a9faceb56bd2..1ef0ccf7f919eb1f4194a4ac199deb7eb77a5074 100644 --- a/source/libs/nodes/src/nodesCloneFuncs.c +++ b/source/libs/nodes/src/nodesCloneFuncs.c @@ -40,6 +40,10 @@ break; \ } \ (pDst)->fldname = strdup((pSrc)->fldname); \ + if (NULL == (pDst)->fldname) { \ + nodesDestroyNode((SNode*)pDst); \ + return NULL; \ + } \ } while (0) #define CLONE_NODE_FIELD(fldname) \ @@ -49,11 +53,23 @@ } \ (pDst)->fldname = nodesCloneNode((pSrc)->fldname); \ if (NULL == (pDst)->fldname) { \ - nodesDestroyNode((SNode*)(pDst)); \ + nodesDestroyNode((SNode*)pDst); \ return NULL; \ } \ } while (0) +#define CLONE_NODE_FIELD_EX(fldname, nodePtrType) \ + do { \ + if (NULL == (pSrc)->fldname) { \ + break; \ + } \ + (pDst)->fldname = (nodePtrType)nodesCloneNode((SNode*)(pSrc)->fldname); \ + if (NULL == (pDst)->fldname) { \ + nodesDestroyNode((SNode*)pDst); \ + return NULL; \ + } \ + } while (0) + #define CLONE_NODE_LIST_FIELD(fldname) \ do { \ if (NULL == (pSrc)->fldname) { \ @@ -61,7 +77,7 @@ } \ (pDst)->fldname = nodesCloneList((pSrc)->fldname); \ if (NULL == (pDst)->fldname) { \ - nodesDestroyNode((SNode*)(pDst)); \ + nodesDestroyNode((SNode*)pDst); \ return NULL; \ } \ } while (0) @@ -73,7 +89,7 @@ } \ (pDst)->fldname = cloneFunc((pSrc)->fldname); \ if (NULL == (pDst)->fldname) { \ - nodesDestroyNode((SNode*)(pDst)); \ + nodesDestroyNode((SNode*)pDst); \ return NULL; \ } \ } while (0) @@ -81,6 +97,7 @@ #define COPY_BASE_OBJECT_FIELD(fldname, copyFunc) \ do { \ if (NULL == copyFunc(&((pSrc)->fldname), &((pDst)->fldname))) { \ + nodesDestroyNode((SNode*)pDst); \ return NULL; \ } \ } while (0) @@ -147,7 +164,7 @@ static SNode* valueNodeCopy(const SValueNode* pSrc, SValueNode* pDst) { int32_t len = varDataTLen(pSrc->datum.p) + 1; pDst->datum.p = taosMemoryCalloc(1, len); if (NULL == pDst->datum.p) { - nodesDestroyNode(pDst); + nodesDestroyNode((SNode*)pDst); return NULL; } memcpy(pDst->datum.p, pSrc->datum.p, len); @@ -275,8 +292,8 @@ static SNode* stateWindowNodeCopy(const SStateWindowNode* pSrc, SStateWindowNode } static SNode* sessionWindowNodeCopy(const SSessionWindowNode* pSrc, SSessionWindowNode* pDst) { - CLONE_NODE_FIELD(pCol); - CLONE_NODE_FIELD(pGap); + CLONE_NODE_FIELD_EX(pCol, SColumnNode*); + CLONE_NODE_FIELD_EX(pGap, SValueNode*); return (SNode*)pDst; } @@ -442,7 +459,7 @@ static SNode* logicIndefRowsFuncCopy(const SIndefRowsFuncLogicNode* pSrc, SIndef static SNode* logicSubplanCopy(const SLogicSubplan* pSrc, SLogicSubplan* pDst) { COPY_OBJECT_FIELD(id, sizeof(SSubplanId)); - CLONE_NODE_FIELD(pNode); + CLONE_NODE_FIELD_EX(pNode, SLogicNode*); COPY_SCALAR_FIELD(subplanType); COPY_SCALAR_FIELD(level); COPY_SCALAR_FIELD(splitFlag); @@ -450,7 +467,7 @@ static SNode* logicSubplanCopy(const SLogicSubplan* pSrc, SLogicSubplan* pDst) { } static SNode* physiNodeCopy(const SPhysiNode* pSrc, SPhysiNode* pDst) { - CLONE_NODE_FIELD(pOutputDataBlockDesc); + CLONE_NODE_FIELD_EX(pOutputDataBlockDesc, SDataBlockDescNode*); CLONE_NODE_FIELD(pConditions); CLONE_NODE_LIST_FIELD(pChildren); return (SNode*)pDst; @@ -555,8 +572,8 @@ static SNode* selectStmtCopy(const SSelectStmt* pSrc, SSelectStmt* pDst) { CLONE_NODE_LIST_FIELD(pGroupByList); CLONE_NODE_FIELD(pHaving); CLONE_NODE_LIST_FIELD(pOrderByList); - CLONE_NODE_FIELD(pLimit); - CLONE_NODE_FIELD(pLimit); + CLONE_NODE_FIELD_EX(pLimit, SLimitNode*); + CLONE_NODE_FIELD_EX(pLimit, SLimitNode*); COPY_CHAR_ARRAY_FIELD(stmtName); COPY_SCALAR_FIELD(precision); COPY_SCALAR_FIELD(isEmptyResult); @@ -566,7 +583,7 @@ static SNode* selectStmtCopy(const SSelectStmt* pSrc, SSelectStmt* pDst) { return (SNode*)pDst; } -SNodeptr nodesCloneNode(const SNodeptr pNode) { +SNode* nodesCloneNode(const SNode* pNode) { if (NULL == pNode) { return NULL; } diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index f7e65f100a392cfeee72c130141b215d3ea5fdff..be1929d554e30891290bc9e7d093fe2af247d87f 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -4205,7 +4205,7 @@ static int32_t jsonToNodeObject(const SJson* pJson, const char* pName, SNode** p return makeNodeByJson(pJsonNode, pNode); } -int32_t nodesNodeToString(const SNodeptr pNode, bool format, char** pStr, int32_t* pLen) { +int32_t nodesNodeToString(const SNode* pNode, bool format, char** pStr, int32_t* pLen) { if (NULL == pNode || NULL == pStr) { terrno = TSDB_CODE_FAILED; return TSDB_CODE_FAILED; diff --git a/source/libs/nodes/src/nodesEqualFuncs.c b/source/libs/nodes/src/nodesEqualFuncs.c index 9887cbdbc57dd8d9ad204071c3d1b31f8212c699..681e99a4526e7da38b2b8bfbf0e003d3f640e281 100644 --- a/source/libs/nodes/src/nodesEqualFuncs.c +++ b/source/libs/nodes/src/nodesEqualFuncs.c @@ -137,7 +137,7 @@ static bool functionNodeEqual(const SFunctionNode* a, const SFunctionNode* b) { return true; } -bool nodesEqualNode(const SNodeptr a, const SNodeptr b) { +bool nodesEqualNode(const SNode* a, const SNode* b) { if (a == b) { return true; } diff --git a/source/libs/nodes/src/nodesTraverseFuncs.c b/source/libs/nodes/src/nodesTraverseFuncs.c index d8130d5650dd78797f3db4642cb097867f0924dd..1fb2db9f23f32847931e4963b12e323e88d916fe 100644 --- a/source/libs/nodes/src/nodesTraverseFuncs.c +++ b/source/libs/nodes/src/nodesTraverseFuncs.c @@ -168,7 +168,7 @@ static EDealRes walkExprs(SNodeList* pNodeList, ETraversalOrder order, FNodeWalk return DEAL_RES_CONTINUE; } -void nodesWalkExpr(SNodeptr pNode, FNodeWalker walker, void* pContext) { +void nodesWalkExpr(SNode* pNode, FNodeWalker walker, void* pContext) { (void)walkExpr(pNode, TRAVERSAL_PREORDER, walker, pContext); } @@ -176,7 +176,7 @@ void nodesWalkExprs(SNodeList* pNodeList, FNodeWalker walker, void* pContext) { (void)walkExprs(pNodeList, TRAVERSAL_PREORDER, walker, pContext); } -void nodesWalkExprPostOrder(SNodeptr pNode, FNodeWalker walker, void* pContext) { +void nodesWalkExprPostOrder(SNode* pNode, FNodeWalker walker, void* pContext) { (void)walkExpr(pNode, TRAVERSAL_POSTORDER, walker, pContext); } diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index 1ea9124839195904073312df2fd8b0161f2bfed0..72666f833d19145262ecee21dd926789df4633c6 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -30,7 +30,7 @@ static SNode* makeNode(ENodeType type, size_t size) { return p; } -SNodeptr nodesMakeNode(ENodeType type) { +SNode* nodesMakeNode(ENodeType type) { switch (type) { case QUERY_NODE_COLUMN: return makeNode(type, sizeof(SColumnNode)); @@ -215,6 +215,8 @@ SNodeptr nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(SKillStmt)); case QUERY_NODE_DELETE_STMT: return makeNode(type, sizeof(SDeleteStmt)); + case QUERY_NODE_QUERY: + return makeNode(type, sizeof(SQuery)); case QUERY_NODE_LOGIC_PLAN_SCAN: return makeNode(type, sizeof(SScanLogicNode)); case QUERY_NODE_LOGIC_PLAN_JOIN: @@ -325,7 +327,7 @@ static void destroyLogicNode(SLogicNode* pNode) { static void destroyPhysiNode(SPhysiNode* pNode) { nodesDestroyList(pNode->pChildren); nodesDestroyNode(pNode->pConditions); - nodesDestroyNode(pNode->pOutputDataBlockDesc); + nodesDestroyNode((SNode*)pNode->pOutputDataBlockDesc); } static void destroyWinodwPhysiNode(SWinodwPhysiNode* pNode) { @@ -340,9 +342,9 @@ static void destroyScanPhysiNode(SScanPhysiNode* pNode) { nodesDestroyList(pNode->pScanCols); } -static void destroyDataSinkNode(SDataSinkNode* pNode) { nodesDestroyNode(pNode->pInputDataBlockDesc); } +static void destroyDataSinkNode(SDataSinkNode* pNode) { nodesDestroyNode((SNode*)pNode->pInputDataBlockDesc); } -void nodesDestroyNode(SNodeptr pNode) { +void nodesDestroyNode(SNode* pNode) { if (NULL == pNode) { return; } @@ -399,8 +401,8 @@ void nodesDestroyNode(SNodeptr pNode) { break; case QUERY_NODE_SESSION_WINDOW: { SSessionWindowNode* pSession = (SSessionWindowNode*)pNode; - nodesDestroyNode(pSession->pCol); - nodesDestroyNode(pSession->pGap); + nodesDestroyNode((SNode*)pSession->pCol); + nodesDestroyNode((SNode*)pSession->pGap); break; } case QUERY_NODE_INTERVAL_WINDOW: { @@ -436,7 +438,7 @@ void nodesDestroyNode(SNodeptr pNode) { break; case QUERY_NODE_DATABASE_OPTIONS: { SDatabaseOptions* pOptions = (SDatabaseOptions*)pNode; - nodesDestroyNode(pOptions->pDaysPerFile); + nodesDestroyNode((SNode*)pOptions->pDaysPerFile); nodesDestroyList(pOptions->pKeep); nodesDestroyList(pOptions->pRetentions); break; @@ -455,6 +457,13 @@ void nodesDestroyNode(SNodeptr pNode) { nodesDestroyNode(pOptions->pSliding); break; } + case QUERY_NODE_EXPLAIN_OPTIONS: // no pointer field + break; + case QUERY_NODE_STREAM_OPTIONS: + nodesDestroyNode(((SStreamOptions*)pNode)->pWatermark); + break; + case QUERY_NODE_LEFT_VALUE: // no pointer field + break; case QUERY_NODE_SET_OPERATOR: { SSetOperator* pStmt = (SSetOperator*)pNode; nodesDestroyNode(pStmt->pLeft); @@ -473,26 +482,26 @@ void nodesDestroyNode(SNodeptr pNode) { nodesDestroyList(pStmt->pGroupByList); nodesDestroyNode(pStmt->pHaving); nodesDestroyList(pStmt->pOrderByList); - nodesDestroyNode(pStmt->pLimit); - nodesDestroyNode(pStmt->pSlimit); + nodesDestroyNode((SNode*)pStmt->pLimit); + nodesDestroyNode((SNode*)pStmt->pSlimit); break; } case QUERY_NODE_VNODE_MODIF_STMT: destroyVgDataBlockArray(((SVnodeModifOpStmt*)pNode)->pDataBlocks); break; case QUERY_NODE_CREATE_DATABASE_STMT: - nodesDestroyNode(((SCreateDatabaseStmt*)pNode)->pOptions); + nodesDestroyNode((SNode*)((SCreateDatabaseStmt*)pNode)->pOptions); break; case QUERY_NODE_DROP_DATABASE_STMT: // no pointer field break; case QUERY_NODE_ALTER_DATABASE_STMT: - nodesDestroyNode(((SAlterDatabaseStmt*)pNode)->pOptions); + nodesDestroyNode((SNode*)((SAlterDatabaseStmt*)pNode)->pOptions); break; case QUERY_NODE_CREATE_TABLE_STMT: { SCreateTableStmt* pStmt = (SCreateTableStmt*)pNode; nodesDestroyList(pStmt->pCols); nodesDestroyList(pStmt->pTags); - nodesDestroyNode(pStmt->pOptions); + nodesDestroyNode((SNode*)pStmt->pOptions); break; } case QUERY_NODE_CREATE_SUBTABLE_CLAUSE: { @@ -507,14 +516,14 @@ void nodesDestroyNode(SNodeptr pNode) { case QUERY_NODE_DROP_TABLE_CLAUSE: // no pointer field break; case QUERY_NODE_DROP_TABLE_STMT: - nodesDestroyNode(((SDropTableStmt*)pNode)->pTables); + nodesDestroyList(((SDropTableStmt*)pNode)->pTables); break; case QUERY_NODE_DROP_SUPER_TABLE_STMT: // no pointer field break; case QUERY_NODE_ALTER_TABLE_STMT: { SAlterTableStmt* pStmt = (SAlterTableStmt*)pNode; - nodesDestroyNode(pStmt->pOptions); - nodesDestroyNode(pStmt->pVal); + nodesDestroyNode((SNode*)pStmt->pOptions); + nodesDestroyNode((SNode*)pStmt->pVal); break; } case QUERY_NODE_CREATE_USER_STMT: // no pointer field @@ -527,37 +536,107 @@ void nodesDestroyNode(SNodeptr pNode) { break; case QUERY_NODE_CREATE_INDEX_STMT: { SCreateIndexStmt* pStmt = (SCreateIndexStmt*)pNode; - nodesDestroyNode(pStmt->pOptions); + nodesDestroyNode((SNode*)pStmt->pOptions); nodesDestroyList(pStmt->pCols); break; } case QUERY_NODE_DROP_INDEX_STMT: // no pointer field case QUERY_NODE_CREATE_QNODE_STMT: // no pointer field case QUERY_NODE_DROP_QNODE_STMT: // no pointer field + case QUERY_NODE_CREATE_BNODE_STMT: // no pointer field + case QUERY_NODE_DROP_BNODE_STMT: // no pointer field + case QUERY_NODE_CREATE_SNODE_STMT: // no pointer field + case QUERY_NODE_DROP_SNODE_STMT: // no pointer field + case QUERY_NODE_CREATE_MNODE_STMT: // no pointer field + case QUERY_NODE_DROP_MNODE_STMT: // no pointer field break; case QUERY_NODE_CREATE_TOPIC_STMT: nodesDestroyNode(((SCreateTopicStmt*)pNode)->pQuery); break; case QUERY_NODE_DROP_TOPIC_STMT: // no pointer field + case QUERY_NODE_DROP_CGROUP_STMT: // no pointer field case QUERY_NODE_ALTER_LOCAL_STMT: // no pointer field break; - case QUERY_NODE_SHOW_DATABASES_STMT: - case QUERY_NODE_SHOW_TABLES_STMT: - case QUERY_NODE_SHOW_STABLES_STMT: - case QUERY_NODE_SHOW_USERS_STMT: + case QUERY_NODE_EXPLAIN_STMT: { + SExplainStmt* pStmt = (SExplainStmt*)pNode; + nodesDestroyNode((SNode*)pStmt->pOptions); + nodesDestroyNode(pStmt->pQuery); + break; + } + case QUERY_NODE_DESCRIBE_STMT: + taosMemoryFree(((SDescribeStmt*)pNode)->pMeta); + break; + case QUERY_NODE_RESET_QUERY_CACHE_STMT: // no pointer field + case QUERY_NODE_COMPACT_STMT: // no pointer field + case QUERY_NODE_CREATE_FUNCTION_STMT: // no pointer field + case QUERY_NODE_DROP_FUNCTION_STMT: // no pointer field + break; + case QUERY_NODE_CREATE_STREAM_STMT: { + SCreateStreamStmt* pStmt = (SCreateStreamStmt*)pNode; + nodesDestroyNode((SNode*)pStmt->pOptions); + nodesDestroyNode(pStmt->pQuery); + break; + } + case QUERY_NODE_DROP_STREAM_STMT: // no pointer field + case QUERY_NODE_BALANCE_VGROUP_STMT: // no pointer field + case QUERY_NODE_MERGE_VGROUP_STMT: // no pointer field + break; + case QUERY_NODE_REDISTRIBUTE_VGROUP_STMT: + nodesDestroyList(((SRedistributeVgroupStmt*)pNode)->pDnodes); + break; + case QUERY_NODE_SPLIT_VGROUP_STMT: // no pointer field + case QUERY_NODE_SYNCDB_STMT: // no pointer field + case QUERY_NODE_GRANT_STMT: // no pointer field + case QUERY_NODE_REVOKE_STMT: // no pointer field + break; case QUERY_NODE_SHOW_DNODES_STMT: - case QUERY_NODE_SHOW_VGROUPS_STMT: case QUERY_NODE_SHOW_MNODES_STMT: case QUERY_NODE_SHOW_MODULES_STMT: case QUERY_NODE_SHOW_QNODES_STMT: + case QUERY_NODE_SHOW_SNODES_STMT: + case QUERY_NODE_SHOW_BNODES_STMT: + case QUERY_NODE_SHOW_CLUSTER_STMT: + case QUERY_NODE_SHOW_DATABASES_STMT: case QUERY_NODE_SHOW_FUNCTIONS_STMT: case QUERY_NODE_SHOW_INDEXES_STMT: - case QUERY_NODE_SHOW_STREAMS_STMT: { + case QUERY_NODE_SHOW_STABLES_STMT: + case QUERY_NODE_SHOW_STREAMS_STMT: + case QUERY_NODE_SHOW_TABLES_STMT: + case QUERY_NODE_SHOW_USERS_STMT: + case QUERY_NODE_SHOW_LICENCE_STMT: + case QUERY_NODE_SHOW_VGROUPS_STMT: + case QUERY_NODE_SHOW_TOPICS_STMT: + case QUERY_NODE_SHOW_CONSUMERS_STMT: + case QUERY_NODE_SHOW_SUBSCRIBES_STMT: + case QUERY_NODE_SHOW_SMAS_STMT: + case QUERY_NODE_SHOW_CONFIGS_STMT: + case QUERY_NODE_SHOW_CONNECTIONS_STMT: + case QUERY_NODE_SHOW_QUERIES_STMT: + case QUERY_NODE_SHOW_VNODES_STMT: + case QUERY_NODE_SHOW_APPS_STMT: + case QUERY_NODE_SHOW_SCORES_STMT: + case QUERY_NODE_SHOW_VARIABLE_STMT: + case QUERY_NODE_SHOW_CREATE_DATABASE_STMT: + case QUERY_NODE_SHOW_CREATE_TABLE_STMT: + case QUERY_NODE_SHOW_CREATE_STABLE_STMT: + case QUERY_NODE_SHOW_TRANSACTIONS_STMT: { SShowStmt* pStmt = (SShowStmt*)pNode; nodesDestroyNode(pStmt->pDbName); nodesDestroyNode(pStmt->pTbNamePattern); break; } + case QUERY_NODE_KILL_CONNECTION_STMT: // no pointer field + case QUERY_NODE_KILL_QUERY_STMT: // no pointer field + case QUERY_NODE_KILL_TRANSACTION_STMT: // no pointer field + break; + case QUERY_NODE_DELETE_STMT: { + SDeleteStmt* pStmt = (SDeleteStmt*)pNode; + nodesDestroyNode(pStmt->pFromTable); + nodesDestroyNode(pStmt->pWhere); + nodesDestroyNode(pStmt->pCountFunc); + nodesDestroyNode(pStmt->pTagIndexCond); + break; + } case QUERY_NODE_QUERY: { SQuery* pQuery = (SQuery*)pNode; nodesDestroyNode(pQuery->pRoot); @@ -606,6 +685,13 @@ void nodesDestroyNode(SNodeptr pNode) { case QUERY_NODE_LOGIC_PLAN_EXCHANGE: destroyLogicNode((SLogicNode*)pNode); break; + case QUERY_NODE_LOGIC_PLAN_MERGE: { + SMergeLogicNode* pLogicNode = (SMergeLogicNode*)pNode; + destroyLogicNode((SLogicNode*)pLogicNode); + nodesDestroyList(pLogicNode->pMergeKeys); + nodesDestroyList(pLogicNode->pInputs); + break; + } case QUERY_NODE_LOGIC_PLAN_WINDOW: { SWindowLogicNode* pLogicNode = (SWindowLogicNode*)pNode; destroyLogicNode((SLogicNode*)pLogicNode); @@ -613,6 +699,13 @@ void nodesDestroyNode(SNodeptr pNode) { nodesDestroyNode(pLogicNode->pTspk); break; } + case QUERY_NODE_LOGIC_PLAN_FILL: { + SFillLogicNode* pLogicNode = (SFillLogicNode*)pNode; + destroyLogicNode((SLogicNode*)pLogicNode); + nodesDestroyNode(pLogicNode->pWStartTs); + nodesDestroyNode(pLogicNode->pValues); + break; + } case QUERY_NODE_LOGIC_PLAN_SORT: { SSortLogicNode* pLogicNode = (SSortLogicNode*)pNode; destroyLogicNode((SLogicNode*)pLogicNode); @@ -625,10 +718,16 @@ void nodesDestroyNode(SNodeptr pNode) { nodesDestroyList(pLogicNode->pPartitionKeys); break; } + case QUERY_NODE_LOGIC_PLAN_INDEF_ROWS_FUNC: { + SIndefRowsFuncLogicNode* pLogicNode = (SIndefRowsFuncLogicNode*)pNode; + destroyLogicNode((SLogicNode*)pLogicNode); + nodesDestroyList(pLogicNode->pVectorFuncs); + break; + } case QUERY_NODE_LOGIC_SUBPLAN: { SLogicSubplan* pSubplan = (SLogicSubplan*)pNode; nodesDestroyList(pSubplan->pChildren); - nodesDestroyNode(pSubplan->pNode); + nodesDestroyNode((SNode*)pSubplan->pNode); nodesClearList(pSubplan->pParents); taosMemoryFreeClear(pSubplan->pVgroupList); break; @@ -637,17 +736,9 @@ void nodesDestroyNode(SNodeptr pNode) { nodesDestroyList(((SQueryLogicPlan*)pNode)->pTopSubplans); break; case QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN: - destroyScanPhysiNode((SScanPhysiNode*)pNode); - break; case QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN: - destroyScanPhysiNode((SScanPhysiNode*)pNode); - break; case QUERY_NODE_PHYSICAL_PLAN_TABLE_SEQ_SCAN: - destroyScanPhysiNode((SScanPhysiNode*)pNode); - break; case QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN: - destroyScanPhysiNode((SScanPhysiNode*)pNode); - break; case QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN: destroyScanPhysiNode((SScanPhysiNode*)pNode); break; @@ -678,21 +769,62 @@ void nodesDestroyNode(SNodeptr pNode) { nodesDestroyList(pPhyNode->pSrcEndPoints); break; } + case QUERY_NODE_PHYSICAL_PLAN_MERGE: { + SMergePhysiNode* pPhyNode = (SMergePhysiNode*)pNode; + destroyPhysiNode((SPhysiNode*)pPhyNode); + nodesDestroyList(pPhyNode->pMergeKeys); + nodesDestroyList(pPhyNode->pTargets); + break; + } case QUERY_NODE_PHYSICAL_PLAN_SORT: { SSortPhysiNode* pPhyNode = (SSortPhysiNode*)pNode; destroyPhysiNode((SPhysiNode*)pPhyNode); - nodesDestroyNode(pPhyNode->pExprs); - nodesDestroyNode(pPhyNode->pSortKeys); + nodesDestroyList(pPhyNode->pExprs); + nodesDestroyList(pPhyNode->pSortKeys); break; } case QUERY_NODE_PHYSICAL_PLAN_HASH_INTERVAL: + case QUERY_NODE_PHYSICAL_PLAN_MERGE_INTERVAL: case QUERY_NODE_PHYSICAL_PLAN_STREAM_INTERVAL: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_FINAL_INTERVAL: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_SEMI_INTERVAL: destroyWinodwPhysiNode((SWinodwPhysiNode*)pNode); break; + case QUERY_NODE_PHYSICAL_PLAN_FILL: { + SFillPhysiNode* pPhyNode = (SFillPhysiNode*)pNode; + destroyPhysiNode((SPhysiNode*)pPhyNode); + nodesDestroyNode(pPhyNode->pWStartTs); + nodesDestroyNode(pPhyNode->pValues); + nodesDestroyList(pPhyNode->pTargets); + break; + } case QUERY_NODE_PHYSICAL_PLAN_MERGE_SESSION: case QUERY_NODE_PHYSICAL_PLAN_STREAM_SESSION: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_FINAL_SESSION: destroyWinodwPhysiNode((SWinodwPhysiNode*)pNode); break; + case QUERY_NODE_PHYSICAL_PLAN_MERGE_STATE: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE: { + SStateWinodwPhysiNode* pPhyNode = (SStateWinodwPhysiNode*)pNode; + destroyWinodwPhysiNode((SWinodwPhysiNode*)pPhyNode); + nodesDestroyNode(pPhyNode->pStateKey); + break; + } + case QUERY_NODE_PHYSICAL_PLAN_PARTITION: { + SPartitionPhysiNode* pPhyNode = (SPartitionPhysiNode*)pNode; + destroyPhysiNode((SPhysiNode*)pPhyNode); + nodesDestroyList(pPhyNode->pExprs); + nodesDestroyList(pPhyNode->pPartitionKeys); + nodesDestroyList(pPhyNode->pTargets); + break; + } + case QUERY_NODE_PHYSICAL_PLAN_INDEF_ROWS_FUNC: { + SIndefRowsFuncPhysiNode* pPhyNode = (SIndefRowsFuncPhysiNode*)pNode; + destroyPhysiNode((SPhysiNode*)pPhyNode); + nodesDestroyList(pPhyNode->pExprs); + nodesDestroyList(pPhyNode->pVectorFuncs); + break; + } case QUERY_NODE_PHYSICAL_PLAN_DISPATCH: destroyDataSinkNode((SDataSinkNode*)pNode); break; @@ -702,11 +834,17 @@ void nodesDestroyNode(SNodeptr pNode) { taosMemoryFreeClear(pSink->pData); break; } + case QUERY_NODE_PHYSICAL_PLAN_DELETE: { + SDataDeleterNode* pSink = (SDataDeleterNode*)pNode; + destroyDataSinkNode((SDataSinkNode*)pSink); + nodesDestroyNode(pSink->pAffectedRows); + break; + } case QUERY_NODE_PHYSICAL_SUBPLAN: { SSubplan* pSubplan = (SSubplan*)pNode; nodesDestroyList(pSubplan->pChildren); - nodesDestroyNode(pSubplan->pNode); - nodesDestroyNode(pSubplan->pDataSink); + nodesDestroyNode((SNode*)pSubplan->pNode); + nodesDestroyNode((SNode*)pSubplan->pDataSink); nodesClearList(pSubplan->pParents); break; } @@ -744,7 +882,7 @@ SNodeList* nodesMakeList() { return p; } -int32_t nodesListAppend(SNodeList* pList, SNodeptr pNode) { +int32_t nodesListAppend(SNodeList* pList, SNode* pNode) { if (NULL == pList || NULL == pNode) { return TSDB_CODE_FAILED; } @@ -766,7 +904,7 @@ int32_t nodesListAppend(SNodeList* pList, SNodeptr pNode) { return TSDB_CODE_SUCCESS; } -int32_t nodesListStrictAppend(SNodeList* pList, SNodeptr pNode) { +int32_t nodesListStrictAppend(SNodeList* pList, SNode* pNode) { if (NULL == pNode) { terrno = TSDB_CODE_OUT_OF_MEMORY; return TSDB_CODE_OUT_OF_MEMORY; @@ -778,7 +916,7 @@ int32_t nodesListStrictAppend(SNodeList* pList, SNodeptr pNode) { return code; } -int32_t nodesListMakeAppend(SNodeList** pList, SNodeptr pNode) { +int32_t nodesListMakeAppend(SNodeList** pList, SNode* pNode) { if (NULL == *pList) { *pList = nodesMakeList(); if (NULL == *pList) { @@ -789,7 +927,7 @@ int32_t nodesListMakeAppend(SNodeList** pList, SNodeptr pNode) { return nodesListAppend(*pList, pNode); } -int32_t nodesListMakeStrictAppend(SNodeList** pList, SNodeptr pNode) { +int32_t nodesListMakeStrictAppend(SNodeList** pList, SNode* pNode) { if (NULL == *pList) { *pList = nodesMakeList(); if (NULL == *pList) { @@ -831,7 +969,7 @@ int32_t nodesListStrictAppendList(SNodeList* pTarget, SNodeList* pSrc) { return code; } -int32_t nodesListPushFront(SNodeList* pList, SNodeptr pNode) { +int32_t nodesListPushFront(SNodeList* pList, SNode* pNode) { if (NULL == pList || NULL == pNode) { return TSDB_CODE_FAILED; } @@ -886,7 +1024,7 @@ void nodesListInsertList(SNodeList* pTarget, SListCell* pPos, SNodeList* pSrc) { taosMemoryFreeClear(pSrc); } -SNodeptr nodesListGetNode(SNodeList* pList, int32_t index) { +SNode* nodesListGetNode(SNodeList* pList, int32_t index) { SNode* node; FOREACH(node, pList) { if (0 == index--) { @@ -1420,7 +1558,7 @@ int32_t nodesMergeConds(SNode** pDst, SNodeList** pSrc) { *pDst = nodesListGetNode(*pSrc, 0); nodesClearList(*pSrc); } else { - SLogicConditionNode* pLogicCond = nodesMakeNode(QUERY_NODE_LOGIC_CONDITION); + SLogicConditionNode* pLogicCond = (SLogicConditionNode*)nodesMakeNode(QUERY_NODE_LOGIC_CONDITION); if (NULL == pLogicCond) { return TSDB_CODE_OUT_OF_MEMORY; } diff --git a/source/libs/parser/inc/parInt.h b/source/libs/parser/inc/parInt.h index adedcf0fd9dfec4168df832a526a6809dd970746..b799fa98558a12584244ab730db213c8be35eacb 100644 --- a/source/libs/parser/inc/parInt.h +++ b/source/libs/parser/inc/parInt.h @@ -27,12 +27,12 @@ extern "C" { #define QUERY_SMA_OPTIMIZE_DISABLE 0 #define QUERY_SMA_OPTIMIZE_ENABLE 1 -int32_t parseInsertSyntax(SParseContext* pContext, SQuery** pQuery); -int32_t parseInsertSql(SParseContext* pContext, SQuery** pQuery); +int32_t parseInsertSyntax(SParseContext* pContext, SQuery** pQuery, SParseMetaCache* pMetaCache); +int32_t parseInsertSql(SParseContext* pContext, SQuery** pQuery, SParseMetaCache* pMetaCache); int32_t parse(SParseContext* pParseCxt, SQuery** pQuery); -int32_t collectMetaKey(SParseContext* pParseCxt, SQuery* pQuery); -int32_t authenticate(SParseContext* pParseCxt, SQuery* pQuery); -int32_t translate(SParseContext* pParseCxt, SQuery* pQuery); +int32_t collectMetaKey(SParseContext* pParseCxt, SQuery* pQuery, SParseMetaCache* pMetaCache); +int32_t authenticate(SParseContext* pParseCxt, SQuery* pQuery, SParseMetaCache* pMetaCache); +int32_t translate(SParseContext* pParseCxt, SQuery* pQuery, SParseMetaCache* pMetaCache); int32_t extractResultSchema(const SNode* pRoot, int32_t* numOfCols, SSchema** pSchema); int32_t calculateConstant(SParseContext* pParseCxt, SQuery* pQuery); diff --git a/source/libs/parser/inc/parUtil.h b/source/libs/parser/inc/parUtil.h index fb67a353686a843c825ea088489dcca4ee620b36..862e3e2cc03789cf18f648b44d40ea625e9f6fc2 100644 --- a/source/libs/parser/inc/parUtil.h +++ b/source/libs/parser/inc/parUtil.h @@ -87,6 +87,7 @@ int32_t getUserAuthFromCache(SParseMetaCache* pMetaCache, const char* pUser, con bool* pPass); int32_t getUdfInfoFromCache(SParseMetaCache* pMetaCache, const char* pFunc, SFuncInfo* pInfo); int32_t getTableIndexFromCache(SParseMetaCache* pMetaCache, const SName* pName, SArray** pIndexes); +void destoryParseMetaCache(SParseMetaCache* pMetaCache); #ifdef __cplusplus } diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index ed338b89e8be145b13502b44b41e5421a3d7067f..83ad41aac0463042b4579dabc1376dd1d98522b6 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -461,6 +461,7 @@ into_opt(A) ::= INTO full_table_name(B). stream_options(A) ::= . { A = createStreamOptions(pCxt); } stream_options(A) ::= stream_options(B) TRIGGER AT_ONCE. { ((SStreamOptions*)B)->triggerType = STREAM_TRIGGER_AT_ONCE; A = B; } stream_options(A) ::= stream_options(B) TRIGGER WINDOW_CLOSE. { ((SStreamOptions*)B)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; A = B; } +stream_options(A) ::= stream_options(B) TRIGGER MAX_DELAY duration_literal(C). { ((SStreamOptions*)B)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)B)->pDelay = releaseRawExprNode(pCxt, C); A = B; } stream_options(A) ::= stream_options(B) WATERMARK duration_literal(C). { ((SStreamOptions*)B)->pWatermark = releaseRawExprNode(pCxt, C); A = B; } /************************************************ kill connection/query ***********************************************/ diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index e7f4b05bc8bd3168ce8b41a211ed852dc2b3d1f7..ca066c7056ea37bc660f0b82b2fc913cf5998ab7 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -338,7 +338,7 @@ SNode* createPlaceholderValueNode(SAstCreateContext* pCxt, const SToken* pLitera if (NULL == pCxt->pPlaceholderValues) { pCxt->pPlaceholderValues = taosArrayInit(TARRAY_MIN_SIZE, POINTER_BYTES); if (NULL == pCxt->pPlaceholderValues) { - nodesDestroyNode(val); + nodesDestroyNode((SNode*)val); return NULL; } } @@ -368,7 +368,7 @@ SNode* createLogicConditionNode(SAstCreateContext* pCxt, ELogicConditionType typ code = addParamToLogicConditionNode(cond, pParam2); } if (TSDB_CODE_SUCCESS != code) { - nodesDestroyNode(cond); + nodesDestroyNode((SNode*)cond); return NULL; } return (SNode*)cond; @@ -399,7 +399,7 @@ SNode* createNotBetweenAnd(SAstCreateContext* pCxt, SNode* pExpr, SNode* pLeft, static SNode* createPrimaryKeyCol(SAstCreateContext* pCxt) { CHECK_PARSER_STATUS(pCxt); - SColumnNode* pCol = nodesMakeNode(QUERY_NODE_COLUMN); + SColumnNode* pCol = (SColumnNode*)nodesMakeNode(QUERY_NODE_COLUMN); CHECK_OUT_OF_MEM(pCol); pCol->colId = PRIMARYKEY_TIMESTAMP_COL_ID; strcpy(pCol->colName, PK_TS_COL_INTERNAL_NAME); @@ -541,7 +541,7 @@ SNode* createStateWindowNode(SAstCreateContext* pCxt, SNode* pExpr) { CHECK_OUT_OF_MEM(state); state->pCol = createPrimaryKeyCol(pCxt); if (NULL == state->pCol) { - nodesDestroyNode(state); + nodesDestroyNode((SNode*)state); CHECK_OUT_OF_MEM(state->pCol); } state->pExpr = pExpr; @@ -555,7 +555,7 @@ SNode* createIntervalWindowNode(SAstCreateContext* pCxt, SNode* pInterval, SNode CHECK_OUT_OF_MEM(interval); interval->pCol = createPrimaryKeyCol(pCxt); if (NULL == interval->pCol) { - nodesDestroyNode(interval); + nodesDestroyNode((SNode*)interval); CHECK_OUT_OF_MEM(interval->pCol); } interval->pInterval = pInterval; @@ -573,7 +573,7 @@ SNode* createFillNode(SAstCreateContext* pCxt, EFillMode mode, SNode* pValues) { fill->pValues = pValues; fill->pWStartTs = nodesMakeNode(QUERY_NODE_FUNCTION); if (NULL == fill->pWStartTs) { - nodesDestroyNode(fill); + nodesDestroyNode((SNode*)fill); CHECK_OUT_OF_MEM(fill->pWStartTs); } strcpy(((SFunctionNode*)fill->pWStartTs)->functionName, "_wstartts"); @@ -689,7 +689,7 @@ SNode* createSetOperator(SAstCreateContext* pCxt, ESetOperatorType type, SNode* SNode* createDefaultDatabaseOptions(SAstCreateContext* pCxt) { CHECK_PARSER_STATUS(pCxt); - SDatabaseOptions* pOptions = nodesMakeNode(QUERY_NODE_DATABASE_OPTIONS); + SDatabaseOptions* pOptions = (SDatabaseOptions*)nodesMakeNode(QUERY_NODE_DATABASE_OPTIONS); CHECK_OUT_OF_MEM(pOptions); pOptions->buffer = TSDB_DEFAULT_BUFFER_PER_VNODE; pOptions->cachelast = TSDB_DEFAULT_CACHE_LAST_ROW; @@ -715,7 +715,7 @@ SNode* createDefaultDatabaseOptions(SAstCreateContext* pCxt) { SNode* createAlterDatabaseOptions(SAstCreateContext* pCxt) { CHECK_PARSER_STATUS(pCxt); - SDatabaseOptions* pOptions = nodesMakeNode(QUERY_NODE_DATABASE_OPTIONS); + SDatabaseOptions* pOptions = (SDatabaseOptions*)nodesMakeNode(QUERY_NODE_DATABASE_OPTIONS); CHECK_OUT_OF_MEM(pOptions); pOptions->buffer = -1; pOptions->cachelast = -1; @@ -852,7 +852,7 @@ SNode* createAlterDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName, SNode* if (!checkDbName(pCxt, pDbName, false)) { return NULL; } - SAlterDatabaseStmt* pStmt = nodesMakeNode(QUERY_NODE_ALTER_DATABASE_STMT); + SAlterDatabaseStmt* pStmt = (SAlterDatabaseStmt*)nodesMakeNode(QUERY_NODE_ALTER_DATABASE_STMT); CHECK_OUT_OF_MEM(pStmt); strncpy(pStmt->dbName, pDbName->z, pDbName->n); pStmt->pOptions = (SDatabaseOptions*)pOptions; @@ -861,7 +861,7 @@ SNode* createAlterDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName, SNode* SNode* createDefaultTableOptions(SAstCreateContext* pCxt) { CHECK_PARSER_STATUS(pCxt); - STableOptions* pOptions = nodesMakeNode(QUERY_NODE_TABLE_OPTIONS); + STableOptions* pOptions = (STableOptions*)nodesMakeNode(QUERY_NODE_TABLE_OPTIONS); CHECK_OUT_OF_MEM(pOptions); pOptions->filesFactor = TSDB_DEFAULT_ROLLUP_FILE_FACTOR; pOptions->ttl = TSDB_DEFAULT_TABLE_TTL; @@ -870,7 +870,7 @@ SNode* createDefaultTableOptions(SAstCreateContext* pCxt) { SNode* createAlterTableOptions(SAstCreateContext* pCxt) { CHECK_PARSER_STATUS(pCxt); - STableOptions* pOptions = nodesMakeNode(QUERY_NODE_TABLE_OPTIONS); + STableOptions* pOptions = (STableOptions*)nodesMakeNode(QUERY_NODE_TABLE_OPTIONS); CHECK_OUT_OF_MEM(pOptions); pOptions->filesFactor = -1; pOptions->ttl = -1; @@ -948,7 +948,7 @@ SNode* createCreateTableStmt(SAstCreateContext* pCxt, bool ignoreExists, SNode* SNode* createCreateSubTableClause(SAstCreateContext* pCxt, bool ignoreExists, SNode* pRealTable, SNode* pUseRealTable, SNodeList* pSpecificTags, SNodeList* pValsOfTags, SNode* pOptions) { CHECK_PARSER_STATUS(pCxt); - SCreateSubTableClause* pStmt = nodesMakeNode(QUERY_NODE_CREATE_SUBTABLE_CLAUSE); + SCreateSubTableClause* pStmt = (SCreateSubTableClause*)nodesMakeNode(QUERY_NODE_CREATE_SUBTABLE_CLAUSE); CHECK_OUT_OF_MEM(pStmt); strcpy(pStmt->dbName, ((SRealTableNode*)pRealTable)->table.dbName); strcpy(pStmt->tableName, ((SRealTableNode*)pRealTable)->table.tableName); @@ -959,12 +959,13 @@ SNode* createCreateSubTableClause(SAstCreateContext* pCxt, bool ignoreExists, SN pStmt->pValsOfTags = pValsOfTags; nodesDestroyNode(pRealTable); nodesDestroyNode(pUseRealTable); + nodesDestroyNode(pOptions); return (SNode*)pStmt; } SNode* createCreateMultiTableStmt(SAstCreateContext* pCxt, SNodeList* pSubTables) { CHECK_PARSER_STATUS(pCxt); - SCreateMultiTableStmt* pStmt = nodesMakeNode(QUERY_NODE_CREATE_MULTI_TABLE_STMT); + SCreateMultiTableStmt* pStmt = (SCreateMultiTableStmt*)nodesMakeNode(QUERY_NODE_CREATE_MULTI_TABLE_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->pSubTables = pSubTables; return (SNode*)pStmt; @@ -972,7 +973,7 @@ SNode* createCreateMultiTableStmt(SAstCreateContext* pCxt, SNodeList* pSubTables SNode* createDropTableClause(SAstCreateContext* pCxt, bool ignoreNotExists, SNode* pRealTable) { CHECK_PARSER_STATUS(pCxt); - SDropTableClause* pStmt = nodesMakeNode(QUERY_NODE_DROP_TABLE_CLAUSE); + SDropTableClause* pStmt = (SDropTableClause*)nodesMakeNode(QUERY_NODE_DROP_TABLE_CLAUSE); CHECK_OUT_OF_MEM(pStmt); strcpy(pStmt->dbName, ((SRealTableNode*)pRealTable)->table.dbName); strcpy(pStmt->tableName, ((SRealTableNode*)pRealTable)->table.tableName); @@ -983,7 +984,7 @@ SNode* createDropTableClause(SAstCreateContext* pCxt, bool ignoreNotExists, SNod SNode* createDropTableStmt(SAstCreateContext* pCxt, SNodeList* pTables) { CHECK_PARSER_STATUS(pCxt); - SDropTableStmt* pStmt = nodesMakeNode(QUERY_NODE_DROP_TABLE_STMT); + SDropTableStmt* pStmt = (SDropTableStmt*)nodesMakeNode(QUERY_NODE_DROP_TABLE_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->pTables = pTables; return (SNode*)pStmt; @@ -991,7 +992,7 @@ SNode* createDropTableStmt(SAstCreateContext* pCxt, SNodeList* pTables) { SNode* createDropSuperTableStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SNode* pRealTable) { CHECK_PARSER_STATUS(pCxt); - SDropSuperTableStmt* pStmt = nodesMakeNode(QUERY_NODE_DROP_SUPER_TABLE_STMT); + SDropSuperTableStmt* pStmt = (SDropSuperTableStmt*)nodesMakeNode(QUERY_NODE_DROP_SUPER_TABLE_STMT); CHECK_OUT_OF_MEM(pStmt); strcpy(pStmt->dbName, ((SRealTableNode*)pRealTable)->table.dbName); strcpy(pStmt->tableName, ((SRealTableNode*)pRealTable)->table.tableName); @@ -1009,7 +1010,7 @@ static SNode* createAlterTableStmtFinalize(SNode* pRealTable, SAlterTableStmt* p SNode* createAlterTableModifyOptions(SAstCreateContext* pCxt, SNode* pRealTable, SNode* pOptions) { CHECK_PARSER_STATUS(pCxt); - SAlterTableStmt* pStmt = nodesMakeNode(QUERY_NODE_ALTER_TABLE_STMT); + SAlterTableStmt* pStmt = (SAlterTableStmt*)nodesMakeNode(QUERY_NODE_ALTER_TABLE_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->alterType = TSDB_ALTER_TABLE_UPDATE_OPTIONS; pStmt->pOptions = (STableOptions*)pOptions; @@ -1022,7 +1023,7 @@ SNode* createAlterTableAddModifyCol(SAstCreateContext* pCxt, SNode* pRealTable, if (!checkColumnName(pCxt, pColName)) { return NULL; } - SAlterTableStmt* pStmt = nodesMakeNode(QUERY_NODE_ALTER_TABLE_STMT); + SAlterTableStmt* pStmt = (SAlterTableStmt*)nodesMakeNode(QUERY_NODE_ALTER_TABLE_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->alterType = alterType; strncpy(pStmt->colName, pColName->z, pColName->n); @@ -1035,7 +1036,7 @@ SNode* createAlterTableDropCol(SAstCreateContext* pCxt, SNode* pRealTable, int8_ if (!checkColumnName(pCxt, pColName)) { return NULL; } - SAlterTableStmt* pStmt = nodesMakeNode(QUERY_NODE_ALTER_TABLE_STMT); + SAlterTableStmt* pStmt = (SAlterTableStmt*)nodesMakeNode(QUERY_NODE_ALTER_TABLE_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->alterType = alterType; strncpy(pStmt->colName, pColName->z, pColName->n); @@ -1048,7 +1049,7 @@ SNode* createAlterTableRenameCol(SAstCreateContext* pCxt, SNode* pRealTable, int if (!checkColumnName(pCxt, pOldColName) || !checkColumnName(pCxt, pNewColName)) { return NULL; } - SAlterTableStmt* pStmt = nodesMakeNode(QUERY_NODE_ALTER_TABLE_STMT); + SAlterTableStmt* pStmt = (SAlterTableStmt*)nodesMakeNode(QUERY_NODE_ALTER_TABLE_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->alterType = alterType; strncpy(pStmt->colName, pOldColName->z, pOldColName->n); @@ -1061,7 +1062,7 @@ SNode* createAlterTableSetTag(SAstCreateContext* pCxt, SNode* pRealTable, SToken if (!checkColumnName(pCxt, pTagName)) { return NULL; } - SAlterTableStmt* pStmt = nodesMakeNode(QUERY_NODE_ALTER_TABLE_STMT); + SAlterTableStmt* pStmt = (SAlterTableStmt*)nodesMakeNode(QUERY_NODE_ALTER_TABLE_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->alterType = TSDB_ALTER_TABLE_UPDATE_TAG_VAL; strncpy(pStmt->colName, pTagName->z, pTagName->n); @@ -1092,7 +1093,7 @@ SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type, SNode* pDbName, S pCxt->errCode = TSDB_CODE_PAR_SYNTAX_ERROR; return NULL; } - SShowStmt* pStmt = nodesMakeNode(type); + SShowStmt* pStmt = (SShowStmt*)nodesMakeNode(type); CHECK_OUT_OF_MEM(pStmt); pStmt->pDbName = pDbName; pStmt->pTbNamePattern = pTbNamePattern; @@ -1137,7 +1138,7 @@ SNode* createAlterUserStmt(SAstCreateContext* pCxt, SToken* pUserName, int8_t al if (TSDB_ALTER_USER_PASSWD == alterType) { char password[TSDB_USET_PASSWORD_LEN] = {0}; if (!checkPassword(pCxt, pVal, password)) { - nodesDestroyNode(pStmt); + nodesDestroyNode((SNode*)pStmt); return NULL; } strcpy(pStmt->password, password); @@ -1187,7 +1188,7 @@ SNode* createDropDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode) { pStmt->dnodeId = taosStr2Int32(pDnode->z, NULL, 10); } else { if (!checkAndSplitEndpoint(pCxt, pDnode, pStmt->fqdn, &pStmt->port)) { - nodesDestroyNode(pStmt); + nodesDestroyNode((SNode*)pStmt); return NULL; } } @@ -1197,7 +1198,7 @@ SNode* createDropDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode) { SNode* createAlterDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, const SToken* pConfig, const SToken* pValue) { CHECK_PARSER_STATUS(pCxt); - SAlterDnodeStmt* pStmt = nodesMakeNode(QUERY_NODE_ALTER_DNODE_STMT); + SAlterDnodeStmt* pStmt = (SAlterDnodeStmt*)nodesMakeNode(QUERY_NODE_ALTER_DNODE_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->dnodeId = taosStr2Int32(pDnode->z, NULL, 10); trimString(pConfig->z, pConfig->n, pStmt->config, sizeof(pStmt->config)); @@ -1213,7 +1214,7 @@ SNode* createCreateIndexStmt(SAstCreateContext* pCxt, EIndexType type, bool igno if (!checkIndexName(pCxt, pIndexName) || !checkTableName(pCxt, pTableName) || !checkDbName(pCxt, NULL, true)) { return NULL; } - SCreateIndexStmt* pStmt = nodesMakeNode(QUERY_NODE_CREATE_INDEX_STMT); + SCreateIndexStmt* pStmt = (SCreateIndexStmt*)nodesMakeNode(QUERY_NODE_CREATE_INDEX_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->indexType = type; pStmt->ignoreExists = ignoreExists; @@ -1227,7 +1228,7 @@ SNode* createCreateIndexStmt(SAstCreateContext* pCxt, EIndexType type, bool igno SNode* createIndexOption(SAstCreateContext* pCxt, SNodeList* pFuncs, SNode* pInterval, SNode* pOffset, SNode* pSliding) { CHECK_PARSER_STATUS(pCxt); - SIndexOptions* pOptions = nodesMakeNode(QUERY_NODE_INDEX_OPTIONS); + SIndexOptions* pOptions = (SIndexOptions*)nodesMakeNode(QUERY_NODE_INDEX_OPTIONS); CHECK_OUT_OF_MEM(pOptions); pOptions->pFuncs = pFuncs; pOptions->pInterval = pInterval; @@ -1241,7 +1242,7 @@ SNode* createDropIndexStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SToken if (!checkIndexName(pCxt, pIndexName) || !checkTableName(pCxt, pTableName)) { return NULL; } - SDropIndexStmt* pStmt = nodesMakeNode(QUERY_NODE_DROP_INDEX_STMT); + SDropIndexStmt* pStmt = (SDropIndexStmt*)nodesMakeNode(QUERY_NODE_DROP_INDEX_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->ignoreNotExists = ignoreNotExists; strncpy(pStmt->indexName, pIndexName->z, pIndexName->n); @@ -1251,26 +1252,24 @@ SNode* createDropIndexStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SToken SNode* createCreateComponentNodeStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pDnodeId) { CHECK_PARSER_STATUS(pCxt); - SCreateComponentNodeStmt* pStmt = nodesMakeNode(type); + SCreateComponentNodeStmt* pStmt = (SCreateComponentNodeStmt*)nodesMakeNode(type); CHECK_OUT_OF_MEM(pStmt); pStmt->dnodeId = taosStr2Int32(pDnodeId->z, NULL, 10); - ; return (SNode*)pStmt; } SNode* createDropComponentNodeStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pDnodeId) { CHECK_PARSER_STATUS(pCxt); - SDropComponentNodeStmt* pStmt = nodesMakeNode(type); + SDropComponentNodeStmt* pStmt = (SDropComponentNodeStmt*)nodesMakeNode(type); CHECK_OUT_OF_MEM(pStmt); pStmt->dnodeId = taosStr2Int32(pDnodeId->z, NULL, 10); - ; return (SNode*)pStmt; } SNode* createCreateTopicStmt(SAstCreateContext* pCxt, bool ignoreExists, const SToken* pTopicName, SNode* pQuery, const SToken* pSubDbName, SNode* pRealTable) { CHECK_PARSER_STATUS(pCxt); - SCreateTopicStmt* pStmt = nodesMakeNode(QUERY_NODE_CREATE_TOPIC_STMT); + SCreateTopicStmt* pStmt = (SCreateTopicStmt*)nodesMakeNode(QUERY_NODE_CREATE_TOPIC_STMT); CHECK_OUT_OF_MEM(pStmt); strncpy(pStmt->topicName, pTopicName->z, pTopicName->n); pStmt->ignoreExists = ignoreExists; @@ -1288,7 +1287,7 @@ SNode* createCreateTopicStmt(SAstCreateContext* pCxt, bool ignoreExists, const S SNode* createDropTopicStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pTopicName) { CHECK_PARSER_STATUS(pCxt); - SDropTopicStmt* pStmt = nodesMakeNode(QUERY_NODE_DROP_TOPIC_STMT); + SDropTopicStmt* pStmt = (SDropTopicStmt*)nodesMakeNode(QUERY_NODE_DROP_TOPIC_STMT); CHECK_OUT_OF_MEM(pStmt); strncpy(pStmt->topicName, pTopicName->z, pTopicName->n); pStmt->ignoreNotExists = ignoreNotExists; @@ -1298,7 +1297,7 @@ SNode* createDropTopicStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SNode* createDropCGroupStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pCGroupId, const SToken* pTopicName) { CHECK_PARSER_STATUS(pCxt); - SDropCGroupStmt* pStmt = nodesMakeNode(QUERY_NODE_DROP_CGROUP_STMT); + SDropCGroupStmt* pStmt = (SDropCGroupStmt*)nodesMakeNode(QUERY_NODE_DROP_CGROUP_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->ignoreNotExists = ignoreNotExists; strncpy(pStmt->topicName, pTopicName->z, pTopicName->n); @@ -1308,7 +1307,7 @@ SNode* createDropCGroupStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SNode* createAlterLocalStmt(SAstCreateContext* pCxt, const SToken* pConfig, const SToken* pValue) { CHECK_PARSER_STATUS(pCxt); - SAlterLocalStmt* pStmt = nodesMakeNode(QUERY_NODE_ALTER_LOCAL_STMT); + SAlterLocalStmt* pStmt = (SAlterLocalStmt*)nodesMakeNode(QUERY_NODE_ALTER_LOCAL_STMT); CHECK_OUT_OF_MEM(pStmt); trimString(pConfig->z, pConfig->n, pStmt->config, sizeof(pStmt->config)); if (NULL != pValue) { @@ -1319,7 +1318,7 @@ SNode* createAlterLocalStmt(SAstCreateContext* pCxt, const SToken* pConfig, cons SNode* createDefaultExplainOptions(SAstCreateContext* pCxt) { CHECK_PARSER_STATUS(pCxt); - SExplainOptions* pOptions = nodesMakeNode(QUERY_NODE_EXPLAIN_OPTIONS); + SExplainOptions* pOptions = (SExplainOptions*)nodesMakeNode(QUERY_NODE_EXPLAIN_OPTIONS); CHECK_OUT_OF_MEM(pOptions); pOptions->verbose = TSDB_DEFAULT_EXPLAIN_VERBOSE; pOptions->ratio = TSDB_DEFAULT_EXPLAIN_RATIO; @@ -1340,7 +1339,7 @@ SNode* setExplainRatio(SAstCreateContext* pCxt, SNode* pOptions, const SToken* p SNode* createExplainStmt(SAstCreateContext* pCxt, bool analyze, SNode* pOptions, SNode* pQuery) { CHECK_PARSER_STATUS(pCxt); - SExplainStmt* pStmt = nodesMakeNode(QUERY_NODE_EXPLAIN_STMT); + SExplainStmt* pStmt = (SExplainStmt*)nodesMakeNode(QUERY_NODE_EXPLAIN_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->analyze = analyze; pStmt->pOptions = (SExplainOptions*)pOptions; @@ -1350,7 +1349,7 @@ SNode* createExplainStmt(SAstCreateContext* pCxt, bool analyze, SNode* pOptions, SNode* createDescribeStmt(SAstCreateContext* pCxt, SNode* pRealTable) { CHECK_PARSER_STATUS(pCxt); - SDescribeStmt* pStmt = nodesMakeNode(QUERY_NODE_DESCRIBE_STMT); + SDescribeStmt* pStmt = (SDescribeStmt*)nodesMakeNode(QUERY_NODE_DESCRIBE_STMT); CHECK_OUT_OF_MEM(pStmt); strcpy(pStmt->dbName, ((SRealTableNode*)pRealTable)->table.dbName); strcpy(pStmt->tableName, ((SRealTableNode*)pRealTable)->table.tableName); @@ -1379,7 +1378,7 @@ SNode* createCreateFunctionStmt(SAstCreateContext* pCxt, bool ignoreExists, bool pCxt->errCode = TSDB_CODE_PAR_SYNTAX_ERROR; return NULL; } - SCreateFunctionStmt* pStmt = nodesMakeNode(QUERY_NODE_CREATE_FUNCTION_STMT); + SCreateFunctionStmt* pStmt = (SCreateFunctionStmt*)nodesMakeNode(QUERY_NODE_CREATE_FUNCTION_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->ignoreExists = ignoreExists; strncpy(pStmt->funcName, pFuncName->z, pFuncName->n); @@ -1392,7 +1391,7 @@ SNode* createCreateFunctionStmt(SAstCreateContext* pCxt, bool ignoreExists, bool SNode* createDropFunctionStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pFuncName) { CHECK_PARSER_STATUS(pCxt); - SDropFunctionStmt* pStmt = nodesMakeNode(QUERY_NODE_DROP_FUNCTION_STMT); + SDropFunctionStmt* pStmt = (SDropFunctionStmt*)nodesMakeNode(QUERY_NODE_DROP_FUNCTION_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->ignoreNotExists = ignoreNotExists; strncpy(pStmt->funcName, pFuncName->z, pFuncName->n); @@ -1401,7 +1400,7 @@ SNode* createDropFunctionStmt(SAstCreateContext* pCxt, bool ignoreNotExists, con SNode* createStreamOptions(SAstCreateContext* pCxt) { CHECK_PARSER_STATUS(pCxt); - SStreamOptions* pOptions = nodesMakeNode(QUERY_NODE_STREAM_OPTIONS); + SStreamOptions* pOptions = (SStreamOptions*)nodesMakeNode(QUERY_NODE_STREAM_OPTIONS); CHECK_OUT_OF_MEM(pOptions); pOptions->triggerType = STREAM_TRIGGER_AT_ONCE; return (SNode*)pOptions; @@ -1410,7 +1409,7 @@ SNode* createStreamOptions(SAstCreateContext* pCxt) { SNode* createCreateStreamStmt(SAstCreateContext* pCxt, bool ignoreExists, const SToken* pStreamName, SNode* pRealTable, SNode* pOptions, SNode* pQuery) { CHECK_PARSER_STATUS(pCxt); - SCreateStreamStmt* pStmt = nodesMakeNode(QUERY_NODE_CREATE_STREAM_STMT); + SCreateStreamStmt* pStmt = (SCreateStreamStmt*)nodesMakeNode(QUERY_NODE_CREATE_STREAM_STMT); CHECK_OUT_OF_MEM(pStmt); strncpy(pStmt->streamName, pStreamName->z, pStreamName->n); if (NULL != pRealTable) { @@ -1426,7 +1425,7 @@ SNode* createCreateStreamStmt(SAstCreateContext* pCxt, bool ignoreExists, const SNode* createDropStreamStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pStreamName) { CHECK_PARSER_STATUS(pCxt); - SDropStreamStmt* pStmt = nodesMakeNode(QUERY_NODE_DROP_STREAM_STMT); + SDropStreamStmt* pStmt = (SDropStreamStmt*)nodesMakeNode(QUERY_NODE_DROP_STREAM_STMT); CHECK_OUT_OF_MEM(pStmt); strncpy(pStmt->streamName, pStreamName->z, pStreamName->n); pStmt->ignoreNotExists = ignoreNotExists; @@ -1435,7 +1434,7 @@ SNode* createDropStreamStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SNode* createKillStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pId) { CHECK_PARSER_STATUS(pCxt); - SKillStmt* pStmt = nodesMakeNode(type); + SKillStmt* pStmt = (SKillStmt*)nodesMakeNode(type); CHECK_OUT_OF_MEM(pStmt); pStmt->targetId = taosStr2Int32(pId->z, NULL, 10); return (SNode*)pStmt; @@ -1443,14 +1442,14 @@ SNode* createKillStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pId SNode* createBalanceVgroupStmt(SAstCreateContext* pCxt) { CHECK_PARSER_STATUS(pCxt); - SBalanceVgroupStmt* pStmt = nodesMakeNode(QUERY_NODE_BALANCE_VGROUP_STMT); + SBalanceVgroupStmt* pStmt = (SBalanceVgroupStmt*)nodesMakeNode(QUERY_NODE_BALANCE_VGROUP_STMT); CHECK_OUT_OF_MEM(pStmt); return (SNode*)pStmt; } SNode* createMergeVgroupStmt(SAstCreateContext* pCxt, const SToken* pVgId1, const SToken* pVgId2) { CHECK_PARSER_STATUS(pCxt); - SMergeVgroupStmt* pStmt = nodesMakeNode(QUERY_NODE_MERGE_VGROUP_STMT); + SMergeVgroupStmt* pStmt = (SMergeVgroupStmt*)nodesMakeNode(QUERY_NODE_MERGE_VGROUP_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->vgId1 = taosStr2Int32(pVgId1->z, NULL, 10); pStmt->vgId2 = taosStr2Int32(pVgId2->z, NULL, 10); @@ -1459,7 +1458,7 @@ SNode* createMergeVgroupStmt(SAstCreateContext* pCxt, const SToken* pVgId1, cons SNode* createRedistributeVgroupStmt(SAstCreateContext* pCxt, const SToken* pVgId, SNodeList* pDnodes) { CHECK_PARSER_STATUS(pCxt); - SRedistributeVgroupStmt* pStmt = nodesMakeNode(QUERY_NODE_REDISTRIBUTE_VGROUP_STMT); + SRedistributeVgroupStmt* pStmt = (SRedistributeVgroupStmt*)nodesMakeNode(QUERY_NODE_REDISTRIBUTE_VGROUP_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->vgId = taosStr2Int32(pVgId->z, NULL, 10); pStmt->pDnodes = pDnodes; @@ -1468,7 +1467,7 @@ SNode* createRedistributeVgroupStmt(SAstCreateContext* pCxt, const SToken* pVgId SNode* createSplitVgroupStmt(SAstCreateContext* pCxt, const SToken* pVgId) { CHECK_PARSER_STATUS(pCxt); - SSplitVgroupStmt* pStmt = nodesMakeNode(QUERY_NODE_SPLIT_VGROUP_STMT); + SSplitVgroupStmt* pStmt = (SSplitVgroupStmt*)nodesMakeNode(QUERY_NODE_SPLIT_VGROUP_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->vgId = taosStr2Int32(pVgId->z, NULL, 10); return (SNode*)pStmt; @@ -1486,7 +1485,7 @@ SNode* createGrantStmt(SAstCreateContext* pCxt, int64_t privileges, SToken* pDbN if (!checkDbName(pCxt, pDbName, false) || !checkUserName(pCxt, pUserName)) { return NULL; } - SGrantStmt* pStmt = nodesMakeNode(QUERY_NODE_GRANT_STMT); + SGrantStmt* pStmt = (SGrantStmt*)nodesMakeNode(QUERY_NODE_GRANT_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->privileges = privileges; strncpy(pStmt->dbName, pDbName->z, pDbName->n); @@ -1499,7 +1498,7 @@ SNode* createRevokeStmt(SAstCreateContext* pCxt, int64_t privileges, SToken* pDb if (!checkDbName(pCxt, pDbName, false) || !checkUserName(pCxt, pUserName)) { return NULL; } - SRevokeStmt* pStmt = nodesMakeNode(QUERY_NODE_REVOKE_STMT); + SRevokeStmt* pStmt = (SRevokeStmt*)nodesMakeNode(QUERY_NODE_REVOKE_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->privileges = privileges; strncpy(pStmt->dbName, pDbName->z, pDbName->n); @@ -1508,11 +1507,11 @@ SNode* createRevokeStmt(SAstCreateContext* pCxt, int64_t privileges, SToken* pDb } SNode* createCountFuncForDelete(SAstCreateContext* pCxt) { - SFunctionNode* pFunc = nodesMakeNode(QUERY_NODE_FUNCTION); + SFunctionNode* pFunc = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION); CHECK_OUT_OF_MEM(pFunc); strcpy(pFunc->functionName, "count"); if (TSDB_CODE_SUCCESS != nodesListMakeStrictAppend(&pFunc->pParameterList, createPrimaryKeyCol(pCxt))) { - nodesDestroyNode(pFunc); + nodesDestroyNode((SNode*)pFunc); CHECK_OUT_OF_MEM(NULL); } return (SNode*)pFunc; @@ -1520,13 +1519,13 @@ SNode* createCountFuncForDelete(SAstCreateContext* pCxt) { SNode* createDeleteStmt(SAstCreateContext* pCxt, SNode* pTable, SNode* pWhere) { CHECK_PARSER_STATUS(pCxt); - SDeleteStmt* pStmt = nodesMakeNode(QUERY_NODE_DELETE_STMT); + SDeleteStmt* pStmt = (SDeleteStmt*)nodesMakeNode(QUERY_NODE_DELETE_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->pFromTable = pTable; pStmt->pWhere = pWhere; pStmt->pCountFunc = createCountFuncForDelete(pCxt); if (NULL == pStmt->pCountFunc) { - nodesDestroyNode(pStmt); + nodesDestroyNode((SNode*)pStmt); CHECK_OUT_OF_MEM(NULL); } return (SNode*)pStmt; diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c index aca7d9c9d332bc6318a39d457a406180ed1ee609..f6467dbf2301fce80880b78ae8b133225098afbb 100644 --- a/source/libs/parser/src/parAstParser.c +++ b/source/libs/parser/src/parAstParser.c @@ -77,7 +77,7 @@ int32_t parse(SParseContext* pParseCxt, SQuery** pQuery) { abort_parse: ParseFree(pParser, (FFree)taosMemoryFree); if (TSDB_CODE_SUCCESS == cxt.errCode) { - *pQuery = taosMemoryCalloc(1, sizeof(SQuery)); + *pQuery = (SQuery*)nodesMakeNode(QUERY_NODE_QUERY); if (NULL == *pQuery) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -95,12 +95,6 @@ typedef struct SCollectMetaKeyCxt { SNode* pStmt; } SCollectMetaKeyCxt; -static void destroyCollectMetaKeyCxt(SCollectMetaKeyCxt* pCxt) { - if (NULL != pCxt->pMetaCache) { - // TODO - } -} - typedef struct SCollectMetaKeyFromExprCxt { SCollectMetaKeyCxt* pComCxt; int32_t errCode; @@ -463,16 +457,7 @@ static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) { return TSDB_CODE_SUCCESS; } -int32_t collectMetaKey(SParseContext* pParseCxt, SQuery* pQuery) { - SCollectMetaKeyCxt cxt = { - .pParseCxt = pParseCxt, .pMetaCache = taosMemoryCalloc(1, sizeof(SParseMetaCache)), .pStmt = pQuery->pRoot}; - if (NULL == cxt.pMetaCache) { - return TSDB_CODE_OUT_OF_MEMORY; - } - int32_t code = collectMetaKeyFromQuery(&cxt, pQuery->pRoot); - if (TSDB_CODE_SUCCESS == code) { - TSWAP(pQuery->pMetaCache, cxt.pMetaCache); - } - destroyCollectMetaKeyCxt(&cxt); - return code; +int32_t collectMetaKey(SParseContext* pParseCxt, SQuery* pQuery, SParseMetaCache* pMetaCache) { + SCollectMetaKeyCxt cxt = {.pParseCxt = pParseCxt, .pMetaCache = pMetaCache, .pStmt = pQuery->pRoot}; + return collectMetaKeyFromQuery(&cxt, pQuery->pRoot); } diff --git a/source/libs/parser/src/parAuthenticator.c b/source/libs/parser/src/parAuthenticator.c index 858f602e1e26fc20493ae0be93729649e7129371..068ac4c94d2fb84e5a5992b5744d13f876cc5d75 100644 --- a/source/libs/parser/src/parAuthenticator.c +++ b/source/libs/parser/src/parAuthenticator.c @@ -105,7 +105,7 @@ static int32_t authQuery(SAuthCxt* pCxt, SNode* pStmt) { return TSDB_CODE_SUCCESS; } -int32_t authenticate(SParseContext* pParseCxt, SQuery* pQuery) { - SAuthCxt cxt = {.pParseCxt = pParseCxt, .pMetaCache = pQuery->pMetaCache, .errCode = TSDB_CODE_SUCCESS}; +int32_t authenticate(SParseContext* pParseCxt, SQuery* pQuery, SParseMetaCache* pMetaCache) { + SAuthCxt cxt = {.pParseCxt = pParseCxt, .pMetaCache = pMetaCache, .errCode = TSDB_CODE_SUCCESS}; return authQuery(&cxt, pQuery->pRoot); } diff --git a/source/libs/parser/src/parCalcConst.c b/source/libs/parser/src/parCalcConst.c index b2cb67b1c3fc13a66922f51f250c2e39621798b3..22d7afd6424a291e397a5a206f822ddadd1e2bc8 100644 --- a/source/libs/parser/src/parCalcConst.c +++ b/source/libs/parser/src/parCalcConst.c @@ -65,7 +65,7 @@ static bool isCondition(const SNode* pNode) { } static int32_t rewriteIsTrue(SNode* pSrc, SNode** pIsTrue) { - SOperatorNode* pOp = nodesMakeNode(QUERY_NODE_OPERATOR); + SOperatorNode* pOp = (SOperatorNode*)nodesMakeNode(QUERY_NODE_OPERATOR); if (NULL == pOp) { return TSDB_CODE_OUT_OF_MEMORY; } diff --git a/source/libs/parser/src/parInsert.c b/source/libs/parser/src/parInsert.c index 7c0bf0de74604a78b8dfaa996484066324be92f1..626960bf100f8fdce7b8efbbc1ba029790e4719f 100644 --- a/source/libs/parser/src/parInsert.c +++ b/source/libs/parser/src/parInsert.c @@ -1301,6 +1301,8 @@ static void destroyInsertParseContextForTable(SInsertParseContext* pCxt) { destroyCreateSubTbReq(&pCxt->createTblReq); } +static void destroySubTableHashElem(void* p) { taosMemoryFree(*(STableMeta**)p); } + static void destroyInsertParseContext(SInsertParseContext* pCxt) { destroyInsertParseContextForTable(pCxt); taosHashCleanup(pCxt->pVgroupsHashObj); @@ -1458,7 +1460,7 @@ static int32_t parseInsertBody(SInsertParseContext* pCxt) { // [(field1_name, ...)] // VALUES (field1_value, ...) [(field1_value2, ...) ...] | FILE csv_file_path // [...]; -int32_t parseInsertSql(SParseContext* pContext, SQuery** pQuery) { +int32_t parseInsertSql(SParseContext* pContext, SQuery** pQuery, SParseMetaCache* pMetaCache) { SInsertParseContext context = { .pComCxt = pContext, .pSql = (char*)pContext->pSql, @@ -1469,7 +1471,8 @@ int32_t parseInsertSql(SParseContext* pContext, SQuery** pQuery) { .pDbFNameHashObj = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_VARCHAR), true, HASH_NO_LOCK), .totalNum = 0, .pOutput = (SVnodeModifOpStmt*)nodesMakeNode(QUERY_NODE_VNODE_MODIF_STMT), - .pStmtCb = pContext->pStmtCb}; + .pStmtCb = pContext->pStmtCb, + .pMetaCache = pMetaCache}; if (pContext->pStmtCb && *pQuery) { (*pContext->pStmtCb->getExecInfoFn)(pContext->pStmtCb->pStmt, &context.pVgroupsHashObj, @@ -1484,18 +1487,17 @@ int32_t parseInsertSql(SParseContext* pContext, SQuery** pQuery) { NULL == context.pTableNameHashObj || NULL == context.pDbFNameHashObj || NULL == context.pOutput) { return TSDB_CODE_TSC_OUT_OF_MEMORY; } + taosHashSetFreeFp(context.pSubTableHashObj, destroySubTableHashElem); if (pContext->pStmtCb) { TSDB_QUERY_SET_TYPE(context.pOutput->insertType, TSDB_QUERY_TYPE_STMT_INSERT); } if (NULL == *pQuery) { - *pQuery = taosMemoryCalloc(1, sizeof(SQuery)); + *pQuery = (SQuery*)nodesMakeNode(QUERY_NODE_QUERY); if (NULL == *pQuery) { return TSDB_CODE_OUT_OF_MEMORY; } - } else { - context.pMetaCache = (*pQuery)->pMetaCache; } (*pQuery)->execMode = QUERY_EXEC_MODE_SCHEDULE; (*pQuery)->haveResultSet = false; @@ -1694,24 +1696,20 @@ static int32_t parseInsertBodySyntax(SInsertParseSyntaxCxt* pCxt) { return TSDB_CODE_SUCCESS; } -int32_t parseInsertSyntax(SParseContext* pContext, SQuery** pQuery) { +int32_t parseInsertSyntax(SParseContext* pContext, SQuery** pQuery, SParseMetaCache* pMetaCache) { SInsertParseSyntaxCxt context = {.pComCxt = pContext, .pSql = (char*)pContext->pSql, .msg = {.buf = pContext->pMsg, .len = pContext->msgLen}, - .pMetaCache = taosMemoryCalloc(1, sizeof(SParseMetaCache))}; - if (NULL == context.pMetaCache) { - return TSDB_CODE_OUT_OF_MEMORY; - } - int32_t code = skipInsertInto(&context.pSql, &context.msg); + .pMetaCache = pMetaCache}; + int32_t code = skipInsertInto(&context.pSql, &context.msg); if (TSDB_CODE_SUCCESS == code) { code = parseInsertBodySyntax(&context); } if (TSDB_CODE_SUCCESS == code) { - *pQuery = taosMemoryCalloc(1, sizeof(SQuery)); + *pQuery = (SQuery*)nodesMakeNode(QUERY_NODE_QUERY); if (NULL == *pQuery) { return TSDB_CODE_OUT_OF_MEMORY; } - TSWAP((*pQuery)->pMetaCache, context.pMetaCache); } return code; } diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index e1ae727b663006fe197ca50ebaf06f328f2891da..a9d730e1ad5fe6b187da0c12639b7a201eabd14e 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -117,6 +117,7 @@ static SKeyword keywordTable[] = { {"LOCAL", TK_LOCAL}, {"MATCH", TK_MATCH}, {"MAXROWS", TK_MAXROWS}, + {"MAX_DELAY", TK_MAX_DELAY}, {"MERGE", TK_MERGE}, {"MINROWS", TK_MINROWS}, {"MINUS", TK_MINUS}, diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index d623b1a9a9c8ccf3cd42ab7c27abcd8563ddad7b..fcf2f57decf287a058dc0d39c7a73adafbd50a7d 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -112,7 +112,7 @@ static int32_t getTableMetaImpl(STranslateContext* pCxt, const SName* pName, STa if (pParCxt->async) { code = getTableMetaFromCache(pCxt->pMetaCache, pName, pMeta); } else { - SRequestConnInfo conn = {.pTrans = pParCxt->pTransporter, + SRequestConnInfo conn = {.pTrans = pParCxt->pTransporter, .requestId = pParCxt->requestId, .requestObjRefId = pParCxt->requestRid, .mgmtEps = pParCxt->mgmtEpSet}; @@ -140,13 +140,12 @@ static int32_t refreshGetTableMeta(STranslateContext* pCxt, const char* pDbName, if (pParCxt->async) { code = getTableMetaFromCache(pCxt->pMetaCache, &name, pMeta); } else { - SRequestConnInfo conn = {.pTrans = pParCxt->pTransporter, + SRequestConnInfo conn = {.pTrans = pParCxt->pTransporter, .requestId = pParCxt->requestId, .requestObjRefId = pParCxt->requestRid, .mgmtEps = pParCxt->mgmtEpSet}; - - code = - catalogRefreshGetTableMeta(pParCxt->pCatalog, &conn, &name, pMeta, false); + + code = catalogRefreshGetTableMeta(pParCxt->pCatalog, &conn, &name, pMeta, false); } if (TSDB_CODE_SUCCESS != code) { parserError("catalogRefreshGetTableMeta error, code:%s, dbName:%s, tbName:%s", tstrerror(code), pDbName, @@ -164,7 +163,7 @@ static int32_t getDBVgInfoImpl(STranslateContext* pCxt, const SName* pName, SArr if (pParCxt->async) { code = getDbVgInfoFromCache(pCxt->pMetaCache, fullDbName, pVgInfo); } else { - SRequestConnInfo conn = {.pTrans = pParCxt->pTransporter, + SRequestConnInfo conn = {.pTrans = pParCxt->pTransporter, .requestId = pParCxt->requestId, .requestObjRefId = pParCxt->requestRid, .mgmtEps = pParCxt->mgmtEpSet}; @@ -195,7 +194,7 @@ static int32_t getTableHashVgroupImpl(STranslateContext* pCxt, const SName* pNam if (pParCxt->async) { code = getTableVgroupFromCache(pCxt->pMetaCache, pName, pInfo); } else { - SRequestConnInfo conn = {.pTrans = pParCxt->pTransporter, + SRequestConnInfo conn = {.pTrans = pParCxt->pTransporter, .requestId = pParCxt->requestId, .requestObjRefId = pParCxt->requestRid, .mgmtEps = pParCxt->mgmtEpSet}; @@ -243,7 +242,7 @@ static int32_t getDBCfg(STranslateContext* pCxt, const char* pDbName, SDbCfgInfo if (pParCxt->async) { code = getDbCfgFromCache(pCxt->pMetaCache, dbFname, pInfo); } else { - SRequestConnInfo conn = {.pTrans = pParCxt->pTransporter, + SRequestConnInfo conn = {.pTrans = pParCxt->pTransporter, .requestId = pParCxt->requestId, .requestObjRefId = pParCxt->requestRid, .mgmtEps = pParCxt->mgmtEpSet}; @@ -264,13 +263,12 @@ static int32_t getUdfInfo(STranslateContext* pCxt, SFunctionNode* pFunc) { if (pParCxt->async) { code = getUdfInfoFromCache(pCxt->pMetaCache, pFunc->functionName, &funcInfo); } else { - SRequestConnInfo conn = {.pTrans = pParCxt->pTransporter, + SRequestConnInfo conn = {.pTrans = pParCxt->pTransporter, .requestId = pParCxt->requestId, .requestObjRefId = pParCxt->requestRid, .mgmtEps = pParCxt->mgmtEpSet}; - code = catalogGetUdfInfo(pParCxt->pCatalog, &conn, pFunc->functionName, - &funcInfo); + code = catalogGetUdfInfo(pParCxt->pCatalog, &conn, pFunc->functionName, &funcInfo); } if (TSDB_CODE_SUCCESS == code) { pFunc->funcType = FUNCTION_TYPE_UDF; @@ -292,11 +290,11 @@ static int32_t getTableIndex(STranslateContext* pCxt, const SName* pName, SArray if (pParCxt->async) { code = getTableIndexFromCache(pCxt->pMetaCache, pName, pIndexes); } else { - SRequestConnInfo conn = {.pTrans = pParCxt->pTransporter, + SRequestConnInfo conn = {.pTrans = pParCxt->pTransporter, .requestId = pParCxt->requestId, .requestObjRefId = pParCxt->requestRid, .mgmtEps = pParCxt->mgmtEpSet}; - + code = catalogGetTableIndex(pParCxt->pCatalog, &conn, pName, pIndexes); } if (TSDB_CODE_SUCCESS != code) { @@ -982,7 +980,7 @@ static bool isCountStar(SFunctionNode* pFunc) { // count(*) is rewritten as count(ts) for scannning optimization static int32_t rewriteCountStar(STranslateContext* pCxt, SFunctionNode* pCount) { - SColumnNode* pCol = nodesListGetNode(pCount->pParameterList, 0); + SColumnNode* pCol = (SColumnNode*)nodesListGetNode(pCount->pParameterList, 0); STableNode* pTable = NULL; int32_t code = findTable(pCxt, ('\0' == pCol->tableAlias[0] ? NULL : pCol->tableAlias), &pTable); if (TSDB_CODE_SUCCESS == code && QUERY_NODE_REAL_TABLE == nodeType(pTable)) { @@ -1034,7 +1032,7 @@ static int32_t translateScanPseudoColumnFunc(STranslateContext* pCxt, SFunctionN return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_TBNAME); } } else { - SValueNode* pVal = nodesListGetNode(pFunc->pParameterList, 0); + SValueNode* pVal = (SValueNode*)nodesListGetNode(pFunc->pParameterList, 0); STableNode* pTable = NULL; pCxt->errCode = findTable(pCxt, pVal->literal, &pTable); if (TSDB_CODE_SUCCESS == pCxt->errCode && (NULL == pTable || QUERY_NODE_REAL_TABLE != nodeType(pTable))) { @@ -1175,7 +1173,7 @@ typedef struct SCheckExprForGroupByCxt { } SCheckExprForGroupByCxt; static EDealRes rewriteColToSelectValFunc(STranslateContext* pCxt, SNode** pNode) { - SFunctionNode* pFunc = nodesMakeNode(QUERY_NODE_FUNCTION); + SFunctionNode* pFunc = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION); if (NULL == pFunc) { pCxt->errCode = TSDB_CODE_OUT_OF_MEMORY; return DEAL_RES_ERROR; @@ -1190,7 +1188,7 @@ static EDealRes rewriteColToSelectValFunc(STranslateContext* pCxt, SNode** pNode *pNode = (SNode*)pFunc; pCxt->pCurrSelectStmt->hasSelectValFunc = true; } else { - nodesDestroyNode(pFunc); + nodesDestroyNode((SNode*)pFunc); } return TSDB_CODE_SUCCESS == pCxt->errCode ? DEAL_RES_IGNORE_CHILD : DEAL_RES_ERROR; } @@ -1527,14 +1525,14 @@ static int32_t createAllColumns(STranslateContext* pCxt, SNodeList** pCols) { } static SNode* createMultiResFunc(SFunctionNode* pSrcFunc, SExprNode* pExpr) { - SFunctionNode* pFunc = nodesMakeNode(QUERY_NODE_FUNCTION); + SFunctionNode* pFunc = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION); if (NULL == pFunc) { return NULL; } pFunc->pParameterList = nodesMakeList(); if (NULL == pFunc->pParameterList || - TSDB_CODE_SUCCESS != nodesListStrictAppend(pFunc->pParameterList, nodesCloneNode(pExpr))) { - nodesDestroyNode(pFunc); + TSDB_CODE_SUCCESS != nodesListStrictAppend(pFunc->pParameterList, nodesCloneNode((SNode*)pExpr))) { + nodesDestroyNode((SNode*)pFunc); return NULL; } @@ -2039,7 +2037,7 @@ static int32_t checkLimit(STranslateContext* pCxt, SSelectStmt* pSelect) { } static int32_t createPrimaryKeyColByTable(STranslateContext* pCxt, STableNode* pTable, SNode** pPrimaryKey) { - SColumnNode* pCol = nodesMakeNode(QUERY_NODE_COLUMN); + SColumnNode* pCol = (SColumnNode*)nodesMakeNode(QUERY_NODE_COLUMN); if (NULL == pCol) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -2120,7 +2118,7 @@ static int32_t translateSelect(STranslateContext* pCxt, SSelectStmt* pSelect) { } static SNode* createSetOperProject(const char* pTableAlias, SNode* pNode) { - SColumnNode* pCol = nodesMakeNode(QUERY_NODE_COLUMN); + SColumnNode* pCol = (SColumnNode*)nodesMakeNode(QUERY_NODE_COLUMN); if (NULL == pCol) { return NULL; } @@ -2132,20 +2130,20 @@ static SNode* createSetOperProject(const char* pTableAlias, SNode* pNode) { } static int32_t createCastFunc(STranslateContext* pCxt, SNode* pExpr, SDataType dt, SNode** pCast) { - SFunctionNode* pFunc = nodesMakeNode(QUERY_NODE_FUNCTION); + SFunctionNode* pFunc = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION); if (NULL == pFunc) { return TSDB_CODE_OUT_OF_MEMORY; } strcpy(pFunc->functionName, "cast"); pFunc->node.resType = dt; if (TSDB_CODE_SUCCESS != nodesListMakeAppend(&pFunc->pParameterList, pExpr)) { - nodesDestroyNode(pFunc); + nodesDestroyNode((SNode*)pFunc); return TSDB_CODE_OUT_OF_MEMORY; } if (TSDB_CODE_SUCCESS != getFuncInfo(pCxt, pFunc)) { nodesClearList(pFunc->pParameterList); pFunc->pParameterList = NULL; - nodesDestroyNode(pFunc); + nodesDestroyNode((SNode*)pFunc); return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_WRONG_VALUE_TYPE, ((SExprNode*)pExpr)->aliasName); } *pCast = (SNode*)pFunc; @@ -2449,11 +2447,11 @@ static int32_t checkDbRetentionsOption(STranslateContext* pCxt, SNodeList* pRete static int32_t checkOptionsDependency(STranslateContext* pCxt, const char* pDbName, SDatabaseOptions* pOptions) { int32_t daysPerFile = pOptions->daysPerFile; - int32_t daysToKeep0 = pOptions->keep[0]; + int64_t daysToKeep0 = pOptions->keep[0]; if (-1 == daysPerFile && -1 == daysToKeep0) { return TSDB_CODE_SUCCESS; } else if (-1 == daysPerFile || -1 == daysToKeep0) { - SDbCfgInfo dbCfg; + SDbCfgInfo dbCfg = {0}; int32_t code = getDBCfg(pCxt, pDbName, &dbCfg); if (TSDB_CODE_SUCCESS != code) { return code; @@ -2557,16 +2555,14 @@ static int32_t buildCmdMsg(STranslateContext* pCxt, int16_t msgType, FSerializeF static int32_t translateCreateDatabase(STranslateContext* pCxt, SCreateDatabaseStmt* pStmt) { SCreateDbReq createReq = {0}; - - int32_t code = checkCreateDatabase(pCxt, pStmt); + int32_t code = checkCreateDatabase(pCxt, pStmt); if (TSDB_CODE_SUCCESS == code) { code = buildCreateDbReq(pCxt, pStmt, &createReq); } - if (TSDB_CODE_SUCCESS == code) { code = buildCmdMsg(pCxt, TDMT_MND_CREATE_DB, (FSerializeFunc)tSerializeSCreateDbReq, &createReq); } - + tFreeSCreateDbReq(&createReq); return code; } @@ -2794,15 +2790,15 @@ static int32_t checkTableSchema(STranslateContext* pCxt, SCreateTableStmt* pStmt } static int32_t checkSchemalessDb(STranslateContext* pCxt, const char* pDbName) { -// if (0 != pCxt->pParseCxt->schemalessType) { -// return TSDB_CODE_SUCCESS; -// } -// SDbCfgInfo info = {0}; -// int32_t code = getDBCfg(pCxt, pDbName, &info); -// if (TSDB_CODE_SUCCESS == code) { -// code = info.schemaless ? TSDB_CODE_SML_INVALID_DB_CONF : TSDB_CODE_SUCCESS; -// } -// return code; + // if (0 != pCxt->pParseCxt->schemalessType) { + // return TSDB_CODE_SUCCESS; + // } + // SDbCfgInfo info = {0}; + // int32_t code = getDBCfg(pCxt, pDbName, &info); + // if (TSDB_CODE_SUCCESS == code) { + // code = info.schemaless ? TSDB_CODE_SML_INVALID_DB_CONF : TSDB_CODE_SUCCESS; + // } + // return code; return TSDB_CODE_SUCCESS; } @@ -2850,15 +2846,15 @@ typedef struct SSampleAstInfo { static int32_t buildSampleAst(STranslateContext* pCxt, SSampleAstInfo* pInfo, char** pAst, int32_t* pLen, char** pExpr, int32_t* pExprLen) { - SSelectStmt* pSelect = nodesMakeNode(QUERY_NODE_SELECT_STMT); + SSelectStmt* pSelect = (SSelectStmt*)nodesMakeNode(QUERY_NODE_SELECT_STMT); if (NULL == pSelect) { return TSDB_CODE_OUT_OF_MEMORY; } sprintf(pSelect->stmtName, "%p", pSelect); - SRealTableNode* pTable = nodesMakeNode(QUERY_NODE_REAL_TABLE); + SRealTableNode* pTable = (SRealTableNode*)nodesMakeNode(QUERY_NODE_REAL_TABLE); if (NULL == pTable) { - nodesDestroyNode(pSelect); + nodesDestroyNode((SNode*)pSelect); return TSDB_CODE_OUT_OF_MEMORY; } strcpy(pTable->table.dbName, pInfo->pDbName); @@ -2867,19 +2863,19 @@ static int32_t buildSampleAst(STranslateContext* pCxt, SSampleAstInfo* pInfo, ch pSelect->pFromTable = (SNode*)pTable; TSWAP(pSelect->pProjectionList, pInfo->pFuncs); - SFunctionNode* pFunc = nodesMakeNode(QUERY_NODE_FUNCTION); + SFunctionNode* pFunc = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION); if (NULL == pSelect->pProjectionList || NULL == pFunc) { - nodesDestroyNode(pSelect); + nodesDestroyNode((SNode*)pSelect); return TSDB_CODE_OUT_OF_MEMORY; } strcpy(pFunc->functionName, "_wstartts"); - nodesListPushFront(pSelect->pProjectionList, pFunc); + nodesListPushFront(pSelect->pProjectionList, (SNode*)pFunc); SNode* pProject = NULL; FOREACH(pProject, pSelect->pProjectionList) { sprintf(((SExprNode*)pProject)->aliasName, "#%p", pProject); } - SIntervalWindowNode* pInterval = nodesMakeNode(QUERY_NODE_INTERVAL_WINDOW); + SIntervalWindowNode* pInterval = (SIntervalWindowNode*)nodesMakeNode(QUERY_NODE_INTERVAL_WINDOW); if (NULL == pInterval) { - nodesDestroyNode(pSelect); + nodesDestroyNode((SNode*)pSelect); return TSDB_CODE_OUT_OF_MEMORY; } pSelect->pWindow = (SNode*)pInterval; @@ -2888,7 +2884,7 @@ static int32_t buildSampleAst(STranslateContext* pCxt, SSampleAstInfo* pInfo, ch TSWAP(pInterval->pSliding, pInfo->pSliding); pInterval->pCol = nodesMakeNode(QUERY_NODE_COLUMN); if (NULL == pInterval->pCol) { - nodesDestroyNode(pSelect); + nodesDestroyNode((SNode*)pSelect); return TSDB_CODE_OUT_OF_MEMORY; } ((SColumnNode*)pInterval->pCol)->colId = PRIMARYKEY_TIMESTAMP_COL_ID; @@ -2897,12 +2893,12 @@ static int32_t buildSampleAst(STranslateContext* pCxt, SSampleAstInfo* pInfo, ch pCxt->createStream = true; int32_t code = translateQuery(pCxt, (SNode*)pSelect); if (TSDB_CODE_SUCCESS == code) { - code = nodesNodeToString(pSelect, false, pAst, pLen); + code = nodesNodeToString((SNode*)pSelect, false, pAst, pLen); } if (TSDB_CODE_SUCCESS == code && NULL != pExpr) { code = nodesListToString(pSelect->pProjectionList, false, pExpr, pExprLen); } - nodesDestroyNode(pSelect); + nodesDestroyNode((SNode*)pSelect); return code; } @@ -2914,7 +2910,7 @@ static void clearSampleAstInfo(SSampleAstInfo* pInfo) { } static SNode* makeIntervalVal(SRetention* pRetension, int8_t precision) { - SValueNode* pVal = nodesMakeNode(QUERY_NODE_VALUE); + SValueNode* pVal = (SValueNode*)nodesMakeNode(QUERY_NODE_VALUE); if (NULL == pVal) { return NULL; } @@ -2923,7 +2919,7 @@ static SNode* makeIntervalVal(SRetention* pRetension, int8_t precision) { int32_t len = snprintf(buf, sizeof(buf), "%" PRId64 "%c", timeVal, pRetension->freqUnit); pVal->literal = strndup(buf, len); if (NULL == pVal->literal) { - nodesDestroyNode(pVal); + nodesDestroyNode((SNode*)pVal); return NULL; } pVal->isDuration = true; @@ -2934,7 +2930,7 @@ static SNode* makeIntervalVal(SRetention* pRetension, int8_t precision) { } static SNode* createColumnFromDef(SColumnDefNode* pDef) { - SColumnNode* pCol = nodesMakeNode(QUERY_NODE_COLUMN); + SColumnNode* pCol = (SColumnNode*)nodesMakeNode(QUERY_NODE_COLUMN); if (NULL == pCol) { return NULL; } @@ -2943,12 +2939,12 @@ static SNode* createColumnFromDef(SColumnDefNode* pDef) { } static SNode* createRollupFunc(SNode* pSrcFunc, SColumnDefNode* pColDef) { - SFunctionNode* pFunc = nodesCloneNode(pSrcFunc); + SFunctionNode* pFunc = (SFunctionNode*)nodesCloneNode(pSrcFunc); if (NULL == pFunc) { return NULL; } if (TSDB_CODE_SUCCESS != nodesListMakeStrictAppend(&pFunc->pParameterList, createColumnFromDef(pColDef))) { - nodesDestroyNode(pFunc); + nodesDestroyNode((SNode*)pFunc); return NULL; } return (SNode*)pFunc; @@ -3098,7 +3094,7 @@ static int32_t doTranslateDropSuperTable(STranslateContext* pCxt, const SName* p } static int32_t translateDropTable(STranslateContext* pCxt, SDropTableStmt* pStmt) { - SDropTableClause* pClause = nodesListGetNode(pStmt->pTables, 0); + SDropTableClause* pClause = (SDropTableClause*)nodesListGetNode(pStmt->pTables, 0); SName tableName; return doTranslateDropSuperTable( pCxt, toName(pCxt->pParseCxt->acctId, pClause->dbName, pClause->tableName, &tableName), pClause->ignoreNotExists); @@ -3170,6 +3166,7 @@ static int32_t translateAlterTable(STranslateContext* pCxt, SAlterTableStmt* pSt if (TSDB_CODE_SUCCESS == code) { code = buildCmdMsg(pCxt, TDMT_MND_ALTER_STB, (FSerializeFunc)tSerializeSMAlterStbReq, &alterReq); } + tFreeSMAltertbReq(&alterReq); return code; } @@ -3576,6 +3573,16 @@ static int32_t translateKillTransaction(STranslateContext* pCxt, SKillStmt* pStm } static int32_t checkCreateStream(STranslateContext* pCxt, SCreateStreamStmt* pStmt) { + if (NULL != pStmt->pOptions->pWatermark && + (DEAL_RES_ERROR == translateValue(pCxt, (SValueNode*)pStmt->pOptions->pWatermark))) { + return pCxt->errCode; + } + + if (NULL != pStmt->pOptions->pDelay && + (DEAL_RES_ERROR == translateValue(pCxt, (SValueNode*)pStmt->pOptions->pDelay))) { + return pCxt->errCode; + } + if (NULL == pStmt->pQuery) { return TSDB_CODE_SUCCESS; } @@ -3623,12 +3630,9 @@ static int32_t buildCreateStreamReq(STranslateContext* pCxt, SCreateStreamStmt* } } - if (TSDB_CODE_SUCCESS == code && NULL != pStmt->pOptions->pWatermark) { - code = (DEAL_RES_ERROR == translateValue(pCxt, (SValueNode*)pStmt->pOptions->pWatermark)) ? pCxt->errCode - : TSDB_CODE_SUCCESS; - } if (TSDB_CODE_SUCCESS == code) { pReq->triggerType = pStmt->pOptions->triggerType; + pReq->maxDelay = (NULL != pStmt->pOptions->pDelay ? ((SValueNode*)pStmt->pOptions->pDelay)->datum.i : 0); pReq->watermark = (NULL != pStmt->pOptions->pWatermark ? ((SValueNode*)pStmt->pOptions->pWatermark)->datum.i : 0); } @@ -4116,15 +4120,15 @@ static const char* getSysTableName(ENodeType type) { } static int32_t createSelectStmtForShow(ENodeType showType, SSelectStmt** pStmt) { - SSelectStmt* pSelect = nodesMakeNode(QUERY_NODE_SELECT_STMT); + SSelectStmt* pSelect = (SSelectStmt*)nodesMakeNode(QUERY_NODE_SELECT_STMT); if (NULL == pSelect) { return TSDB_CODE_OUT_OF_MEMORY; } sprintf(pSelect->stmtName, "%p", pSelect); - SRealTableNode* pTable = nodesMakeNode(QUERY_NODE_REAL_TABLE); + SRealTableNode* pTable = (SRealTableNode*)nodesMakeNode(QUERY_NODE_REAL_TABLE); if (NULL == pTable) { - nodesDestroyNode(pSelect); + nodesDestroyNode((SNode*)pSelect); return TSDB_CODE_OUT_OF_MEMORY; } strcpy(pTable->table.dbName, getSysDbName(showType)); @@ -4142,7 +4146,7 @@ static int32_t createOperatorNode(EOperatorType opType, const char* pColName, SN return TSDB_CODE_SUCCESS; } - SOperatorNode* pOper = nodesMakeNode(QUERY_NODE_OPERATOR); + SOperatorNode* pOper = (SOperatorNode*)nodesMakeNode(QUERY_NODE_OPERATOR); if (NULL == pOper) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -4151,7 +4155,7 @@ static int32_t createOperatorNode(EOperatorType opType, const char* pColName, SN pOper->pLeft = nodesMakeNode(QUERY_NODE_COLUMN); pOper->pRight = nodesCloneNode(pRight); if (NULL == pOper->pLeft || NULL == pOper->pRight) { - nodesDestroyNode(pOper); + nodesDestroyNode((SNode*)pOper); return TSDB_CODE_OUT_OF_MEMORY; } strcpy(((SColumnNode*)pOper->pLeft)->colName, pColName); @@ -4165,19 +4169,19 @@ static const char* getTbNameColName(ENodeType type) { } static int32_t createLogicCondNode(SNode* pCond1, SNode* pCond2, SNode** pCond) { - SLogicConditionNode* pCondition = nodesMakeNode(QUERY_NODE_LOGIC_CONDITION); + SLogicConditionNode* pCondition = (SLogicConditionNode*)nodesMakeNode(QUERY_NODE_LOGIC_CONDITION); if (NULL == pCondition) { return TSDB_CODE_OUT_OF_MEMORY; } pCondition->condType = LOGIC_COND_TYPE_AND; pCondition->pParameterList = nodesMakeList(); if (NULL == pCondition->pParameterList) { - nodesDestroyNode(pCondition); + nodesDestroyNode((SNode*)pCondition); return TSDB_CODE_OUT_OF_MEMORY; } if (TSDB_CODE_SUCCESS != nodesListAppend(pCondition->pParameterList, pCond1) || TSDB_CODE_SUCCESS != nodesListAppend(pCondition->pParameterList, pCond2)) { - nodesDestroyNode(pCondition); + nodesDestroyNode((SNode*)pCondition); return TSDB_CODE_OUT_OF_MEMORY; } @@ -4325,7 +4329,7 @@ static void destroyCreateTbReqBatch(SVgroupCreateTableBatch* pTbBatch) { } static int32_t rewriteToVnodeModifyOpStmt(SQuery* pQuery, SArray* pBufArray) { - SVnodeModifOpStmt* pNewStmt = nodesMakeNode(QUERY_NODE_VNODE_MODIF_STMT); + SVnodeModifOpStmt* pNewStmt = (SVnodeModifOpStmt*)nodesMakeNode(QUERY_NODE_VNODE_MODIF_STMT); if (pNewStmt == NULL) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -5078,29 +5082,18 @@ static int32_t buildModifyVnodeArray(STranslateContext* pCxt, SAlterTableStmt* p return code; } -static int32_t rewriteAlterTable(STranslateContext* pCxt, SQuery* pQuery) { - SAlterTableStmt* pStmt = (SAlterTableStmt*)pQuery->pRoot; - int32_t code = checkSchemalessDb(pCxt, pStmt->dbName); - if (TSDB_CODE_SUCCESS != code) { - return code; - } - STableMeta* pTableMeta = NULL; - code = getTableMeta(pCxt, pStmt->dbName, pStmt->tableName, &pTableMeta); - if (TSDB_CODE_SUCCESS != code) { - return code; - } - - if (pStmt->dataType.type == TSDB_DATA_TYPE_JSON && pStmt->alterType == TSDB_ALTER_TABLE_ADD_TAG) { - return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_ONLY_ONE_JSON_TAG); - } - - if (pStmt->dataType.type == TSDB_DATA_TYPE_JSON && pStmt->alterType == TSDB_ALTER_TABLE_ADD_COLUMN) { - return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_COL_JSON); - } +static void destoryAlterTbReq(SVAlterTbReq* pReq) { + taosMemoryFree(pReq->tbName); + taosMemoryFree(pReq->colName); + taosMemoryFree(pReq->colNewName); + taosMemoryFree(pReq->tagName); + taosMemoryFree(pReq->newComment); +} +static int32_t rewriteAlterTableImpl(STranslateContext* pCxt, SAlterTableStmt* pStmt, STableMeta* pTableMeta, + SQuery* pQuery) { if (getNumOfTags(pTableMeta) == 1 && pStmt->alterType == TSDB_ALTER_TABLE_DROP_TAG) { - return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_ALTER_TABLE, - "can not drop tag if there is only one tag"); + return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_ALTER_TABLE); } if (TSDB_SUPER_TABLE == pTableMeta->tableType) { @@ -5116,7 +5109,7 @@ static int32_t rewriteAlterTable(STranslateContext* pCxt, SQuery* pQuery) { } SVAlterTbReq req = {0}; - code = buildAlterTbReq(pCxt, pStmt, pTableMeta, &req); + int32_t code = buildAlterTbReq(pCxt, pStmt, pTableMeta, &req); SArray* pArray = NULL; if (TSDB_CODE_SUCCESS == code) { @@ -5125,7 +5118,27 @@ static int32_t rewriteAlterTable(STranslateContext* pCxt, SQuery* pQuery) { if (TSDB_CODE_SUCCESS == code) { code = rewriteToVnodeModifyOpStmt(pQuery, pArray); } + destoryAlterTbReq(&req); + return code; +} + +static int32_t rewriteAlterTable(STranslateContext* pCxt, SQuery* pQuery) { + SAlterTableStmt* pStmt = (SAlterTableStmt*)pQuery->pRoot; + if (pStmt->dataType.type == TSDB_DATA_TYPE_JSON && pStmt->alterType == TSDB_ALTER_TABLE_ADD_TAG) { + return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_ONLY_ONE_JSON_TAG); + } + + if (pStmt->dataType.type == TSDB_DATA_TYPE_JSON && pStmt->alterType == TSDB_ALTER_TABLE_ADD_COLUMN) { + return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_COL_JSON); + } + + STableMeta* pTableMeta = NULL; + int32_t code = getTableMeta(pCxt, pStmt->dbName, pStmt->tableName, &pTableMeta); + if (TSDB_CODE_SUCCESS == code) { + code = rewriteAlterTableImpl(pCxt, pStmt, pTableMeta, pQuery); + } + taosMemoryFree(pTableMeta); return code; } @@ -5261,10 +5274,10 @@ static int32_t setQuery(STranslateContext* pCxt, SQuery* pQuery) { return TSDB_CODE_SUCCESS; } -int32_t translate(SParseContext* pParseCxt, SQuery* pQuery) { +int32_t translate(SParseContext* pParseCxt, SQuery* pQuery, SParseMetaCache* pMetaCache) { STranslateContext cxt = {0}; - int32_t code = initTranslateContext(pParseCxt, pQuery->pMetaCache, &cxt); + int32_t code = initTranslateContext(pParseCxt, pMetaCache, &cxt); if (TSDB_CODE_SUCCESS == code) { code = rewriteQuery(&cxt, pQuery); } diff --git a/source/libs/parser/src/parUtil.c b/source/libs/parser/src/parUtil.c index 716b120af53b7e11fa2236fe2fc2b2f9016ebf6d..c3ff4c63a4c452476139607fb8a9be070a96ae95 100644 --- a/source/libs/parser/src/parUtil.c +++ b/source/libs/parser/src/parUtil.c @@ -19,6 +19,8 @@ #define USER_AUTH_KEY_MAX_LEN TSDB_USER_LEN + TSDB_DB_FNAME_LEN + 2 +const void* nullPointer = NULL; + static char* getSyntaxErrFormat(int32_t errCode) { switch (errCode) { case TSDB_CODE_PAR_SYNTAX_ERROR: @@ -550,9 +552,15 @@ int32_t buildCatalogReq(const SParseMetaCache* pMetaCache, SCatalogReq* pCatalog return code; } -static int32_t putMetaDataToHash(const char* pKey, int32_t len, const SArray* pData, int32_t index, SHashObj* pHash) { +static int32_t putMetaDataToHash(const char* pKey, int32_t len, const SArray* pData, int32_t index, SHashObj** pHash) { + if (NULL == *pHash) { + *pHash = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK); + if (NULL == *pHash) { + return TSDB_CODE_OUT_OF_MEMORY; + } + } SMetaRes* pRes = taosArrayGet(pData, index); - return taosHashPut(pHash, pKey, len, &pRes, POINTER_BYTES); + return taosHashPut(*pHash, pKey, len, &pRes, POINTER_BYTES); } static int32_t getMetaDataFromHash(const char* pKey, int32_t len, SHashObj* pHash, void** pOutput) { @@ -566,7 +574,7 @@ static int32_t getMetaDataFromHash(const char* pKey, int32_t len, SHashObj* pHas return (*pRes)->code; } -static int32_t putTableDataToCache(const SArray* pTableReq, const SArray* pTableData, SHashObj* pTable) { +static int32_t putTableDataToCache(const SArray* pTableReq, const SArray* pTableData, SHashObj** pTable) { int32_t ntables = taosArrayGetSize(pTableReq); for (int32_t i = 0; i < ntables; ++i) { char fullName[TSDB_TABLE_FNAME_LEN]; @@ -578,7 +586,7 @@ static int32_t putTableDataToCache(const SArray* pTableReq, const SArray* pTable return TSDB_CODE_SUCCESS; } -static int32_t putDbDataToCache(const SArray* pDbReq, const SArray* pDbData, SHashObj* pDb) { +static int32_t putDbDataToCache(const SArray* pDbReq, const SArray* pDbData, SHashObj** pDb) { int32_t nvgs = taosArrayGetSize(pDbReq); for (int32_t i = 0; i < nvgs; ++i) { char* pDbFName = taosArrayGet(pDbReq, i); @@ -589,7 +597,7 @@ static int32_t putDbDataToCache(const SArray* pDbReq, const SArray* pDbData, SHa return TSDB_CODE_SUCCESS; } -static int32_t putUserAuthToCache(const SArray* pUserAuthReq, const SArray* pUserAuthData, SHashObj* pUserAuth) { +static int32_t putUserAuthToCache(const SArray* pUserAuthReq, const SArray* pUserAuthData, SHashObj** pUserAuth) { int32_t nvgs = taosArrayGetSize(pUserAuthReq); for (int32_t i = 0; i < nvgs; ++i) { SUserAuthInfo* pUser = taosArrayGet(pUserAuthReq, i); @@ -602,7 +610,7 @@ static int32_t putUserAuthToCache(const SArray* pUserAuthReq, const SArray* pUse return TSDB_CODE_SUCCESS; } -static int32_t putUdfToCache(const SArray* pUdfReq, const SArray* pUdfData, SHashObj* pUdf) { +static int32_t putUdfToCache(const SArray* pUdfReq, const SArray* pUdfData, SHashObj** pUdf) { int32_t num = taosArrayGetSize(pUdfReq); for (int32_t i = 0; i < num; ++i) { char* pFunc = taosArrayGet(pUdfReq, i); @@ -614,27 +622,27 @@ static int32_t putUdfToCache(const SArray* pUdfReq, const SArray* pUdfData, SHas } int32_t putMetaDataToCache(const SCatalogReq* pCatalogReq, const SMetaData* pMetaData, SParseMetaCache* pMetaCache) { - int32_t code = putTableDataToCache(pCatalogReq->pTableMeta, pMetaData->pTableMeta, pMetaCache->pTableMeta); + int32_t code = putTableDataToCache(pCatalogReq->pTableMeta, pMetaData->pTableMeta, &pMetaCache->pTableMeta); if (TSDB_CODE_SUCCESS == code) { - code = putDbDataToCache(pCatalogReq->pDbVgroup, pMetaData->pDbVgroup, pMetaCache->pDbVgroup); + code = putDbDataToCache(pCatalogReq->pDbVgroup, pMetaData->pDbVgroup, &pMetaCache->pDbVgroup); } if (TSDB_CODE_SUCCESS == code) { - code = putTableDataToCache(pCatalogReq->pTableHash, pMetaData->pTableHash, pMetaCache->pTableVgroup); + code = putTableDataToCache(pCatalogReq->pTableHash, pMetaData->pTableHash, &pMetaCache->pTableVgroup); } if (TSDB_CODE_SUCCESS == code) { - code = putDbDataToCache(pCatalogReq->pDbCfg, pMetaData->pDbCfg, pMetaCache->pDbCfg); + code = putDbDataToCache(pCatalogReq->pDbCfg, pMetaData->pDbCfg, &pMetaCache->pDbCfg); } if (TSDB_CODE_SUCCESS == code) { - code = putDbDataToCache(pCatalogReq->pDbInfo, pMetaData->pDbInfo, pMetaCache->pDbInfo); + code = putDbDataToCache(pCatalogReq->pDbInfo, pMetaData->pDbInfo, &pMetaCache->pDbInfo); } if (TSDB_CODE_SUCCESS == code) { - code = putUserAuthToCache(pCatalogReq->pUser, pMetaData->pUser, pMetaCache->pUserAuth); + code = putUserAuthToCache(pCatalogReq->pUser, pMetaData->pUser, &pMetaCache->pUserAuth); } if (TSDB_CODE_SUCCESS == code) { - code = putUdfToCache(pCatalogReq->pUdf, pMetaData->pUdfList, pMetaCache->pUdf); + code = putUdfToCache(pCatalogReq->pUdf, pMetaData->pUdfList, &pMetaCache->pUdf); } if (TSDB_CODE_SUCCESS == code) { - code = putTableDataToCache(pCatalogReq->pTableIndex, pMetaData->pTableIndex, pMetaCache->pTableIndex); + code = putTableDataToCache(pCatalogReq->pTableIndex, pMetaData->pTableIndex, &pMetaCache->pTableIndex); } return code; } @@ -646,7 +654,7 @@ static int32_t reserveTableReqInCacheImpl(const char* pTbFName, int32_t len, SHa return TSDB_CODE_OUT_OF_MEMORY; } } - return taosHashPut(*pTables, pTbFName, len, &pTables, POINTER_BYTES); + return taosHashPut(*pTables, pTbFName, len, &nullPointer, POINTER_BYTES); } static int32_t reserveTableReqInCache(int32_t acctId, const char* pDb, const char* pTable, SHashObj** pTables) { @@ -688,7 +696,7 @@ static int32_t reserveDbReqInCache(int32_t acctId, const char* pDb, SHashObj** p } char fullName[TSDB_TABLE_FNAME_LEN]; int32_t len = snprintf(fullName, sizeof(fullName), "%d.%s", acctId, pDb); - return taosHashPut(*pDbs, fullName, len, &pDbs, POINTER_BYTES); + return taosHashPut(*pDbs, fullName, len, &nullPointer, POINTER_BYTES); } int32_t reserveDbVgInfoInCache(int32_t acctId, const char* pDb, SParseMetaCache* pMetaCache) { @@ -803,7 +811,7 @@ int32_t reserveUdfInCache(const char* pFunc, SParseMetaCache* pMetaCache) { return TSDB_CODE_OUT_OF_MEMORY; } } - return taosHashPut(pMetaCache->pUdf, pFunc, strlen(pFunc), &pMetaCache, POINTER_BYTES); + return taosHashPut(pMetaCache->pUdf, pFunc, strlen(pFunc), &nullPointer, POINTER_BYTES); } int32_t getUdfInfoFromCache(SParseMetaCache* pMetaCache, const char* pFunc, SFuncInfo* pInfo) { @@ -854,3 +862,14 @@ int32_t getTableIndexFromCache(SParseMetaCache* pMetaCache, const SName* pName, } return code; } + +void destoryParseMetaCache(SParseMetaCache* pMetaCache) { + taosHashCleanup(pMetaCache->pTableMeta); + taosHashCleanup(pMetaCache->pDbVgroup); + taosHashCleanup(pMetaCache->pTableVgroup); + taosHashCleanup(pMetaCache->pDbCfg); + taosHashCleanup(pMetaCache->pDbInfo); + taosHashCleanup(pMetaCache->pUserAuth); + taosHashCleanup(pMetaCache->pUdf); + taosHashCleanup(pMetaCache->pTableIndex); +} diff --git a/source/libs/parser/src/parser.c b/source/libs/parser/src/parser.c index edb0d79f02e53b28704ff216e5dcd4d2aa5cc281..7c330158fad131e44578dbe65cec1e7afe1a11d0 100644 --- a/source/libs/parser/src/parser.c +++ b/source/libs/parser/src/parser.c @@ -34,8 +34,8 @@ bool qIsInsertSql(const char* pStr, size_t length) { } while (1); } -static int32_t analyseSemantic(SParseContext* pCxt, SQuery* pQuery) { - int32_t code = authenticate(pCxt, pQuery); +static int32_t analyseSemantic(SParseContext* pCxt, SQuery* pQuery, SParseMetaCache* pMetaCache) { + int32_t code = authenticate(pCxt, pQuery, pMetaCache); if (TSDB_CODE_SUCCESS == code && pQuery->placeholderNum > 0) { TSWAP(pQuery->pPrepareRoot, pQuery->pRoot); @@ -43,7 +43,7 @@ static int32_t analyseSemantic(SParseContext* pCxt, SQuery* pQuery) { } if (TSDB_CODE_SUCCESS == code) { - code = translate(pCxt, pQuery); + code = translate(pCxt, pQuery, pMetaCache); } if (TSDB_CODE_SUCCESS == code) { code = calculateConstant(pCxt, pQuery); @@ -54,15 +54,15 @@ static int32_t analyseSemantic(SParseContext* pCxt, SQuery* pQuery) { static int32_t parseSqlIntoAst(SParseContext* pCxt, SQuery** pQuery) { int32_t code = parse(pCxt, pQuery); if (TSDB_CODE_SUCCESS == code) { - code = analyseSemantic(pCxt, *pQuery); + code = analyseSemantic(pCxt, *pQuery, NULL); } return code; } -static int32_t parseSqlSyntax(SParseContext* pCxt, SQuery** pQuery) { +static int32_t parseSqlSyntax(SParseContext* pCxt, SQuery** pQuery, SParseMetaCache* pMetaCache) { int32_t code = parse(pCxt, pQuery); if (TSDB_CODE_SUCCESS == code) { - code = collectMetaKey(pCxt, *pQuery); + code = collectMetaKey(pCxt, *pQuery, pMetaCache); } return code; } @@ -149,7 +149,7 @@ static void rewriteExprAlias(SNode* pRoot) { int32_t qParseSql(SParseContext* pCxt, SQuery** pQuery) { int32_t code = TSDB_CODE_SUCCESS; if (qIsInsertSql(pCxt->pSql, pCxt->sqlLen)) { - code = parseInsertSql(pCxt, pQuery); + code = parseInsertSql(pCxt, pQuery, NULL); } else { code = parseSqlIntoAst(pCxt, pQuery); } @@ -158,29 +158,38 @@ int32_t qParseSql(SParseContext* pCxt, SQuery** pQuery) { } int32_t qParseSqlSyntax(SParseContext* pCxt, SQuery** pQuery, struct SCatalogReq* pCatalogReq) { - int32_t code = TSDB_CODE_SUCCESS; + SParseMetaCache metaCache = {0}; + int32_t code = TSDB_CODE_SUCCESS; if (qIsInsertSql(pCxt->pSql, pCxt->sqlLen)) { - code = parseInsertSyntax(pCxt, pQuery); + code = parseInsertSyntax(pCxt, pQuery, &metaCache); } else { - code = parseSqlSyntax(pCxt, pQuery); + code = parseSqlSyntax(pCxt, pQuery, &metaCache); } if (TSDB_CODE_SUCCESS == code) { - code = buildCatalogReq((*pQuery)->pMetaCache, pCatalogReq); + code = buildCatalogReq(&metaCache, pCatalogReq); } + destoryParseMetaCache(&metaCache); terrno = code; return code; } int32_t qAnalyseSqlSemantic(SParseContext* pCxt, const struct SCatalogReq* pCatalogReq, const struct SMetaData* pMetaData, SQuery* pQuery) { - int32_t code = putMetaDataToCache(pCatalogReq, pMetaData, pQuery->pMetaCache); - if (NULL == pQuery->pRoot) { - return parseInsertSql(pCxt, &pQuery); + SParseMetaCache metaCache = {0}; + int32_t code = putMetaDataToCache(pCatalogReq, pMetaData, &metaCache); + if (TSDB_CODE_SUCCESS == code) { + if (NULL == pQuery->pRoot) { + code = parseInsertSql(pCxt, &pQuery, &metaCache); + } else { + code = analyseSemantic(pCxt, pQuery, &metaCache); + } } - return analyseSemantic(pCxt, pQuery); + destoryParseMetaCache(&metaCache); + terrno = code; + return code; } -void qDestroyQuery(SQuery* pQueryNode) { nodesDestroyNode(pQueryNode); } +void qDestroyQuery(SQuery* pQueryNode) { nodesDestroyNode((SNode*)pQueryNode); } int32_t qExtractResultSchema(const SNode* pRoot, int32_t* numOfCols, SSchema** pSchema) { return extractResultSchema(pRoot, numOfCols, pSchema); @@ -226,10 +235,9 @@ int32_t qStmtBindParams(SQuery* pQuery, TAOS_MULTI_BIND* pParams, int32_t colIdx } int32_t qStmtParseQuerySql(SParseContext* pCxt, SQuery* pQuery) { - int32_t code = translate(pCxt, pQuery); + int32_t code = translate(pCxt, pQuery, NULL); if (TSDB_CODE_SUCCESS == code) { code = calculateConstant(pCxt, pQuery); } - return code; } diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 6fbee8cb113a5c99068b85cc55593bfae38cf673..b2de892f305d376152ef52154b7e4c0ed9d51854 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -104,25 +104,25 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 359 +#define YYNOCODE 360 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - EOperatorType yy28; - int32_t yy42; - ENullOrder yy107; - EFillMode yy320; - SToken yy421; - SNodeList* yy530; - SAlterOption yy557; - EOrder yy610; - bool yy621; - EJoinType yy636; - int64_t yy669; - SNode* yy674; - SDataType yy690; + EFillMode yy54; + int32_t yy100; + bool yy137; + int64_t yy189; + SToken yy209; + ENullOrder yy217; + SDataType yy304; + EOperatorType yy380; + SNodeList* yy424; + EOrder yy578; + SAlterOption yy605; + EJoinType yy612; + SNode* yy632; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -138,17 +138,17 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 618 -#define YYNRULE 453 -#define YYNTOKEN 239 -#define YY_MAX_SHIFT 617 -#define YY_MIN_SHIFTREDUCE 904 -#define YY_MAX_SHIFTREDUCE 1356 -#define YY_ERROR_ACTION 1357 -#define YY_ACCEPT_ACTION 1358 -#define YY_NO_ACTION 1359 -#define YY_MIN_REDUCE 1360 -#define YY_MAX_REDUCE 1812 +#define YYNSTATE 619 +#define YYNRULE 454 +#define YYNTOKEN 240 +#define YY_MAX_SHIFT 618 +#define YY_MIN_SHIFTREDUCE 906 +#define YY_MAX_SHIFTREDUCE 1359 +#define YY_ERROR_ACTION 1360 +#define YY_ACCEPT_ACTION 1361 +#define YY_NO_ACTION 1362 +#define YY_MIN_REDUCE 1363 +#define YY_MAX_REDUCE 1816 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -215,602 +215,607 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (2144) +#define YY_ACTTAB_COUNT (2152) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 28, 230, 1659, 1646, 610, 609, 296, 1646, 357, 1482, - /* 10 */ 313, 1480, 35, 33, 351, 36, 34, 32, 31, 30, - /* 20 */ 305, 24, 1170, 1643, 532, 441, 440, 1643, 79, 1643, - /* 30 */ 1675, 36, 34, 32, 31, 30, 152, 492, 516, 1639, - /* 40 */ 1645, 115, 277, 1639, 1645, 1639, 1645, 1168, 515, 1483, - /* 50 */ 535, 532, 1629, 1491, 535, 1790, 535, 496, 14, 1742, - /* 60 */ 35, 33, 1297, 355, 1176, 1659, 114, 147, 305, 1688, - /* 70 */ 1170, 1787, 82, 1660, 518, 1662, 1663, 514, 500, 535, - /* 80 */ 1491, 1, 1728, 1739, 1790, 1311, 278, 1724, 36, 34, - /* 90 */ 32, 31, 30, 1675, 531, 1168, 1789, 1647, 1790, 519, - /* 100 */ 1787, 516, 308, 614, 112, 1580, 14, 409, 35, 33, - /* 110 */ 149, 515, 1176, 1169, 1787, 1629, 305, 1643, 1170, 145, - /* 120 */ 1735, 1736, 1194, 1740, 36, 34, 32, 31, 30, 2, - /* 130 */ 381, 63, 1688, 1639, 1645, 84, 1660, 518, 1662, 1663, - /* 140 */ 514, 1361, 535, 1168, 535, 1728, 531, 1790, 56, 1727, - /* 150 */ 1724, 614, 142, 1487, 14, 391, 1171, 392, 1392, 148, - /* 160 */ 1176, 1169, 96, 1787, 1529, 95, 94, 93, 92, 91, - /* 170 */ 90, 89, 88, 87, 161, 160, 132, 2, 1372, 566, - /* 180 */ 1174, 1175, 934, 1221, 1222, 1224, 1225, 1226, 1227, 1228, - /* 190 */ 511, 533, 1236, 1237, 1238, 1239, 1240, 1241, 565, 614, - /* 200 */ 564, 563, 562, 399, 1171, 392, 1392, 38, 96, 1169, - /* 210 */ 150, 95, 94, 93, 92, 91, 90, 89, 88, 87, - /* 220 */ 938, 939, 65, 294, 1353, 55, 194, 1617, 1174, 1175, - /* 230 */ 1360, 1221, 1222, 1224, 1225, 1226, 1227, 1228, 511, 533, - /* 240 */ 1236, 1237, 1238, 1239, 1240, 1241, 36, 34, 32, 31, - /* 250 */ 30, 531, 1171, 1358, 105, 104, 103, 102, 101, 100, - /* 260 */ 99, 98, 97, 1469, 501, 35, 33, 36, 34, 32, - /* 270 */ 31, 30, 330, 305, 55, 1170, 1174, 1175, 342, 1221, - /* 280 */ 1222, 1224, 1225, 1226, 1227, 1228, 511, 533, 1236, 1237, - /* 290 */ 1238, 1239, 1240, 1241, 468, 532, 444, 443, 344, 340, - /* 300 */ 1168, 442, 486, 1659, 111, 439, 1352, 356, 438, 437, - /* 310 */ 436, 321, 39, 35, 33, 1242, 26, 1176, 133, 63, - /* 320 */ 409, 305, 1448, 1170, 1491, 72, 36, 34, 32, 31, - /* 330 */ 30, 1675, 110, 508, 8, 1790, 150, 1208, 1535, 516, - /* 340 */ 288, 1486, 55, 492, 458, 295, 1484, 147, 1168, 515, - /* 350 */ 1533, 1787, 1790, 1629, 150, 951, 614, 950, 496, 481, - /* 360 */ 1261, 35, 33, 1468, 147, 1176, 1169, 200, 1787, 305, - /* 370 */ 1688, 1170, 114, 82, 1660, 518, 1662, 1663, 514, 129, - /* 380 */ 535, 1266, 9, 1728, 952, 1790, 568, 278, 1724, 289, - /* 390 */ 1196, 287, 286, 55, 432, 66, 1168, 147, 434, 1790, - /* 400 */ 1422, 1787, 78, 150, 614, 1790, 32, 31, 30, 1171, - /* 410 */ 112, 147, 74, 1176, 1169, 1787, 350, 1788, 349, 25, - /* 420 */ 433, 1787, 396, 1467, 494, 144, 1735, 1736, 1192, 1740, - /* 430 */ 9, 487, 482, 1174, 1175, 583, 1221, 1222, 1224, 1225, - /* 440 */ 1226, 1227, 1228, 511, 533, 1236, 1237, 1238, 1239, 1240, - /* 450 */ 1241, 317, 614, 1003, 532, 1251, 566, 1171, 1571, 1573, - /* 460 */ 444, 443, 1169, 150, 1466, 442, 366, 1321, 111, 439, - /* 470 */ 1005, 150, 438, 437, 436, 565, 345, 564, 563, 562, - /* 480 */ 568, 1174, 1175, 1491, 1221, 1222, 1224, 1225, 1226, 1227, - /* 490 */ 1228, 511, 533, 1236, 1237, 1238, 1239, 1240, 1241, 157, - /* 500 */ 11, 10, 1195, 1675, 309, 1171, 478, 1319, 1320, 1322, - /* 510 */ 1323, 485, 130, 1535, 1383, 221, 584, 582, 35, 33, - /* 520 */ 310, 1493, 150, 1382, 61, 1533, 305, 60, 1170, 1174, - /* 530 */ 1175, 1193, 1221, 1222, 1224, 1225, 1226, 1227, 1228, 511, - /* 540 */ 533, 1236, 1237, 1238, 1239, 1240, 1241, 484, 390, 1572, - /* 550 */ 1573, 394, 1304, 1168, 1535, 532, 532, 566, 1194, 532, - /* 560 */ 276, 316, 1192, 1419, 1629, 975, 1533, 106, 106, 374, - /* 570 */ 1176, 367, 386, 1629, 430, 435, 565, 519, 564, 563, - /* 580 */ 562, 1273, 976, 1581, 1491, 1491, 532, 2, 1491, 131, - /* 590 */ 387, 532, 532, 532, 258, 1247, 1381, 1380, 408, 1379, - /* 600 */ 315, 1194, 1535, 1607, 1488, 466, 256, 53, 130, 614, - /* 610 */ 52, 1378, 561, 398, 1534, 1491, 394, 1493, 950, 1169, - /* 620 */ 1491, 1491, 1491, 590, 589, 588, 320, 162, 587, 586, - /* 630 */ 585, 116, 580, 579, 578, 577, 576, 575, 574, 573, - /* 640 */ 123, 569, 318, 428, 1568, 130, 1629, 1629, 1197, 1629, - /* 650 */ 130, 159, 55, 252, 1494, 572, 1521, 1463, 7, 1493, - /* 660 */ 385, 1629, 1171, 380, 379, 378, 377, 376, 373, 372, - /* 670 */ 371, 370, 369, 365, 364, 363, 362, 361, 360, 359, - /* 680 */ 358, 1377, 1376, 54, 492, 503, 1174, 1175, 81, 1221, - /* 690 */ 1222, 1224, 1225, 1226, 1227, 1228, 511, 533, 1236, 1237, - /* 700 */ 1238, 1239, 1240, 1241, 532, 1375, 36, 34, 32, 31, - /* 710 */ 30, 532, 1374, 114, 532, 1194, 529, 938, 939, 59, - /* 720 */ 58, 354, 1223, 530, 156, 1659, 243, 532, 1371, 348, - /* 730 */ 1296, 1629, 1629, 1491, 36, 34, 32, 31, 30, 319, - /* 740 */ 1491, 275, 185, 1491, 338, 183, 336, 332, 328, 153, - /* 750 */ 323, 112, 279, 1675, 1370, 1629, 1491, 1369, 1476, 1742, - /* 760 */ 571, 495, 1629, 1742, 1368, 1223, 146, 1735, 1736, 1367, - /* 770 */ 1740, 515, 1366, 206, 1478, 1629, 1208, 1365, 1629, 1409, - /* 780 */ 279, 150, 1364, 1738, 1259, 1659, 1363, 1737, 1747, 1292, - /* 790 */ 1474, 187, 1688, 434, 186, 83, 1660, 518, 1662, 1663, - /* 800 */ 514, 445, 535, 189, 1629, 1728, 188, 1629, 197, 298, - /* 810 */ 1724, 143, 1259, 1675, 1629, 433, 1404, 191, 1402, 1629, - /* 820 */ 190, 495, 1629, 222, 456, 1153, 1154, 1629, 474, 1755, - /* 830 */ 1292, 515, 1629, 1260, 449, 1629, 1629, 454, 447, 1649, - /* 840 */ 450, 510, 120, 46, 560, 209, 37, 11, 10, 457, - /* 850 */ 1355, 1356, 1688, 465, 1265, 83, 1660, 518, 1662, 1663, - /* 860 */ 514, 1260, 535, 193, 1179, 1728, 37, 37, 232, 298, - /* 870 */ 1724, 143, 1373, 504, 118, 452, 1651, 1170, 1178, 1223, - /* 880 */ 446, 1449, 1265, 470, 1318, 192, 211, 1267, 225, 1756, - /* 890 */ 459, 119, 27, 303, 1254, 1255, 1256, 1257, 1258, 1262, - /* 900 */ 1263, 1264, 1168, 1659, 120, 498, 46, 1229, 1126, 234, - /* 910 */ 51, 540, 479, 50, 216, 524, 119, 1676, 120, 1176, - /* 920 */ 27, 303, 1254, 1255, 1256, 1257, 1258, 1262, 1263, 1264, - /* 930 */ 1182, 1675, 240, 1393, 427, 1659, 1758, 1295, 121, 516, - /* 940 */ 1530, 119, 493, 224, 1181, 1034, 227, 251, 229, 515, - /* 950 */ 3, 5, 1062, 1629, 1192, 322, 325, 1066, 614, 1072, - /* 960 */ 329, 1003, 284, 1675, 285, 1137, 248, 1659, 1169, 368, - /* 970 */ 1688, 516, 1570, 83, 1660, 518, 1662, 1663, 514, 1070, - /* 980 */ 535, 515, 122, 1728, 158, 1629, 383, 298, 1724, 1803, - /* 990 */ 375, 388, 1198, 382, 384, 1675, 389, 397, 1762, 1201, - /* 1000 */ 400, 165, 1688, 516, 401, 83, 1660, 518, 1662, 1663, - /* 1010 */ 514, 1171, 535, 515, 167, 1728, 1200, 1629, 1659, 298, - /* 1020 */ 1724, 1803, 1202, 402, 170, 405, 403, 172, 406, 1199, - /* 1030 */ 1785, 175, 407, 410, 1688, 1174, 1175, 83, 1660, 518, - /* 1040 */ 1662, 1663, 514, 62, 535, 178, 1675, 1728, 1659, 1176, - /* 1050 */ 431, 298, 1724, 1803, 516, 1481, 429, 182, 1477, 86, - /* 1060 */ 184, 1611, 1746, 124, 515, 293, 125, 1479, 1629, 1475, - /* 1070 */ 126, 249, 195, 496, 460, 198, 1675, 127, 467, 469, - /* 1080 */ 461, 472, 464, 1197, 516, 1688, 201, 471, 263, 1660, - /* 1090 */ 518, 1662, 1663, 514, 515, 535, 204, 1759, 1629, 480, - /* 1100 */ 522, 1769, 1768, 496, 6, 1749, 207, 477, 489, 215, - /* 1110 */ 1292, 476, 210, 137, 1790, 1688, 297, 113, 263, 1660, - /* 1120 */ 518, 1662, 1663, 514, 483, 535, 149, 1196, 40, 217, - /* 1130 */ 1787, 505, 502, 1041, 558, 557, 556, 1045, 555, 1047, - /* 1140 */ 1048, 554, 1050, 551, 1790, 1056, 548, 1058, 1059, 545, - /* 1150 */ 542, 1743, 18, 299, 1579, 1578, 147, 180, 520, 521, - /* 1160 */ 1787, 1786, 1709, 1659, 218, 307, 223, 525, 526, 141, - /* 1170 */ 236, 527, 238, 250, 1492, 426, 422, 418, 414, 179, - /* 1180 */ 71, 73, 1659, 538, 1464, 253, 1806, 245, 47, 499, - /* 1190 */ 226, 1675, 613, 506, 228, 136, 264, 274, 255, 516, - /* 1200 */ 257, 265, 1623, 1622, 64, 57, 1621, 177, 324, 515, - /* 1210 */ 1675, 1618, 327, 1629, 326, 1163, 1164, 154, 513, 331, - /* 1220 */ 1616, 333, 334, 335, 1615, 337, 1614, 339, 515, 1613, - /* 1230 */ 1688, 341, 1629, 84, 1660, 518, 1662, 1663, 514, 1612, - /* 1240 */ 535, 1659, 343, 1728, 1597, 155, 346, 507, 1724, 1688, - /* 1250 */ 1659, 347, 272, 1660, 518, 1662, 1663, 514, 512, 535, - /* 1260 */ 509, 1700, 1140, 1591, 176, 1139, 168, 1590, 173, 1675, - /* 1270 */ 404, 352, 353, 1589, 1588, 1109, 1563, 516, 1675, 1562, - /* 1280 */ 1561, 1560, 1559, 1558, 1557, 1556, 516, 515, 166, 1555, - /* 1290 */ 1554, 1629, 1553, 1552, 1551, 1550, 515, 1549, 1548, 1547, - /* 1300 */ 1629, 1546, 117, 1545, 1544, 1543, 1542, 1541, 1688, 1540, - /* 1310 */ 1111, 134, 1660, 518, 1662, 1663, 514, 1688, 535, 1539, - /* 1320 */ 84, 1660, 518, 1662, 1663, 514, 1538, 535, 1537, 1536, - /* 1330 */ 1728, 617, 1659, 1421, 1389, 1725, 163, 108, 941, 940, - /* 1340 */ 1388, 1659, 1605, 140, 1599, 247, 1587, 171, 164, 1586, - /* 1350 */ 109, 1576, 393, 169, 497, 1804, 1470, 107, 395, 174, - /* 1360 */ 1675, 1420, 1418, 606, 602, 598, 594, 246, 516, 1675, - /* 1370 */ 969, 1416, 413, 417, 411, 412, 416, 516, 515, 415, - /* 1380 */ 1414, 1412, 1629, 420, 419, 475, 423, 515, 424, 421, - /* 1390 */ 425, 1629, 80, 1659, 1401, 241, 1400, 1387, 1472, 1688, - /* 1400 */ 1075, 1076, 273, 1660, 518, 1662, 1663, 514, 1688, 535, - /* 1410 */ 45, 268, 1660, 518, 1662, 1663, 514, 1471, 535, 1002, - /* 1420 */ 1001, 1675, 1000, 999, 581, 583, 996, 1410, 528, 516, - /* 1430 */ 290, 1405, 995, 181, 994, 291, 448, 1403, 451, 515, - /* 1440 */ 292, 1386, 453, 1629, 1385, 455, 85, 1604, 488, 1147, - /* 1450 */ 1598, 462, 1659, 473, 1585, 1584, 202, 199, 1583, 1575, - /* 1460 */ 1688, 312, 311, 134, 1660, 518, 1662, 1663, 514, 203, - /* 1470 */ 535, 1184, 208, 67, 1145, 4, 196, 37, 128, 15, - /* 1480 */ 1675, 43, 1317, 1310, 1659, 135, 49, 212, 516, 213, - /* 1490 */ 205, 22, 463, 48, 1289, 214, 1177, 1649, 515, 41, - /* 1500 */ 1659, 23, 1629, 1288, 42, 302, 68, 1805, 220, 138, - /* 1510 */ 1346, 17, 1675, 1176, 1341, 1335, 1340, 10, 300, 1688, - /* 1520 */ 513, 1345, 273, 1660, 518, 1662, 1663, 514, 1675, 535, - /* 1530 */ 515, 1344, 301, 19, 1629, 16, 516, 13, 1231, 1252, - /* 1540 */ 139, 151, 29, 1216, 1230, 517, 515, 12, 523, 20, - /* 1550 */ 1629, 1688, 536, 304, 272, 1660, 518, 1662, 1663, 514, - /* 1560 */ 1659, 535, 1180, 1701, 21, 1574, 237, 1688, 231, 1315, - /* 1570 */ 273, 1660, 518, 1662, 1663, 514, 233, 535, 239, 235, - /* 1580 */ 69, 70, 74, 1648, 242, 1691, 1186, 1233, 1675, 1063, - /* 1590 */ 534, 44, 539, 537, 314, 541, 516, 543, 1060, 544, - /* 1600 */ 1659, 1057, 546, 547, 549, 1185, 515, 1051, 550, 552, - /* 1610 */ 1629, 1659, 1049, 306, 553, 1040, 1055, 1054, 1053, 559, - /* 1620 */ 1071, 1068, 1052, 75, 76, 77, 967, 1688, 1675, 1188, - /* 1630 */ 273, 1660, 518, 1662, 1663, 514, 516, 535, 567, 1675, - /* 1640 */ 533, 1236, 1237, 991, 1069, 1009, 515, 516, 570, 244, - /* 1650 */ 1629, 1659, 989, 988, 987, 984, 986, 515, 1006, 985, - /* 1660 */ 983, 1629, 982, 1004, 1659, 492, 979, 1688, 978, 977, - /* 1670 */ 259, 1660, 518, 1662, 1663, 514, 974, 535, 1688, 1675, - /* 1680 */ 1417, 267, 1660, 518, 1662, 1663, 514, 516, 535, 973, - /* 1690 */ 972, 591, 1675, 592, 114, 593, 1415, 515, 596, 595, - /* 1700 */ 516, 1629, 597, 1413, 599, 600, 601, 1411, 603, 604, - /* 1710 */ 515, 605, 1399, 496, 1629, 607, 608, 1659, 1688, 1398, - /* 1720 */ 1384, 269, 1660, 518, 1662, 1663, 514, 611, 535, 612, - /* 1730 */ 615, 1688, 112, 1172, 260, 1660, 518, 1662, 1663, 514, - /* 1740 */ 254, 535, 616, 1359, 1359, 1675, 1359, 219, 1735, 491, - /* 1750 */ 1659, 490, 1359, 516, 1790, 1359, 1359, 1359, 1359, 1359, - /* 1760 */ 1359, 1359, 1359, 515, 1359, 1659, 149, 1629, 1359, 1359, - /* 1770 */ 1787, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1675, 1359, - /* 1780 */ 1359, 1359, 1359, 1359, 1688, 1359, 516, 270, 1660, 518, - /* 1790 */ 1662, 1663, 514, 1675, 535, 1359, 515, 1359, 1659, 1359, - /* 1800 */ 1629, 516, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, - /* 1810 */ 1359, 515, 1359, 1659, 1359, 1629, 1359, 1688, 1359, 1359, - /* 1820 */ 261, 1660, 518, 1662, 1663, 514, 1675, 535, 1359, 1359, - /* 1830 */ 1359, 1359, 1688, 1359, 516, 271, 1660, 518, 1662, 1663, - /* 1840 */ 514, 1675, 535, 1359, 515, 1359, 1359, 1359, 1629, 516, - /* 1850 */ 1359, 1359, 1359, 1659, 1359, 1359, 1359, 1359, 1359, 515, - /* 1860 */ 1359, 1359, 1359, 1629, 1359, 1688, 1359, 1359, 262, 1660, - /* 1870 */ 518, 1662, 1663, 514, 1359, 535, 1359, 1359, 1359, 1359, - /* 1880 */ 1688, 1675, 1359, 1671, 1660, 518, 1662, 1663, 514, 516, - /* 1890 */ 535, 1359, 1359, 1659, 1359, 1359, 1359, 1359, 1359, 515, - /* 1900 */ 1359, 1359, 1359, 1629, 1659, 1359, 1359, 1359, 1359, 1359, - /* 1910 */ 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, - /* 1920 */ 1688, 1675, 1359, 1670, 1660, 518, 1662, 1663, 514, 516, - /* 1930 */ 535, 1359, 1675, 1359, 1359, 1359, 1359, 1359, 1359, 515, - /* 1940 */ 516, 1359, 1359, 1629, 1659, 1359, 1359, 1359, 1359, 1359, - /* 1950 */ 515, 1359, 1359, 1359, 1629, 1359, 1359, 1659, 1359, 1359, - /* 1960 */ 1688, 1359, 1359, 1669, 1660, 518, 1662, 1663, 514, 1359, - /* 1970 */ 535, 1688, 1675, 1359, 282, 1660, 518, 1662, 1663, 514, - /* 1980 */ 516, 535, 1359, 1359, 1359, 1675, 1359, 1359, 1359, 1359, - /* 1990 */ 515, 1359, 1359, 516, 1629, 1359, 1359, 1359, 1359, 1359, - /* 2000 */ 1359, 1359, 1359, 515, 1359, 1359, 1359, 1629, 1659, 1359, - /* 2010 */ 1359, 1688, 1359, 1359, 281, 1660, 518, 1662, 1663, 514, - /* 2020 */ 1359, 535, 1359, 1359, 1688, 1359, 1359, 283, 1660, 518, - /* 2030 */ 1662, 1663, 514, 1359, 535, 1359, 1675, 1359, 492, 1359, - /* 2040 */ 1359, 1659, 1359, 1359, 516, 1359, 1359, 1359, 1359, 1359, - /* 2050 */ 1359, 1359, 1359, 1359, 515, 1359, 1359, 1359, 1629, 1359, - /* 2060 */ 1359, 1359, 1359, 1359, 1359, 1359, 1359, 114, 1359, 1675, - /* 2070 */ 1359, 1359, 1359, 1359, 1359, 1688, 1359, 516, 280, 1660, - /* 2080 */ 518, 1662, 1663, 514, 1359, 535, 496, 515, 1359, 1359, - /* 2090 */ 1359, 1629, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, - /* 2100 */ 1359, 1359, 1359, 1359, 1359, 112, 1359, 1359, 1688, 1359, - /* 2110 */ 1359, 266, 1660, 518, 1662, 1663, 514, 1359, 535, 1359, - /* 2120 */ 219, 1735, 491, 1359, 490, 1359, 1359, 1790, 1359, 1359, - /* 2130 */ 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 1359, 147, - /* 2140 */ 1359, 1359, 1359, 1787, + /* 0 */ 28, 231, 1663, 1650, 611, 610, 297, 1650, 358, 1485, + /* 10 */ 314, 1483, 35, 33, 352, 36, 34, 32, 31, 30, + /* 20 */ 306, 24, 1173, 1647, 533, 442, 441, 1647, 79, 1647, + /* 30 */ 1679, 36, 34, 32, 31, 30, 152, 493, 517, 1643, + /* 40 */ 1649, 115, 278, 1643, 1649, 1643, 1649, 1171, 516, 1486, + /* 50 */ 536, 533, 1633, 1494, 536, 1794, 536, 497, 14, 1746, + /* 60 */ 35, 33, 1300, 356, 1179, 1663, 114, 147, 306, 1692, + /* 70 */ 1173, 1791, 82, 1664, 519, 1666, 1667, 515, 532, 536, + /* 80 */ 1494, 1, 1732, 1743, 1794, 1314, 280, 1728, 36, 34, + /* 90 */ 32, 31, 30, 1679, 410, 1171, 1793, 1651, 1794, 520, + /* 100 */ 1791, 517, 309, 615, 112, 1583, 14, 1746, 35, 33, + /* 110 */ 149, 516, 1179, 1172, 1791, 1633, 306, 1647, 1173, 145, + /* 120 */ 1739, 1740, 532, 1744, 36, 34, 32, 31, 30, 2, + /* 130 */ 63, 1742, 1692, 1643, 1649, 84, 1664, 519, 1666, 1667, + /* 140 */ 515, 1364, 536, 1171, 536, 1732, 953, 1794, 952, 1731, + /* 150 */ 1728, 615, 1490, 72, 14, 392, 1174, 393, 1395, 148, + /* 160 */ 1179, 1172, 96, 1791, 532, 95, 94, 93, 92, 91, + /* 170 */ 90, 89, 88, 87, 1487, 954, 56, 2, 132, 201, + /* 180 */ 1375, 1177, 1178, 39, 1224, 1225, 1227, 1228, 1229, 1230, + /* 190 */ 1231, 512, 534, 1239, 1240, 1241, 1242, 1243, 1244, 615, + /* 200 */ 400, 952, 393, 1395, 1174, 55, 1197, 66, 133, 1172, + /* 210 */ 96, 150, 1451, 95, 94, 93, 92, 91, 90, 89, + /* 220 */ 88, 87, 65, 279, 1356, 38, 429, 194, 567, 1177, + /* 230 */ 1178, 1363, 1224, 1225, 1227, 1228, 1229, 1230, 1231, 512, + /* 240 */ 534, 1239, 1240, 1241, 1242, 1243, 1244, 566, 487, 565, + /* 250 */ 564, 563, 1174, 55, 63, 105, 104, 103, 102, 101, + /* 260 */ 100, 99, 98, 97, 936, 35, 33, 110, 36, 34, + /* 270 */ 32, 31, 30, 306, 1746, 1173, 1489, 1177, 1178, 1198, + /* 280 */ 1224, 1225, 1227, 1228, 1229, 1230, 1231, 512, 534, 1239, + /* 290 */ 1240, 1241, 1242, 1243, 1244, 55, 445, 444, 1741, 1538, + /* 300 */ 1171, 443, 940, 941, 111, 440, 296, 1355, 439, 438, + /* 310 */ 437, 1536, 569, 35, 33, 1245, 1679, 1179, 26, 310, + /* 320 */ 1386, 306, 391, 1173, 486, 395, 290, 130, 36, 34, + /* 330 */ 32, 31, 30, 1196, 8, 150, 1496, 1043, 559, 558, + /* 340 */ 557, 1047, 556, 1049, 1050, 555, 1052, 552, 1171, 1058, + /* 350 */ 549, 1060, 1061, 546, 543, 150, 615, 450, 482, 618, + /* 360 */ 485, 35, 33, 585, 583, 1179, 1172, 142, 397, 306, + /* 370 */ 1633, 1173, 458, 248, 1195, 291, 1324, 289, 288, 1532, + /* 380 */ 433, 318, 9, 150, 435, 107, 193, 399, 1574, 1576, + /* 390 */ 395, 607, 603, 599, 595, 247, 1171, 1472, 453, 157, + /* 400 */ 533, 129, 1361, 447, 615, 1425, 434, 572, 192, 1174, + /* 410 */ 1794, 1385, 357, 1179, 1172, 479, 1322, 1323, 1325, 1326, + /* 420 */ 80, 1571, 1792, 242, 61, 150, 1791, 60, 159, 1494, + /* 430 */ 9, 488, 483, 51, 1177, 1178, 50, 1224, 1225, 1227, + /* 440 */ 1228, 1229, 1230, 1231, 512, 534, 1239, 1240, 1241, 1242, + /* 450 */ 1243, 1244, 615, 55, 410, 316, 529, 1174, 54, 319, + /* 460 */ 322, 1633, 1172, 130, 150, 445, 444, 130, 1538, 562, + /* 470 */ 443, 382, 1496, 111, 440, 311, 1496, 439, 438, 437, + /* 480 */ 1536, 474, 1177, 1178, 203, 1224, 1225, 1227, 1228, 1229, + /* 490 */ 1230, 1231, 512, 534, 1239, 1240, 1241, 1242, 1243, 1244, + /* 500 */ 1384, 1794, 1147, 1199, 197, 1174, 1575, 1576, 36, 34, + /* 510 */ 32, 31, 30, 147, 1307, 161, 160, 1791, 35, 33, + /* 520 */ 1197, 1663, 1155, 1156, 195, 1470, 306, 351, 1173, 350, + /* 530 */ 1177, 1178, 493, 1224, 1225, 1227, 1228, 1229, 1230, 1231, + /* 540 */ 512, 534, 1239, 1240, 1241, 1242, 1243, 1244, 253, 1679, + /* 550 */ 1633, 1524, 533, 1171, 1383, 1621, 533, 517, 1382, 1250, + /* 560 */ 277, 114, 1195, 1005, 367, 1197, 1479, 516, 106, 375, + /* 570 */ 1179, 1633, 387, 466, 533, 431, 497, 1422, 1211, 469, + /* 580 */ 1007, 1494, 569, 150, 1381, 1494, 368, 2, 1692, 343, + /* 590 */ 388, 82, 1664, 519, 1666, 1667, 515, 1481, 536, 112, + /* 600 */ 331, 1732, 1477, 1494, 1633, 280, 1728, 198, 1633, 615, + /* 610 */ 345, 341, 533, 495, 144, 1739, 1740, 1794, 1744, 1172, + /* 620 */ 1794, 940, 941, 1538, 106, 1376, 11, 10, 222, 147, + /* 630 */ 317, 436, 147, 1791, 1633, 1536, 1791, 591, 590, 589, + /* 640 */ 321, 1494, 588, 587, 586, 116, 581, 580, 579, 578, + /* 650 */ 577, 576, 575, 574, 123, 570, 32, 31, 30, 1380, + /* 660 */ 386, 1299, 1174, 381, 380, 379, 378, 377, 374, 373, + /* 670 */ 372, 371, 370, 366, 365, 364, 363, 362, 361, 360, + /* 680 */ 359, 499, 1663, 520, 1379, 1226, 1197, 1177, 1178, 1584, + /* 690 */ 1224, 1225, 1227, 1228, 1229, 1230, 1231, 512, 534, 1239, + /* 700 */ 1240, 1241, 1242, 1243, 1244, 1264, 131, 1276, 1378, 1633, + /* 710 */ 1679, 259, 573, 533, 1466, 7, 511, 533, 496, 1471, + /* 720 */ 1200, 533, 459, 257, 53, 409, 1269, 52, 516, 1491, + /* 730 */ 1226, 533, 1633, 1610, 1633, 533, 36, 34, 32, 31, + /* 740 */ 30, 1377, 1494, 244, 162, 1374, 1494, 467, 1663, 1692, + /* 750 */ 1494, 501, 83, 1664, 519, 1666, 1667, 515, 1633, 536, + /* 760 */ 1494, 1373, 1732, 1794, 1494, 25, 299, 1728, 143, 55, + /* 770 */ 36, 34, 32, 31, 30, 147, 1679, 1469, 533, 1791, + /* 780 */ 223, 533, 281, 130, 517, 475, 1759, 435, 533, 1372, + /* 790 */ 530, 1633, 1497, 531, 516, 1633, 185, 1371, 1633, 183, + /* 800 */ 320, 476, 1370, 1369, 1663, 81, 1211, 1494, 1368, 434, + /* 810 */ 1494, 1633, 567, 504, 1262, 1692, 281, 1494, 274, 1664, + /* 820 */ 519, 1666, 1667, 515, 509, 536, 1751, 1295, 493, 561, + /* 830 */ 457, 566, 1679, 565, 564, 563, 59, 58, 355, 1633, + /* 840 */ 514, 156, 1452, 455, 1538, 207, 349, 1633, 1262, 584, + /* 850 */ 516, 1226, 1633, 1633, 1633, 1367, 1537, 114, 1633, 276, + /* 860 */ 1173, 226, 339, 1263, 337, 333, 329, 153, 324, 1298, + /* 870 */ 567, 1692, 1412, 1182, 273, 1664, 519, 1666, 1667, 515, + /* 880 */ 513, 536, 510, 1704, 1268, 1171, 1366, 1407, 1295, 566, + /* 890 */ 346, 565, 564, 563, 446, 112, 120, 1263, 187, 150, + /* 900 */ 189, 186, 1179, 188, 191, 1633, 1663, 190, 46, 448, + /* 910 */ 146, 1739, 1740, 1405, 1744, 11, 10, 1653, 1268, 1358, + /* 920 */ 1359, 480, 1181, 27, 304, 1257, 1258, 1259, 1260, 1261, + /* 930 */ 1265, 1266, 1267, 210, 1679, 451, 1633, 471, 502, 1185, + /* 940 */ 78, 615, 496, 37, 37, 460, 37, 1254, 233, 1321, + /* 950 */ 74, 1172, 516, 217, 1655, 1680, 1633, 27, 304, 1257, + /* 960 */ 1258, 1259, 1260, 1261, 1265, 1266, 1267, 118, 1663, 1396, + /* 970 */ 119, 1533, 120, 1692, 212, 46, 83, 1664, 519, 1666, + /* 980 */ 1667, 515, 977, 536, 1270, 1232, 1732, 1128, 1184, 235, + /* 990 */ 299, 1728, 143, 541, 1174, 428, 1679, 1762, 494, 978, + /* 1000 */ 1663, 225, 505, 119, 517, 228, 120, 230, 525, 3, + /* 1010 */ 1760, 241, 5, 1036, 516, 121, 252, 119, 1633, 1177, + /* 1020 */ 1178, 323, 1195, 326, 330, 286, 287, 1005, 1679, 249, + /* 1030 */ 1139, 369, 1573, 376, 1064, 1692, 517, 158, 83, 1664, + /* 1040 */ 519, 1666, 1667, 515, 1068, 536, 516, 1074, 1732, 384, + /* 1050 */ 1633, 389, 299, 1728, 1807, 383, 1072, 1201, 122, 385, + /* 1060 */ 1663, 390, 1204, 1766, 401, 398, 165, 1692, 402, 167, + /* 1070 */ 83, 1664, 519, 1666, 1667, 515, 1203, 536, 1205, 404, + /* 1080 */ 1732, 403, 170, 406, 299, 1728, 1807, 172, 1679, 407, + /* 1090 */ 1202, 175, 1663, 408, 62, 1789, 517, 411, 178, 430, + /* 1100 */ 432, 1484, 182, 86, 1480, 184, 516, 295, 124, 1179, + /* 1110 */ 1633, 125, 1482, 1478, 1615, 126, 127, 1614, 196, 461, + /* 1120 */ 1679, 199, 250, 202, 465, 462, 1200, 1692, 517, 468, + /* 1130 */ 83, 1664, 519, 1666, 1667, 515, 472, 536, 516, 205, + /* 1140 */ 1732, 481, 1633, 1663, 299, 1728, 1807, 497, 470, 478, + /* 1150 */ 473, 523, 1773, 1772, 298, 1750, 490, 208, 1763, 1692, + /* 1160 */ 211, 6, 264, 1664, 519, 1666, 1667, 515, 1753, 536, + /* 1170 */ 484, 1679, 216, 1663, 477, 113, 1295, 218, 1199, 517, + /* 1180 */ 40, 300, 1747, 506, 503, 18, 527, 1582, 1794, 516, + /* 1190 */ 137, 521, 522, 1633, 219, 1581, 526, 308, 497, 237, + /* 1200 */ 149, 1679, 528, 224, 1791, 251, 1663, 1495, 1713, 517, + /* 1210 */ 1692, 1810, 1790, 264, 1664, 519, 1666, 1667, 515, 516, + /* 1220 */ 536, 239, 71, 1633, 73, 539, 246, 254, 500, 614, + /* 1230 */ 136, 227, 1467, 229, 1679, 507, 1663, 265, 47, 1794, + /* 1240 */ 1692, 256, 517, 84, 1664, 519, 1666, 1667, 515, 258, + /* 1250 */ 536, 147, 516, 1732, 275, 1791, 1633, 508, 1728, 266, + /* 1260 */ 1627, 1626, 57, 1625, 1679, 325, 1622, 327, 328, 332, + /* 1270 */ 1166, 1167, 517, 1692, 154, 1620, 134, 1664, 519, 1666, + /* 1280 */ 1667, 515, 516, 536, 334, 335, 1633, 1663, 336, 1619, + /* 1290 */ 338, 1618, 340, 1617, 342, 1616, 1663, 344, 1600, 155, + /* 1300 */ 1142, 347, 1141, 1692, 348, 1594, 84, 1664, 519, 1666, + /* 1310 */ 1667, 515, 1593, 536, 353, 1679, 1732, 354, 1592, 498, + /* 1320 */ 1808, 1729, 1591, 517, 1679, 1111, 1566, 1565, 1564, 1563, + /* 1330 */ 1562, 1561, 517, 516, 1560, 1559, 1558, 1633, 1557, 1556, + /* 1340 */ 1555, 1554, 516, 1553, 1552, 1551, 1633, 1550, 1549, 117, + /* 1350 */ 1663, 1548, 1547, 1546, 1692, 1545, 1544, 269, 1664, 519, + /* 1360 */ 1666, 1667, 515, 1692, 536, 1543, 134, 1664, 519, 1666, + /* 1370 */ 1667, 515, 1113, 536, 1542, 1541, 1540, 1539, 1679, 1424, + /* 1380 */ 1392, 943, 163, 108, 942, 1391, 517, 1608, 1602, 1590, + /* 1390 */ 1663, 171, 1589, 394, 489, 140, 516, 164, 109, 169, + /* 1400 */ 1633, 396, 1579, 303, 45, 174, 1663, 1473, 1423, 1421, + /* 1410 */ 1809, 1419, 1417, 412, 413, 414, 417, 1692, 1679, 971, + /* 1420 */ 274, 1664, 519, 1666, 1667, 515, 514, 536, 416, 420, + /* 1430 */ 418, 421, 422, 1415, 1679, 426, 516, 424, 1404, 425, + /* 1440 */ 1633, 1403, 517, 1390, 1475, 1077, 181, 1078, 1474, 1413, + /* 1450 */ 1004, 582, 516, 1003, 1663, 584, 1633, 1692, 292, 305, + /* 1460 */ 273, 1664, 519, 1666, 1667, 515, 1408, 536, 1002, 1705, + /* 1470 */ 449, 1001, 998, 1692, 997, 996, 274, 1664, 519, 1666, + /* 1480 */ 1667, 515, 1679, 536, 293, 1406, 1663, 294, 1389, 452, + /* 1490 */ 517, 180, 1388, 454, 456, 85, 1607, 1149, 1601, 463, + /* 1500 */ 516, 1588, 1587, 141, 1633, 1586, 1578, 307, 49, 427, + /* 1510 */ 423, 419, 415, 179, 1679, 67, 1663, 204, 464, 4, + /* 1520 */ 37, 1692, 517, 206, 274, 1664, 519, 1666, 1667, 515, + /* 1530 */ 15, 536, 516, 128, 209, 43, 1633, 1320, 64, 200, + /* 1540 */ 135, 177, 213, 215, 1679, 22, 48, 1653, 214, 1313, + /* 1550 */ 68, 23, 517, 1692, 42, 1292, 260, 1664, 519, 1666, + /* 1560 */ 1667, 515, 516, 536, 221, 1291, 1633, 1663, 138, 1349, + /* 1570 */ 17, 1338, 1344, 1343, 301, 1348, 10, 1347, 302, 19, + /* 1580 */ 1255, 139, 1234, 1692, 151, 29, 268, 1664, 519, 1666, + /* 1590 */ 1667, 515, 12, 536, 1233, 1679, 20, 1219, 176, 16, + /* 1600 */ 168, 518, 173, 517, 405, 41, 13, 1663, 1577, 238, + /* 1610 */ 74, 524, 1652, 516, 232, 21, 234, 1633, 1318, 1189, + /* 1620 */ 236, 240, 166, 69, 70, 243, 1695, 540, 1236, 535, + /* 1630 */ 44, 1071, 1065, 538, 1692, 1679, 315, 270, 1664, 519, + /* 1640 */ 1666, 1667, 515, 517, 536, 542, 544, 1663, 1062, 1059, + /* 1650 */ 545, 547, 548, 516, 550, 1053, 553, 1633, 551, 1057, + /* 1660 */ 1051, 1056, 1663, 554, 1055, 1054, 75, 1042, 76, 560, + /* 1670 */ 1073, 77, 1070, 568, 1692, 1679, 969, 261, 1664, 519, + /* 1680 */ 1666, 1667, 515, 517, 536, 993, 1011, 245, 991, 571, + /* 1690 */ 1679, 986, 1008, 516, 990, 989, 988, 1633, 517, 987, + /* 1700 */ 985, 984, 1006, 981, 980, 979, 976, 975, 516, 974, + /* 1710 */ 1420, 592, 1633, 1663, 1692, 593, 594, 271, 1664, 519, + /* 1720 */ 1666, 1667, 515, 1418, 536, 1663, 597, 596, 598, 1692, + /* 1730 */ 1416, 600, 262, 1664, 519, 1666, 1667, 515, 601, 536, + /* 1740 */ 602, 1679, 604, 605, 606, 1402, 608, 609, 1401, 517, + /* 1750 */ 1414, 1387, 613, 1679, 612, 1175, 255, 616, 617, 516, + /* 1760 */ 1362, 517, 1362, 1633, 1362, 1663, 1362, 1362, 1362, 1362, + /* 1770 */ 1362, 516, 1362, 1362, 1362, 1633, 1663, 1362, 1362, 1362, + /* 1780 */ 1692, 1362, 1362, 272, 1664, 519, 1666, 1667, 515, 1362, + /* 1790 */ 536, 1362, 1692, 1679, 1362, 263, 1664, 519, 1666, 1667, + /* 1800 */ 515, 517, 536, 1362, 1679, 1362, 1362, 1362, 1362, 1362, + /* 1810 */ 1362, 516, 517, 1362, 1362, 1633, 1362, 1362, 1362, 1362, + /* 1820 */ 1362, 1362, 516, 1362, 1362, 1362, 1633, 1663, 1362, 1362, + /* 1830 */ 1362, 1362, 1692, 1362, 1362, 1675, 1664, 519, 1666, 1667, + /* 1840 */ 515, 1362, 536, 1692, 1362, 1362, 1674, 1664, 519, 1666, + /* 1850 */ 1667, 515, 1362, 536, 1362, 1679, 1362, 1663, 1362, 1362, + /* 1860 */ 1362, 1362, 1362, 517, 1362, 1362, 1362, 1362, 1362, 1362, + /* 1870 */ 1362, 1362, 1362, 516, 1362, 1362, 1362, 1633, 1362, 1362, + /* 1880 */ 1362, 1362, 1362, 1362, 1362, 1679, 1362, 1663, 1362, 1362, + /* 1890 */ 1362, 1362, 1362, 517, 1692, 1362, 1362, 1673, 1664, 519, + /* 1900 */ 1666, 1667, 515, 516, 536, 1362, 1362, 1633, 1362, 1362, + /* 1910 */ 1362, 1362, 1362, 1362, 1362, 1679, 1362, 1362, 1362, 1663, + /* 1920 */ 1362, 1362, 1362, 517, 1692, 1362, 1362, 284, 1664, 519, + /* 1930 */ 1666, 1667, 515, 516, 536, 1362, 1362, 1633, 1362, 1362, + /* 1940 */ 1362, 1362, 1362, 313, 312, 1362, 1362, 1679, 1362, 1362, + /* 1950 */ 1362, 1362, 1663, 1187, 1692, 517, 1362, 283, 1664, 519, + /* 1960 */ 1666, 1667, 515, 1362, 536, 516, 1362, 1362, 1362, 1633, + /* 1970 */ 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1362, 1180, 1362, + /* 1980 */ 1679, 1362, 1362, 1362, 1362, 1663, 1692, 1362, 517, 285, + /* 1990 */ 1664, 519, 1666, 1667, 515, 1179, 536, 1362, 516, 1362, + /* 2000 */ 1362, 1362, 1633, 1362, 1362, 1362, 1362, 1362, 1362, 1362, + /* 2010 */ 1362, 1362, 1362, 1679, 1362, 1362, 493, 1362, 1362, 1692, + /* 2020 */ 1362, 517, 282, 1664, 519, 1666, 1667, 515, 1362, 536, + /* 2030 */ 1362, 516, 1362, 1362, 537, 1633, 1362, 1362, 1362, 1362, + /* 2040 */ 1362, 1362, 1362, 1362, 1183, 114, 493, 1362, 1362, 1362, + /* 2050 */ 1362, 1362, 1692, 1362, 1362, 267, 1664, 519, 1666, 1667, + /* 2060 */ 515, 1362, 536, 1362, 497, 1362, 1362, 1362, 1362, 1362, + /* 2070 */ 1362, 1362, 1362, 1362, 1362, 114, 1362, 1362, 1362, 1362, + /* 2080 */ 1362, 1362, 1362, 112, 1362, 1362, 1362, 1188, 1362, 1362, + /* 2090 */ 1362, 1362, 1362, 1362, 497, 1362, 1362, 1362, 220, 1739, + /* 2100 */ 492, 1362, 491, 1362, 1362, 1794, 1362, 1362, 1362, 1362, + /* 2110 */ 1362, 1362, 1191, 112, 1362, 1362, 1362, 149, 1362, 1362, + /* 2120 */ 1362, 1791, 1362, 534, 1239, 1240, 1362, 1362, 220, 1739, + /* 2130 */ 492, 1362, 491, 1362, 1362, 1794, 1362, 1362, 1362, 1362, + /* 2140 */ 1362, 1362, 1362, 1362, 1362, 1362, 1362, 147, 1362, 1362, + /* 2150 */ 1362, 1791, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 323, 324, 242, 272, 250, 251, 275, 272, 249, 272, - /* 10 */ 275, 271, 12, 13, 297, 12, 13, 14, 15, 16, - /* 20 */ 20, 2, 22, 292, 249, 256, 257, 292, 252, 292, - /* 30 */ 270, 12, 13, 14, 15, 16, 261, 249, 278, 308, - /* 40 */ 309, 265, 283, 308, 309, 308, 309, 47, 288, 273, - /* 50 */ 319, 249, 292, 278, 319, 338, 319, 297, 58, 310, - /* 60 */ 12, 13, 14, 261, 64, 242, 278, 350, 20, 309, - /* 70 */ 22, 354, 312, 313, 314, 315, 316, 317, 41, 319, - /* 80 */ 278, 81, 322, 334, 338, 82, 326, 327, 12, 13, - /* 90 */ 14, 15, 16, 270, 20, 47, 350, 272, 338, 288, - /* 100 */ 354, 278, 291, 103, 316, 294, 58, 57, 12, 13, - /* 110 */ 350, 288, 64, 113, 354, 292, 20, 292, 22, 331, - /* 120 */ 332, 333, 20, 335, 12, 13, 14, 15, 16, 81, - /* 130 */ 75, 254, 309, 308, 309, 312, 313, 314, 315, 316, - /* 140 */ 317, 0, 319, 47, 319, 322, 20, 338, 4, 326, - /* 150 */ 327, 103, 269, 276, 58, 245, 156, 247, 248, 350, - /* 160 */ 64, 113, 21, 354, 281, 24, 25, 26, 27, 28, - /* 170 */ 29, 30, 31, 32, 119, 120, 241, 81, 243, 93, - /* 180 */ 180, 181, 4, 183, 184, 185, 186, 187, 188, 189, - /* 190 */ 190, 191, 192, 193, 194, 195, 196, 197, 112, 103, - /* 200 */ 114, 115, 116, 245, 156, 247, 248, 81, 21, 113, - /* 210 */ 210, 24, 25, 26, 27, 28, 29, 30, 31, 32, - /* 220 */ 42, 43, 165, 166, 148, 81, 169, 0, 180, 181, - /* 230 */ 0, 183, 184, 185, 186, 187, 188, 189, 190, 191, - /* 240 */ 192, 193, 194, 195, 196, 197, 12, 13, 14, 15, - /* 250 */ 16, 20, 156, 239, 24, 25, 26, 27, 28, 29, - /* 260 */ 30, 31, 32, 0, 227, 12, 13, 12, 13, 14, - /* 270 */ 15, 16, 45, 20, 81, 22, 180, 181, 151, 183, + /* 0 */ 324, 325, 243, 273, 251, 252, 276, 273, 250, 273, + /* 10 */ 276, 272, 12, 13, 298, 12, 13, 14, 15, 16, + /* 20 */ 20, 2, 22, 293, 250, 257, 258, 293, 253, 293, + /* 30 */ 271, 12, 13, 14, 15, 16, 262, 250, 279, 309, + /* 40 */ 310, 266, 284, 309, 310, 309, 310, 47, 289, 274, + /* 50 */ 320, 250, 293, 279, 320, 339, 320, 298, 58, 311, + /* 60 */ 12, 13, 14, 262, 64, 243, 279, 351, 20, 310, + /* 70 */ 22, 355, 313, 314, 315, 316, 317, 318, 20, 320, + /* 80 */ 279, 81, 323, 335, 339, 82, 327, 328, 12, 13, + /* 90 */ 14, 15, 16, 271, 57, 47, 351, 273, 339, 289, + /* 100 */ 355, 279, 292, 103, 317, 295, 58, 311, 12, 13, + /* 110 */ 351, 289, 64, 113, 355, 293, 20, 293, 22, 332, + /* 120 */ 333, 334, 20, 336, 12, 13, 14, 15, 16, 81, + /* 130 */ 255, 335, 310, 309, 310, 313, 314, 315, 316, 317, + /* 140 */ 318, 0, 320, 47, 320, 323, 20, 339, 22, 327, + /* 150 */ 328, 103, 277, 253, 58, 246, 156, 248, 249, 351, + /* 160 */ 64, 113, 21, 355, 20, 24, 25, 26, 27, 28, + /* 170 */ 29, 30, 31, 32, 274, 49, 4, 81, 242, 55, + /* 180 */ 244, 181, 182, 81, 184, 185, 186, 187, 188, 189, + /* 190 */ 190, 191, 192, 193, 194, 195, 196, 197, 198, 103, + /* 200 */ 246, 22, 248, 249, 156, 81, 20, 83, 256, 113, + /* 210 */ 21, 211, 260, 24, 25, 26, 27, 28, 29, 30, + /* 220 */ 31, 32, 165, 166, 148, 81, 47, 170, 93, 181, + /* 230 */ 182, 0, 184, 185, 186, 187, 188, 189, 190, 191, + /* 240 */ 192, 193, 194, 195, 196, 197, 198, 112, 20, 114, + /* 250 */ 115, 116, 156, 81, 255, 24, 25, 26, 27, 28, + /* 260 */ 29, 30, 31, 32, 4, 12, 13, 268, 12, 13, + /* 270 */ 14, 15, 16, 20, 311, 22, 277, 181, 182, 20, /* 280 */ 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - /* 290 */ 194, 195, 196, 197, 297, 249, 60, 61, 171, 172, - /* 300 */ 47, 65, 20, 242, 68, 69, 230, 261, 72, 73, - /* 310 */ 74, 297, 81, 12, 13, 14, 2, 64, 255, 254, - /* 320 */ 57, 20, 259, 22, 278, 252, 12, 13, 14, 15, - /* 330 */ 16, 270, 267, 58, 81, 338, 210, 82, 270, 278, - /* 340 */ 35, 276, 81, 249, 297, 277, 273, 350, 47, 288, - /* 350 */ 282, 354, 338, 292, 210, 20, 103, 22, 297, 143, - /* 360 */ 139, 12, 13, 0, 350, 64, 113, 55, 354, 20, - /* 370 */ 309, 22, 278, 312, 313, 314, 315, 316, 317, 145, - /* 380 */ 319, 160, 81, 322, 49, 338, 57, 326, 327, 84, - /* 390 */ 20, 86, 87, 81, 89, 83, 47, 350, 93, 338, - /* 400 */ 0, 354, 81, 210, 103, 338, 14, 15, 16, 156, - /* 410 */ 316, 350, 91, 64, 113, 354, 155, 350, 157, 198, - /* 420 */ 115, 354, 14, 0, 330, 331, 332, 333, 20, 335, - /* 430 */ 81, 215, 216, 180, 181, 41, 183, 184, 185, 186, + /* 290 */ 194, 195, 196, 197, 198, 81, 60, 61, 335, 271, + /* 300 */ 47, 65, 42, 43, 68, 69, 278, 231, 72, 73, + /* 310 */ 74, 283, 57, 12, 13, 14, 271, 64, 2, 263, + /* 320 */ 243, 20, 247, 22, 279, 250, 35, 271, 12, 13, + /* 330 */ 14, 15, 16, 20, 81, 211, 280, 94, 95, 96, + /* 340 */ 97, 98, 99, 100, 101, 102, 103, 104, 47, 106, + /* 350 */ 107, 108, 109, 110, 111, 211, 103, 4, 143, 19, + /* 360 */ 315, 12, 13, 257, 258, 64, 113, 270, 14, 20, + /* 370 */ 293, 22, 19, 33, 20, 84, 181, 86, 87, 282, + /* 380 */ 89, 281, 81, 211, 93, 45, 33, 247, 288, 289, + /* 390 */ 250, 51, 52, 53, 54, 55, 47, 0, 45, 55, + /* 400 */ 250, 145, 240, 50, 103, 0, 115, 64, 55, 156, + /* 410 */ 339, 243, 262, 64, 113, 220, 221, 222, 223, 224, + /* 420 */ 80, 279, 351, 83, 80, 211, 355, 83, 286, 279, + /* 430 */ 81, 216, 217, 80, 181, 182, 83, 184, 185, 186, /* 440 */ 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - /* 450 */ 197, 280, 103, 47, 249, 180, 93, 156, 287, 288, - /* 460 */ 60, 61, 113, 210, 0, 65, 261, 180, 68, 69, - /* 470 */ 64, 210, 72, 73, 74, 112, 82, 114, 115, 116, - /* 480 */ 57, 180, 181, 278, 183, 184, 185, 186, 187, 188, - /* 490 */ 189, 190, 191, 192, 193, 194, 195, 196, 197, 55, - /* 500 */ 1, 2, 20, 270, 262, 156, 219, 220, 221, 222, - /* 510 */ 223, 278, 270, 270, 242, 145, 256, 257, 12, 13, - /* 520 */ 277, 279, 210, 242, 80, 282, 20, 83, 22, 180, - /* 530 */ 181, 20, 183, 184, 185, 186, 187, 188, 189, 190, - /* 540 */ 191, 192, 193, 194, 195, 196, 197, 314, 246, 287, - /* 550 */ 288, 249, 14, 47, 270, 249, 249, 93, 20, 249, - /* 560 */ 18, 277, 20, 0, 292, 47, 282, 261, 261, 27, - /* 570 */ 64, 261, 30, 292, 268, 268, 112, 288, 114, 115, - /* 580 */ 116, 82, 64, 294, 278, 278, 249, 81, 278, 18, - /* 590 */ 48, 249, 249, 249, 23, 14, 242, 242, 261, 242, - /* 600 */ 262, 20, 270, 261, 261, 261, 35, 36, 270, 103, - /* 610 */ 39, 242, 92, 246, 282, 278, 249, 279, 22, 113, - /* 620 */ 278, 278, 278, 60, 61, 62, 63, 56, 65, 66, - /* 630 */ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - /* 640 */ 77, 78, 262, 47, 278, 270, 292, 292, 20, 292, - /* 650 */ 270, 285, 81, 263, 279, 258, 266, 260, 37, 279, - /* 660 */ 118, 292, 156, 121, 122, 123, 124, 125, 126, 127, + /* 450 */ 197, 198, 103, 81, 57, 263, 116, 156, 3, 263, + /* 460 */ 298, 293, 113, 271, 211, 60, 61, 271, 271, 92, + /* 470 */ 65, 75, 280, 68, 69, 278, 280, 72, 73, 74, + /* 480 */ 283, 141, 181, 182, 144, 184, 185, 186, 187, 188, + /* 490 */ 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + /* 500 */ 243, 339, 162, 20, 164, 156, 288, 289, 12, 13, + /* 510 */ 14, 15, 16, 351, 14, 119, 120, 355, 12, 13, + /* 520 */ 20, 243, 167, 168, 169, 0, 20, 155, 22, 157, + /* 530 */ 181, 182, 250, 184, 185, 186, 187, 188, 189, 190, + /* 540 */ 191, 192, 193, 194, 195, 196, 197, 198, 264, 271, + /* 550 */ 293, 267, 250, 47, 243, 0, 250, 279, 243, 14, + /* 560 */ 18, 279, 20, 47, 262, 20, 272, 289, 262, 27, + /* 570 */ 64, 293, 30, 302, 250, 269, 298, 0, 82, 298, + /* 580 */ 64, 279, 57, 211, 243, 279, 262, 81, 310, 151, + /* 590 */ 48, 313, 314, 315, 316, 317, 318, 272, 320, 317, + /* 600 */ 45, 323, 272, 279, 293, 327, 328, 272, 293, 103, + /* 610 */ 172, 173, 250, 331, 332, 333, 334, 339, 336, 113, + /* 620 */ 339, 42, 43, 271, 262, 244, 1, 2, 145, 351, + /* 630 */ 278, 269, 351, 355, 293, 283, 355, 60, 61, 62, + /* 640 */ 63, 279, 65, 66, 67, 68, 69, 70, 71, 72, + /* 650 */ 73, 74, 75, 76, 77, 78, 14, 15, 16, 243, + /* 660 */ 118, 4, 156, 121, 122, 123, 124, 125, 126, 127, /* 670 */ 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - /* 680 */ 138, 242, 242, 3, 249, 41, 180, 181, 117, 183, + /* 680 */ 138, 226, 243, 289, 243, 185, 20, 181, 182, 295, /* 690 */ 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - /* 700 */ 194, 195, 196, 197, 249, 242, 12, 13, 14, 15, - /* 710 */ 16, 249, 242, 278, 249, 20, 261, 42, 43, 148, - /* 720 */ 149, 150, 184, 261, 153, 242, 261, 249, 242, 158, - /* 730 */ 4, 292, 292, 278, 12, 13, 14, 15, 16, 261, - /* 740 */ 278, 170, 85, 278, 173, 88, 175, 176, 177, 178, - /* 750 */ 179, 316, 58, 270, 242, 292, 278, 242, 271, 310, - /* 760 */ 64, 278, 292, 310, 242, 184, 331, 332, 333, 242, - /* 770 */ 335, 288, 242, 145, 271, 292, 82, 242, 292, 0, - /* 780 */ 58, 210, 242, 334, 90, 242, 242, 334, 208, 209, - /* 790 */ 271, 85, 309, 93, 88, 312, 313, 314, 315, 316, - /* 800 */ 317, 22, 319, 85, 292, 322, 88, 292, 271, 326, - /* 810 */ 327, 328, 90, 270, 292, 115, 0, 85, 0, 292, - /* 820 */ 88, 278, 292, 340, 21, 167, 168, 292, 345, 346, - /* 830 */ 209, 288, 292, 139, 4, 292, 292, 34, 22, 44, - /* 840 */ 22, 271, 41, 41, 271, 41, 41, 1, 2, 19, - /* 850 */ 195, 196, 309, 301, 160, 312, 313, 314, 315, 316, - /* 860 */ 317, 139, 319, 33, 47, 322, 41, 41, 41, 326, - /* 870 */ 327, 328, 243, 229, 41, 45, 81, 22, 47, 184, - /* 880 */ 50, 259, 160, 82, 82, 55, 82, 82, 357, 346, - /* 890 */ 305, 41, 198, 199, 200, 201, 202, 203, 204, 205, - /* 900 */ 206, 207, 47, 242, 41, 225, 41, 82, 82, 82, - /* 910 */ 80, 41, 348, 83, 342, 82, 41, 270, 41, 64, - /* 920 */ 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - /* 930 */ 113, 270, 82, 248, 250, 242, 311, 211, 41, 278, - /* 940 */ 281, 41, 336, 351, 113, 82, 351, 82, 351, 288, - /* 950 */ 339, 212, 82, 292, 20, 307, 249, 82, 103, 82, - /* 960 */ 45, 47, 306, 270, 256, 154, 299, 242, 113, 249, - /* 970 */ 309, 278, 249, 312, 313, 314, 315, 316, 317, 82, - /* 980 */ 319, 288, 82, 322, 40, 292, 139, 326, 327, 328, - /* 990 */ 286, 249, 20, 284, 284, 270, 244, 244, 337, 20, - /* 1000 */ 303, 254, 309, 278, 288, 312, 313, 314, 315, 316, - /* 1010 */ 317, 156, 319, 288, 254, 322, 20, 292, 242, 326, - /* 1020 */ 327, 328, 20, 296, 254, 296, 298, 254, 278, 20, - /* 1030 */ 337, 254, 289, 249, 309, 180, 181, 312, 313, 314, - /* 1040 */ 315, 316, 317, 254, 319, 254, 270, 322, 242, 64, - /* 1050 */ 270, 326, 327, 328, 278, 270, 244, 270, 270, 249, - /* 1060 */ 270, 292, 337, 270, 288, 244, 270, 270, 292, 270, - /* 1070 */ 270, 303, 252, 297, 163, 252, 270, 270, 249, 296, - /* 1080 */ 302, 289, 288, 20, 278, 309, 252, 278, 312, 313, - /* 1090 */ 314, 315, 316, 317, 288, 319, 252, 311, 292, 218, - /* 1100 */ 217, 347, 347, 297, 224, 344, 293, 292, 147, 343, - /* 1110 */ 209, 213, 293, 341, 338, 309, 292, 278, 312, 313, - /* 1120 */ 314, 315, 316, 317, 292, 319, 350, 20, 40, 307, - /* 1130 */ 354, 228, 226, 94, 95, 96, 97, 98, 99, 100, - /* 1140 */ 101, 102, 103, 104, 338, 106, 107, 108, 109, 110, - /* 1150 */ 111, 310, 81, 231, 293, 293, 350, 33, 292, 292, - /* 1160 */ 354, 353, 325, 242, 329, 292, 352, 142, 290, 45, - /* 1170 */ 278, 289, 252, 266, 278, 51, 52, 53, 54, 55, - /* 1180 */ 252, 81, 242, 274, 260, 249, 358, 252, 300, 353, - /* 1190 */ 352, 270, 244, 353, 352, 304, 264, 264, 253, 278, - /* 1200 */ 240, 264, 0, 0, 80, 40, 0, 83, 72, 288, - /* 1210 */ 270, 0, 174, 292, 47, 47, 47, 47, 278, 174, - /* 1220 */ 0, 47, 47, 174, 0, 174, 0, 47, 288, 0, - /* 1230 */ 309, 47, 292, 312, 313, 314, 315, 316, 317, 0, - /* 1240 */ 319, 242, 47, 322, 0, 81, 160, 326, 327, 309, - /* 1250 */ 242, 159, 312, 313, 314, 315, 316, 317, 318, 319, - /* 1260 */ 320, 321, 113, 0, 140, 156, 142, 0, 144, 270, - /* 1270 */ 146, 152, 151, 0, 0, 44, 0, 278, 270, 0, - /* 1280 */ 0, 0, 0, 0, 0, 0, 278, 288, 164, 0, - /* 1290 */ 0, 292, 0, 0, 0, 0, 288, 0, 0, 0, - /* 1300 */ 292, 0, 40, 0, 0, 0, 0, 0, 309, 0, - /* 1310 */ 22, 312, 313, 314, 315, 316, 317, 309, 319, 0, - /* 1320 */ 312, 313, 314, 315, 316, 317, 0, 319, 0, 0, - /* 1330 */ 322, 19, 242, 0, 0, 327, 40, 37, 14, 14, - /* 1340 */ 0, 242, 0, 41, 0, 33, 0, 147, 38, 0, - /* 1350 */ 37, 0, 44, 37, 355, 356, 0, 45, 44, 37, - /* 1360 */ 270, 0, 0, 51, 52, 53, 54, 55, 278, 270, - /* 1370 */ 59, 0, 37, 37, 47, 45, 45, 278, 288, 47, - /* 1380 */ 0, 0, 292, 45, 47, 295, 47, 288, 45, 37, - /* 1390 */ 37, 292, 80, 242, 0, 83, 0, 0, 0, 309, - /* 1400 */ 22, 47, 312, 313, 314, 315, 316, 317, 309, 319, - /* 1410 */ 90, 312, 313, 314, 315, 316, 317, 0, 319, 47, - /* 1420 */ 47, 270, 47, 47, 41, 41, 47, 0, 116, 278, - /* 1430 */ 22, 0, 47, 88, 47, 22, 48, 0, 47, 288, - /* 1440 */ 22, 0, 22, 292, 0, 22, 20, 0, 349, 47, - /* 1450 */ 0, 22, 242, 141, 0, 0, 144, 142, 0, 0, - /* 1460 */ 309, 12, 13, 312, 313, 314, 315, 316, 317, 37, - /* 1470 */ 319, 22, 82, 81, 162, 41, 164, 41, 161, 214, - /* 1480 */ 270, 41, 82, 82, 242, 81, 145, 81, 278, 41, - /* 1490 */ 140, 81, 145, 145, 82, 44, 47, 44, 288, 208, - /* 1500 */ 242, 41, 292, 82, 41, 295, 81, 356, 44, 44, - /* 1510 */ 82, 41, 270, 64, 47, 82, 47, 2, 47, 309, - /* 1520 */ 278, 47, 312, 313, 314, 315, 316, 317, 270, 319, - /* 1530 */ 288, 47, 47, 41, 292, 214, 278, 214, 82, 180, - /* 1540 */ 44, 44, 81, 22, 82, 182, 288, 81, 143, 81, - /* 1550 */ 292, 309, 103, 295, 312, 313, 314, 315, 316, 317, - /* 1560 */ 242, 319, 113, 321, 81, 0, 37, 309, 82, 82, - /* 1570 */ 312, 313, 314, 315, 316, 317, 81, 319, 140, 81, - /* 1580 */ 81, 81, 91, 44, 44, 81, 22, 82, 270, 82, - /* 1590 */ 81, 81, 47, 92, 47, 81, 278, 47, 82, 81, - /* 1600 */ 242, 82, 47, 81, 47, 156, 288, 82, 81, 47, - /* 1610 */ 292, 242, 82, 295, 81, 22, 105, 105, 105, 93, - /* 1620 */ 47, 22, 105, 81, 81, 81, 59, 309, 270, 180, - /* 1630 */ 312, 313, 314, 315, 316, 317, 278, 319, 58, 270, - /* 1640 */ 191, 192, 193, 47, 113, 64, 288, 278, 79, 41, - /* 1650 */ 292, 242, 47, 47, 47, 22, 47, 288, 64, 47, - /* 1660 */ 47, 292, 47, 47, 242, 249, 47, 309, 47, 47, - /* 1670 */ 312, 313, 314, 315, 316, 317, 47, 319, 309, 270, - /* 1680 */ 0, 312, 313, 314, 315, 316, 317, 278, 319, 47, - /* 1690 */ 47, 47, 270, 45, 278, 37, 0, 288, 45, 47, - /* 1700 */ 278, 292, 37, 0, 47, 45, 37, 0, 47, 45, - /* 1710 */ 288, 37, 0, 297, 292, 47, 46, 242, 309, 0, - /* 1720 */ 0, 312, 313, 314, 315, 316, 317, 22, 319, 21, - /* 1730 */ 21, 309, 316, 22, 312, 313, 314, 315, 316, 317, - /* 1740 */ 22, 319, 20, 359, 359, 270, 359, 331, 332, 333, - /* 1750 */ 242, 335, 359, 278, 338, 359, 359, 359, 359, 359, - /* 1760 */ 359, 359, 359, 288, 359, 242, 350, 292, 359, 359, - /* 1770 */ 354, 359, 359, 359, 359, 359, 359, 359, 270, 359, - /* 1780 */ 359, 359, 359, 359, 309, 359, 278, 312, 313, 314, - /* 1790 */ 315, 316, 317, 270, 319, 359, 288, 359, 242, 359, - /* 1800 */ 292, 278, 359, 359, 359, 359, 359, 359, 359, 359, - /* 1810 */ 359, 288, 359, 242, 359, 292, 359, 309, 359, 359, - /* 1820 */ 312, 313, 314, 315, 316, 317, 270, 319, 359, 359, - /* 1830 */ 359, 359, 309, 359, 278, 312, 313, 314, 315, 316, - /* 1840 */ 317, 270, 319, 359, 288, 359, 359, 359, 292, 278, - /* 1850 */ 359, 359, 359, 242, 359, 359, 359, 359, 359, 288, - /* 1860 */ 359, 359, 359, 292, 359, 309, 359, 359, 312, 313, - /* 1870 */ 314, 315, 316, 317, 359, 319, 359, 359, 359, 359, - /* 1880 */ 309, 270, 359, 312, 313, 314, 315, 316, 317, 278, - /* 1890 */ 319, 359, 359, 242, 359, 359, 359, 359, 359, 288, - /* 1900 */ 359, 359, 359, 292, 242, 359, 359, 359, 359, 359, - /* 1910 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 359, - /* 1920 */ 309, 270, 359, 312, 313, 314, 315, 316, 317, 278, - /* 1930 */ 319, 359, 270, 359, 359, 359, 359, 359, 359, 288, - /* 1940 */ 278, 359, 359, 292, 242, 359, 359, 359, 359, 359, - /* 1950 */ 288, 359, 359, 359, 292, 359, 359, 242, 359, 359, - /* 1960 */ 309, 359, 359, 312, 313, 314, 315, 316, 317, 359, - /* 1970 */ 319, 309, 270, 359, 312, 313, 314, 315, 316, 317, - /* 1980 */ 278, 319, 359, 359, 359, 270, 359, 359, 359, 359, - /* 1990 */ 288, 359, 359, 278, 292, 359, 359, 359, 359, 359, - /* 2000 */ 359, 359, 359, 288, 359, 359, 359, 292, 242, 359, - /* 2010 */ 359, 309, 359, 359, 312, 313, 314, 315, 316, 317, - /* 2020 */ 359, 319, 359, 359, 309, 359, 359, 312, 313, 314, - /* 2030 */ 315, 316, 317, 359, 319, 359, 270, 359, 249, 359, - /* 2040 */ 359, 242, 359, 359, 278, 359, 359, 359, 359, 359, - /* 2050 */ 359, 359, 359, 359, 288, 359, 359, 359, 292, 359, - /* 2060 */ 359, 359, 359, 359, 359, 359, 359, 278, 359, 270, - /* 2070 */ 359, 359, 359, 359, 359, 309, 359, 278, 312, 313, - /* 2080 */ 314, 315, 316, 317, 359, 319, 297, 288, 359, 359, - /* 2090 */ 359, 292, 359, 359, 359, 359, 359, 359, 359, 359, - /* 2100 */ 359, 359, 359, 359, 359, 316, 359, 359, 309, 359, - /* 2110 */ 359, 312, 313, 314, 315, 316, 317, 359, 319, 359, - /* 2120 */ 331, 332, 333, 359, 335, 359, 359, 338, 359, 359, - /* 2130 */ 359, 359, 359, 359, 359, 359, 359, 359, 359, 350, - /* 2140 */ 359, 359, 359, 354, + /* 700 */ 194, 195, 196, 197, 198, 139, 18, 82, 243, 293, + /* 710 */ 271, 23, 259, 250, 261, 37, 272, 250, 279, 0, + /* 720 */ 20, 250, 298, 35, 36, 262, 160, 39, 289, 262, + /* 730 */ 185, 250, 293, 262, 293, 250, 12, 13, 14, 15, + /* 740 */ 16, 243, 279, 262, 56, 243, 279, 262, 243, 310, + /* 750 */ 279, 41, 313, 314, 315, 316, 317, 318, 293, 320, + /* 760 */ 279, 243, 323, 339, 279, 199, 327, 328, 329, 81, + /* 770 */ 12, 13, 14, 15, 16, 351, 271, 0, 250, 355, + /* 780 */ 341, 250, 58, 271, 279, 346, 347, 93, 250, 243, + /* 790 */ 262, 293, 280, 262, 289, 293, 85, 243, 293, 88, + /* 800 */ 262, 296, 243, 243, 243, 117, 82, 279, 243, 115, + /* 810 */ 279, 293, 93, 41, 90, 310, 58, 279, 313, 314, + /* 820 */ 315, 316, 317, 318, 58, 320, 209, 210, 250, 272, + /* 830 */ 21, 112, 271, 114, 115, 116, 148, 149, 150, 293, + /* 840 */ 279, 153, 260, 34, 271, 145, 158, 293, 90, 41, + /* 850 */ 289, 185, 293, 293, 293, 243, 283, 279, 293, 171, + /* 860 */ 22, 358, 174, 139, 176, 177, 178, 179, 180, 212, + /* 870 */ 93, 310, 0, 47, 313, 314, 315, 316, 317, 318, + /* 880 */ 319, 320, 321, 322, 160, 47, 243, 0, 210, 112, + /* 890 */ 82, 114, 115, 116, 22, 317, 41, 139, 85, 211, + /* 900 */ 85, 88, 64, 88, 85, 293, 243, 88, 41, 22, + /* 910 */ 332, 333, 334, 0, 336, 1, 2, 44, 160, 196, + /* 920 */ 197, 349, 47, 199, 200, 201, 202, 203, 204, 205, + /* 930 */ 206, 207, 208, 41, 271, 22, 293, 82, 228, 113, + /* 940 */ 81, 103, 279, 41, 41, 306, 41, 181, 41, 82, + /* 950 */ 91, 113, 289, 343, 81, 271, 293, 199, 200, 201, + /* 960 */ 202, 203, 204, 205, 206, 207, 208, 41, 243, 249, + /* 970 */ 41, 282, 41, 310, 82, 41, 313, 314, 315, 316, + /* 980 */ 317, 318, 47, 320, 82, 82, 323, 82, 113, 82, + /* 990 */ 327, 328, 329, 41, 156, 251, 271, 312, 337, 64, + /* 1000 */ 243, 352, 230, 41, 279, 352, 41, 352, 82, 340, + /* 1010 */ 347, 82, 213, 82, 289, 41, 82, 41, 293, 181, + /* 1020 */ 182, 308, 20, 250, 45, 307, 257, 47, 271, 300, + /* 1030 */ 154, 250, 250, 287, 82, 310, 279, 40, 313, 314, + /* 1040 */ 315, 316, 317, 318, 82, 320, 289, 82, 323, 139, + /* 1050 */ 293, 250, 327, 328, 329, 285, 82, 20, 82, 285, + /* 1060 */ 243, 245, 20, 338, 304, 245, 255, 310, 289, 255, + /* 1070 */ 313, 314, 315, 316, 317, 318, 20, 320, 20, 299, + /* 1080 */ 323, 297, 255, 297, 327, 328, 329, 255, 271, 279, + /* 1090 */ 20, 255, 243, 290, 255, 338, 279, 250, 255, 245, + /* 1100 */ 271, 271, 271, 250, 271, 271, 289, 245, 271, 64, + /* 1110 */ 293, 271, 271, 271, 293, 271, 271, 293, 253, 163, + /* 1120 */ 271, 253, 304, 253, 289, 303, 20, 310, 279, 250, + /* 1130 */ 313, 314, 315, 316, 317, 318, 279, 320, 289, 253, + /* 1140 */ 323, 219, 293, 243, 327, 328, 329, 298, 297, 293, + /* 1150 */ 290, 218, 348, 348, 293, 338, 147, 294, 312, 310, + /* 1160 */ 294, 225, 313, 314, 315, 316, 317, 318, 345, 320, + /* 1170 */ 293, 271, 344, 243, 214, 279, 210, 308, 20, 279, + /* 1180 */ 40, 232, 311, 229, 227, 81, 291, 294, 339, 289, + /* 1190 */ 342, 293, 293, 293, 330, 294, 142, 293, 298, 279, + /* 1200 */ 351, 271, 290, 353, 355, 267, 243, 279, 326, 279, + /* 1210 */ 310, 359, 354, 313, 314, 315, 316, 317, 318, 289, + /* 1220 */ 320, 253, 253, 293, 81, 275, 253, 250, 354, 245, + /* 1230 */ 305, 353, 261, 353, 271, 354, 243, 265, 301, 339, + /* 1240 */ 310, 254, 279, 313, 314, 315, 316, 317, 318, 241, + /* 1250 */ 320, 351, 289, 323, 265, 355, 293, 327, 328, 265, + /* 1260 */ 0, 0, 40, 0, 271, 72, 0, 47, 175, 175, + /* 1270 */ 47, 47, 279, 310, 47, 0, 313, 314, 315, 316, + /* 1280 */ 317, 318, 289, 320, 47, 47, 293, 243, 175, 0, + /* 1290 */ 175, 0, 47, 0, 47, 0, 243, 47, 0, 81, + /* 1300 */ 113, 160, 156, 310, 159, 0, 313, 314, 315, 316, + /* 1310 */ 317, 318, 0, 320, 152, 271, 323, 151, 0, 356, + /* 1320 */ 357, 328, 0, 279, 271, 44, 0, 0, 0, 0, + /* 1330 */ 0, 0, 279, 289, 0, 0, 0, 293, 0, 0, + /* 1340 */ 0, 0, 289, 0, 0, 0, 293, 0, 0, 40, + /* 1350 */ 243, 0, 0, 0, 310, 0, 0, 313, 314, 315, + /* 1360 */ 316, 317, 318, 310, 320, 0, 313, 314, 315, 316, + /* 1370 */ 317, 318, 22, 320, 0, 0, 0, 0, 271, 0, + /* 1380 */ 0, 14, 40, 37, 14, 0, 279, 0, 0, 0, + /* 1390 */ 243, 147, 0, 44, 350, 41, 289, 38, 37, 37, + /* 1400 */ 293, 44, 0, 296, 90, 37, 243, 0, 0, 0, + /* 1410 */ 357, 0, 0, 47, 45, 37, 45, 310, 271, 59, + /* 1420 */ 313, 314, 315, 316, 317, 318, 279, 320, 47, 47, + /* 1430 */ 37, 45, 37, 0, 271, 37, 289, 47, 0, 45, + /* 1440 */ 293, 0, 279, 0, 0, 22, 88, 47, 0, 0, + /* 1450 */ 47, 41, 289, 47, 243, 41, 293, 310, 22, 296, + /* 1460 */ 313, 314, 315, 316, 317, 318, 0, 320, 47, 322, + /* 1470 */ 48, 47, 47, 310, 47, 47, 313, 314, 315, 316, + /* 1480 */ 317, 318, 271, 320, 22, 0, 243, 22, 0, 47, + /* 1490 */ 279, 33, 0, 22, 22, 20, 0, 47, 0, 22, + /* 1500 */ 289, 0, 0, 45, 293, 0, 0, 296, 145, 51, + /* 1510 */ 52, 53, 54, 55, 271, 81, 243, 37, 145, 41, + /* 1520 */ 41, 310, 279, 140, 313, 314, 315, 316, 317, 318, + /* 1530 */ 215, 320, 289, 161, 82, 41, 293, 82, 80, 142, + /* 1540 */ 81, 83, 81, 44, 271, 81, 145, 44, 41, 82, + /* 1550 */ 81, 41, 279, 310, 41, 82, 313, 314, 315, 316, + /* 1560 */ 317, 318, 289, 320, 44, 82, 293, 243, 44, 82, + /* 1570 */ 41, 82, 47, 47, 47, 47, 2, 47, 47, 41, + /* 1580 */ 181, 44, 82, 310, 44, 81, 313, 314, 315, 316, + /* 1590 */ 317, 318, 81, 320, 82, 271, 81, 22, 140, 215, + /* 1600 */ 142, 183, 144, 279, 146, 209, 215, 243, 0, 37, + /* 1610 */ 91, 143, 44, 289, 82, 81, 81, 293, 82, 22, + /* 1620 */ 81, 140, 164, 81, 81, 44, 81, 47, 82, 81, + /* 1630 */ 81, 113, 82, 92, 310, 271, 47, 313, 314, 315, + /* 1640 */ 316, 317, 318, 279, 320, 81, 47, 243, 82, 82, + /* 1650 */ 81, 47, 81, 289, 47, 82, 47, 293, 81, 105, + /* 1660 */ 82, 105, 243, 81, 105, 105, 81, 22, 81, 93, + /* 1670 */ 47, 81, 22, 58, 310, 271, 59, 313, 314, 315, + /* 1680 */ 316, 317, 318, 279, 320, 47, 64, 41, 47, 79, + /* 1690 */ 271, 22, 64, 289, 47, 47, 47, 293, 279, 47, + /* 1700 */ 47, 47, 47, 47, 47, 47, 47, 47, 289, 47, + /* 1710 */ 0, 47, 293, 243, 310, 45, 37, 313, 314, 315, + /* 1720 */ 316, 317, 318, 0, 320, 243, 45, 47, 37, 310, + /* 1730 */ 0, 47, 313, 314, 315, 316, 317, 318, 45, 320, + /* 1740 */ 37, 271, 47, 45, 37, 0, 47, 46, 0, 279, + /* 1750 */ 0, 0, 21, 271, 22, 22, 22, 21, 20, 289, + /* 1760 */ 360, 279, 360, 293, 360, 243, 360, 360, 360, 360, + /* 1770 */ 360, 289, 360, 360, 360, 293, 243, 360, 360, 360, + /* 1780 */ 310, 360, 360, 313, 314, 315, 316, 317, 318, 360, + /* 1790 */ 320, 360, 310, 271, 360, 313, 314, 315, 316, 317, + /* 1800 */ 318, 279, 320, 360, 271, 360, 360, 360, 360, 360, + /* 1810 */ 360, 289, 279, 360, 360, 293, 360, 360, 360, 360, + /* 1820 */ 360, 360, 289, 360, 360, 360, 293, 243, 360, 360, + /* 1830 */ 360, 360, 310, 360, 360, 313, 314, 315, 316, 317, + /* 1840 */ 318, 360, 320, 310, 360, 360, 313, 314, 315, 316, + /* 1850 */ 317, 318, 360, 320, 360, 271, 360, 243, 360, 360, + /* 1860 */ 360, 360, 360, 279, 360, 360, 360, 360, 360, 360, + /* 1870 */ 360, 360, 360, 289, 360, 360, 360, 293, 360, 360, + /* 1880 */ 360, 360, 360, 360, 360, 271, 360, 243, 360, 360, + /* 1890 */ 360, 360, 360, 279, 310, 360, 360, 313, 314, 315, + /* 1900 */ 316, 317, 318, 289, 320, 360, 360, 293, 360, 360, + /* 1910 */ 360, 360, 360, 360, 360, 271, 360, 360, 360, 243, + /* 1920 */ 360, 360, 360, 279, 310, 360, 360, 313, 314, 315, + /* 1930 */ 316, 317, 318, 289, 320, 360, 360, 293, 360, 360, + /* 1940 */ 360, 360, 360, 12, 13, 360, 360, 271, 360, 360, + /* 1950 */ 360, 360, 243, 22, 310, 279, 360, 313, 314, 315, + /* 1960 */ 316, 317, 318, 360, 320, 289, 360, 360, 360, 293, + /* 1970 */ 360, 360, 360, 360, 360, 360, 360, 360, 47, 360, + /* 1980 */ 271, 360, 360, 360, 360, 243, 310, 360, 279, 313, + /* 1990 */ 314, 315, 316, 317, 318, 64, 320, 360, 289, 360, + /* 2000 */ 360, 360, 293, 360, 360, 360, 360, 360, 360, 360, + /* 2010 */ 360, 360, 360, 271, 360, 360, 250, 360, 360, 310, + /* 2020 */ 360, 279, 313, 314, 315, 316, 317, 318, 360, 320, + /* 2030 */ 360, 289, 360, 360, 103, 293, 360, 360, 360, 360, + /* 2040 */ 360, 360, 360, 360, 113, 279, 250, 360, 360, 360, + /* 2050 */ 360, 360, 310, 360, 360, 313, 314, 315, 316, 317, + /* 2060 */ 318, 360, 320, 360, 298, 360, 360, 360, 360, 360, + /* 2070 */ 360, 360, 360, 360, 360, 279, 360, 360, 360, 360, + /* 2080 */ 360, 360, 360, 317, 360, 360, 360, 156, 360, 360, + /* 2090 */ 360, 360, 360, 360, 298, 360, 360, 360, 332, 333, + /* 2100 */ 334, 360, 336, 360, 360, 339, 360, 360, 360, 360, + /* 2110 */ 360, 360, 181, 317, 360, 360, 360, 351, 360, 360, + /* 2120 */ 360, 355, 360, 192, 193, 194, 360, 360, 332, 333, + /* 2130 */ 334, 360, 336, 360, 360, 339, 360, 360, 360, 360, + /* 2140 */ 360, 360, 360, 360, 360, 360, 360, 351, 360, 360, + /* 2150 */ 360, 355, 360, 360, 360, 360, 360, 360, 360, 360, + /* 2160 */ 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, + /* 2170 */ 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, + /* 2180 */ 360, 360, 360, 360, }; -#define YY_SHIFT_COUNT (617) +#define YY_SHIFT_COUNT (618) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (1722) +#define YY_SHIFT_MAX (1931) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 571, 0, 0, 48, 96, 96, 96, 96, 253, 253, + /* 0 */ 688, 0, 0, 48, 96, 96, 96, 96, 253, 253, /* 10 */ 96, 96, 301, 349, 506, 349, 349, 349, 349, 349, /* 20 */ 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, - /* 30 */ 349, 349, 349, 349, 349, 349, 349, 349, 126, 126, - /* 40 */ 231, 231, 231, 1449, 1449, 1449, 1449, 261, 312, 193, - /* 50 */ 74, 74, 178, 178, 144, 193, 193, 74, 74, 74, - /* 60 */ 74, 74, 74, 74, 50, 74, 74, 102, 282, 482, - /* 70 */ 102, 74, 74, 102, 74, 102, 102, 482, 102, 74, - /* 80 */ 329, 542, 694, 722, 722, 187, 236, 855, 855, 855, - /* 90 */ 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, - /* 100 */ 855, 855, 855, 855, 855, 855, 305, 335, 408, 408, - /* 110 */ 263, 406, 370, 370, 370, 423, 406, 511, 482, 102, - /* 120 */ 102, 482, 520, 696, 1039, 1039, 1039, 1039, 1039, 1039, - /* 130 */ 1039, 1312, 141, 400, 76, 287, 57, 216, 538, 581, - /* 140 */ 675, 596, 700, 628, 580, 621, 580, 680, 680, 680, - /* 150 */ 726, 695, 739, 934, 915, 914, 811, 934, 934, 944, - /* 160 */ 847, 847, 934, 972, 972, 979, 50, 482, 50, 996, - /* 170 */ 1002, 50, 996, 50, 511, 1009, 50, 50, 934, 50, - /* 180 */ 972, 102, 102, 102, 102, 102, 102, 102, 102, 102, - /* 190 */ 102, 102, 934, 972, 985, 979, 329, 911, 482, 329, - /* 200 */ 934, 996, 329, 511, 1009, 329, 1063, 881, 883, 985, - /* 210 */ 881, 883, 985, 985, 102, 880, 961, 898, 739, 901, - /* 220 */ 511, 1107, 1088, 903, 906, 922, 903, 906, 903, 906, - /* 230 */ 1071, 883, 985, 985, 883, 985, 1025, 511, 1009, 329, - /* 240 */ 520, 329, 511, 1100, 696, 934, 329, 972, 2144, 2144, - /* 250 */ 2144, 2144, 2144, 2144, 2144, 563, 1124, 230, 830, 3, - /* 260 */ 19, 314, 234, 255, 363, 464, 112, 112, 112, 112, - /* 270 */ 112, 112, 112, 112, 86, 127, 444, 55, 499, 221, - /* 280 */ 392, 392, 392, 392, 227, 394, 657, 706, 718, 732, - /* 290 */ 779, 816, 818, 803, 658, 801, 802, 804, 846, 655, - /* 300 */ 37, 644, 805, 275, 825, 795, 826, 827, 833, 850, - /* 310 */ 863, 817, 831, 865, 870, 875, 877, 897, 900, 321, - /* 320 */ 518, 1202, 1203, 1165, 1206, 1136, 1211, 1167, 1038, 1168, - /* 330 */ 1169, 1170, 1045, 1220, 1174, 1175, 1049, 1224, 1051, 1226, - /* 340 */ 1180, 1229, 1184, 1239, 1195, 1244, 1164, 1086, 1092, 1149, - /* 350 */ 1109, 1263, 1267, 1119, 1121, 1273, 1274, 1231, 1276, 1279, - /* 360 */ 1280, 1281, 1282, 1283, 1284, 1285, 1289, 1290, 1292, 1293, - /* 370 */ 1294, 1295, 1297, 1298, 1299, 1301, 1262, 1303, 1304, 1305, - /* 380 */ 1306, 1307, 1309, 1288, 1319, 1326, 1328, 1329, 1333, 1334, - /* 390 */ 1296, 1300, 1302, 1324, 1308, 1325, 1314, 1340, 1310, 1313, - /* 400 */ 1342, 1344, 1346, 1316, 1200, 1349, 1351, 1322, 1356, 1311, - /* 410 */ 1361, 1362, 1327, 1330, 1335, 1371, 1332, 1331, 1336, 1380, - /* 420 */ 1337, 1338, 1352, 1381, 1339, 1343, 1353, 1394, 1396, 1397, - /* 430 */ 1398, 1320, 1345, 1354, 1378, 1417, 1372, 1373, 1375, 1376, - /* 440 */ 1383, 1384, 1379, 1385, 1387, 1427, 1408, 1431, 1413, 1388, - /* 450 */ 1437, 1418, 1391, 1441, 1420, 1444, 1423, 1426, 1447, 1341, - /* 460 */ 1402, 1450, 1317, 1429, 1347, 1315, 1454, 1455, 1458, 1348, - /* 470 */ 1459, 1392, 1432, 1350, 1434, 1436, 1265, 1390, 1440, 1400, - /* 480 */ 1404, 1406, 1410, 1401, 1448, 1451, 1453, 1425, 1460, 1321, - /* 490 */ 1412, 1421, 1464, 1291, 1463, 1465, 1428, 1470, 1323, 1433, - /* 500 */ 1467, 1469, 1471, 1474, 1484, 1485, 1433, 1515, 1359, 1492, - /* 510 */ 1456, 1461, 1462, 1496, 1466, 1468, 1497, 1521, 1363, 1483, - /* 520 */ 1486, 1487, 1495, 1498, 1405, 1499, 1565, 1529, 1438, 1500, - /* 530 */ 1491, 1539, 1540, 1504, 1505, 1509, 1564, 1510, 1501, 1507, - /* 540 */ 1545, 1547, 1514, 1516, 1550, 1518, 1519, 1555, 1522, 1525, - /* 550 */ 1557, 1527, 1530, 1562, 1533, 1511, 1512, 1513, 1517, 1593, - /* 560 */ 1526, 1542, 1543, 1573, 1544, 1531, 1599, 1567, 1580, 1596, - /* 570 */ 1581, 1569, 1608, 1605, 1606, 1607, 1609, 1612, 1633, 1613, - /* 580 */ 1615, 1594, 1383, 1616, 1384, 1619, 1621, 1622, 1629, 1642, - /* 590 */ 1643, 1680, 1644, 1648, 1658, 1696, 1652, 1653, 1665, 1703, - /* 600 */ 1657, 1660, 1669, 1707, 1661, 1664, 1674, 1712, 1668, 1670, - /* 610 */ 1719, 1720, 1705, 1708, 1711, 1718, 1709, 1722, + /* 30 */ 349, 349, 349, 349, 349, 349, 349, 349, 144, 144, + /* 40 */ 102, 102, 102, 1931, 1931, 1931, 1931, 372, 124, 214, + /* 50 */ 58, 58, 260, 260, 172, 214, 214, 58, 58, 58, + /* 60 */ 58, 58, 58, 58, 37, 58, 58, 186, 228, 259, + /* 70 */ 186, 58, 58, 186, 58, 186, 186, 259, 186, 58, + /* 80 */ 255, 542, 724, 758, 758, 189, 236, 838, 838, 838, + /* 90 */ 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, + /* 100 */ 838, 838, 838, 838, 838, 838, 291, 126, 354, 354, + /* 110 */ 397, 516, 483, 483, 483, 525, 516, 313, 259, 186, + /* 120 */ 186, 259, 377, 343, 243, 243, 243, 243, 243, 243, + /* 130 */ 243, 340, 141, 405, 76, 195, 57, 215, 500, 545, + /* 140 */ 579, 179, 694, 700, 617, 678, 617, 455, 455, 455, + /* 150 */ 657, 666, 799, 1002, 979, 980, 876, 1002, 1002, 997, + /* 160 */ 910, 910, 1002, 1037, 1037, 1042, 37, 259, 37, 1056, + /* 170 */ 1058, 37, 1056, 37, 313, 1070, 37, 37, 1002, 37, + /* 180 */ 1037, 186, 186, 186, 186, 186, 186, 186, 186, 186, + /* 190 */ 186, 186, 1002, 1037, 1045, 1045, 1042, 255, 956, 259, + /* 200 */ 255, 1002, 1056, 255, 313, 1070, 255, 1106, 922, 933, + /* 210 */ 1045, 922, 933, 1045, 1045, 186, 936, 1009, 960, 799, + /* 220 */ 966, 313, 1158, 1140, 954, 957, 949, 954, 957, 954, + /* 230 */ 957, 1104, 933, 1045, 1045, 933, 1045, 1054, 313, 1070, + /* 240 */ 255, 377, 255, 313, 1143, 343, 1002, 255, 1037, 2152, + /* 250 */ 2152, 2152, 2152, 2152, 2152, 2152, 577, 1458, 231, 353, + /* 260 */ 3, 19, 316, 256, 496, 719, 777, 112, 112, 112, + /* 270 */ 112, 112, 112, 112, 112, 135, 438, 344, 396, 355, + /* 280 */ 625, 566, 642, 642, 642, 642, 555, 808, 711, 813, + /* 290 */ 815, 819, 872, 887, 913, 809, 855, 867, 892, 914, + /* 300 */ 723, 710, 772, 902, 766, 903, 873, 905, 907, 926, + /* 310 */ 929, 931, 826, 875, 934, 952, 962, 965, 974, 976, + /* 320 */ 859, 935, 1260, 1261, 1222, 1263, 1193, 1266, 1220, 1093, + /* 330 */ 1223, 1224, 1227, 1094, 1275, 1237, 1238, 1113, 1289, 1115, + /* 340 */ 1291, 1245, 1293, 1247, 1295, 1250, 1298, 1218, 1141, 1145, + /* 350 */ 1187, 1146, 1305, 1312, 1162, 1166, 1318, 1322, 1281, 1326, + /* 360 */ 1327, 1328, 1329, 1330, 1331, 1334, 1335, 1336, 1338, 1339, + /* 370 */ 1340, 1341, 1343, 1344, 1345, 1347, 1348, 1309, 1351, 1352, + /* 380 */ 1353, 1355, 1356, 1365, 1350, 1374, 1375, 1376, 1377, 1379, + /* 390 */ 1380, 1342, 1346, 1354, 1367, 1349, 1370, 1357, 1385, 1359, + /* 400 */ 1361, 1387, 1388, 1389, 1362, 1244, 1392, 1402, 1368, 1407, + /* 410 */ 1360, 1408, 1409, 1366, 1369, 1378, 1411, 1381, 1371, 1393, + /* 420 */ 1412, 1382, 1386, 1395, 1433, 1390, 1394, 1398, 1438, 1441, + /* 430 */ 1443, 1444, 1314, 1358, 1400, 1423, 1448, 1403, 1406, 1421, + /* 440 */ 1424, 1410, 1414, 1425, 1427, 1428, 1449, 1436, 1466, 1462, + /* 450 */ 1422, 1485, 1465, 1442, 1488, 1471, 1492, 1472, 1475, 1496, + /* 460 */ 1363, 1450, 1498, 1372, 1477, 1373, 1397, 1501, 1502, 1505, + /* 470 */ 1401, 1506, 1434, 1480, 1383, 1478, 1479, 1315, 1452, 1494, + /* 480 */ 1455, 1459, 1461, 1464, 1467, 1507, 1499, 1503, 1469, 1510, + /* 490 */ 1384, 1473, 1483, 1520, 1396, 1513, 1524, 1487, 1529, 1391, + /* 500 */ 1489, 1525, 1526, 1527, 1528, 1530, 1531, 1489, 1574, 1399, + /* 510 */ 1538, 1500, 1504, 1512, 1537, 1511, 1515, 1540, 1575, 1418, + /* 520 */ 1534, 1532, 1536, 1535, 1539, 1468, 1542, 1608, 1572, 1481, + /* 530 */ 1543, 1519, 1568, 1581, 1545, 1546, 1548, 1597, 1549, 1541, + /* 540 */ 1550, 1580, 1589, 1564, 1566, 1599, 1569, 1567, 1604, 1571, + /* 550 */ 1573, 1607, 1577, 1578, 1609, 1582, 1554, 1556, 1559, 1560, + /* 560 */ 1645, 1576, 1585, 1587, 1623, 1590, 1518, 1650, 1617, 1615, + /* 570 */ 1638, 1622, 1610, 1646, 1641, 1647, 1648, 1649, 1652, 1669, + /* 580 */ 1653, 1654, 1628, 1410, 1655, 1414, 1656, 1657, 1658, 1659, + /* 590 */ 1660, 1662, 1710, 1664, 1670, 1679, 1723, 1680, 1681, 1691, + /* 600 */ 1730, 1684, 1693, 1703, 1750, 1695, 1698, 1707, 1745, 1699, + /* 610 */ 1701, 1748, 1751, 1732, 1731, 1733, 1734, 1736, 1738, }; -#define YY_REDUCE_COUNT (254) -#define YY_REDUCE_MIN (-323) -#define YY_REDUCE_MAX (1799) +#define YY_REDUCE_COUNT (255) +#define YY_REDUCE_MIN (-324) +#define YY_REDUCE_MAX (1796) static const short yy_reduce_ofst[] = { - /* 0 */ 14, -240, 61, 483, 543, 661, 693, 725, 776, 806, - /* 10 */ -177, 921, 940, 999, 1008, 1090, 1099, 1151, 1210, 1242, - /* 20 */ 1258, 1318, 1358, 1369, 1409, 1422, 1475, 1508, 1523, 1556, - /* 30 */ 1571, 1611, 1651, 1662, 1702, 1715, 1766, 1799, 1416, 1789, - /* 40 */ 94, -212, 435, -269, -265, -263, -175, -283, -3, 47, - /* 50 */ 306, 307, -90, -42, -254, -191, 67, -225, -198, 46, - /* 60 */ 205, 310, 337, 343, 65, 342, 344, 68, 233, -189, - /* 70 */ 242, 455, 462, 243, 465, 338, 284, 171, 380, 478, - /* 80 */ -224, -241, -323, -323, -323, -65, 63, 272, 281, 354, - /* 90 */ 355, 357, 369, 439, 440, 463, 470, 486, 512, 515, - /* 100 */ 522, 527, 530, 535, 540, 544, -117, -246, 302, 367, - /* 110 */ -123, -231, -251, 449, 453, 73, 260, 366, 289, 375, - /* 120 */ 332, 262, 390, 397, -260, 487, 503, 519, 537, 570, - /* 130 */ 573, 552, 629, 622, 531, 564, 585, 572, 647, 647, - /* 140 */ 685, 684, 659, 625, 606, 606, 606, 592, 595, 597, - /* 150 */ 611, 647, 648, 707, 656, 708, 667, 720, 723, 704, - /* 160 */ 709, 710, 742, 752, 753, 697, 747, 716, 760, 727, - /* 170 */ 728, 770, 729, 773, 750, 743, 777, 789, 784, 791, - /* 180 */ 812, 780, 785, 787, 788, 790, 793, 796, 797, 799, - /* 190 */ 800, 807, 810, 821, 769, 768, 820, 778, 794, 823, - /* 200 */ 829, 783, 834, 809, 792, 844, 786, 754, 813, 815, - /* 210 */ 755, 819, 824, 832, 647, 761, 766, 772, 822, 606, - /* 220 */ 839, 841, 835, 808, 814, 828, 836, 838, 840, 842, - /* 230 */ 837, 861, 866, 867, 862, 873, 878, 892, 882, 920, - /* 240 */ 907, 928, 896, 909, 924, 936, 935, 948, 888, 891, - /* 250 */ 932, 933, 937, 945, 960, + /* 0 */ 162, -241, 278, 439, 663, 725, 757, 817, 849, 900, + /* 10 */ -178, 930, 561, 963, 993, 505, 1044, 1053, 1107, 1147, + /* 20 */ 1163, 1211, 1243, 1273, 1324, 1364, 1404, 1419, 1470, 1482, + /* 30 */ 1522, 1533, 1584, 1614, 1644, 1676, 1709, 1742, 1766, 1796, + /* 40 */ 282, -213, 578, -270, -266, -264, -176, -284, 281, 424, + /* 50 */ 306, 362, -91, -46, -255, -192, 71, -226, -199, 150, + /* 60 */ 302, 324, 463, 467, -1, 471, 485, 28, 45, -190, + /* 70 */ 56, 528, 531, 197, 481, 192, 352, 100, 196, 538, + /* 80 */ -225, -242, -324, -324, -324, -64, -48, 77, 168, 257, + /* 90 */ 311, 315, 341, 416, 441, 465, 498, 502, 518, 546, + /* 100 */ 554, 559, 560, 565, 612, 643, 97, -247, 75, 140, + /* 110 */ -125, -232, -252, -204, -37, -100, 106, 142, 394, 512, + /* 120 */ 573, 218, 284, 453, -261, 294, 325, 330, 335, 444, + /* 130 */ 557, 271, 381, 582, 503, 572, 639, 610, 684, 684, + /* 140 */ 720, 744, 689, 685, 661, 661, 661, 649, 653, 655, + /* 150 */ 669, 684, 713, 773, 718, 769, 729, 781, 782, 746, + /* 160 */ 770, 774, 801, 816, 820, 760, 811, 779, 814, 784, + /* 170 */ 780, 827, 786, 832, 810, 803, 836, 839, 847, 843, + /* 180 */ 854, 829, 830, 831, 833, 834, 837, 840, 841, 842, + /* 190 */ 844, 845, 853, 862, 821, 824, 818, 865, 822, 835, + /* 200 */ 868, 879, 851, 870, 857, 860, 886, 846, 804, 863, + /* 210 */ 856, 805, 866, 861, 877, 684, 823, 828, 848, 869, + /* 220 */ 661, 896, 871, 864, 858, 850, 852, 874, 878, 881, + /* 230 */ 880, 882, 893, 898, 899, 901, 904, 895, 920, 912, + /* 240 */ 968, 938, 969, 928, 950, 971, 977, 973, 984, 937, + /* 250 */ 925, 972, 989, 994, 987, 1008, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 10 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 20 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 30 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 40 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 50 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 60 */ 1357, 1357, 1357, 1357, 1426, 1357, 1357, 1357, 1357, 1357, - /* 70 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 80 */ 1424, 1564, 1357, 1730, 1357, 1357, 1357, 1357, 1357, 1357, - /* 90 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 100 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 110 */ 1426, 1357, 1741, 1741, 1741, 1424, 1357, 1357, 1357, 1357, - /* 120 */ 1357, 1357, 1520, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 130 */ 1357, 1600, 1357, 1357, 1807, 1357, 1606, 1765, 1357, 1357, - /* 140 */ 1357, 1357, 1473, 1757, 1733, 1747, 1734, 1792, 1792, 1792, - /* 150 */ 1750, 1357, 1761, 1357, 1357, 1357, 1592, 1357, 1357, 1569, - /* 160 */ 1566, 1566, 1357, 1357, 1357, 1357, 1426, 1357, 1426, 1357, - /* 170 */ 1357, 1426, 1357, 1426, 1357, 1357, 1426, 1426, 1357, 1426, - /* 180 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 190 */ 1357, 1357, 1357, 1357, 1357, 1357, 1424, 1602, 1357, 1424, - /* 200 */ 1357, 1357, 1424, 1357, 1357, 1424, 1357, 1772, 1770, 1357, - /* 210 */ 1772, 1770, 1357, 1357, 1357, 1784, 1780, 1763, 1761, 1747, - /* 220 */ 1357, 1357, 1357, 1798, 1794, 1810, 1798, 1794, 1798, 1794, - /* 230 */ 1357, 1770, 1357, 1357, 1770, 1357, 1577, 1357, 1357, 1424, - /* 240 */ 1357, 1424, 1357, 1489, 1357, 1357, 1424, 1357, 1594, 1608, - /* 250 */ 1523, 1523, 1523, 1427, 1362, 1357, 1357, 1357, 1357, 1357, - /* 260 */ 1357, 1357, 1357, 1357, 1357, 1357, 1674, 1783, 1782, 1706, - /* 270 */ 1705, 1704, 1702, 1673, 1485, 1357, 1357, 1357, 1357, 1357, - /* 280 */ 1667, 1668, 1666, 1665, 1357, 1357, 1357, 1357, 1357, 1357, - /* 290 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1731, 1357, - /* 300 */ 1795, 1799, 1357, 1357, 1357, 1650, 1357, 1357, 1357, 1357, - /* 310 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 320 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 330 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 340 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 350 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 360 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 370 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 380 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 390 */ 1357, 1357, 1391, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 400 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 410 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 420 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 430 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 440 */ 1454, 1453, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 450 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 460 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 470 */ 1357, 1357, 1357, 1357, 1754, 1764, 1357, 1357, 1357, 1357, - /* 480 */ 1357, 1357, 1357, 1357, 1357, 1357, 1650, 1357, 1781, 1357, - /* 490 */ 1740, 1736, 1357, 1357, 1732, 1357, 1357, 1793, 1357, 1357, - /* 500 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1726, 1357, 1699, - /* 510 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1661, 1357, - /* 520 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 530 */ 1357, 1649, 1357, 1690, 1357, 1357, 1357, 1357, 1357, 1357, - /* 540 */ 1357, 1357, 1517, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 550 */ 1357, 1357, 1357, 1357, 1357, 1502, 1500, 1499, 1498, 1357, - /* 560 */ 1495, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 570 */ 1357, 1357, 1446, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 580 */ 1357, 1357, 1437, 1357, 1436, 1357, 1357, 1357, 1357, 1357, - /* 590 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 600 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, - /* 610 */ 1357, 1357, 1357, 1357, 1357, 1357, 1357, 1357, + /* 0 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 10 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 20 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 30 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 40 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 50 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 60 */ 1360, 1360, 1360, 1360, 1429, 1360, 1360, 1360, 1360, 1360, + /* 70 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 80 */ 1427, 1567, 1360, 1734, 1360, 1360, 1360, 1360, 1360, 1360, + /* 90 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 100 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 110 */ 1429, 1360, 1745, 1745, 1745, 1427, 1360, 1360, 1360, 1360, + /* 120 */ 1360, 1360, 1523, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 130 */ 1360, 1603, 1360, 1360, 1811, 1360, 1609, 1769, 1360, 1360, + /* 140 */ 1360, 1360, 1476, 1761, 1737, 1751, 1738, 1796, 1796, 1796, + /* 150 */ 1754, 1360, 1765, 1360, 1360, 1360, 1595, 1360, 1360, 1572, + /* 160 */ 1569, 1569, 1360, 1360, 1360, 1360, 1429, 1360, 1429, 1360, + /* 170 */ 1360, 1429, 1360, 1429, 1360, 1360, 1429, 1429, 1360, 1429, + /* 180 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 190 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1427, 1605, 1360, + /* 200 */ 1427, 1360, 1360, 1427, 1360, 1360, 1427, 1360, 1776, 1774, + /* 210 */ 1360, 1776, 1774, 1360, 1360, 1360, 1788, 1784, 1767, 1765, + /* 220 */ 1751, 1360, 1360, 1360, 1802, 1798, 1814, 1802, 1798, 1802, + /* 230 */ 1798, 1360, 1774, 1360, 1360, 1774, 1360, 1580, 1360, 1360, + /* 240 */ 1427, 1360, 1427, 1360, 1492, 1360, 1360, 1427, 1360, 1597, + /* 250 */ 1611, 1526, 1526, 1526, 1430, 1365, 1360, 1360, 1360, 1360, + /* 260 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1678, 1787, 1786, + /* 270 */ 1710, 1709, 1708, 1706, 1677, 1488, 1360, 1360, 1360, 1360, + /* 280 */ 1360, 1360, 1671, 1672, 1670, 1669, 1360, 1360, 1360, 1360, + /* 290 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1735, + /* 300 */ 1360, 1799, 1803, 1360, 1360, 1360, 1654, 1360, 1360, 1360, + /* 310 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 320 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 330 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 340 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 350 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 360 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 370 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 380 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 390 */ 1360, 1360, 1360, 1394, 1360, 1360, 1360, 1360, 1360, 1360, + /* 400 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 410 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 420 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 430 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 440 */ 1360, 1457, 1456, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 450 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 460 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 470 */ 1360, 1360, 1360, 1360, 1360, 1758, 1768, 1360, 1360, 1360, + /* 480 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1654, 1360, 1785, + /* 490 */ 1360, 1744, 1740, 1360, 1360, 1736, 1360, 1360, 1797, 1360, + /* 500 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1730, 1360, + /* 510 */ 1703, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1665, + /* 520 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 530 */ 1360, 1360, 1653, 1360, 1694, 1360, 1360, 1360, 1360, 1360, + /* 540 */ 1360, 1360, 1360, 1520, 1360, 1360, 1360, 1360, 1360, 1360, + /* 550 */ 1360, 1360, 1360, 1360, 1360, 1360, 1505, 1503, 1502, 1501, + /* 560 */ 1360, 1498, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 570 */ 1360, 1360, 1360, 1449, 1360, 1360, 1360, 1360, 1360, 1360, + /* 580 */ 1360, 1360, 1360, 1440, 1360, 1439, 1360, 1360, 1360, 1360, + /* 590 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 600 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, + /* 610 */ 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, 1360, }; /********** End of lemon-generated parsing tables *****************************/ @@ -999,6 +1004,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* TRIGGER => nothing */ 0, /* AT_ONCE => nothing */ 0, /* WINDOW_CLOSE => nothing */ + 0, /* MAX_DELAY => nothing */ 0, /* WATERMARK => nothing */ 0, /* KILL => nothing */ 0, /* CONNECTION => nothing */ @@ -1063,12 +1069,12 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ID => nothing */ - 232, /* NK_BITNOT => ID */ - 232, /* INSERT => ID */ - 232, /* VALUES => ID */ - 232, /* IMPORT => ID */ - 232, /* NK_SEMI => ID */ - 232, /* FILE => ID */ + 233, /* NK_BITNOT => ID */ + 233, /* INSERT => ID */ + 233, /* VALUES => ID */ + 233, /* IMPORT => ID */ + 233, /* NK_SEMI => ID */ + 233, /* FILE => ID */ }; #endif /* YYFALLBACK */ @@ -1325,196 +1331,197 @@ static const char *const yyTokenName[] = { /* 166 */ "TRIGGER", /* 167 */ "AT_ONCE", /* 168 */ "WINDOW_CLOSE", - /* 169 */ "WATERMARK", - /* 170 */ "KILL", - /* 171 */ "CONNECTION", - /* 172 */ "TRANSACTION", - /* 173 */ "BALANCE", - /* 174 */ "VGROUP", - /* 175 */ "MERGE", - /* 176 */ "REDISTRIBUTE", - /* 177 */ "SPLIT", - /* 178 */ "SYNCDB", - /* 179 */ "DELETE", - /* 180 */ "NULL", - /* 181 */ "NK_QUESTION", - /* 182 */ "NK_ARROW", - /* 183 */ "ROWTS", - /* 184 */ "TBNAME", - /* 185 */ "QSTARTTS", - /* 186 */ "QENDTS", - /* 187 */ "WSTARTTS", - /* 188 */ "WENDTS", - /* 189 */ "WDURATION", - /* 190 */ "CAST", - /* 191 */ "NOW", - /* 192 */ "TODAY", - /* 193 */ "TIMEZONE", - /* 194 */ "COUNT", - /* 195 */ "FIRST", - /* 196 */ "LAST", - /* 197 */ "LAST_ROW", - /* 198 */ "BETWEEN", - /* 199 */ "IS", - /* 200 */ "NK_LT", - /* 201 */ "NK_GT", - /* 202 */ "NK_LE", - /* 203 */ "NK_GE", - /* 204 */ "NK_NE", - /* 205 */ "MATCH", - /* 206 */ "NMATCH", - /* 207 */ "CONTAINS", - /* 208 */ "JOIN", - /* 209 */ "INNER", - /* 210 */ "SELECT", - /* 211 */ "DISTINCT", - /* 212 */ "WHERE", - /* 213 */ "PARTITION", - /* 214 */ "BY", - /* 215 */ "SESSION", - /* 216 */ "STATE_WINDOW", - /* 217 */ "SLIDING", - /* 218 */ "FILL", - /* 219 */ "VALUE", - /* 220 */ "NONE", - /* 221 */ "PREV", - /* 222 */ "LINEAR", - /* 223 */ "NEXT", - /* 224 */ "HAVING", - /* 225 */ "ORDER", - /* 226 */ "SLIMIT", - /* 227 */ "SOFFSET", - /* 228 */ "LIMIT", - /* 229 */ "OFFSET", - /* 230 */ "ASC", - /* 231 */ "NULLS", - /* 232 */ "ID", - /* 233 */ "NK_BITNOT", - /* 234 */ "INSERT", - /* 235 */ "VALUES", - /* 236 */ "IMPORT", - /* 237 */ "NK_SEMI", - /* 238 */ "FILE", - /* 239 */ "cmd", - /* 240 */ "account_options", - /* 241 */ "alter_account_options", - /* 242 */ "literal", - /* 243 */ "alter_account_option", - /* 244 */ "user_name", - /* 245 */ "privileges", - /* 246 */ "priv_level", - /* 247 */ "priv_type_list", - /* 248 */ "priv_type", - /* 249 */ "db_name", - /* 250 */ "dnode_endpoint", - /* 251 */ "dnode_host_name", - /* 252 */ "not_exists_opt", - /* 253 */ "db_options", - /* 254 */ "exists_opt", - /* 255 */ "alter_db_options", - /* 256 */ "integer_list", - /* 257 */ "variable_list", - /* 258 */ "retention_list", - /* 259 */ "alter_db_option", - /* 260 */ "retention", - /* 261 */ "full_table_name", - /* 262 */ "column_def_list", - /* 263 */ "tags_def_opt", - /* 264 */ "table_options", - /* 265 */ "multi_create_clause", - /* 266 */ "tags_def", - /* 267 */ "multi_drop_clause", - /* 268 */ "alter_table_clause", - /* 269 */ "alter_table_options", - /* 270 */ "column_name", - /* 271 */ "type_name", - /* 272 */ "signed_literal", - /* 273 */ "create_subtable_clause", - /* 274 */ "specific_tags_opt", - /* 275 */ "literal_list", - /* 276 */ "drop_table_clause", - /* 277 */ "col_name_list", - /* 278 */ "table_name", - /* 279 */ "column_def", - /* 280 */ "func_name_list", - /* 281 */ "alter_table_option", - /* 282 */ "col_name", - /* 283 */ "db_name_cond_opt", - /* 284 */ "like_pattern_opt", - /* 285 */ "table_name_cond", - /* 286 */ "from_db_opt", - /* 287 */ "func_name", - /* 288 */ "function_name", - /* 289 */ "index_name", - /* 290 */ "index_options", - /* 291 */ "func_list", - /* 292 */ "duration_literal", - /* 293 */ "sliding_opt", - /* 294 */ "func", - /* 295 */ "expression_list", - /* 296 */ "topic_name", - /* 297 */ "query_expression", - /* 298 */ "cgroup_name", - /* 299 */ "analyze_opt", - /* 300 */ "explain_options", - /* 301 */ "agg_func_opt", - /* 302 */ "bufsize_opt", - /* 303 */ "stream_name", - /* 304 */ "stream_options", - /* 305 */ "into_opt", - /* 306 */ "dnode_list", - /* 307 */ "where_clause_opt", - /* 308 */ "signed", - /* 309 */ "literal_func", - /* 310 */ "table_alias", - /* 311 */ "column_alias", - /* 312 */ "expression", - /* 313 */ "pseudo_column", - /* 314 */ "column_reference", - /* 315 */ "function_expression", - /* 316 */ "subquery", - /* 317 */ "star_func", - /* 318 */ "star_func_para_list", - /* 319 */ "noarg_func", - /* 320 */ "other_para_list", - /* 321 */ "star_func_para", - /* 322 */ "predicate", - /* 323 */ "compare_op", - /* 324 */ "in_op", - /* 325 */ "in_predicate_value", - /* 326 */ "boolean_value_expression", - /* 327 */ "boolean_primary", - /* 328 */ "common_expression", - /* 329 */ "from_clause", - /* 330 */ "table_reference_list", - /* 331 */ "table_reference", - /* 332 */ "table_primary", - /* 333 */ "joined_table", - /* 334 */ "alias_opt", - /* 335 */ "parenthesized_joined_table", - /* 336 */ "join_type", - /* 337 */ "search_condition", - /* 338 */ "query_specification", - /* 339 */ "set_quantifier_opt", - /* 340 */ "select_list", - /* 341 */ "partition_by_clause_opt", - /* 342 */ "twindow_clause_opt", - /* 343 */ "group_by_clause_opt", - /* 344 */ "having_clause_opt", - /* 345 */ "select_sublist", - /* 346 */ "select_item", - /* 347 */ "fill_opt", - /* 348 */ "fill_mode", - /* 349 */ "group_by_list", - /* 350 */ "query_expression_body", - /* 351 */ "order_by_clause_opt", - /* 352 */ "slimit_clause_opt", - /* 353 */ "limit_clause_opt", - /* 354 */ "query_primary", - /* 355 */ "sort_specification_list", - /* 356 */ "sort_specification", - /* 357 */ "ordering_specification_opt", - /* 358 */ "null_ordering_opt", + /* 169 */ "MAX_DELAY", + /* 170 */ "WATERMARK", + /* 171 */ "KILL", + /* 172 */ "CONNECTION", + /* 173 */ "TRANSACTION", + /* 174 */ "BALANCE", + /* 175 */ "VGROUP", + /* 176 */ "MERGE", + /* 177 */ "REDISTRIBUTE", + /* 178 */ "SPLIT", + /* 179 */ "SYNCDB", + /* 180 */ "DELETE", + /* 181 */ "NULL", + /* 182 */ "NK_QUESTION", + /* 183 */ "NK_ARROW", + /* 184 */ "ROWTS", + /* 185 */ "TBNAME", + /* 186 */ "QSTARTTS", + /* 187 */ "QENDTS", + /* 188 */ "WSTARTTS", + /* 189 */ "WENDTS", + /* 190 */ "WDURATION", + /* 191 */ "CAST", + /* 192 */ "NOW", + /* 193 */ "TODAY", + /* 194 */ "TIMEZONE", + /* 195 */ "COUNT", + /* 196 */ "FIRST", + /* 197 */ "LAST", + /* 198 */ "LAST_ROW", + /* 199 */ "BETWEEN", + /* 200 */ "IS", + /* 201 */ "NK_LT", + /* 202 */ "NK_GT", + /* 203 */ "NK_LE", + /* 204 */ "NK_GE", + /* 205 */ "NK_NE", + /* 206 */ "MATCH", + /* 207 */ "NMATCH", + /* 208 */ "CONTAINS", + /* 209 */ "JOIN", + /* 210 */ "INNER", + /* 211 */ "SELECT", + /* 212 */ "DISTINCT", + /* 213 */ "WHERE", + /* 214 */ "PARTITION", + /* 215 */ "BY", + /* 216 */ "SESSION", + /* 217 */ "STATE_WINDOW", + /* 218 */ "SLIDING", + /* 219 */ "FILL", + /* 220 */ "VALUE", + /* 221 */ "NONE", + /* 222 */ "PREV", + /* 223 */ "LINEAR", + /* 224 */ "NEXT", + /* 225 */ "HAVING", + /* 226 */ "ORDER", + /* 227 */ "SLIMIT", + /* 228 */ "SOFFSET", + /* 229 */ "LIMIT", + /* 230 */ "OFFSET", + /* 231 */ "ASC", + /* 232 */ "NULLS", + /* 233 */ "ID", + /* 234 */ "NK_BITNOT", + /* 235 */ "INSERT", + /* 236 */ "VALUES", + /* 237 */ "IMPORT", + /* 238 */ "NK_SEMI", + /* 239 */ "FILE", + /* 240 */ "cmd", + /* 241 */ "account_options", + /* 242 */ "alter_account_options", + /* 243 */ "literal", + /* 244 */ "alter_account_option", + /* 245 */ "user_name", + /* 246 */ "privileges", + /* 247 */ "priv_level", + /* 248 */ "priv_type_list", + /* 249 */ "priv_type", + /* 250 */ "db_name", + /* 251 */ "dnode_endpoint", + /* 252 */ "dnode_host_name", + /* 253 */ "not_exists_opt", + /* 254 */ "db_options", + /* 255 */ "exists_opt", + /* 256 */ "alter_db_options", + /* 257 */ "integer_list", + /* 258 */ "variable_list", + /* 259 */ "retention_list", + /* 260 */ "alter_db_option", + /* 261 */ "retention", + /* 262 */ "full_table_name", + /* 263 */ "column_def_list", + /* 264 */ "tags_def_opt", + /* 265 */ "table_options", + /* 266 */ "multi_create_clause", + /* 267 */ "tags_def", + /* 268 */ "multi_drop_clause", + /* 269 */ "alter_table_clause", + /* 270 */ "alter_table_options", + /* 271 */ "column_name", + /* 272 */ "type_name", + /* 273 */ "signed_literal", + /* 274 */ "create_subtable_clause", + /* 275 */ "specific_tags_opt", + /* 276 */ "literal_list", + /* 277 */ "drop_table_clause", + /* 278 */ "col_name_list", + /* 279 */ "table_name", + /* 280 */ "column_def", + /* 281 */ "func_name_list", + /* 282 */ "alter_table_option", + /* 283 */ "col_name", + /* 284 */ "db_name_cond_opt", + /* 285 */ "like_pattern_opt", + /* 286 */ "table_name_cond", + /* 287 */ "from_db_opt", + /* 288 */ "func_name", + /* 289 */ "function_name", + /* 290 */ "index_name", + /* 291 */ "index_options", + /* 292 */ "func_list", + /* 293 */ "duration_literal", + /* 294 */ "sliding_opt", + /* 295 */ "func", + /* 296 */ "expression_list", + /* 297 */ "topic_name", + /* 298 */ "query_expression", + /* 299 */ "cgroup_name", + /* 300 */ "analyze_opt", + /* 301 */ "explain_options", + /* 302 */ "agg_func_opt", + /* 303 */ "bufsize_opt", + /* 304 */ "stream_name", + /* 305 */ "stream_options", + /* 306 */ "into_opt", + /* 307 */ "dnode_list", + /* 308 */ "where_clause_opt", + /* 309 */ "signed", + /* 310 */ "literal_func", + /* 311 */ "table_alias", + /* 312 */ "column_alias", + /* 313 */ "expression", + /* 314 */ "pseudo_column", + /* 315 */ "column_reference", + /* 316 */ "function_expression", + /* 317 */ "subquery", + /* 318 */ "star_func", + /* 319 */ "star_func_para_list", + /* 320 */ "noarg_func", + /* 321 */ "other_para_list", + /* 322 */ "star_func_para", + /* 323 */ "predicate", + /* 324 */ "compare_op", + /* 325 */ "in_op", + /* 326 */ "in_predicate_value", + /* 327 */ "boolean_value_expression", + /* 328 */ "boolean_primary", + /* 329 */ "common_expression", + /* 330 */ "from_clause", + /* 331 */ "table_reference_list", + /* 332 */ "table_reference", + /* 333 */ "table_primary", + /* 334 */ "joined_table", + /* 335 */ "alias_opt", + /* 336 */ "parenthesized_joined_table", + /* 337 */ "join_type", + /* 338 */ "search_condition", + /* 339 */ "query_specification", + /* 340 */ "set_quantifier_opt", + /* 341 */ "select_list", + /* 342 */ "partition_by_clause_opt", + /* 343 */ "twindow_clause_opt", + /* 344 */ "group_by_clause_opt", + /* 345 */ "having_clause_opt", + /* 346 */ "select_sublist", + /* 347 */ "select_item", + /* 348 */ "fill_opt", + /* 349 */ "fill_mode", + /* 350 */ "group_by_list", + /* 351 */ "query_expression_body", + /* 352 */ "order_by_clause_opt", + /* 353 */ "slimit_clause_opt", + /* 354 */ "limit_clause_opt", + /* 355 */ "query_primary", + /* 356 */ "sort_specification_list", + /* 357 */ "sort_specification", + /* 358 */ "ordering_specification_opt", + /* 359 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -1773,208 +1780,209 @@ static const char *const yyRuleName[] = { /* 248 */ "stream_options ::=", /* 249 */ "stream_options ::= stream_options TRIGGER AT_ONCE", /* 250 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 251 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 252 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 253 */ "cmd ::= KILL QUERY NK_INTEGER", - /* 254 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 255 */ "cmd ::= BALANCE VGROUP", - /* 256 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 257 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 258 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 259 */ "dnode_list ::= DNODE NK_INTEGER", - /* 260 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 261 */ "cmd ::= SYNCDB db_name REPLICA", - /* 262 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 263 */ "cmd ::= query_expression", - /* 264 */ "literal ::= NK_INTEGER", - /* 265 */ "literal ::= NK_FLOAT", - /* 266 */ "literal ::= NK_STRING", - /* 267 */ "literal ::= NK_BOOL", - /* 268 */ "literal ::= TIMESTAMP NK_STRING", - /* 269 */ "literal ::= duration_literal", - /* 270 */ "literal ::= NULL", - /* 271 */ "literal ::= NK_QUESTION", - /* 272 */ "duration_literal ::= NK_VARIABLE", - /* 273 */ "signed ::= NK_INTEGER", - /* 274 */ "signed ::= NK_PLUS NK_INTEGER", - /* 275 */ "signed ::= NK_MINUS NK_INTEGER", - /* 276 */ "signed ::= NK_FLOAT", - /* 277 */ "signed ::= NK_PLUS NK_FLOAT", - /* 278 */ "signed ::= NK_MINUS NK_FLOAT", - /* 279 */ "signed_literal ::= signed", - /* 280 */ "signed_literal ::= NK_STRING", - /* 281 */ "signed_literal ::= NK_BOOL", - /* 282 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 283 */ "signed_literal ::= duration_literal", - /* 284 */ "signed_literal ::= NULL", - /* 285 */ "signed_literal ::= literal_func", - /* 286 */ "literal_list ::= signed_literal", - /* 287 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 288 */ "db_name ::= NK_ID", - /* 289 */ "table_name ::= NK_ID", - /* 290 */ "column_name ::= NK_ID", - /* 291 */ "function_name ::= NK_ID", - /* 292 */ "table_alias ::= NK_ID", - /* 293 */ "column_alias ::= NK_ID", - /* 294 */ "user_name ::= NK_ID", - /* 295 */ "index_name ::= NK_ID", - /* 296 */ "topic_name ::= NK_ID", - /* 297 */ "stream_name ::= NK_ID", - /* 298 */ "cgroup_name ::= NK_ID", - /* 299 */ "expression ::= literal", - /* 300 */ "expression ::= pseudo_column", - /* 301 */ "expression ::= column_reference", - /* 302 */ "expression ::= function_expression", - /* 303 */ "expression ::= subquery", - /* 304 */ "expression ::= NK_LP expression NK_RP", - /* 305 */ "expression ::= NK_PLUS expression", - /* 306 */ "expression ::= NK_MINUS expression", - /* 307 */ "expression ::= expression NK_PLUS expression", - /* 308 */ "expression ::= expression NK_MINUS expression", - /* 309 */ "expression ::= expression NK_STAR expression", - /* 310 */ "expression ::= expression NK_SLASH expression", - /* 311 */ "expression ::= expression NK_REM expression", - /* 312 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 313 */ "expression_list ::= expression", - /* 314 */ "expression_list ::= expression_list NK_COMMA expression", - /* 315 */ "column_reference ::= column_name", - /* 316 */ "column_reference ::= table_name NK_DOT column_name", - /* 317 */ "pseudo_column ::= ROWTS", - /* 318 */ "pseudo_column ::= TBNAME", - /* 319 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 320 */ "pseudo_column ::= QSTARTTS", - /* 321 */ "pseudo_column ::= QENDTS", - /* 322 */ "pseudo_column ::= WSTARTTS", - /* 323 */ "pseudo_column ::= WENDTS", - /* 324 */ "pseudo_column ::= WDURATION", - /* 325 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 326 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 327 */ "function_expression ::= CAST NK_LP expression AS type_name NK_RP", - /* 328 */ "function_expression ::= literal_func", - /* 329 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 330 */ "literal_func ::= NOW", - /* 331 */ "noarg_func ::= NOW", - /* 332 */ "noarg_func ::= TODAY", - /* 333 */ "noarg_func ::= TIMEZONE", - /* 334 */ "star_func ::= COUNT", - /* 335 */ "star_func ::= FIRST", - /* 336 */ "star_func ::= LAST", - /* 337 */ "star_func ::= LAST_ROW", - /* 338 */ "star_func_para_list ::= NK_STAR", - /* 339 */ "star_func_para_list ::= other_para_list", - /* 340 */ "other_para_list ::= star_func_para", - /* 341 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 342 */ "star_func_para ::= expression", - /* 343 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 344 */ "predicate ::= expression compare_op expression", - /* 345 */ "predicate ::= expression BETWEEN expression AND expression", - /* 346 */ "predicate ::= expression NOT BETWEEN expression AND expression", - /* 347 */ "predicate ::= expression IS NULL", - /* 348 */ "predicate ::= expression IS NOT NULL", - /* 349 */ "predicate ::= expression in_op in_predicate_value", - /* 350 */ "compare_op ::= NK_LT", - /* 351 */ "compare_op ::= NK_GT", - /* 352 */ "compare_op ::= NK_LE", - /* 353 */ "compare_op ::= NK_GE", - /* 354 */ "compare_op ::= NK_NE", - /* 355 */ "compare_op ::= NK_EQ", - /* 356 */ "compare_op ::= LIKE", - /* 357 */ "compare_op ::= NOT LIKE", - /* 358 */ "compare_op ::= MATCH", - /* 359 */ "compare_op ::= NMATCH", - /* 360 */ "compare_op ::= CONTAINS", - /* 361 */ "in_op ::= IN", - /* 362 */ "in_op ::= NOT IN", - /* 363 */ "in_predicate_value ::= NK_LP expression_list NK_RP", - /* 364 */ "boolean_value_expression ::= boolean_primary", - /* 365 */ "boolean_value_expression ::= NOT boolean_primary", - /* 366 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 367 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 368 */ "boolean_primary ::= predicate", - /* 369 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 370 */ "common_expression ::= expression", - /* 371 */ "common_expression ::= boolean_value_expression", - /* 372 */ "from_clause ::= FROM table_reference_list", - /* 373 */ "table_reference_list ::= table_reference", - /* 374 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 375 */ "table_reference ::= table_primary", - /* 376 */ "table_reference ::= joined_table", - /* 377 */ "table_primary ::= table_name alias_opt", - /* 378 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 379 */ "table_primary ::= subquery alias_opt", - /* 380 */ "table_primary ::= parenthesized_joined_table", - /* 381 */ "alias_opt ::=", - /* 382 */ "alias_opt ::= table_alias", - /* 383 */ "alias_opt ::= AS table_alias", - /* 384 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 385 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 386 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 387 */ "join_type ::=", - /* 388 */ "join_type ::= INNER", - /* 389 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt", - /* 390 */ "set_quantifier_opt ::=", - /* 391 */ "set_quantifier_opt ::= DISTINCT", - /* 392 */ "set_quantifier_opt ::= ALL", - /* 393 */ "select_list ::= NK_STAR", - /* 394 */ "select_list ::= select_sublist", - /* 395 */ "select_sublist ::= select_item", - /* 396 */ "select_sublist ::= select_sublist NK_COMMA select_item", - /* 397 */ "select_item ::= common_expression", - /* 398 */ "select_item ::= common_expression column_alias", - /* 399 */ "select_item ::= common_expression AS column_alias", - /* 400 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 401 */ "where_clause_opt ::=", - /* 402 */ "where_clause_opt ::= WHERE search_condition", - /* 403 */ "partition_by_clause_opt ::=", - /* 404 */ "partition_by_clause_opt ::= PARTITION BY expression_list", - /* 405 */ "twindow_clause_opt ::=", - /* 406 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 407 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP", - /* 408 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 409 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 410 */ "sliding_opt ::=", - /* 411 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 412 */ "fill_opt ::=", - /* 413 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 414 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", - /* 415 */ "fill_mode ::= NONE", - /* 416 */ "fill_mode ::= PREV", - /* 417 */ "fill_mode ::= NULL", - /* 418 */ "fill_mode ::= LINEAR", - /* 419 */ "fill_mode ::= NEXT", - /* 420 */ "group_by_clause_opt ::=", - /* 421 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 422 */ "group_by_list ::= expression", - /* 423 */ "group_by_list ::= group_by_list NK_COMMA expression", - /* 424 */ "having_clause_opt ::=", - /* 425 */ "having_clause_opt ::= HAVING search_condition", - /* 426 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 427 */ "query_expression_body ::= query_primary", - /* 428 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", - /* 429 */ "query_expression_body ::= query_expression_body UNION query_expression_body", - /* 430 */ "query_primary ::= query_specification", - /* 431 */ "query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP", - /* 432 */ "order_by_clause_opt ::=", - /* 433 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 434 */ "slimit_clause_opt ::=", - /* 435 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 436 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 437 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 438 */ "limit_clause_opt ::=", - /* 439 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 440 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 441 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 442 */ "subquery ::= NK_LP query_expression NK_RP", - /* 443 */ "search_condition ::= common_expression", - /* 444 */ "sort_specification_list ::= sort_specification", - /* 445 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 446 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", - /* 447 */ "ordering_specification_opt ::=", - /* 448 */ "ordering_specification_opt ::= ASC", - /* 449 */ "ordering_specification_opt ::= DESC", - /* 450 */ "null_ordering_opt ::=", - /* 451 */ "null_ordering_opt ::= NULLS FIRST", - /* 452 */ "null_ordering_opt ::= NULLS LAST", + /* 251 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 252 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 253 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 254 */ "cmd ::= KILL QUERY NK_INTEGER", + /* 255 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 256 */ "cmd ::= BALANCE VGROUP", + /* 257 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 258 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 259 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 260 */ "dnode_list ::= DNODE NK_INTEGER", + /* 261 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 262 */ "cmd ::= SYNCDB db_name REPLICA", + /* 263 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 264 */ "cmd ::= query_expression", + /* 265 */ "literal ::= NK_INTEGER", + /* 266 */ "literal ::= NK_FLOAT", + /* 267 */ "literal ::= NK_STRING", + /* 268 */ "literal ::= NK_BOOL", + /* 269 */ "literal ::= TIMESTAMP NK_STRING", + /* 270 */ "literal ::= duration_literal", + /* 271 */ "literal ::= NULL", + /* 272 */ "literal ::= NK_QUESTION", + /* 273 */ "duration_literal ::= NK_VARIABLE", + /* 274 */ "signed ::= NK_INTEGER", + /* 275 */ "signed ::= NK_PLUS NK_INTEGER", + /* 276 */ "signed ::= NK_MINUS NK_INTEGER", + /* 277 */ "signed ::= NK_FLOAT", + /* 278 */ "signed ::= NK_PLUS NK_FLOAT", + /* 279 */ "signed ::= NK_MINUS NK_FLOAT", + /* 280 */ "signed_literal ::= signed", + /* 281 */ "signed_literal ::= NK_STRING", + /* 282 */ "signed_literal ::= NK_BOOL", + /* 283 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 284 */ "signed_literal ::= duration_literal", + /* 285 */ "signed_literal ::= NULL", + /* 286 */ "signed_literal ::= literal_func", + /* 287 */ "literal_list ::= signed_literal", + /* 288 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 289 */ "db_name ::= NK_ID", + /* 290 */ "table_name ::= NK_ID", + /* 291 */ "column_name ::= NK_ID", + /* 292 */ "function_name ::= NK_ID", + /* 293 */ "table_alias ::= NK_ID", + /* 294 */ "column_alias ::= NK_ID", + /* 295 */ "user_name ::= NK_ID", + /* 296 */ "index_name ::= NK_ID", + /* 297 */ "topic_name ::= NK_ID", + /* 298 */ "stream_name ::= NK_ID", + /* 299 */ "cgroup_name ::= NK_ID", + /* 300 */ "expression ::= literal", + /* 301 */ "expression ::= pseudo_column", + /* 302 */ "expression ::= column_reference", + /* 303 */ "expression ::= function_expression", + /* 304 */ "expression ::= subquery", + /* 305 */ "expression ::= NK_LP expression NK_RP", + /* 306 */ "expression ::= NK_PLUS expression", + /* 307 */ "expression ::= NK_MINUS expression", + /* 308 */ "expression ::= expression NK_PLUS expression", + /* 309 */ "expression ::= expression NK_MINUS expression", + /* 310 */ "expression ::= expression NK_STAR expression", + /* 311 */ "expression ::= expression NK_SLASH expression", + /* 312 */ "expression ::= expression NK_REM expression", + /* 313 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 314 */ "expression_list ::= expression", + /* 315 */ "expression_list ::= expression_list NK_COMMA expression", + /* 316 */ "column_reference ::= column_name", + /* 317 */ "column_reference ::= table_name NK_DOT column_name", + /* 318 */ "pseudo_column ::= ROWTS", + /* 319 */ "pseudo_column ::= TBNAME", + /* 320 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 321 */ "pseudo_column ::= QSTARTTS", + /* 322 */ "pseudo_column ::= QENDTS", + /* 323 */ "pseudo_column ::= WSTARTTS", + /* 324 */ "pseudo_column ::= WENDTS", + /* 325 */ "pseudo_column ::= WDURATION", + /* 326 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 327 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 328 */ "function_expression ::= CAST NK_LP expression AS type_name NK_RP", + /* 329 */ "function_expression ::= literal_func", + /* 330 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 331 */ "literal_func ::= NOW", + /* 332 */ "noarg_func ::= NOW", + /* 333 */ "noarg_func ::= TODAY", + /* 334 */ "noarg_func ::= TIMEZONE", + /* 335 */ "star_func ::= COUNT", + /* 336 */ "star_func ::= FIRST", + /* 337 */ "star_func ::= LAST", + /* 338 */ "star_func ::= LAST_ROW", + /* 339 */ "star_func_para_list ::= NK_STAR", + /* 340 */ "star_func_para_list ::= other_para_list", + /* 341 */ "other_para_list ::= star_func_para", + /* 342 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 343 */ "star_func_para ::= expression", + /* 344 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 345 */ "predicate ::= expression compare_op expression", + /* 346 */ "predicate ::= expression BETWEEN expression AND expression", + /* 347 */ "predicate ::= expression NOT BETWEEN expression AND expression", + /* 348 */ "predicate ::= expression IS NULL", + /* 349 */ "predicate ::= expression IS NOT NULL", + /* 350 */ "predicate ::= expression in_op in_predicate_value", + /* 351 */ "compare_op ::= NK_LT", + /* 352 */ "compare_op ::= NK_GT", + /* 353 */ "compare_op ::= NK_LE", + /* 354 */ "compare_op ::= NK_GE", + /* 355 */ "compare_op ::= NK_NE", + /* 356 */ "compare_op ::= NK_EQ", + /* 357 */ "compare_op ::= LIKE", + /* 358 */ "compare_op ::= NOT LIKE", + /* 359 */ "compare_op ::= MATCH", + /* 360 */ "compare_op ::= NMATCH", + /* 361 */ "compare_op ::= CONTAINS", + /* 362 */ "in_op ::= IN", + /* 363 */ "in_op ::= NOT IN", + /* 364 */ "in_predicate_value ::= NK_LP expression_list NK_RP", + /* 365 */ "boolean_value_expression ::= boolean_primary", + /* 366 */ "boolean_value_expression ::= NOT boolean_primary", + /* 367 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 368 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 369 */ "boolean_primary ::= predicate", + /* 370 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 371 */ "common_expression ::= expression", + /* 372 */ "common_expression ::= boolean_value_expression", + /* 373 */ "from_clause ::= FROM table_reference_list", + /* 374 */ "table_reference_list ::= table_reference", + /* 375 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 376 */ "table_reference ::= table_primary", + /* 377 */ "table_reference ::= joined_table", + /* 378 */ "table_primary ::= table_name alias_opt", + /* 379 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 380 */ "table_primary ::= subquery alias_opt", + /* 381 */ "table_primary ::= parenthesized_joined_table", + /* 382 */ "alias_opt ::=", + /* 383 */ "alias_opt ::= table_alias", + /* 384 */ "alias_opt ::= AS table_alias", + /* 385 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 386 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 387 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 388 */ "join_type ::=", + /* 389 */ "join_type ::= INNER", + /* 390 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt", + /* 391 */ "set_quantifier_opt ::=", + /* 392 */ "set_quantifier_opt ::= DISTINCT", + /* 393 */ "set_quantifier_opt ::= ALL", + /* 394 */ "select_list ::= NK_STAR", + /* 395 */ "select_list ::= select_sublist", + /* 396 */ "select_sublist ::= select_item", + /* 397 */ "select_sublist ::= select_sublist NK_COMMA select_item", + /* 398 */ "select_item ::= common_expression", + /* 399 */ "select_item ::= common_expression column_alias", + /* 400 */ "select_item ::= common_expression AS column_alias", + /* 401 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 402 */ "where_clause_opt ::=", + /* 403 */ "where_clause_opt ::= WHERE search_condition", + /* 404 */ "partition_by_clause_opt ::=", + /* 405 */ "partition_by_clause_opt ::= PARTITION BY expression_list", + /* 406 */ "twindow_clause_opt ::=", + /* 407 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 408 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP", + /* 409 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 410 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 411 */ "sliding_opt ::=", + /* 412 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 413 */ "fill_opt ::=", + /* 414 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 415 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 416 */ "fill_mode ::= NONE", + /* 417 */ "fill_mode ::= PREV", + /* 418 */ "fill_mode ::= NULL", + /* 419 */ "fill_mode ::= LINEAR", + /* 420 */ "fill_mode ::= NEXT", + /* 421 */ "group_by_clause_opt ::=", + /* 422 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 423 */ "group_by_list ::= expression", + /* 424 */ "group_by_list ::= group_by_list NK_COMMA expression", + /* 425 */ "having_clause_opt ::=", + /* 426 */ "having_clause_opt ::= HAVING search_condition", + /* 427 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 428 */ "query_expression_body ::= query_primary", + /* 429 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", + /* 430 */ "query_expression_body ::= query_expression_body UNION query_expression_body", + /* 431 */ "query_primary ::= query_specification", + /* 432 */ "query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP", + /* 433 */ "order_by_clause_opt ::=", + /* 434 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 435 */ "slimit_clause_opt ::=", + /* 436 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 437 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 438 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 439 */ "limit_clause_opt ::=", + /* 440 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 441 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 442 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 443 */ "subquery ::= NK_LP query_expression NK_RP", + /* 444 */ "search_condition ::= common_expression", + /* 445 */ "sort_specification_list ::= sort_specification", + /* 446 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 447 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", + /* 448 */ "ordering_specification_opt ::=", + /* 449 */ "ordering_specification_opt ::= ASC", + /* 450 */ "ordering_specification_opt ::= DESC", + /* 451 */ "null_ordering_opt ::=", + /* 452 */ "null_ordering_opt ::= NULLS FIRST", + /* 453 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2101,174 +2109,174 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 239: /* cmd */ - case 242: /* literal */ - case 253: /* db_options */ - case 255: /* alter_db_options */ - case 260: /* retention */ - case 261: /* full_table_name */ - case 264: /* table_options */ - case 268: /* alter_table_clause */ - case 269: /* alter_table_options */ - case 272: /* signed_literal */ - case 273: /* create_subtable_clause */ - case 276: /* drop_table_clause */ - case 279: /* column_def */ - case 282: /* col_name */ - case 283: /* db_name_cond_opt */ - case 284: /* like_pattern_opt */ - case 285: /* table_name_cond */ - case 286: /* from_db_opt */ - case 287: /* func_name */ - case 290: /* index_options */ - case 292: /* duration_literal */ - case 293: /* sliding_opt */ - case 294: /* func */ - case 297: /* query_expression */ - case 300: /* explain_options */ - case 304: /* stream_options */ - case 305: /* into_opt */ - case 307: /* where_clause_opt */ - case 308: /* signed */ - case 309: /* literal_func */ - case 312: /* expression */ - case 313: /* pseudo_column */ - case 314: /* column_reference */ - case 315: /* function_expression */ - case 316: /* subquery */ - case 321: /* star_func_para */ - case 322: /* predicate */ - case 325: /* in_predicate_value */ - case 326: /* boolean_value_expression */ - case 327: /* boolean_primary */ - case 328: /* common_expression */ - case 329: /* from_clause */ - case 330: /* table_reference_list */ - case 331: /* table_reference */ - case 332: /* table_primary */ - case 333: /* joined_table */ - case 335: /* parenthesized_joined_table */ - case 337: /* search_condition */ - case 338: /* query_specification */ - case 342: /* twindow_clause_opt */ - case 344: /* having_clause_opt */ - case 346: /* select_item */ - case 347: /* fill_opt */ - case 350: /* query_expression_body */ - case 352: /* slimit_clause_opt */ - case 353: /* limit_clause_opt */ - case 354: /* query_primary */ - case 356: /* sort_specification */ + case 240: /* cmd */ + case 243: /* literal */ + case 254: /* db_options */ + case 256: /* alter_db_options */ + case 261: /* retention */ + case 262: /* full_table_name */ + case 265: /* table_options */ + case 269: /* alter_table_clause */ + case 270: /* alter_table_options */ + case 273: /* signed_literal */ + case 274: /* create_subtable_clause */ + case 277: /* drop_table_clause */ + case 280: /* column_def */ + case 283: /* col_name */ + case 284: /* db_name_cond_opt */ + case 285: /* like_pattern_opt */ + case 286: /* table_name_cond */ + case 287: /* from_db_opt */ + case 288: /* func_name */ + case 291: /* index_options */ + case 293: /* duration_literal */ + case 294: /* sliding_opt */ + case 295: /* func */ + case 298: /* query_expression */ + case 301: /* explain_options */ + case 305: /* stream_options */ + case 306: /* into_opt */ + case 308: /* where_clause_opt */ + case 309: /* signed */ + case 310: /* literal_func */ + case 313: /* expression */ + case 314: /* pseudo_column */ + case 315: /* column_reference */ + case 316: /* function_expression */ + case 317: /* subquery */ + case 322: /* star_func_para */ + case 323: /* predicate */ + case 326: /* in_predicate_value */ + case 327: /* boolean_value_expression */ + case 328: /* boolean_primary */ + case 329: /* common_expression */ + case 330: /* from_clause */ + case 331: /* table_reference_list */ + case 332: /* table_reference */ + case 333: /* table_primary */ + case 334: /* joined_table */ + case 336: /* parenthesized_joined_table */ + case 338: /* search_condition */ + case 339: /* query_specification */ + case 343: /* twindow_clause_opt */ + case 345: /* having_clause_opt */ + case 347: /* select_item */ + case 348: /* fill_opt */ + case 351: /* query_expression_body */ + case 353: /* slimit_clause_opt */ + case 354: /* limit_clause_opt */ + case 355: /* query_primary */ + case 357: /* sort_specification */ { - nodesDestroyNode((yypminor->yy674)); + nodesDestroyNode((yypminor->yy632)); } break; - case 240: /* account_options */ - case 241: /* alter_account_options */ - case 243: /* alter_account_option */ - case 302: /* bufsize_opt */ + case 241: /* account_options */ + case 242: /* alter_account_options */ + case 244: /* alter_account_option */ + case 303: /* bufsize_opt */ { } break; - case 244: /* user_name */ - case 246: /* priv_level */ - case 249: /* db_name */ - case 250: /* dnode_endpoint */ - case 251: /* dnode_host_name */ - case 270: /* column_name */ - case 278: /* table_name */ - case 288: /* function_name */ - case 289: /* index_name */ - case 296: /* topic_name */ - case 298: /* cgroup_name */ - case 303: /* stream_name */ - case 310: /* table_alias */ - case 311: /* column_alias */ - case 317: /* star_func */ - case 319: /* noarg_func */ - case 334: /* alias_opt */ + case 245: /* user_name */ + case 247: /* priv_level */ + case 250: /* db_name */ + case 251: /* dnode_endpoint */ + case 252: /* dnode_host_name */ + case 271: /* column_name */ + case 279: /* table_name */ + case 289: /* function_name */ + case 290: /* index_name */ + case 297: /* topic_name */ + case 299: /* cgroup_name */ + case 304: /* stream_name */ + case 311: /* table_alias */ + case 312: /* column_alias */ + case 318: /* star_func */ + case 320: /* noarg_func */ + case 335: /* alias_opt */ { } break; - case 245: /* privileges */ - case 247: /* priv_type_list */ - case 248: /* priv_type */ + case 246: /* privileges */ + case 248: /* priv_type_list */ + case 249: /* priv_type */ { } break; - case 252: /* not_exists_opt */ - case 254: /* exists_opt */ - case 299: /* analyze_opt */ - case 301: /* agg_func_opt */ - case 339: /* set_quantifier_opt */ + case 253: /* not_exists_opt */ + case 255: /* exists_opt */ + case 300: /* analyze_opt */ + case 302: /* agg_func_opt */ + case 340: /* set_quantifier_opt */ { } break; - case 256: /* integer_list */ - case 257: /* variable_list */ - case 258: /* retention_list */ - case 262: /* column_def_list */ - case 263: /* tags_def_opt */ - case 265: /* multi_create_clause */ - case 266: /* tags_def */ - case 267: /* multi_drop_clause */ - case 274: /* specific_tags_opt */ - case 275: /* literal_list */ - case 277: /* col_name_list */ - case 280: /* func_name_list */ - case 291: /* func_list */ - case 295: /* expression_list */ - case 306: /* dnode_list */ - case 318: /* star_func_para_list */ - case 320: /* other_para_list */ - case 340: /* select_list */ - case 341: /* partition_by_clause_opt */ - case 343: /* group_by_clause_opt */ - case 345: /* select_sublist */ - case 349: /* group_by_list */ - case 351: /* order_by_clause_opt */ - case 355: /* sort_specification_list */ + case 257: /* integer_list */ + case 258: /* variable_list */ + case 259: /* retention_list */ + case 263: /* column_def_list */ + case 264: /* tags_def_opt */ + case 266: /* multi_create_clause */ + case 267: /* tags_def */ + case 268: /* multi_drop_clause */ + case 275: /* specific_tags_opt */ + case 276: /* literal_list */ + case 278: /* col_name_list */ + case 281: /* func_name_list */ + case 292: /* func_list */ + case 296: /* expression_list */ + case 307: /* dnode_list */ + case 319: /* star_func_para_list */ + case 321: /* other_para_list */ + case 341: /* select_list */ + case 342: /* partition_by_clause_opt */ + case 344: /* group_by_clause_opt */ + case 346: /* select_sublist */ + case 350: /* group_by_list */ + case 352: /* order_by_clause_opt */ + case 356: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy530)); + nodesDestroyList((yypminor->yy424)); } break; - case 259: /* alter_db_option */ - case 281: /* alter_table_option */ + case 260: /* alter_db_option */ + case 282: /* alter_table_option */ { } break; - case 271: /* type_name */ + case 272: /* type_name */ { } break; - case 323: /* compare_op */ - case 324: /* in_op */ + case 324: /* compare_op */ + case 325: /* in_op */ { } break; - case 336: /* join_type */ + case 337: /* join_type */ { } break; - case 348: /* fill_mode */ + case 349: /* fill_mode */ { } break; - case 357: /* ordering_specification_opt */ + case 358: /* ordering_specification_opt */ { } break; - case 358: /* null_ordering_opt */ + case 359: /* null_ordering_opt */ { } @@ -2567,459 +2575,460 @@ static const struct { YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ signed char nrhs; /* Negative of the number of RHS symbols in the rule */ } yyRuleInfo[] = { - { 239, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ - { 239, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ - { 240, 0 }, /* (2) account_options ::= */ - { 240, -3 }, /* (3) account_options ::= account_options PPS literal */ - { 240, -3 }, /* (4) account_options ::= account_options TSERIES literal */ - { 240, -3 }, /* (5) account_options ::= account_options STORAGE literal */ - { 240, -3 }, /* (6) account_options ::= account_options STREAMS literal */ - { 240, -3 }, /* (7) account_options ::= account_options QTIME literal */ - { 240, -3 }, /* (8) account_options ::= account_options DBS literal */ - { 240, -3 }, /* (9) account_options ::= account_options USERS literal */ - { 240, -3 }, /* (10) account_options ::= account_options CONNS literal */ - { 240, -3 }, /* (11) account_options ::= account_options STATE literal */ - { 241, -1 }, /* (12) alter_account_options ::= alter_account_option */ - { 241, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */ - { 243, -2 }, /* (14) alter_account_option ::= PASS literal */ - { 243, -2 }, /* (15) alter_account_option ::= PPS literal */ - { 243, -2 }, /* (16) alter_account_option ::= TSERIES literal */ - { 243, -2 }, /* (17) alter_account_option ::= STORAGE literal */ - { 243, -2 }, /* (18) alter_account_option ::= STREAMS literal */ - { 243, -2 }, /* (19) alter_account_option ::= QTIME literal */ - { 243, -2 }, /* (20) alter_account_option ::= DBS literal */ - { 243, -2 }, /* (21) alter_account_option ::= USERS literal */ - { 243, -2 }, /* (22) alter_account_option ::= CONNS literal */ - { 243, -2 }, /* (23) alter_account_option ::= STATE literal */ - { 239, -5 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING */ - { 239, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */ - { 239, -5 }, /* (26) cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */ - { 239, -3 }, /* (27) cmd ::= DROP USER user_name */ - { 239, -6 }, /* (28) cmd ::= GRANT privileges ON priv_level TO user_name */ - { 239, -6 }, /* (29) cmd ::= REVOKE privileges ON priv_level FROM user_name */ - { 245, -1 }, /* (30) privileges ::= ALL */ - { 245, -1 }, /* (31) privileges ::= priv_type_list */ - { 247, -1 }, /* (32) priv_type_list ::= priv_type */ - { 247, -3 }, /* (33) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - { 248, -1 }, /* (34) priv_type ::= READ */ - { 248, -1 }, /* (35) priv_type ::= WRITE */ - { 246, -3 }, /* (36) priv_level ::= NK_STAR NK_DOT NK_STAR */ - { 246, -3 }, /* (37) priv_level ::= db_name NK_DOT NK_STAR */ - { 239, -3 }, /* (38) cmd ::= CREATE DNODE dnode_endpoint */ - { 239, -5 }, /* (39) cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */ - { 239, -3 }, /* (40) cmd ::= DROP DNODE NK_INTEGER */ - { 239, -3 }, /* (41) cmd ::= DROP DNODE dnode_endpoint */ - { 239, -4 }, /* (42) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - { 239, -5 }, /* (43) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - { 239, -4 }, /* (44) cmd ::= ALTER ALL DNODES NK_STRING */ - { 239, -5 }, /* (45) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - { 250, -1 }, /* (46) dnode_endpoint ::= NK_STRING */ - { 251, -1 }, /* (47) dnode_host_name ::= NK_ID */ - { 251, -1 }, /* (48) dnode_host_name ::= NK_IPTOKEN */ - { 239, -3 }, /* (49) cmd ::= ALTER LOCAL NK_STRING */ - { 239, -4 }, /* (50) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - { 239, -5 }, /* (51) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - { 239, -5 }, /* (52) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - { 239, -5 }, /* (53) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - { 239, -5 }, /* (54) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - { 239, -5 }, /* (55) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - { 239, -5 }, /* (56) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - { 239, -5 }, /* (57) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - { 239, -5 }, /* (58) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - { 239, -5 }, /* (59) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - { 239, -4 }, /* (60) cmd ::= DROP DATABASE exists_opt db_name */ - { 239, -2 }, /* (61) cmd ::= USE db_name */ - { 239, -4 }, /* (62) cmd ::= ALTER DATABASE db_name alter_db_options */ - { 252, -3 }, /* (63) not_exists_opt ::= IF NOT EXISTS */ - { 252, 0 }, /* (64) not_exists_opt ::= */ - { 254, -2 }, /* (65) exists_opt ::= IF EXISTS */ - { 254, 0 }, /* (66) exists_opt ::= */ - { 253, 0 }, /* (67) db_options ::= */ - { 253, -3 }, /* (68) db_options ::= db_options BUFFER NK_INTEGER */ - { 253, -3 }, /* (69) db_options ::= db_options CACHELAST NK_INTEGER */ - { 253, -3 }, /* (70) db_options ::= db_options COMP NK_INTEGER */ - { 253, -3 }, /* (71) db_options ::= db_options DAYS NK_INTEGER */ - { 253, -3 }, /* (72) db_options ::= db_options DAYS NK_VARIABLE */ - { 253, -3 }, /* (73) db_options ::= db_options FSYNC NK_INTEGER */ - { 253, -3 }, /* (74) db_options ::= db_options MAXROWS NK_INTEGER */ - { 253, -3 }, /* (75) db_options ::= db_options MINROWS NK_INTEGER */ - { 253, -3 }, /* (76) db_options ::= db_options KEEP integer_list */ - { 253, -3 }, /* (77) db_options ::= db_options KEEP variable_list */ - { 253, -3 }, /* (78) db_options ::= db_options PAGES NK_INTEGER */ - { 253, -3 }, /* (79) db_options ::= db_options PAGESIZE NK_INTEGER */ - { 253, -3 }, /* (80) db_options ::= db_options PRECISION NK_STRING */ - { 253, -3 }, /* (81) db_options ::= db_options REPLICA NK_INTEGER */ - { 253, -3 }, /* (82) db_options ::= db_options STRICT NK_INTEGER */ - { 253, -3 }, /* (83) db_options ::= db_options WAL NK_INTEGER */ - { 253, -3 }, /* (84) db_options ::= db_options VGROUPS NK_INTEGER */ - { 253, -3 }, /* (85) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - { 253, -3 }, /* (86) db_options ::= db_options RETENTIONS retention_list */ - { 253, -3 }, /* (87) db_options ::= db_options SCHEMALESS NK_INTEGER */ - { 255, -1 }, /* (88) alter_db_options ::= alter_db_option */ - { 255, -2 }, /* (89) alter_db_options ::= alter_db_options alter_db_option */ - { 259, -2 }, /* (90) alter_db_option ::= BUFFER NK_INTEGER */ - { 259, -2 }, /* (91) alter_db_option ::= CACHELAST NK_INTEGER */ - { 259, -2 }, /* (92) alter_db_option ::= FSYNC NK_INTEGER */ - { 259, -2 }, /* (93) alter_db_option ::= KEEP integer_list */ - { 259, -2 }, /* (94) alter_db_option ::= KEEP variable_list */ - { 259, -2 }, /* (95) alter_db_option ::= PAGES NK_INTEGER */ - { 259, -2 }, /* (96) alter_db_option ::= REPLICA NK_INTEGER */ - { 259, -2 }, /* (97) alter_db_option ::= STRICT NK_INTEGER */ - { 259, -2 }, /* (98) alter_db_option ::= WAL NK_INTEGER */ - { 256, -1 }, /* (99) integer_list ::= NK_INTEGER */ - { 256, -3 }, /* (100) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - { 257, -1 }, /* (101) variable_list ::= NK_VARIABLE */ - { 257, -3 }, /* (102) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - { 258, -1 }, /* (103) retention_list ::= retention */ - { 258, -3 }, /* (104) retention_list ::= retention_list NK_COMMA retention */ - { 260, -3 }, /* (105) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - { 239, -9 }, /* (106) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - { 239, -3 }, /* (107) cmd ::= CREATE TABLE multi_create_clause */ - { 239, -9 }, /* (108) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - { 239, -3 }, /* (109) cmd ::= DROP TABLE multi_drop_clause */ - { 239, -4 }, /* (110) cmd ::= DROP STABLE exists_opt full_table_name */ - { 239, -3 }, /* (111) cmd ::= ALTER TABLE alter_table_clause */ - { 239, -3 }, /* (112) cmd ::= ALTER STABLE alter_table_clause */ - { 268, -2 }, /* (113) alter_table_clause ::= full_table_name alter_table_options */ - { 268, -5 }, /* (114) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ - { 268, -4 }, /* (115) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - { 268, -5 }, /* (116) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - { 268, -5 }, /* (117) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - { 268, -5 }, /* (118) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - { 268, -4 }, /* (119) alter_table_clause ::= full_table_name DROP TAG column_name */ - { 268, -5 }, /* (120) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - { 268, -5 }, /* (121) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - { 268, -6 }, /* (122) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ - { 265, -1 }, /* (123) multi_create_clause ::= create_subtable_clause */ - { 265, -2 }, /* (124) multi_create_clause ::= multi_create_clause create_subtable_clause */ - { 273, -10 }, /* (125) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP table_options */ - { 267, -1 }, /* (126) multi_drop_clause ::= drop_table_clause */ - { 267, -2 }, /* (127) multi_drop_clause ::= multi_drop_clause drop_table_clause */ - { 276, -2 }, /* (128) drop_table_clause ::= exists_opt full_table_name */ - { 274, 0 }, /* (129) specific_tags_opt ::= */ - { 274, -3 }, /* (130) specific_tags_opt ::= NK_LP col_name_list NK_RP */ - { 261, -1 }, /* (131) full_table_name ::= table_name */ - { 261, -3 }, /* (132) full_table_name ::= db_name NK_DOT table_name */ - { 262, -1 }, /* (133) column_def_list ::= column_def */ - { 262, -3 }, /* (134) column_def_list ::= column_def_list NK_COMMA column_def */ - { 279, -2 }, /* (135) column_def ::= column_name type_name */ - { 279, -4 }, /* (136) column_def ::= column_name type_name COMMENT NK_STRING */ - { 271, -1 }, /* (137) type_name ::= BOOL */ - { 271, -1 }, /* (138) type_name ::= TINYINT */ - { 271, -1 }, /* (139) type_name ::= SMALLINT */ - { 271, -1 }, /* (140) type_name ::= INT */ - { 271, -1 }, /* (141) type_name ::= INTEGER */ - { 271, -1 }, /* (142) type_name ::= BIGINT */ - { 271, -1 }, /* (143) type_name ::= FLOAT */ - { 271, -1 }, /* (144) type_name ::= DOUBLE */ - { 271, -4 }, /* (145) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - { 271, -1 }, /* (146) type_name ::= TIMESTAMP */ - { 271, -4 }, /* (147) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - { 271, -2 }, /* (148) type_name ::= TINYINT UNSIGNED */ - { 271, -2 }, /* (149) type_name ::= SMALLINT UNSIGNED */ - { 271, -2 }, /* (150) type_name ::= INT UNSIGNED */ - { 271, -2 }, /* (151) type_name ::= BIGINT UNSIGNED */ - { 271, -1 }, /* (152) type_name ::= JSON */ - { 271, -4 }, /* (153) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - { 271, -1 }, /* (154) type_name ::= MEDIUMBLOB */ - { 271, -1 }, /* (155) type_name ::= BLOB */ - { 271, -4 }, /* (156) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - { 271, -1 }, /* (157) type_name ::= DECIMAL */ - { 271, -4 }, /* (158) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - { 271, -6 }, /* (159) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - { 263, 0 }, /* (160) tags_def_opt ::= */ - { 263, -1 }, /* (161) tags_def_opt ::= tags_def */ - { 266, -4 }, /* (162) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - { 264, 0 }, /* (163) table_options ::= */ - { 264, -3 }, /* (164) table_options ::= table_options COMMENT NK_STRING */ - { 264, -3 }, /* (165) table_options ::= table_options FILE_FACTOR NK_FLOAT */ - { 264, -5 }, /* (166) table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */ - { 264, -3 }, /* (167) table_options ::= table_options TTL NK_INTEGER */ - { 264, -5 }, /* (168) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - { 269, -1 }, /* (169) alter_table_options ::= alter_table_option */ - { 269, -2 }, /* (170) alter_table_options ::= alter_table_options alter_table_option */ - { 281, -2 }, /* (171) alter_table_option ::= COMMENT NK_STRING */ - { 281, -2 }, /* (172) alter_table_option ::= TTL NK_INTEGER */ - { 277, -1 }, /* (173) col_name_list ::= col_name */ - { 277, -3 }, /* (174) col_name_list ::= col_name_list NK_COMMA col_name */ - { 282, -1 }, /* (175) col_name ::= column_name */ - { 239, -2 }, /* (176) cmd ::= SHOW DNODES */ - { 239, -2 }, /* (177) cmd ::= SHOW USERS */ - { 239, -2 }, /* (178) cmd ::= SHOW DATABASES */ - { 239, -4 }, /* (179) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ - { 239, -4 }, /* (180) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - { 239, -3 }, /* (181) cmd ::= SHOW db_name_cond_opt VGROUPS */ - { 239, -2 }, /* (182) cmd ::= SHOW MNODES */ - { 239, -2 }, /* (183) cmd ::= SHOW MODULES */ - { 239, -2 }, /* (184) cmd ::= SHOW QNODES */ - { 239, -2 }, /* (185) cmd ::= SHOW FUNCTIONS */ - { 239, -5 }, /* (186) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - { 239, -2 }, /* (187) cmd ::= SHOW STREAMS */ - { 239, -2 }, /* (188) cmd ::= SHOW ACCOUNTS */ - { 239, -2 }, /* (189) cmd ::= SHOW APPS */ - { 239, -2 }, /* (190) cmd ::= SHOW CONNECTIONS */ - { 239, -2 }, /* (191) cmd ::= SHOW LICENCE */ - { 239, -2 }, /* (192) cmd ::= SHOW GRANTS */ - { 239, -4 }, /* (193) cmd ::= SHOW CREATE DATABASE db_name */ - { 239, -4 }, /* (194) cmd ::= SHOW CREATE TABLE full_table_name */ - { 239, -4 }, /* (195) cmd ::= SHOW CREATE STABLE full_table_name */ - { 239, -2 }, /* (196) cmd ::= SHOW QUERIES */ - { 239, -2 }, /* (197) cmd ::= SHOW SCORES */ - { 239, -2 }, /* (198) cmd ::= SHOW TOPICS */ - { 239, -2 }, /* (199) cmd ::= SHOW VARIABLES */ - { 239, -2 }, /* (200) cmd ::= SHOW BNODES */ - { 239, -2 }, /* (201) cmd ::= SHOW SNODES */ - { 239, -2 }, /* (202) cmd ::= SHOW CLUSTER */ - { 239, -2 }, /* (203) cmd ::= SHOW TRANSACTIONS */ - { 283, 0 }, /* (204) db_name_cond_opt ::= */ - { 283, -2 }, /* (205) db_name_cond_opt ::= db_name NK_DOT */ - { 284, 0 }, /* (206) like_pattern_opt ::= */ - { 284, -2 }, /* (207) like_pattern_opt ::= LIKE NK_STRING */ - { 285, -1 }, /* (208) table_name_cond ::= table_name */ - { 286, 0 }, /* (209) from_db_opt ::= */ - { 286, -2 }, /* (210) from_db_opt ::= FROM db_name */ - { 280, -1 }, /* (211) func_name_list ::= func_name */ - { 280, -3 }, /* (212) func_name_list ::= func_name_list NK_COMMA func_name */ - { 287, -1 }, /* (213) func_name ::= function_name */ - { 239, -8 }, /* (214) cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */ - { 239, -10 }, /* (215) cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */ - { 239, -6 }, /* (216) cmd ::= DROP INDEX exists_opt index_name ON table_name */ - { 290, 0 }, /* (217) index_options ::= */ - { 290, -9 }, /* (218) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */ - { 290, -11 }, /* (219) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */ - { 291, -1 }, /* (220) func_list ::= func */ - { 291, -3 }, /* (221) func_list ::= func_list NK_COMMA func */ - { 294, -4 }, /* (222) func ::= function_name NK_LP expression_list NK_RP */ - { 239, -6 }, /* (223) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ - { 239, -7 }, /* (224) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ - { 239, -7 }, /* (225) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ - { 239, -4 }, /* (226) cmd ::= DROP TOPIC exists_opt topic_name */ - { 239, -7 }, /* (227) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - { 239, -2 }, /* (228) cmd ::= DESC full_table_name */ - { 239, -2 }, /* (229) cmd ::= DESCRIBE full_table_name */ - { 239, -3 }, /* (230) cmd ::= RESET QUERY CACHE */ - { 239, -4 }, /* (231) cmd ::= EXPLAIN analyze_opt explain_options query_expression */ - { 299, 0 }, /* (232) analyze_opt ::= */ - { 299, -1 }, /* (233) analyze_opt ::= ANALYZE */ - { 300, 0 }, /* (234) explain_options ::= */ - { 300, -3 }, /* (235) explain_options ::= explain_options VERBOSE NK_BOOL */ - { 300, -3 }, /* (236) explain_options ::= explain_options RATIO NK_FLOAT */ - { 239, -6 }, /* (237) cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */ - { 239, -10 }, /* (238) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ - { 239, -4 }, /* (239) cmd ::= DROP FUNCTION exists_opt function_name */ - { 301, 0 }, /* (240) agg_func_opt ::= */ - { 301, -1 }, /* (241) agg_func_opt ::= AGGREGATE */ - { 302, 0 }, /* (242) bufsize_opt ::= */ - { 302, -2 }, /* (243) bufsize_opt ::= BUFSIZE NK_INTEGER */ - { 239, -8 }, /* (244) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */ - { 239, -4 }, /* (245) cmd ::= DROP STREAM exists_opt stream_name */ - { 305, 0 }, /* (246) into_opt ::= */ - { 305, -2 }, /* (247) into_opt ::= INTO full_table_name */ - { 304, 0 }, /* (248) stream_options ::= */ - { 304, -3 }, /* (249) stream_options ::= stream_options TRIGGER AT_ONCE */ - { 304, -3 }, /* (250) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - { 304, -3 }, /* (251) stream_options ::= stream_options WATERMARK duration_literal */ - { 239, -3 }, /* (252) cmd ::= KILL CONNECTION NK_INTEGER */ - { 239, -3 }, /* (253) cmd ::= KILL QUERY NK_INTEGER */ - { 239, -3 }, /* (254) cmd ::= KILL TRANSACTION NK_INTEGER */ - { 239, -2 }, /* (255) cmd ::= BALANCE VGROUP */ - { 239, -4 }, /* (256) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - { 239, -4 }, /* (257) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - { 239, -3 }, /* (258) cmd ::= SPLIT VGROUP NK_INTEGER */ - { 306, -2 }, /* (259) dnode_list ::= DNODE NK_INTEGER */ - { 306, -3 }, /* (260) dnode_list ::= dnode_list DNODE NK_INTEGER */ - { 239, -3 }, /* (261) cmd ::= SYNCDB db_name REPLICA */ - { 239, -4 }, /* (262) cmd ::= DELETE FROM full_table_name where_clause_opt */ - { 239, -1 }, /* (263) cmd ::= query_expression */ - { 242, -1 }, /* (264) literal ::= NK_INTEGER */ - { 242, -1 }, /* (265) literal ::= NK_FLOAT */ - { 242, -1 }, /* (266) literal ::= NK_STRING */ - { 242, -1 }, /* (267) literal ::= NK_BOOL */ - { 242, -2 }, /* (268) literal ::= TIMESTAMP NK_STRING */ - { 242, -1 }, /* (269) literal ::= duration_literal */ - { 242, -1 }, /* (270) literal ::= NULL */ - { 242, -1 }, /* (271) literal ::= NK_QUESTION */ - { 292, -1 }, /* (272) duration_literal ::= NK_VARIABLE */ - { 308, -1 }, /* (273) signed ::= NK_INTEGER */ - { 308, -2 }, /* (274) signed ::= NK_PLUS NK_INTEGER */ - { 308, -2 }, /* (275) signed ::= NK_MINUS NK_INTEGER */ - { 308, -1 }, /* (276) signed ::= NK_FLOAT */ - { 308, -2 }, /* (277) signed ::= NK_PLUS NK_FLOAT */ - { 308, -2 }, /* (278) signed ::= NK_MINUS NK_FLOAT */ - { 272, -1 }, /* (279) signed_literal ::= signed */ - { 272, -1 }, /* (280) signed_literal ::= NK_STRING */ - { 272, -1 }, /* (281) signed_literal ::= NK_BOOL */ - { 272, -2 }, /* (282) signed_literal ::= TIMESTAMP NK_STRING */ - { 272, -1 }, /* (283) signed_literal ::= duration_literal */ - { 272, -1 }, /* (284) signed_literal ::= NULL */ - { 272, -1 }, /* (285) signed_literal ::= literal_func */ - { 275, -1 }, /* (286) literal_list ::= signed_literal */ - { 275, -3 }, /* (287) literal_list ::= literal_list NK_COMMA signed_literal */ - { 249, -1 }, /* (288) db_name ::= NK_ID */ - { 278, -1 }, /* (289) table_name ::= NK_ID */ - { 270, -1 }, /* (290) column_name ::= NK_ID */ - { 288, -1 }, /* (291) function_name ::= NK_ID */ - { 310, -1 }, /* (292) table_alias ::= NK_ID */ - { 311, -1 }, /* (293) column_alias ::= NK_ID */ - { 244, -1 }, /* (294) user_name ::= NK_ID */ - { 289, -1 }, /* (295) index_name ::= NK_ID */ - { 296, -1 }, /* (296) topic_name ::= NK_ID */ - { 303, -1 }, /* (297) stream_name ::= NK_ID */ - { 298, -1 }, /* (298) cgroup_name ::= NK_ID */ - { 312, -1 }, /* (299) expression ::= literal */ - { 312, -1 }, /* (300) expression ::= pseudo_column */ - { 312, -1 }, /* (301) expression ::= column_reference */ - { 312, -1 }, /* (302) expression ::= function_expression */ - { 312, -1 }, /* (303) expression ::= subquery */ - { 312, -3 }, /* (304) expression ::= NK_LP expression NK_RP */ - { 312, -2 }, /* (305) expression ::= NK_PLUS expression */ - { 312, -2 }, /* (306) expression ::= NK_MINUS expression */ - { 312, -3 }, /* (307) expression ::= expression NK_PLUS expression */ - { 312, -3 }, /* (308) expression ::= expression NK_MINUS expression */ - { 312, -3 }, /* (309) expression ::= expression NK_STAR expression */ - { 312, -3 }, /* (310) expression ::= expression NK_SLASH expression */ - { 312, -3 }, /* (311) expression ::= expression NK_REM expression */ - { 312, -3 }, /* (312) expression ::= column_reference NK_ARROW NK_STRING */ - { 295, -1 }, /* (313) expression_list ::= expression */ - { 295, -3 }, /* (314) expression_list ::= expression_list NK_COMMA expression */ - { 314, -1 }, /* (315) column_reference ::= column_name */ - { 314, -3 }, /* (316) column_reference ::= table_name NK_DOT column_name */ - { 313, -1 }, /* (317) pseudo_column ::= ROWTS */ - { 313, -1 }, /* (318) pseudo_column ::= TBNAME */ - { 313, -3 }, /* (319) pseudo_column ::= table_name NK_DOT TBNAME */ - { 313, -1 }, /* (320) pseudo_column ::= QSTARTTS */ - { 313, -1 }, /* (321) pseudo_column ::= QENDTS */ - { 313, -1 }, /* (322) pseudo_column ::= WSTARTTS */ - { 313, -1 }, /* (323) pseudo_column ::= WENDTS */ - { 313, -1 }, /* (324) pseudo_column ::= WDURATION */ - { 315, -4 }, /* (325) function_expression ::= function_name NK_LP expression_list NK_RP */ - { 315, -4 }, /* (326) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - { 315, -6 }, /* (327) function_expression ::= CAST NK_LP expression AS type_name NK_RP */ - { 315, -1 }, /* (328) function_expression ::= literal_func */ - { 309, -3 }, /* (329) literal_func ::= noarg_func NK_LP NK_RP */ - { 309, -1 }, /* (330) literal_func ::= NOW */ - { 319, -1 }, /* (331) noarg_func ::= NOW */ - { 319, -1 }, /* (332) noarg_func ::= TODAY */ - { 319, -1 }, /* (333) noarg_func ::= TIMEZONE */ - { 317, -1 }, /* (334) star_func ::= COUNT */ - { 317, -1 }, /* (335) star_func ::= FIRST */ - { 317, -1 }, /* (336) star_func ::= LAST */ - { 317, -1 }, /* (337) star_func ::= LAST_ROW */ - { 318, -1 }, /* (338) star_func_para_list ::= NK_STAR */ - { 318, -1 }, /* (339) star_func_para_list ::= other_para_list */ - { 320, -1 }, /* (340) other_para_list ::= star_func_para */ - { 320, -3 }, /* (341) other_para_list ::= other_para_list NK_COMMA star_func_para */ - { 321, -1 }, /* (342) star_func_para ::= expression */ - { 321, -3 }, /* (343) star_func_para ::= table_name NK_DOT NK_STAR */ - { 322, -3 }, /* (344) predicate ::= expression compare_op expression */ - { 322, -5 }, /* (345) predicate ::= expression BETWEEN expression AND expression */ - { 322, -6 }, /* (346) predicate ::= expression NOT BETWEEN expression AND expression */ - { 322, -3 }, /* (347) predicate ::= expression IS NULL */ - { 322, -4 }, /* (348) predicate ::= expression IS NOT NULL */ - { 322, -3 }, /* (349) predicate ::= expression in_op in_predicate_value */ - { 323, -1 }, /* (350) compare_op ::= NK_LT */ - { 323, -1 }, /* (351) compare_op ::= NK_GT */ - { 323, -1 }, /* (352) compare_op ::= NK_LE */ - { 323, -1 }, /* (353) compare_op ::= NK_GE */ - { 323, -1 }, /* (354) compare_op ::= NK_NE */ - { 323, -1 }, /* (355) compare_op ::= NK_EQ */ - { 323, -1 }, /* (356) compare_op ::= LIKE */ - { 323, -2 }, /* (357) compare_op ::= NOT LIKE */ - { 323, -1 }, /* (358) compare_op ::= MATCH */ - { 323, -1 }, /* (359) compare_op ::= NMATCH */ - { 323, -1 }, /* (360) compare_op ::= CONTAINS */ - { 324, -1 }, /* (361) in_op ::= IN */ - { 324, -2 }, /* (362) in_op ::= NOT IN */ - { 325, -3 }, /* (363) in_predicate_value ::= NK_LP expression_list NK_RP */ - { 326, -1 }, /* (364) boolean_value_expression ::= boolean_primary */ - { 326, -2 }, /* (365) boolean_value_expression ::= NOT boolean_primary */ - { 326, -3 }, /* (366) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - { 326, -3 }, /* (367) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - { 327, -1 }, /* (368) boolean_primary ::= predicate */ - { 327, -3 }, /* (369) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - { 328, -1 }, /* (370) common_expression ::= expression */ - { 328, -1 }, /* (371) common_expression ::= boolean_value_expression */ - { 329, -2 }, /* (372) from_clause ::= FROM table_reference_list */ - { 330, -1 }, /* (373) table_reference_list ::= table_reference */ - { 330, -3 }, /* (374) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - { 331, -1 }, /* (375) table_reference ::= table_primary */ - { 331, -1 }, /* (376) table_reference ::= joined_table */ - { 332, -2 }, /* (377) table_primary ::= table_name alias_opt */ - { 332, -4 }, /* (378) table_primary ::= db_name NK_DOT table_name alias_opt */ - { 332, -2 }, /* (379) table_primary ::= subquery alias_opt */ - { 332, -1 }, /* (380) table_primary ::= parenthesized_joined_table */ - { 334, 0 }, /* (381) alias_opt ::= */ - { 334, -1 }, /* (382) alias_opt ::= table_alias */ - { 334, -2 }, /* (383) alias_opt ::= AS table_alias */ - { 335, -3 }, /* (384) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - { 335, -3 }, /* (385) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - { 333, -6 }, /* (386) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - { 336, 0 }, /* (387) join_type ::= */ - { 336, -1 }, /* (388) join_type ::= INNER */ - { 338, -9 }, /* (389) query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - { 339, 0 }, /* (390) set_quantifier_opt ::= */ - { 339, -1 }, /* (391) set_quantifier_opt ::= DISTINCT */ - { 339, -1 }, /* (392) set_quantifier_opt ::= ALL */ - { 340, -1 }, /* (393) select_list ::= NK_STAR */ - { 340, -1 }, /* (394) select_list ::= select_sublist */ - { 345, -1 }, /* (395) select_sublist ::= select_item */ - { 345, -3 }, /* (396) select_sublist ::= select_sublist NK_COMMA select_item */ - { 346, -1 }, /* (397) select_item ::= common_expression */ - { 346, -2 }, /* (398) select_item ::= common_expression column_alias */ - { 346, -3 }, /* (399) select_item ::= common_expression AS column_alias */ - { 346, -3 }, /* (400) select_item ::= table_name NK_DOT NK_STAR */ - { 307, 0 }, /* (401) where_clause_opt ::= */ - { 307, -2 }, /* (402) where_clause_opt ::= WHERE search_condition */ - { 341, 0 }, /* (403) partition_by_clause_opt ::= */ - { 341, -3 }, /* (404) partition_by_clause_opt ::= PARTITION BY expression_list */ - { 342, 0 }, /* (405) twindow_clause_opt ::= */ - { 342, -6 }, /* (406) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - { 342, -4 }, /* (407) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ - { 342, -6 }, /* (408) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - { 342, -8 }, /* (409) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - { 293, 0 }, /* (410) sliding_opt ::= */ - { 293, -4 }, /* (411) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - { 347, 0 }, /* (412) fill_opt ::= */ - { 347, -4 }, /* (413) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - { 347, -6 }, /* (414) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ - { 348, -1 }, /* (415) fill_mode ::= NONE */ - { 348, -1 }, /* (416) fill_mode ::= PREV */ - { 348, -1 }, /* (417) fill_mode ::= NULL */ - { 348, -1 }, /* (418) fill_mode ::= LINEAR */ - { 348, -1 }, /* (419) fill_mode ::= NEXT */ - { 343, 0 }, /* (420) group_by_clause_opt ::= */ - { 343, -3 }, /* (421) group_by_clause_opt ::= GROUP BY group_by_list */ - { 349, -1 }, /* (422) group_by_list ::= expression */ - { 349, -3 }, /* (423) group_by_list ::= group_by_list NK_COMMA expression */ - { 344, 0 }, /* (424) having_clause_opt ::= */ - { 344, -2 }, /* (425) having_clause_opt ::= HAVING search_condition */ - { 297, -4 }, /* (426) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ - { 350, -1 }, /* (427) query_expression_body ::= query_primary */ - { 350, -4 }, /* (428) query_expression_body ::= query_expression_body UNION ALL query_expression_body */ - { 350, -3 }, /* (429) query_expression_body ::= query_expression_body UNION query_expression_body */ - { 354, -1 }, /* (430) query_primary ::= query_specification */ - { 354, -6 }, /* (431) query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ - { 351, 0 }, /* (432) order_by_clause_opt ::= */ - { 351, -3 }, /* (433) order_by_clause_opt ::= ORDER BY sort_specification_list */ - { 352, 0 }, /* (434) slimit_clause_opt ::= */ - { 352, -2 }, /* (435) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - { 352, -4 }, /* (436) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - { 352, -4 }, /* (437) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 353, 0 }, /* (438) limit_clause_opt ::= */ - { 353, -2 }, /* (439) limit_clause_opt ::= LIMIT NK_INTEGER */ - { 353, -4 }, /* (440) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - { 353, -4 }, /* (441) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 316, -3 }, /* (442) subquery ::= NK_LP query_expression NK_RP */ - { 337, -1 }, /* (443) search_condition ::= common_expression */ - { 355, -1 }, /* (444) sort_specification_list ::= sort_specification */ - { 355, -3 }, /* (445) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - { 356, -3 }, /* (446) sort_specification ::= expression ordering_specification_opt null_ordering_opt */ - { 357, 0 }, /* (447) ordering_specification_opt ::= */ - { 357, -1 }, /* (448) ordering_specification_opt ::= ASC */ - { 357, -1 }, /* (449) ordering_specification_opt ::= DESC */ - { 358, 0 }, /* (450) null_ordering_opt ::= */ - { 358, -2 }, /* (451) null_ordering_opt ::= NULLS FIRST */ - { 358, -2 }, /* (452) null_ordering_opt ::= NULLS LAST */ + { 240, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ + { 240, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ + { 241, 0 }, /* (2) account_options ::= */ + { 241, -3 }, /* (3) account_options ::= account_options PPS literal */ + { 241, -3 }, /* (4) account_options ::= account_options TSERIES literal */ + { 241, -3 }, /* (5) account_options ::= account_options STORAGE literal */ + { 241, -3 }, /* (6) account_options ::= account_options STREAMS literal */ + { 241, -3 }, /* (7) account_options ::= account_options QTIME literal */ + { 241, -3 }, /* (8) account_options ::= account_options DBS literal */ + { 241, -3 }, /* (9) account_options ::= account_options USERS literal */ + { 241, -3 }, /* (10) account_options ::= account_options CONNS literal */ + { 241, -3 }, /* (11) account_options ::= account_options STATE literal */ + { 242, -1 }, /* (12) alter_account_options ::= alter_account_option */ + { 242, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */ + { 244, -2 }, /* (14) alter_account_option ::= PASS literal */ + { 244, -2 }, /* (15) alter_account_option ::= PPS literal */ + { 244, -2 }, /* (16) alter_account_option ::= TSERIES literal */ + { 244, -2 }, /* (17) alter_account_option ::= STORAGE literal */ + { 244, -2 }, /* (18) alter_account_option ::= STREAMS literal */ + { 244, -2 }, /* (19) alter_account_option ::= QTIME literal */ + { 244, -2 }, /* (20) alter_account_option ::= DBS literal */ + { 244, -2 }, /* (21) alter_account_option ::= USERS literal */ + { 244, -2 }, /* (22) alter_account_option ::= CONNS literal */ + { 244, -2 }, /* (23) alter_account_option ::= STATE literal */ + { 240, -5 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING */ + { 240, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */ + { 240, -5 }, /* (26) cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */ + { 240, -3 }, /* (27) cmd ::= DROP USER user_name */ + { 240, -6 }, /* (28) cmd ::= GRANT privileges ON priv_level TO user_name */ + { 240, -6 }, /* (29) cmd ::= REVOKE privileges ON priv_level FROM user_name */ + { 246, -1 }, /* (30) privileges ::= ALL */ + { 246, -1 }, /* (31) privileges ::= priv_type_list */ + { 248, -1 }, /* (32) priv_type_list ::= priv_type */ + { 248, -3 }, /* (33) priv_type_list ::= priv_type_list NK_COMMA priv_type */ + { 249, -1 }, /* (34) priv_type ::= READ */ + { 249, -1 }, /* (35) priv_type ::= WRITE */ + { 247, -3 }, /* (36) priv_level ::= NK_STAR NK_DOT NK_STAR */ + { 247, -3 }, /* (37) priv_level ::= db_name NK_DOT NK_STAR */ + { 240, -3 }, /* (38) cmd ::= CREATE DNODE dnode_endpoint */ + { 240, -5 }, /* (39) cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */ + { 240, -3 }, /* (40) cmd ::= DROP DNODE NK_INTEGER */ + { 240, -3 }, /* (41) cmd ::= DROP DNODE dnode_endpoint */ + { 240, -4 }, /* (42) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + { 240, -5 }, /* (43) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + { 240, -4 }, /* (44) cmd ::= ALTER ALL DNODES NK_STRING */ + { 240, -5 }, /* (45) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + { 251, -1 }, /* (46) dnode_endpoint ::= NK_STRING */ + { 252, -1 }, /* (47) dnode_host_name ::= NK_ID */ + { 252, -1 }, /* (48) dnode_host_name ::= NK_IPTOKEN */ + { 240, -3 }, /* (49) cmd ::= ALTER LOCAL NK_STRING */ + { 240, -4 }, /* (50) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + { 240, -5 }, /* (51) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + { 240, -5 }, /* (52) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + { 240, -5 }, /* (53) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + { 240, -5 }, /* (54) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + { 240, -5 }, /* (55) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + { 240, -5 }, /* (56) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + { 240, -5 }, /* (57) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + { 240, -5 }, /* (58) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + { 240, -5 }, /* (59) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + { 240, -4 }, /* (60) cmd ::= DROP DATABASE exists_opt db_name */ + { 240, -2 }, /* (61) cmd ::= USE db_name */ + { 240, -4 }, /* (62) cmd ::= ALTER DATABASE db_name alter_db_options */ + { 253, -3 }, /* (63) not_exists_opt ::= IF NOT EXISTS */ + { 253, 0 }, /* (64) not_exists_opt ::= */ + { 255, -2 }, /* (65) exists_opt ::= IF EXISTS */ + { 255, 0 }, /* (66) exists_opt ::= */ + { 254, 0 }, /* (67) db_options ::= */ + { 254, -3 }, /* (68) db_options ::= db_options BUFFER NK_INTEGER */ + { 254, -3 }, /* (69) db_options ::= db_options CACHELAST NK_INTEGER */ + { 254, -3 }, /* (70) db_options ::= db_options COMP NK_INTEGER */ + { 254, -3 }, /* (71) db_options ::= db_options DAYS NK_INTEGER */ + { 254, -3 }, /* (72) db_options ::= db_options DAYS NK_VARIABLE */ + { 254, -3 }, /* (73) db_options ::= db_options FSYNC NK_INTEGER */ + { 254, -3 }, /* (74) db_options ::= db_options MAXROWS NK_INTEGER */ + { 254, -3 }, /* (75) db_options ::= db_options MINROWS NK_INTEGER */ + { 254, -3 }, /* (76) db_options ::= db_options KEEP integer_list */ + { 254, -3 }, /* (77) db_options ::= db_options KEEP variable_list */ + { 254, -3 }, /* (78) db_options ::= db_options PAGES NK_INTEGER */ + { 254, -3 }, /* (79) db_options ::= db_options PAGESIZE NK_INTEGER */ + { 254, -3 }, /* (80) db_options ::= db_options PRECISION NK_STRING */ + { 254, -3 }, /* (81) db_options ::= db_options REPLICA NK_INTEGER */ + { 254, -3 }, /* (82) db_options ::= db_options STRICT NK_INTEGER */ + { 254, -3 }, /* (83) db_options ::= db_options WAL NK_INTEGER */ + { 254, -3 }, /* (84) db_options ::= db_options VGROUPS NK_INTEGER */ + { 254, -3 }, /* (85) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + { 254, -3 }, /* (86) db_options ::= db_options RETENTIONS retention_list */ + { 254, -3 }, /* (87) db_options ::= db_options SCHEMALESS NK_INTEGER */ + { 256, -1 }, /* (88) alter_db_options ::= alter_db_option */ + { 256, -2 }, /* (89) alter_db_options ::= alter_db_options alter_db_option */ + { 260, -2 }, /* (90) alter_db_option ::= BUFFER NK_INTEGER */ + { 260, -2 }, /* (91) alter_db_option ::= CACHELAST NK_INTEGER */ + { 260, -2 }, /* (92) alter_db_option ::= FSYNC NK_INTEGER */ + { 260, -2 }, /* (93) alter_db_option ::= KEEP integer_list */ + { 260, -2 }, /* (94) alter_db_option ::= KEEP variable_list */ + { 260, -2 }, /* (95) alter_db_option ::= PAGES NK_INTEGER */ + { 260, -2 }, /* (96) alter_db_option ::= REPLICA NK_INTEGER */ + { 260, -2 }, /* (97) alter_db_option ::= STRICT NK_INTEGER */ + { 260, -2 }, /* (98) alter_db_option ::= WAL NK_INTEGER */ + { 257, -1 }, /* (99) integer_list ::= NK_INTEGER */ + { 257, -3 }, /* (100) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + { 258, -1 }, /* (101) variable_list ::= NK_VARIABLE */ + { 258, -3 }, /* (102) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + { 259, -1 }, /* (103) retention_list ::= retention */ + { 259, -3 }, /* (104) retention_list ::= retention_list NK_COMMA retention */ + { 261, -3 }, /* (105) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + { 240, -9 }, /* (106) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + { 240, -3 }, /* (107) cmd ::= CREATE TABLE multi_create_clause */ + { 240, -9 }, /* (108) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + { 240, -3 }, /* (109) cmd ::= DROP TABLE multi_drop_clause */ + { 240, -4 }, /* (110) cmd ::= DROP STABLE exists_opt full_table_name */ + { 240, -3 }, /* (111) cmd ::= ALTER TABLE alter_table_clause */ + { 240, -3 }, /* (112) cmd ::= ALTER STABLE alter_table_clause */ + { 269, -2 }, /* (113) alter_table_clause ::= full_table_name alter_table_options */ + { 269, -5 }, /* (114) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + { 269, -4 }, /* (115) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + { 269, -5 }, /* (116) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + { 269, -5 }, /* (117) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + { 269, -5 }, /* (118) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + { 269, -4 }, /* (119) alter_table_clause ::= full_table_name DROP TAG column_name */ + { 269, -5 }, /* (120) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + { 269, -5 }, /* (121) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + { 269, -6 }, /* (122) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ + { 266, -1 }, /* (123) multi_create_clause ::= create_subtable_clause */ + { 266, -2 }, /* (124) multi_create_clause ::= multi_create_clause create_subtable_clause */ + { 274, -10 }, /* (125) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP table_options */ + { 268, -1 }, /* (126) multi_drop_clause ::= drop_table_clause */ + { 268, -2 }, /* (127) multi_drop_clause ::= multi_drop_clause drop_table_clause */ + { 277, -2 }, /* (128) drop_table_clause ::= exists_opt full_table_name */ + { 275, 0 }, /* (129) specific_tags_opt ::= */ + { 275, -3 }, /* (130) specific_tags_opt ::= NK_LP col_name_list NK_RP */ + { 262, -1 }, /* (131) full_table_name ::= table_name */ + { 262, -3 }, /* (132) full_table_name ::= db_name NK_DOT table_name */ + { 263, -1 }, /* (133) column_def_list ::= column_def */ + { 263, -3 }, /* (134) column_def_list ::= column_def_list NK_COMMA column_def */ + { 280, -2 }, /* (135) column_def ::= column_name type_name */ + { 280, -4 }, /* (136) column_def ::= column_name type_name COMMENT NK_STRING */ + { 272, -1 }, /* (137) type_name ::= BOOL */ + { 272, -1 }, /* (138) type_name ::= TINYINT */ + { 272, -1 }, /* (139) type_name ::= SMALLINT */ + { 272, -1 }, /* (140) type_name ::= INT */ + { 272, -1 }, /* (141) type_name ::= INTEGER */ + { 272, -1 }, /* (142) type_name ::= BIGINT */ + { 272, -1 }, /* (143) type_name ::= FLOAT */ + { 272, -1 }, /* (144) type_name ::= DOUBLE */ + { 272, -4 }, /* (145) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + { 272, -1 }, /* (146) type_name ::= TIMESTAMP */ + { 272, -4 }, /* (147) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + { 272, -2 }, /* (148) type_name ::= TINYINT UNSIGNED */ + { 272, -2 }, /* (149) type_name ::= SMALLINT UNSIGNED */ + { 272, -2 }, /* (150) type_name ::= INT UNSIGNED */ + { 272, -2 }, /* (151) type_name ::= BIGINT UNSIGNED */ + { 272, -1 }, /* (152) type_name ::= JSON */ + { 272, -4 }, /* (153) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + { 272, -1 }, /* (154) type_name ::= MEDIUMBLOB */ + { 272, -1 }, /* (155) type_name ::= BLOB */ + { 272, -4 }, /* (156) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + { 272, -1 }, /* (157) type_name ::= DECIMAL */ + { 272, -4 }, /* (158) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + { 272, -6 }, /* (159) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + { 264, 0 }, /* (160) tags_def_opt ::= */ + { 264, -1 }, /* (161) tags_def_opt ::= tags_def */ + { 267, -4 }, /* (162) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + { 265, 0 }, /* (163) table_options ::= */ + { 265, -3 }, /* (164) table_options ::= table_options COMMENT NK_STRING */ + { 265, -3 }, /* (165) table_options ::= table_options FILE_FACTOR NK_FLOAT */ + { 265, -5 }, /* (166) table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */ + { 265, -3 }, /* (167) table_options ::= table_options TTL NK_INTEGER */ + { 265, -5 }, /* (168) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + { 270, -1 }, /* (169) alter_table_options ::= alter_table_option */ + { 270, -2 }, /* (170) alter_table_options ::= alter_table_options alter_table_option */ + { 282, -2 }, /* (171) alter_table_option ::= COMMENT NK_STRING */ + { 282, -2 }, /* (172) alter_table_option ::= TTL NK_INTEGER */ + { 278, -1 }, /* (173) col_name_list ::= col_name */ + { 278, -3 }, /* (174) col_name_list ::= col_name_list NK_COMMA col_name */ + { 283, -1 }, /* (175) col_name ::= column_name */ + { 240, -2 }, /* (176) cmd ::= SHOW DNODES */ + { 240, -2 }, /* (177) cmd ::= SHOW USERS */ + { 240, -2 }, /* (178) cmd ::= SHOW DATABASES */ + { 240, -4 }, /* (179) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ + { 240, -4 }, /* (180) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + { 240, -3 }, /* (181) cmd ::= SHOW db_name_cond_opt VGROUPS */ + { 240, -2 }, /* (182) cmd ::= SHOW MNODES */ + { 240, -2 }, /* (183) cmd ::= SHOW MODULES */ + { 240, -2 }, /* (184) cmd ::= SHOW QNODES */ + { 240, -2 }, /* (185) cmd ::= SHOW FUNCTIONS */ + { 240, -5 }, /* (186) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + { 240, -2 }, /* (187) cmd ::= SHOW STREAMS */ + { 240, -2 }, /* (188) cmd ::= SHOW ACCOUNTS */ + { 240, -2 }, /* (189) cmd ::= SHOW APPS */ + { 240, -2 }, /* (190) cmd ::= SHOW CONNECTIONS */ + { 240, -2 }, /* (191) cmd ::= SHOW LICENCE */ + { 240, -2 }, /* (192) cmd ::= SHOW GRANTS */ + { 240, -4 }, /* (193) cmd ::= SHOW CREATE DATABASE db_name */ + { 240, -4 }, /* (194) cmd ::= SHOW CREATE TABLE full_table_name */ + { 240, -4 }, /* (195) cmd ::= SHOW CREATE STABLE full_table_name */ + { 240, -2 }, /* (196) cmd ::= SHOW QUERIES */ + { 240, -2 }, /* (197) cmd ::= SHOW SCORES */ + { 240, -2 }, /* (198) cmd ::= SHOW TOPICS */ + { 240, -2 }, /* (199) cmd ::= SHOW VARIABLES */ + { 240, -2 }, /* (200) cmd ::= SHOW BNODES */ + { 240, -2 }, /* (201) cmd ::= SHOW SNODES */ + { 240, -2 }, /* (202) cmd ::= SHOW CLUSTER */ + { 240, -2 }, /* (203) cmd ::= SHOW TRANSACTIONS */ + { 284, 0 }, /* (204) db_name_cond_opt ::= */ + { 284, -2 }, /* (205) db_name_cond_opt ::= db_name NK_DOT */ + { 285, 0 }, /* (206) like_pattern_opt ::= */ + { 285, -2 }, /* (207) like_pattern_opt ::= LIKE NK_STRING */ + { 286, -1 }, /* (208) table_name_cond ::= table_name */ + { 287, 0 }, /* (209) from_db_opt ::= */ + { 287, -2 }, /* (210) from_db_opt ::= FROM db_name */ + { 281, -1 }, /* (211) func_name_list ::= func_name */ + { 281, -3 }, /* (212) func_name_list ::= func_name_list NK_COMMA func_name */ + { 288, -1 }, /* (213) func_name ::= function_name */ + { 240, -8 }, /* (214) cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */ + { 240, -10 }, /* (215) cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */ + { 240, -6 }, /* (216) cmd ::= DROP INDEX exists_opt index_name ON table_name */ + { 291, 0 }, /* (217) index_options ::= */ + { 291, -9 }, /* (218) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */ + { 291, -11 }, /* (219) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */ + { 292, -1 }, /* (220) func_list ::= func */ + { 292, -3 }, /* (221) func_list ::= func_list NK_COMMA func */ + { 295, -4 }, /* (222) func ::= function_name NK_LP expression_list NK_RP */ + { 240, -6 }, /* (223) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ + { 240, -7 }, /* (224) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ + { 240, -7 }, /* (225) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ + { 240, -4 }, /* (226) cmd ::= DROP TOPIC exists_opt topic_name */ + { 240, -7 }, /* (227) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + { 240, -2 }, /* (228) cmd ::= DESC full_table_name */ + { 240, -2 }, /* (229) cmd ::= DESCRIBE full_table_name */ + { 240, -3 }, /* (230) cmd ::= RESET QUERY CACHE */ + { 240, -4 }, /* (231) cmd ::= EXPLAIN analyze_opt explain_options query_expression */ + { 300, 0 }, /* (232) analyze_opt ::= */ + { 300, -1 }, /* (233) analyze_opt ::= ANALYZE */ + { 301, 0 }, /* (234) explain_options ::= */ + { 301, -3 }, /* (235) explain_options ::= explain_options VERBOSE NK_BOOL */ + { 301, -3 }, /* (236) explain_options ::= explain_options RATIO NK_FLOAT */ + { 240, -6 }, /* (237) cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */ + { 240, -10 }, /* (238) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ + { 240, -4 }, /* (239) cmd ::= DROP FUNCTION exists_opt function_name */ + { 302, 0 }, /* (240) agg_func_opt ::= */ + { 302, -1 }, /* (241) agg_func_opt ::= AGGREGATE */ + { 303, 0 }, /* (242) bufsize_opt ::= */ + { 303, -2 }, /* (243) bufsize_opt ::= BUFSIZE NK_INTEGER */ + { 240, -8 }, /* (244) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */ + { 240, -4 }, /* (245) cmd ::= DROP STREAM exists_opt stream_name */ + { 306, 0 }, /* (246) into_opt ::= */ + { 306, -2 }, /* (247) into_opt ::= INTO full_table_name */ + { 305, 0 }, /* (248) stream_options ::= */ + { 305, -3 }, /* (249) stream_options ::= stream_options TRIGGER AT_ONCE */ + { 305, -3 }, /* (250) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + { 305, -4 }, /* (251) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + { 305, -3 }, /* (252) stream_options ::= stream_options WATERMARK duration_literal */ + { 240, -3 }, /* (253) cmd ::= KILL CONNECTION NK_INTEGER */ + { 240, -3 }, /* (254) cmd ::= KILL QUERY NK_INTEGER */ + { 240, -3 }, /* (255) cmd ::= KILL TRANSACTION NK_INTEGER */ + { 240, -2 }, /* (256) cmd ::= BALANCE VGROUP */ + { 240, -4 }, /* (257) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + { 240, -4 }, /* (258) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + { 240, -3 }, /* (259) cmd ::= SPLIT VGROUP NK_INTEGER */ + { 307, -2 }, /* (260) dnode_list ::= DNODE NK_INTEGER */ + { 307, -3 }, /* (261) dnode_list ::= dnode_list DNODE NK_INTEGER */ + { 240, -3 }, /* (262) cmd ::= SYNCDB db_name REPLICA */ + { 240, -4 }, /* (263) cmd ::= DELETE FROM full_table_name where_clause_opt */ + { 240, -1 }, /* (264) cmd ::= query_expression */ + { 243, -1 }, /* (265) literal ::= NK_INTEGER */ + { 243, -1 }, /* (266) literal ::= NK_FLOAT */ + { 243, -1 }, /* (267) literal ::= NK_STRING */ + { 243, -1 }, /* (268) literal ::= NK_BOOL */ + { 243, -2 }, /* (269) literal ::= TIMESTAMP NK_STRING */ + { 243, -1 }, /* (270) literal ::= duration_literal */ + { 243, -1 }, /* (271) literal ::= NULL */ + { 243, -1 }, /* (272) literal ::= NK_QUESTION */ + { 293, -1 }, /* (273) duration_literal ::= NK_VARIABLE */ + { 309, -1 }, /* (274) signed ::= NK_INTEGER */ + { 309, -2 }, /* (275) signed ::= NK_PLUS NK_INTEGER */ + { 309, -2 }, /* (276) signed ::= NK_MINUS NK_INTEGER */ + { 309, -1 }, /* (277) signed ::= NK_FLOAT */ + { 309, -2 }, /* (278) signed ::= NK_PLUS NK_FLOAT */ + { 309, -2 }, /* (279) signed ::= NK_MINUS NK_FLOAT */ + { 273, -1 }, /* (280) signed_literal ::= signed */ + { 273, -1 }, /* (281) signed_literal ::= NK_STRING */ + { 273, -1 }, /* (282) signed_literal ::= NK_BOOL */ + { 273, -2 }, /* (283) signed_literal ::= TIMESTAMP NK_STRING */ + { 273, -1 }, /* (284) signed_literal ::= duration_literal */ + { 273, -1 }, /* (285) signed_literal ::= NULL */ + { 273, -1 }, /* (286) signed_literal ::= literal_func */ + { 276, -1 }, /* (287) literal_list ::= signed_literal */ + { 276, -3 }, /* (288) literal_list ::= literal_list NK_COMMA signed_literal */ + { 250, -1 }, /* (289) db_name ::= NK_ID */ + { 279, -1 }, /* (290) table_name ::= NK_ID */ + { 271, -1 }, /* (291) column_name ::= NK_ID */ + { 289, -1 }, /* (292) function_name ::= NK_ID */ + { 311, -1 }, /* (293) table_alias ::= NK_ID */ + { 312, -1 }, /* (294) column_alias ::= NK_ID */ + { 245, -1 }, /* (295) user_name ::= NK_ID */ + { 290, -1 }, /* (296) index_name ::= NK_ID */ + { 297, -1 }, /* (297) topic_name ::= NK_ID */ + { 304, -1 }, /* (298) stream_name ::= NK_ID */ + { 299, -1 }, /* (299) cgroup_name ::= NK_ID */ + { 313, -1 }, /* (300) expression ::= literal */ + { 313, -1 }, /* (301) expression ::= pseudo_column */ + { 313, -1 }, /* (302) expression ::= column_reference */ + { 313, -1 }, /* (303) expression ::= function_expression */ + { 313, -1 }, /* (304) expression ::= subquery */ + { 313, -3 }, /* (305) expression ::= NK_LP expression NK_RP */ + { 313, -2 }, /* (306) expression ::= NK_PLUS expression */ + { 313, -2 }, /* (307) expression ::= NK_MINUS expression */ + { 313, -3 }, /* (308) expression ::= expression NK_PLUS expression */ + { 313, -3 }, /* (309) expression ::= expression NK_MINUS expression */ + { 313, -3 }, /* (310) expression ::= expression NK_STAR expression */ + { 313, -3 }, /* (311) expression ::= expression NK_SLASH expression */ + { 313, -3 }, /* (312) expression ::= expression NK_REM expression */ + { 313, -3 }, /* (313) expression ::= column_reference NK_ARROW NK_STRING */ + { 296, -1 }, /* (314) expression_list ::= expression */ + { 296, -3 }, /* (315) expression_list ::= expression_list NK_COMMA expression */ + { 315, -1 }, /* (316) column_reference ::= column_name */ + { 315, -3 }, /* (317) column_reference ::= table_name NK_DOT column_name */ + { 314, -1 }, /* (318) pseudo_column ::= ROWTS */ + { 314, -1 }, /* (319) pseudo_column ::= TBNAME */ + { 314, -3 }, /* (320) pseudo_column ::= table_name NK_DOT TBNAME */ + { 314, -1 }, /* (321) pseudo_column ::= QSTARTTS */ + { 314, -1 }, /* (322) pseudo_column ::= QENDTS */ + { 314, -1 }, /* (323) pseudo_column ::= WSTARTTS */ + { 314, -1 }, /* (324) pseudo_column ::= WENDTS */ + { 314, -1 }, /* (325) pseudo_column ::= WDURATION */ + { 316, -4 }, /* (326) function_expression ::= function_name NK_LP expression_list NK_RP */ + { 316, -4 }, /* (327) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + { 316, -6 }, /* (328) function_expression ::= CAST NK_LP expression AS type_name NK_RP */ + { 316, -1 }, /* (329) function_expression ::= literal_func */ + { 310, -3 }, /* (330) literal_func ::= noarg_func NK_LP NK_RP */ + { 310, -1 }, /* (331) literal_func ::= NOW */ + { 320, -1 }, /* (332) noarg_func ::= NOW */ + { 320, -1 }, /* (333) noarg_func ::= TODAY */ + { 320, -1 }, /* (334) noarg_func ::= TIMEZONE */ + { 318, -1 }, /* (335) star_func ::= COUNT */ + { 318, -1 }, /* (336) star_func ::= FIRST */ + { 318, -1 }, /* (337) star_func ::= LAST */ + { 318, -1 }, /* (338) star_func ::= LAST_ROW */ + { 319, -1 }, /* (339) star_func_para_list ::= NK_STAR */ + { 319, -1 }, /* (340) star_func_para_list ::= other_para_list */ + { 321, -1 }, /* (341) other_para_list ::= star_func_para */ + { 321, -3 }, /* (342) other_para_list ::= other_para_list NK_COMMA star_func_para */ + { 322, -1 }, /* (343) star_func_para ::= expression */ + { 322, -3 }, /* (344) star_func_para ::= table_name NK_DOT NK_STAR */ + { 323, -3 }, /* (345) predicate ::= expression compare_op expression */ + { 323, -5 }, /* (346) predicate ::= expression BETWEEN expression AND expression */ + { 323, -6 }, /* (347) predicate ::= expression NOT BETWEEN expression AND expression */ + { 323, -3 }, /* (348) predicate ::= expression IS NULL */ + { 323, -4 }, /* (349) predicate ::= expression IS NOT NULL */ + { 323, -3 }, /* (350) predicate ::= expression in_op in_predicate_value */ + { 324, -1 }, /* (351) compare_op ::= NK_LT */ + { 324, -1 }, /* (352) compare_op ::= NK_GT */ + { 324, -1 }, /* (353) compare_op ::= NK_LE */ + { 324, -1 }, /* (354) compare_op ::= NK_GE */ + { 324, -1 }, /* (355) compare_op ::= NK_NE */ + { 324, -1 }, /* (356) compare_op ::= NK_EQ */ + { 324, -1 }, /* (357) compare_op ::= LIKE */ + { 324, -2 }, /* (358) compare_op ::= NOT LIKE */ + { 324, -1 }, /* (359) compare_op ::= MATCH */ + { 324, -1 }, /* (360) compare_op ::= NMATCH */ + { 324, -1 }, /* (361) compare_op ::= CONTAINS */ + { 325, -1 }, /* (362) in_op ::= IN */ + { 325, -2 }, /* (363) in_op ::= NOT IN */ + { 326, -3 }, /* (364) in_predicate_value ::= NK_LP expression_list NK_RP */ + { 327, -1 }, /* (365) boolean_value_expression ::= boolean_primary */ + { 327, -2 }, /* (366) boolean_value_expression ::= NOT boolean_primary */ + { 327, -3 }, /* (367) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + { 327, -3 }, /* (368) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + { 328, -1 }, /* (369) boolean_primary ::= predicate */ + { 328, -3 }, /* (370) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + { 329, -1 }, /* (371) common_expression ::= expression */ + { 329, -1 }, /* (372) common_expression ::= boolean_value_expression */ + { 330, -2 }, /* (373) from_clause ::= FROM table_reference_list */ + { 331, -1 }, /* (374) table_reference_list ::= table_reference */ + { 331, -3 }, /* (375) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + { 332, -1 }, /* (376) table_reference ::= table_primary */ + { 332, -1 }, /* (377) table_reference ::= joined_table */ + { 333, -2 }, /* (378) table_primary ::= table_name alias_opt */ + { 333, -4 }, /* (379) table_primary ::= db_name NK_DOT table_name alias_opt */ + { 333, -2 }, /* (380) table_primary ::= subquery alias_opt */ + { 333, -1 }, /* (381) table_primary ::= parenthesized_joined_table */ + { 335, 0 }, /* (382) alias_opt ::= */ + { 335, -1 }, /* (383) alias_opt ::= table_alias */ + { 335, -2 }, /* (384) alias_opt ::= AS table_alias */ + { 336, -3 }, /* (385) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + { 336, -3 }, /* (386) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + { 334, -6 }, /* (387) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + { 337, 0 }, /* (388) join_type ::= */ + { 337, -1 }, /* (389) join_type ::= INNER */ + { 339, -9 }, /* (390) query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + { 340, 0 }, /* (391) set_quantifier_opt ::= */ + { 340, -1 }, /* (392) set_quantifier_opt ::= DISTINCT */ + { 340, -1 }, /* (393) set_quantifier_opt ::= ALL */ + { 341, -1 }, /* (394) select_list ::= NK_STAR */ + { 341, -1 }, /* (395) select_list ::= select_sublist */ + { 346, -1 }, /* (396) select_sublist ::= select_item */ + { 346, -3 }, /* (397) select_sublist ::= select_sublist NK_COMMA select_item */ + { 347, -1 }, /* (398) select_item ::= common_expression */ + { 347, -2 }, /* (399) select_item ::= common_expression column_alias */ + { 347, -3 }, /* (400) select_item ::= common_expression AS column_alias */ + { 347, -3 }, /* (401) select_item ::= table_name NK_DOT NK_STAR */ + { 308, 0 }, /* (402) where_clause_opt ::= */ + { 308, -2 }, /* (403) where_clause_opt ::= WHERE search_condition */ + { 342, 0 }, /* (404) partition_by_clause_opt ::= */ + { 342, -3 }, /* (405) partition_by_clause_opt ::= PARTITION BY expression_list */ + { 343, 0 }, /* (406) twindow_clause_opt ::= */ + { 343, -6 }, /* (407) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + { 343, -4 }, /* (408) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ + { 343, -6 }, /* (409) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + { 343, -8 }, /* (410) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + { 294, 0 }, /* (411) sliding_opt ::= */ + { 294, -4 }, /* (412) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + { 348, 0 }, /* (413) fill_opt ::= */ + { 348, -4 }, /* (414) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + { 348, -6 }, /* (415) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + { 349, -1 }, /* (416) fill_mode ::= NONE */ + { 349, -1 }, /* (417) fill_mode ::= PREV */ + { 349, -1 }, /* (418) fill_mode ::= NULL */ + { 349, -1 }, /* (419) fill_mode ::= LINEAR */ + { 349, -1 }, /* (420) fill_mode ::= NEXT */ + { 344, 0 }, /* (421) group_by_clause_opt ::= */ + { 344, -3 }, /* (422) group_by_clause_opt ::= GROUP BY group_by_list */ + { 350, -1 }, /* (423) group_by_list ::= expression */ + { 350, -3 }, /* (424) group_by_list ::= group_by_list NK_COMMA expression */ + { 345, 0 }, /* (425) having_clause_opt ::= */ + { 345, -2 }, /* (426) having_clause_opt ::= HAVING search_condition */ + { 298, -4 }, /* (427) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + { 351, -1 }, /* (428) query_expression_body ::= query_primary */ + { 351, -4 }, /* (429) query_expression_body ::= query_expression_body UNION ALL query_expression_body */ + { 351, -3 }, /* (430) query_expression_body ::= query_expression_body UNION query_expression_body */ + { 355, -1 }, /* (431) query_primary ::= query_specification */ + { 355, -6 }, /* (432) query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ + { 352, 0 }, /* (433) order_by_clause_opt ::= */ + { 352, -3 }, /* (434) order_by_clause_opt ::= ORDER BY sort_specification_list */ + { 353, 0 }, /* (435) slimit_clause_opt ::= */ + { 353, -2 }, /* (436) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + { 353, -4 }, /* (437) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + { 353, -4 }, /* (438) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 354, 0 }, /* (439) limit_clause_opt ::= */ + { 354, -2 }, /* (440) limit_clause_opt ::= LIMIT NK_INTEGER */ + { 354, -4 }, /* (441) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + { 354, -4 }, /* (442) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 317, -3 }, /* (443) subquery ::= NK_LP query_expression NK_RP */ + { 338, -1 }, /* (444) search_condition ::= common_expression */ + { 356, -1 }, /* (445) sort_specification_list ::= sort_specification */ + { 356, -3 }, /* (446) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + { 357, -3 }, /* (447) sort_specification ::= expression ordering_specification_opt null_ordering_opt */ + { 358, 0 }, /* (448) ordering_specification_opt ::= */ + { 358, -1 }, /* (449) ordering_specification_opt ::= ASC */ + { 358, -1 }, /* (450) ordering_specification_opt ::= DESC */ + { 359, 0 }, /* (451) null_ordering_opt ::= */ + { 359, -2 }, /* (452) null_ordering_opt ::= NULLS FIRST */ + { 359, -2 }, /* (453) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -3108,11 +3117,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,240,&yymsp[0].minor); + yy_destructor(yypParser,241,&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,241,&yymsp[0].minor); + yy_destructor(yypParser,242,&yymsp[0].minor); break; case 2: /* account_options ::= */ { } @@ -3126,20 +3135,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,240,&yymsp[-2].minor); +{ yy_destructor(yypParser,241,&yymsp[-2].minor); { } - yy_destructor(yypParser,242,&yymsp[0].minor); + yy_destructor(yypParser,243,&yymsp[0].minor); } break; case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,243,&yymsp[0].minor); +{ yy_destructor(yypParser,244,&yymsp[0].minor); { } } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,241,&yymsp[-1].minor); +{ yy_destructor(yypParser,242,&yymsp[-1].minor); { } - yy_destructor(yypParser,243,&yymsp[0].minor); + yy_destructor(yypParser,244,&yymsp[0].minor); } break; case 14: /* alter_account_option ::= PASS literal */ @@ -3153,63 +3162,63 @@ 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,242,&yymsp[0].minor); + yy_destructor(yypParser,243,&yymsp[0].minor); break; case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy0); } break; case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy421, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy209, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } break; case 26: /* cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy421, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy209, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0); } break; case 27: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy421); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy209); } break; case 28: /* cmd ::= GRANT privileges ON priv_level TO user_name */ -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy669, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy421); } +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy189, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy209); } break; case 29: /* cmd ::= REVOKE privileges ON priv_level FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy669, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy421); } +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy189, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy209); } break; case 30: /* privileges ::= ALL */ -{ yymsp[0].minor.yy669 = PRIVILEGE_TYPE_ALL; } +{ yymsp[0].minor.yy189 = PRIVILEGE_TYPE_ALL; } break; case 31: /* privileges ::= priv_type_list */ case 32: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==32); -{ yylhsminor.yy669 = yymsp[0].minor.yy669; } - yymsp[0].minor.yy669 = yylhsminor.yy669; +{ yylhsminor.yy189 = yymsp[0].minor.yy189; } + yymsp[0].minor.yy189 = yylhsminor.yy189; break; case 33: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy669 = yymsp[-2].minor.yy669 | yymsp[0].minor.yy669; } - yymsp[-2].minor.yy669 = yylhsminor.yy669; +{ yylhsminor.yy189 = yymsp[-2].minor.yy189 | yymsp[0].minor.yy189; } + yymsp[-2].minor.yy189 = yylhsminor.yy189; break; case 34: /* priv_type ::= READ */ -{ yymsp[0].minor.yy669 = PRIVILEGE_TYPE_READ; } +{ yymsp[0].minor.yy189 = PRIVILEGE_TYPE_READ; } break; case 35: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy669 = PRIVILEGE_TYPE_WRITE; } +{ yymsp[0].minor.yy189 = PRIVILEGE_TYPE_WRITE; } break; case 36: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy421 = yymsp[-2].minor.yy0; } - yymsp[-2].minor.yy421 = yylhsminor.yy421; +{ yylhsminor.yy209 = yymsp[-2].minor.yy0; } + yymsp[-2].minor.yy209 = yylhsminor.yy209; break; case 37: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy421 = yymsp[-2].minor.yy421; } - yymsp[-2].minor.yy421 = yylhsminor.yy421; +{ yylhsminor.yy209 = yymsp[-2].minor.yy209; } + yymsp[-2].minor.yy209 = yylhsminor.yy209; break; case 38: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy421, NULL); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy209, NULL); } break; case 39: /* cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy0); } break; case 40: /* cmd ::= DROP DNODE NK_INTEGER */ { pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy0); } break; case 41: /* cmd ::= DROP DNODE dnode_endpoint */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy421); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy209); } break; case 42: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } @@ -3226,26 +3235,26 @@ static YYACTIONTYPE yy_reduce( case 46: /* dnode_endpoint ::= NK_STRING */ case 47: /* dnode_host_name ::= NK_ID */ yytestcase(yyruleno==47); case 48: /* dnode_host_name ::= NK_IPTOKEN */ yytestcase(yyruleno==48); - case 288: /* db_name ::= NK_ID */ yytestcase(yyruleno==288); - case 289: /* table_name ::= NK_ID */ yytestcase(yyruleno==289); - case 290: /* column_name ::= NK_ID */ yytestcase(yyruleno==290); - case 291: /* function_name ::= NK_ID */ yytestcase(yyruleno==291); - case 292: /* table_alias ::= NK_ID */ yytestcase(yyruleno==292); - case 293: /* column_alias ::= NK_ID */ yytestcase(yyruleno==293); - case 294: /* user_name ::= NK_ID */ yytestcase(yyruleno==294); - case 295: /* index_name ::= NK_ID */ yytestcase(yyruleno==295); - case 296: /* topic_name ::= NK_ID */ yytestcase(yyruleno==296); - case 297: /* stream_name ::= NK_ID */ yytestcase(yyruleno==297); - case 298: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==298); - case 331: /* noarg_func ::= NOW */ yytestcase(yyruleno==331); - case 332: /* noarg_func ::= TODAY */ yytestcase(yyruleno==332); - case 333: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==333); - case 334: /* star_func ::= COUNT */ yytestcase(yyruleno==334); - case 335: /* star_func ::= FIRST */ yytestcase(yyruleno==335); - case 336: /* star_func ::= LAST */ yytestcase(yyruleno==336); - case 337: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==337); -{ yylhsminor.yy421 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy421 = yylhsminor.yy421; + case 289: /* db_name ::= NK_ID */ yytestcase(yyruleno==289); + case 290: /* table_name ::= NK_ID */ yytestcase(yyruleno==290); + case 291: /* column_name ::= NK_ID */ yytestcase(yyruleno==291); + case 292: /* function_name ::= NK_ID */ yytestcase(yyruleno==292); + case 293: /* table_alias ::= NK_ID */ yytestcase(yyruleno==293); + case 294: /* column_alias ::= NK_ID */ yytestcase(yyruleno==294); + case 295: /* user_name ::= NK_ID */ yytestcase(yyruleno==295); + case 296: /* index_name ::= NK_ID */ yytestcase(yyruleno==296); + case 297: /* topic_name ::= NK_ID */ yytestcase(yyruleno==297); + case 298: /* stream_name ::= NK_ID */ yytestcase(yyruleno==298); + case 299: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==299); + case 332: /* noarg_func ::= NOW */ yytestcase(yyruleno==332); + case 333: /* noarg_func ::= TODAY */ yytestcase(yyruleno==333); + case 334: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==334); + case 335: /* star_func ::= COUNT */ yytestcase(yyruleno==335); + case 336: /* star_func ::= FIRST */ yytestcase(yyruleno==336); + case 337: /* star_func ::= LAST */ yytestcase(yyruleno==337); + case 338: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==338); +{ yylhsminor.yy209 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy209 = yylhsminor.yy209; break; case 49: /* cmd ::= ALTER LOCAL NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } @@ -3278,156 +3287,156 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } break; case 59: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy621, &yymsp[-1].minor.yy421, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy137, &yymsp[-1].minor.yy209, yymsp[0].minor.yy632); } break; case 60: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy621, &yymsp[0].minor.yy421); } +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy137, &yymsp[0].minor.yy209); } break; case 61: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy421); } +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy209); } break; case 62: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy421, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy209, yymsp[0].minor.yy632); } break; case 63: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy621 = true; } +{ yymsp[-2].minor.yy137 = true; } break; case 64: /* not_exists_opt ::= */ case 66: /* exists_opt ::= */ yytestcase(yyruleno==66); case 232: /* analyze_opt ::= */ yytestcase(yyruleno==232); case 240: /* agg_func_opt ::= */ yytestcase(yyruleno==240); - case 390: /* set_quantifier_opt ::= */ yytestcase(yyruleno==390); -{ yymsp[1].minor.yy621 = false; } + case 391: /* set_quantifier_opt ::= */ yytestcase(yyruleno==391); +{ yymsp[1].minor.yy137 = false; } break; case 65: /* exists_opt ::= IF EXISTS */ -{ yymsp[-1].minor.yy621 = true; } +{ yymsp[-1].minor.yy137 = true; } break; case 67: /* db_options ::= */ -{ yymsp[1].minor.yy674 = createDefaultDatabaseOptions(pCxt); } +{ yymsp[1].minor.yy632 = createDefaultDatabaseOptions(pCxt); } break; case 68: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setDatabaseOption(pCxt, yymsp[-2].minor.yy632, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 69: /* db_options ::= db_options CACHELAST NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setDatabaseOption(pCxt, yymsp[-2].minor.yy632, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 70: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setDatabaseOption(pCxt, yymsp[-2].minor.yy632, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 71: /* db_options ::= db_options DAYS NK_INTEGER */ case 72: /* db_options ::= db_options DAYS NK_VARIABLE */ yytestcase(yyruleno==72); -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setDatabaseOption(pCxt, yymsp[-2].minor.yy632, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 73: /* db_options ::= db_options FSYNC NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setDatabaseOption(pCxt, yymsp[-2].minor.yy632, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 74: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setDatabaseOption(pCxt, yymsp[-2].minor.yy632, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 75: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setDatabaseOption(pCxt, yymsp[-2].minor.yy632, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 76: /* db_options ::= db_options KEEP integer_list */ case 77: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==77); -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_KEEP, yymsp[0].minor.yy530); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setDatabaseOption(pCxt, yymsp[-2].minor.yy632, DB_OPTION_KEEP, yymsp[0].minor.yy424); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 78: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setDatabaseOption(pCxt, yymsp[-2].minor.yy632, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 79: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setDatabaseOption(pCxt, yymsp[-2].minor.yy632, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 80: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setDatabaseOption(pCxt, yymsp[-2].minor.yy632, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 81: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setDatabaseOption(pCxt, yymsp[-2].minor.yy632, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 82: /* db_options ::= db_options STRICT NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setDatabaseOption(pCxt, yymsp[-2].minor.yy632, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 83: /* db_options ::= db_options WAL NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setDatabaseOption(pCxt, yymsp[-2].minor.yy632, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 84: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setDatabaseOption(pCxt, yymsp[-2].minor.yy632, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 85: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setDatabaseOption(pCxt, yymsp[-2].minor.yy632, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 86: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_RETENTIONS, yymsp[0].minor.yy530); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setDatabaseOption(pCxt, yymsp[-2].minor.yy632, DB_OPTION_RETENTIONS, yymsp[0].minor.yy424); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 87: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy674 = setDatabaseOption(pCxt, yymsp[-2].minor.yy674, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setDatabaseOption(pCxt, yymsp[-2].minor.yy632, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 88: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy674 = createAlterDatabaseOptions(pCxt); yylhsminor.yy674 = setAlterDatabaseOption(pCxt, yylhsminor.yy674, &yymsp[0].minor.yy557); } - yymsp[0].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createAlterDatabaseOptions(pCxt); yylhsminor.yy632 = setAlterDatabaseOption(pCxt, yylhsminor.yy632, &yymsp[0].minor.yy605); } + yymsp[0].minor.yy632 = yylhsminor.yy632; break; case 89: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy674 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy674, &yymsp[0].minor.yy557); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy632, &yymsp[0].minor.yy605); } + yymsp[-1].minor.yy632 = yylhsminor.yy632; break; case 90: /* alter_db_option ::= BUFFER NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy605.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy605.val = yymsp[0].minor.yy0; } break; case 91: /* alter_db_option ::= CACHELAST NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy605.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy605.val = yymsp[0].minor.yy0; } break; case 92: /* alter_db_option ::= FSYNC NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy605.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy605.val = yymsp[0].minor.yy0; } break; case 93: /* alter_db_option ::= KEEP integer_list */ case 94: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==94); -{ yymsp[-1].minor.yy557.type = DB_OPTION_KEEP; yymsp[-1].minor.yy557.pList = yymsp[0].minor.yy530; } +{ yymsp[-1].minor.yy605.type = DB_OPTION_KEEP; yymsp[-1].minor.yy605.pList = yymsp[0].minor.yy424; } break; case 95: /* alter_db_option ::= PAGES NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_PAGES; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy605.type = DB_OPTION_PAGES; yymsp[-1].minor.yy605.val = yymsp[0].minor.yy0; } break; case 96: /* alter_db_option ::= REPLICA NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy605.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy605.val = yymsp[0].minor.yy0; } break; case 97: /* alter_db_option ::= STRICT NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_STRICT; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy605.type = DB_OPTION_STRICT; yymsp[-1].minor.yy605.val = yymsp[0].minor.yy0; } break; case 98: /* alter_db_option ::= WAL NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_WAL; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy605.type = DB_OPTION_WAL; yymsp[-1].minor.yy605.val = yymsp[0].minor.yy0; } break; case 99: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy530 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy530 = yylhsminor.yy530; +{ yylhsminor.yy424 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy424 = yylhsminor.yy424; break; case 100: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 260: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==260); -{ yylhsminor.yy530 = addNodeToList(pCxt, yymsp[-2].minor.yy530, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy530 = yylhsminor.yy530; + case 261: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==261); +{ yylhsminor.yy424 = addNodeToList(pCxt, yymsp[-2].minor.yy424, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy424 = yylhsminor.yy424; break; case 101: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy530 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy530 = yylhsminor.yy530; +{ yylhsminor.yy424 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy424 = yylhsminor.yy424; break; case 102: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy530 = addNodeToList(pCxt, yymsp[-2].minor.yy530, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy530 = yylhsminor.yy530; +{ yylhsminor.yy424 = addNodeToList(pCxt, yymsp[-2].minor.yy424, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy424 = yylhsminor.yy424; break; case 103: /* retention_list ::= retention */ case 123: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==123); @@ -3436,242 +3445,242 @@ static YYACTIONTYPE yy_reduce( case 173: /* col_name_list ::= col_name */ yytestcase(yyruleno==173); case 211: /* func_name_list ::= func_name */ yytestcase(yyruleno==211); case 220: /* func_list ::= func */ yytestcase(yyruleno==220); - case 286: /* literal_list ::= signed_literal */ yytestcase(yyruleno==286); - case 340: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==340); - case 395: /* select_sublist ::= select_item */ yytestcase(yyruleno==395); - case 444: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==444); -{ yylhsminor.yy530 = createNodeList(pCxt, yymsp[0].minor.yy674); } - yymsp[0].minor.yy530 = yylhsminor.yy530; + case 287: /* literal_list ::= signed_literal */ yytestcase(yyruleno==287); + case 341: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==341); + case 396: /* select_sublist ::= select_item */ yytestcase(yyruleno==396); + case 445: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==445); +{ yylhsminor.yy424 = createNodeList(pCxt, yymsp[0].minor.yy632); } + yymsp[0].minor.yy424 = yylhsminor.yy424; break; case 104: /* retention_list ::= retention_list NK_COMMA retention */ case 134: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==134); case 174: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==174); case 212: /* func_name_list ::= func_name_list NK_COMMA func_name */ yytestcase(yyruleno==212); case 221: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==221); - case 287: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==287); - case 341: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==341); - case 396: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==396); - case 445: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==445); -{ yylhsminor.yy530 = addNodeToList(pCxt, yymsp[-2].minor.yy530, yymsp[0].minor.yy674); } - yymsp[-2].minor.yy530 = yylhsminor.yy530; + case 288: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==288); + case 342: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==342); + case 397: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==397); + case 446: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==446); +{ yylhsminor.yy424 = addNodeToList(pCxt, yymsp[-2].minor.yy424, yymsp[0].minor.yy632); } + yymsp[-2].minor.yy424 = yylhsminor.yy424; break; case 105: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ -{ yylhsminor.yy674 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 106: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ case 108: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==108); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy621, yymsp[-5].minor.yy674, yymsp[-3].minor.yy530, yymsp[-1].minor.yy530, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy137, yymsp[-5].minor.yy632, yymsp[-3].minor.yy424, yymsp[-1].minor.yy424, yymsp[0].minor.yy632); } break; case 107: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy530); } +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy424); } break; case 109: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy530); } +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy424); } break; case 110: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy621, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy137, yymsp[0].minor.yy632); } break; case 111: /* cmd ::= ALTER TABLE alter_table_clause */ case 112: /* cmd ::= ALTER STABLE alter_table_clause */ yytestcase(yyruleno==112); - case 263: /* cmd ::= query_expression */ yytestcase(yyruleno==263); -{ pCxt->pRootNode = yymsp[0].minor.yy674; } + case 264: /* cmd ::= query_expression */ yytestcase(yyruleno==264); +{ pCxt->pRootNode = yymsp[0].minor.yy632; } break; case 113: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy674 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy674, yymsp[0].minor.yy674); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy632, yymsp[0].minor.yy632); } + yymsp[-1].minor.yy632 = yylhsminor.yy632; break; case 114: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy674 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy674, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy421, yymsp[0].minor.yy690); } - yymsp[-4].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy632, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy209, yymsp[0].minor.yy304); } + yymsp[-4].minor.yy632 = yylhsminor.yy632; break; case 115: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy674 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy674, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy421); } - yymsp[-3].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy632, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy209); } + yymsp[-3].minor.yy632 = yylhsminor.yy632; break; case 116: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy674 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy674, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy421, yymsp[0].minor.yy690); } - yymsp[-4].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy632, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy209, yymsp[0].minor.yy304); } + yymsp[-4].minor.yy632 = yylhsminor.yy632; break; case 117: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy674 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy674, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy421, &yymsp[0].minor.yy421); } - yymsp[-4].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy632, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy209, &yymsp[0].minor.yy209); } + yymsp[-4].minor.yy632 = yylhsminor.yy632; break; case 118: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy674 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy674, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy421, yymsp[0].minor.yy690); } - yymsp[-4].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy632, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy209, yymsp[0].minor.yy304); } + yymsp[-4].minor.yy632 = yylhsminor.yy632; break; case 119: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy674 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy674, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy421); } - yymsp[-3].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy632, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy209); } + yymsp[-3].minor.yy632 = yylhsminor.yy632; break; case 120: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy674 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy674, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy421, yymsp[0].minor.yy690); } - yymsp[-4].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy632, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy209, yymsp[0].minor.yy304); } + yymsp[-4].minor.yy632 = yylhsminor.yy632; break; case 121: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy674 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy674, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy421, &yymsp[0].minor.yy421); } - yymsp[-4].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy632, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy209, &yymsp[0].minor.yy209); } + yymsp[-4].minor.yy632 = yylhsminor.yy632; break; case 122: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ -{ yylhsminor.yy674 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy674, &yymsp[-2].minor.yy421, yymsp[0].minor.yy674); } - yymsp[-5].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy632, &yymsp[-2].minor.yy209, yymsp[0].minor.yy632); } + yymsp[-5].minor.yy632 = yylhsminor.yy632; break; case 124: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ case 127: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==127); -{ yylhsminor.yy530 = addNodeToList(pCxt, yymsp[-1].minor.yy530, yymsp[0].minor.yy674); } - yymsp[-1].minor.yy530 = yylhsminor.yy530; +{ yylhsminor.yy424 = addNodeToList(pCxt, yymsp[-1].minor.yy424, yymsp[0].minor.yy632); } + yymsp[-1].minor.yy424 = yylhsminor.yy424; break; case 125: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP table_options */ -{ yylhsminor.yy674 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy621, yymsp[-8].minor.yy674, yymsp[-6].minor.yy674, yymsp[-5].minor.yy530, yymsp[-2].minor.yy530, yymsp[0].minor.yy674); } - yymsp[-9].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy137, yymsp[-8].minor.yy632, yymsp[-6].minor.yy632, yymsp[-5].minor.yy424, yymsp[-2].minor.yy424, yymsp[0].minor.yy632); } + yymsp[-9].minor.yy632 = yylhsminor.yy632; break; case 128: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy674 = createDropTableClause(pCxt, yymsp[-1].minor.yy621, yymsp[0].minor.yy674); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createDropTableClause(pCxt, yymsp[-1].minor.yy137, yymsp[0].minor.yy632); } + yymsp[-1].minor.yy632 = yylhsminor.yy632; break; case 129: /* specific_tags_opt ::= */ case 160: /* tags_def_opt ::= */ yytestcase(yyruleno==160); - case 403: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==403); - case 420: /* group_by_clause_opt ::= */ yytestcase(yyruleno==420); - case 432: /* order_by_clause_opt ::= */ yytestcase(yyruleno==432); -{ yymsp[1].minor.yy530 = NULL; } + case 404: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==404); + case 421: /* group_by_clause_opt ::= */ yytestcase(yyruleno==421); + case 433: /* order_by_clause_opt ::= */ yytestcase(yyruleno==433); +{ yymsp[1].minor.yy424 = NULL; } break; case 130: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */ -{ yymsp[-2].minor.yy530 = yymsp[-1].minor.yy530; } +{ yymsp[-2].minor.yy424 = yymsp[-1].minor.yy424; } break; case 131: /* full_table_name ::= table_name */ -{ yylhsminor.yy674 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy421, NULL); } - yymsp[0].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy209, NULL); } + yymsp[0].minor.yy632 = yylhsminor.yy632; break; case 132: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy674 = createRealTableNode(pCxt, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy421, NULL); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createRealTableNode(pCxt, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy209, NULL); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 135: /* column_def ::= column_name type_name */ -{ yylhsminor.yy674 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy421, yymsp[0].minor.yy690, NULL); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy209, yymsp[0].minor.yy304, NULL); } + yymsp[-1].minor.yy632 = yylhsminor.yy632; break; case 136: /* column_def ::= column_name type_name COMMENT NK_STRING */ -{ yylhsminor.yy674 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy421, yymsp[-2].minor.yy690, &yymsp[0].minor.yy0); } - yymsp[-3].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy209, yymsp[-2].minor.yy304, &yymsp[0].minor.yy0); } + yymsp[-3].minor.yy632 = yylhsminor.yy632; break; case 137: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_BOOL); } +{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_BOOL); } break; case 138: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_TINYINT); } +{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; case 139: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_SMALLINT); } +{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; case 140: /* type_name ::= INT */ case 141: /* type_name ::= INTEGER */ yytestcase(yyruleno==141); -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_INT); } +{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_INT); } break; case 142: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_BIGINT); } +{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; case 143: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_FLOAT); } +{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; case 144: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_DOUBLE); } +{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; case 145: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy690 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy304 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; case 146: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } +{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; case 147: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy690 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy304 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; case 148: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy690 = createDataType(TSDB_DATA_TYPE_UTINYINT); } +{ yymsp[-1].minor.yy304 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; case 149: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy690 = createDataType(TSDB_DATA_TYPE_USMALLINT); } +{ yymsp[-1].minor.yy304 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; case 150: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy690 = createDataType(TSDB_DATA_TYPE_UINT); } +{ yymsp[-1].minor.yy304 = createDataType(TSDB_DATA_TYPE_UINT); } break; case 151: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy690 = createDataType(TSDB_DATA_TYPE_UBIGINT); } +{ yymsp[-1].minor.yy304 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; case 152: /* type_name ::= JSON */ -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_JSON); } +{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_JSON); } break; case 153: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy690 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy304 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; case 154: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } +{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; case 155: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_BLOB); } +{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_BLOB); } break; case 156: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy690 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy304 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; case 157: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy690 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 158: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy690 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-3].minor.yy304 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 159: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy690 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-5].minor.yy304 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 161: /* tags_def_opt ::= tags_def */ - case 339: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==339); - case 394: /* select_list ::= select_sublist */ yytestcase(yyruleno==394); -{ yylhsminor.yy530 = yymsp[0].minor.yy530; } - yymsp[0].minor.yy530 = yylhsminor.yy530; + case 340: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==340); + case 395: /* select_list ::= select_sublist */ yytestcase(yyruleno==395); +{ yylhsminor.yy424 = yymsp[0].minor.yy424; } + yymsp[0].minor.yy424 = yylhsminor.yy424; break; case 162: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ -{ yymsp[-3].minor.yy530 = yymsp[-1].minor.yy530; } +{ yymsp[-3].minor.yy424 = yymsp[-1].minor.yy424; } break; case 163: /* table_options ::= */ -{ yymsp[1].minor.yy674 = createDefaultTableOptions(pCxt); } +{ yymsp[1].minor.yy632 = createDefaultTableOptions(pCxt); } break; case 164: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy674 = setTableOption(pCxt, yymsp[-2].minor.yy674, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setTableOption(pCxt, yymsp[-2].minor.yy632, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 165: /* table_options ::= table_options FILE_FACTOR NK_FLOAT */ -{ yylhsminor.yy674 = setTableOption(pCxt, yymsp[-2].minor.yy674, TABLE_OPTION_FILE_FACTOR, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setTableOption(pCxt, yymsp[-2].minor.yy632, TABLE_OPTION_FILE_FACTOR, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 166: /* table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */ -{ yylhsminor.yy674 = setTableOption(pCxt, yymsp[-4].minor.yy674, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy530); } - yymsp[-4].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setTableOption(pCxt, yymsp[-4].minor.yy632, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy424); } + yymsp[-4].minor.yy632 = yylhsminor.yy632; break; case 167: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy674 = setTableOption(pCxt, yymsp[-2].minor.yy674, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setTableOption(pCxt, yymsp[-2].minor.yy632, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 168: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy674 = setTableOption(pCxt, yymsp[-4].minor.yy674, TABLE_OPTION_SMA, yymsp[-1].minor.yy530); } - yymsp[-4].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setTableOption(pCxt, yymsp[-4].minor.yy632, TABLE_OPTION_SMA, yymsp[-1].minor.yy424); } + yymsp[-4].minor.yy632 = yylhsminor.yy632; break; case 169: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy674 = createAlterTableOptions(pCxt); yylhsminor.yy674 = setTableOption(pCxt, yylhsminor.yy674, yymsp[0].minor.yy557.type, &yymsp[0].minor.yy557.val); } - yymsp[0].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createAlterTableOptions(pCxt); yylhsminor.yy632 = setTableOption(pCxt, yylhsminor.yy632, yymsp[0].minor.yy605.type, &yymsp[0].minor.yy605.val); } + yymsp[0].minor.yy632 = yylhsminor.yy632; break; case 170: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy674 = setTableOption(pCxt, yymsp[-1].minor.yy674, yymsp[0].minor.yy557.type, &yymsp[0].minor.yy557.val); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setTableOption(pCxt, yymsp[-1].minor.yy632, yymsp[0].minor.yy605.type, &yymsp[0].minor.yy605.val); } + yymsp[-1].minor.yy632 = yylhsminor.yy632; break; case 171: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy557.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy605.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy605.val = yymsp[0].minor.yy0; } break; case 172: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy605.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy605.val = yymsp[0].minor.yy0; } break; case 175: /* col_name ::= column_name */ -{ yylhsminor.yy674 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy421); } - yymsp[0].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy209); } + yymsp[0].minor.yy632 = yylhsminor.yy632; break; case 176: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT, NULL, NULL); } @@ -3683,13 +3692,13 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT, NULL, NULL); } break; case 179: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy674, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy632, yymsp[0].minor.yy632); } break; case 180: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy674, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy632, yymsp[0].minor.yy632); } break; case 181: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy674, NULL); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy632, NULL); } break; case 182: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT, NULL, NULL); } @@ -3704,7 +3713,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT, NULL, NULL); } break; case 186: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[-1].minor.yy674, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[-1].minor.yy632, yymsp[0].minor.yy632); } break; case 187: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT, NULL, NULL); } @@ -3723,13 +3732,13 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCE_STMT, NULL, NULL); } break; case 193: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy421); } +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy209); } break; case 194: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy632); } break; case 195: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy632); } break; case 196: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT, NULL, NULL); } @@ -3757,672 +3766,676 @@ static YYACTIONTYPE yy_reduce( break; case 204: /* db_name_cond_opt ::= */ case 209: /* from_db_opt ::= */ yytestcase(yyruleno==209); -{ yymsp[1].minor.yy674 = createDefaultDatabaseCondValue(pCxt); } +{ yymsp[1].minor.yy632 = createDefaultDatabaseCondValue(pCxt); } break; case 205: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy421); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy209); } + yymsp[-1].minor.yy632 = yylhsminor.yy632; break; case 206: /* like_pattern_opt ::= */ case 217: /* index_options ::= */ yytestcase(yyruleno==217); case 246: /* into_opt ::= */ yytestcase(yyruleno==246); - case 401: /* where_clause_opt ::= */ yytestcase(yyruleno==401); - case 405: /* twindow_clause_opt ::= */ yytestcase(yyruleno==405); - case 410: /* sliding_opt ::= */ yytestcase(yyruleno==410); - case 412: /* fill_opt ::= */ yytestcase(yyruleno==412); - case 424: /* having_clause_opt ::= */ yytestcase(yyruleno==424); - case 434: /* slimit_clause_opt ::= */ yytestcase(yyruleno==434); - case 438: /* limit_clause_opt ::= */ yytestcase(yyruleno==438); -{ yymsp[1].minor.yy674 = NULL; } + case 402: /* where_clause_opt ::= */ yytestcase(yyruleno==402); + case 406: /* twindow_clause_opt ::= */ yytestcase(yyruleno==406); + case 411: /* sliding_opt ::= */ yytestcase(yyruleno==411); + case 413: /* fill_opt ::= */ yytestcase(yyruleno==413); + case 425: /* having_clause_opt ::= */ yytestcase(yyruleno==425); + case 435: /* slimit_clause_opt ::= */ yytestcase(yyruleno==435); + case 439: /* limit_clause_opt ::= */ yytestcase(yyruleno==439); +{ yymsp[1].minor.yy632 = NULL; } break; case 207: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } +{ yymsp[-1].minor.yy632 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; case 208: /* table_name_cond ::= table_name */ -{ yylhsminor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy421); } - yymsp[0].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy209); } + yymsp[0].minor.yy632 = yylhsminor.yy632; break; case 210: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy421); } +{ yymsp[-1].minor.yy632 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy209); } break; case 213: /* func_name ::= function_name */ -{ yylhsminor.yy674 = createFunctionNode(pCxt, &yymsp[0].minor.yy421, NULL); } - yymsp[0].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createFunctionNode(pCxt, &yymsp[0].minor.yy209, NULL); } + yymsp[0].minor.yy632 = yylhsminor.yy632; break; case 214: /* cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy621, &yymsp[-3].minor.yy421, &yymsp[-1].minor.yy421, NULL, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy137, &yymsp[-3].minor.yy209, &yymsp[-1].minor.yy209, NULL, yymsp[0].minor.yy632); } break; case 215: /* cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_FULLTEXT, yymsp[-6].minor.yy621, &yymsp[-5].minor.yy421, &yymsp[-3].minor.yy421, yymsp[-1].minor.yy530, NULL); } +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_FULLTEXT, yymsp[-6].minor.yy137, &yymsp[-5].minor.yy209, &yymsp[-3].minor.yy209, yymsp[-1].minor.yy424, NULL); } break; case 216: /* cmd ::= DROP INDEX exists_opt index_name ON table_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-3].minor.yy621, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy421); } +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-3].minor.yy137, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy209); } break; case 218: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */ -{ yymsp[-8].minor.yy674 = createIndexOption(pCxt, yymsp[-6].minor.yy530, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), NULL, yymsp[0].minor.yy674); } +{ yymsp[-8].minor.yy632 = createIndexOption(pCxt, yymsp[-6].minor.yy424, releaseRawExprNode(pCxt, yymsp[-2].minor.yy632), NULL, yymsp[0].minor.yy632); } break; case 219: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */ -{ yymsp[-10].minor.yy674 = createIndexOption(pCxt, yymsp[-8].minor.yy530, releaseRawExprNode(pCxt, yymsp[-4].minor.yy674), releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), yymsp[0].minor.yy674); } +{ yymsp[-10].minor.yy632 = createIndexOption(pCxt, yymsp[-8].minor.yy424, releaseRawExprNode(pCxt, yymsp[-4].minor.yy632), releaseRawExprNode(pCxt, yymsp[-2].minor.yy632), yymsp[0].minor.yy632); } break; case 222: /* func ::= function_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy674 = createFunctionNode(pCxt, &yymsp[-3].minor.yy421, yymsp[-1].minor.yy530); } - yymsp[-3].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = createFunctionNode(pCxt, &yymsp[-3].minor.yy209, yymsp[-1].minor.yy424); } + yymsp[-3].minor.yy632 = yylhsminor.yy632; break; case 223: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ -{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy621, &yymsp[-2].minor.yy421, yymsp[0].minor.yy674, NULL, NULL); } +{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy137, &yymsp[-2].minor.yy209, yymsp[0].minor.yy632, NULL, NULL); } break; case 224: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-4].minor.yy621, &yymsp[-3].minor.yy421, NULL, &yymsp[0].minor.yy421, NULL); } +{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-4].minor.yy137, &yymsp[-3].minor.yy209, NULL, &yymsp[0].minor.yy209, NULL); } break; case 225: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-4].minor.yy621, &yymsp[-3].minor.yy421, NULL, NULL, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-4].minor.yy137, &yymsp[-3].minor.yy209, NULL, NULL, yymsp[0].minor.yy632); } break; case 226: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy621, &yymsp[0].minor.yy421); } +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy137, &yymsp[0].minor.yy209); } break; case 227: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy621, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy421); } +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy137, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy209); } break; case 228: /* cmd ::= DESC full_table_name */ case 229: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==229); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy632); } break; case 230: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; case 231: /* cmd ::= EXPLAIN analyze_opt explain_options query_expression */ -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy621, yymsp[-1].minor.yy674, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy137, yymsp[-1].minor.yy632, yymsp[0].minor.yy632); } break; case 233: /* analyze_opt ::= ANALYZE */ case 241: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==241); - case 391: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==391); -{ yymsp[0].minor.yy621 = true; } + case 392: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==392); +{ yymsp[0].minor.yy137 = true; } break; case 234: /* explain_options ::= */ -{ yymsp[1].minor.yy674 = createDefaultExplainOptions(pCxt); } +{ yymsp[1].minor.yy632 = createDefaultExplainOptions(pCxt); } break; case 235: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy674 = setExplainVerbose(pCxt, yymsp[-2].minor.yy674, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setExplainVerbose(pCxt, yymsp[-2].minor.yy632, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 236: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy674 = setExplainRatio(pCxt, yymsp[-2].minor.yy674, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ yylhsminor.yy632 = setExplainRatio(pCxt, yymsp[-2].minor.yy632, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 237: /* cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */ -{ pCxt->pRootNode = createCompactStmt(pCxt, yymsp[-1].minor.yy530); } +{ pCxt->pRootNode = createCompactStmt(pCxt, yymsp[-1].minor.yy424); } break; case 238: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ -{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy621, yymsp[-8].minor.yy621, &yymsp[-5].minor.yy421, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy690, yymsp[0].minor.yy42); } +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy137, yymsp[-8].minor.yy137, &yymsp[-5].minor.yy209, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy304, yymsp[0].minor.yy100); } break; case 239: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy621, &yymsp[0].minor.yy421); } +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy137, &yymsp[0].minor.yy209); } break; case 242: /* bufsize_opt ::= */ -{ yymsp[1].minor.yy42 = 0; } +{ yymsp[1].minor.yy100 = 0; } break; case 243: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ -{ yymsp[-1].minor.yy42 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy100 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; case 244: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */ -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-5].minor.yy621, &yymsp[-4].minor.yy421, yymsp[-2].minor.yy674, yymsp[-3].minor.yy674, yymsp[0].minor.yy674); } +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-5].minor.yy137, &yymsp[-4].minor.yy209, yymsp[-2].minor.yy632, yymsp[-3].minor.yy632, yymsp[0].minor.yy632); } break; case 245: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy621, &yymsp[0].minor.yy421); } +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy137, &yymsp[0].minor.yy209); } break; case 247: /* into_opt ::= INTO full_table_name */ - case 372: /* from_clause ::= FROM table_reference_list */ yytestcase(yyruleno==372); - case 402: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==402); - case 425: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==425); -{ yymsp[-1].minor.yy674 = yymsp[0].minor.yy674; } + case 373: /* from_clause ::= FROM table_reference_list */ yytestcase(yyruleno==373); + case 403: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==403); + case 426: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==426); +{ yymsp[-1].minor.yy632 = yymsp[0].minor.yy632; } break; case 248: /* stream_options ::= */ -{ yymsp[1].minor.yy674 = createStreamOptions(pCxt); } +{ yymsp[1].minor.yy632 = createStreamOptions(pCxt); } break; case 249: /* stream_options ::= stream_options TRIGGER AT_ONCE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy674)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy674 = yymsp[-2].minor.yy674; } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ ((SStreamOptions*)yymsp[-2].minor.yy632)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy632 = yymsp[-2].minor.yy632; } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; case 250: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy674)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy674 = yymsp[-2].minor.yy674; } - yymsp[-2].minor.yy674 = yylhsminor.yy674; +{ ((SStreamOptions*)yymsp[-2].minor.yy632)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy632 = yymsp[-2].minor.yy632; } + yymsp[-2].minor.yy632 = yylhsminor.yy632; + break; + case 251: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-3].minor.yy632)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy632)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy632); yylhsminor.yy632 = yymsp[-3].minor.yy632; } + yymsp[-3].minor.yy632 = yylhsminor.yy632; break; - case 251: /* stream_options ::= stream_options WATERMARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy674)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy674); yylhsminor.yy674 = yymsp[-2].minor.yy674; } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 252: /* stream_options ::= stream_options WATERMARK duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy632)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy632); yylhsminor.yy632 = yymsp[-2].minor.yy632; } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; - case 252: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 253: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } break; - case 253: /* cmd ::= KILL QUERY NK_INTEGER */ + case 254: /* cmd ::= KILL QUERY NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_QUERY_STMT, &yymsp[0].minor.yy0); } break; - case 254: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 255: /* cmd ::= KILL TRANSACTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } break; - case 255: /* cmd ::= BALANCE VGROUP */ + case 256: /* cmd ::= BALANCE VGROUP */ { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; - case 256: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 257: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 257: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy530); } + case 258: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy424); } break; - case 258: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 259: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 259: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy530 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - break; - case 261: /* cmd ::= SYNCDB db_name REPLICA */ -{ pCxt->pRootNode = createSyncdbStmt(pCxt, &yymsp[-1].minor.yy421); } - break; - case 262: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy674, yymsp[0].minor.yy674); } - break; - case 264: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy674 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy674 = yylhsminor.yy674; - break; - case 265: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy674 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy674 = yylhsminor.yy674; - break; - case 266: /* literal ::= NK_STRING */ -{ yylhsminor.yy674 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy674 = yylhsminor.yy674; - break; - case 267: /* literal ::= NK_BOOL */ -{ yylhsminor.yy674 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy674 = yylhsminor.yy674; - break; - case 268: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; - break; - case 269: /* literal ::= duration_literal */ - case 279: /* signed_literal ::= signed */ yytestcase(yyruleno==279); - case 299: /* expression ::= literal */ yytestcase(yyruleno==299); - case 300: /* expression ::= pseudo_column */ yytestcase(yyruleno==300); - case 301: /* expression ::= column_reference */ yytestcase(yyruleno==301); - case 302: /* expression ::= function_expression */ yytestcase(yyruleno==302); - case 303: /* expression ::= subquery */ yytestcase(yyruleno==303); - case 328: /* function_expression ::= literal_func */ yytestcase(yyruleno==328); - case 364: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==364); - case 368: /* boolean_primary ::= predicate */ yytestcase(yyruleno==368); - case 370: /* common_expression ::= expression */ yytestcase(yyruleno==370); - case 371: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==371); - case 373: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==373); - case 375: /* table_reference ::= table_primary */ yytestcase(yyruleno==375); - case 376: /* table_reference ::= joined_table */ yytestcase(yyruleno==376); - case 380: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==380); - case 427: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==427); - case 430: /* query_primary ::= query_specification */ yytestcase(yyruleno==430); -{ yylhsminor.yy674 = yymsp[0].minor.yy674; } - yymsp[0].minor.yy674 = yylhsminor.yy674; - break; - case 270: /* literal ::= NULL */ -{ yylhsminor.yy674 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy674 = yylhsminor.yy674; - break; - case 271: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy674 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy674 = yylhsminor.yy674; - break; - case 272: /* duration_literal ::= NK_VARIABLE */ -{ yylhsminor.yy674 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy674 = yylhsminor.yy674; - break; - case 273: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy674 = yylhsminor.yy674; - break; - case 274: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } - break; - case 275: /* signed ::= NK_MINUS NK_INTEGER */ + case 260: /* dnode_list ::= DNODE NK_INTEGER */ +{ yymsp[-1].minor.yy424 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + break; + case 262: /* cmd ::= SYNCDB db_name REPLICA */ +{ pCxt->pRootNode = createSyncdbStmt(pCxt, &yymsp[-1].minor.yy209); } + break; + case 263: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy632, yymsp[0].minor.yy632); } + break; + case 265: /* literal ::= NK_INTEGER */ +{ yylhsminor.yy632 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy632 = yylhsminor.yy632; + break; + case 266: /* literal ::= NK_FLOAT */ +{ yylhsminor.yy632 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy632 = yylhsminor.yy632; + break; + case 267: /* literal ::= NK_STRING */ +{ yylhsminor.yy632 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy632 = yylhsminor.yy632; + break; + case 268: /* literal ::= NK_BOOL */ +{ yylhsminor.yy632 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy632 = yylhsminor.yy632; + break; + case 269: /* literal ::= TIMESTAMP NK_STRING */ +{ yylhsminor.yy632 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy632 = yylhsminor.yy632; + break; + case 270: /* literal ::= duration_literal */ + case 280: /* signed_literal ::= signed */ yytestcase(yyruleno==280); + case 300: /* expression ::= literal */ yytestcase(yyruleno==300); + case 301: /* expression ::= pseudo_column */ yytestcase(yyruleno==301); + case 302: /* expression ::= column_reference */ yytestcase(yyruleno==302); + case 303: /* expression ::= function_expression */ yytestcase(yyruleno==303); + case 304: /* expression ::= subquery */ yytestcase(yyruleno==304); + case 329: /* function_expression ::= literal_func */ yytestcase(yyruleno==329); + case 365: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==365); + case 369: /* boolean_primary ::= predicate */ yytestcase(yyruleno==369); + case 371: /* common_expression ::= expression */ yytestcase(yyruleno==371); + case 372: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==372); + case 374: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==374); + case 376: /* table_reference ::= table_primary */ yytestcase(yyruleno==376); + case 377: /* table_reference ::= joined_table */ yytestcase(yyruleno==377); + case 381: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==381); + case 428: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==428); + case 431: /* query_primary ::= query_specification */ yytestcase(yyruleno==431); +{ yylhsminor.yy632 = yymsp[0].minor.yy632; } + yymsp[0].minor.yy632 = yylhsminor.yy632; + break; + case 271: /* literal ::= NULL */ +{ yylhsminor.yy632 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy632 = yylhsminor.yy632; + break; + case 272: /* literal ::= NK_QUESTION */ +{ yylhsminor.yy632 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy632 = yylhsminor.yy632; + break; + case 273: /* duration_literal ::= NK_VARIABLE */ +{ yylhsminor.yy632 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy632 = yylhsminor.yy632; + break; + case 274: /* signed ::= NK_INTEGER */ +{ yylhsminor.yy632 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy632 = yylhsminor.yy632; + break; + case 275: /* signed ::= NK_PLUS NK_INTEGER */ +{ yymsp[-1].minor.yy632 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } + break; + case 276: /* 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.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy632 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; + yymsp[-1].minor.yy632 = yylhsminor.yy632; break; - case 276: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy674 = yylhsminor.yy674; + case 277: /* signed ::= NK_FLOAT */ +{ yylhsminor.yy632 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy632 = yylhsminor.yy632; break; - case 277: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + case 278: /* signed ::= NK_PLUS NK_FLOAT */ +{ yymsp[-1].minor.yy632 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 278: /* signed ::= NK_MINUS NK_FLOAT */ + case 279: /* 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.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy632 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; + yymsp[-1].minor.yy632 = yylhsminor.yy632; break; - case 280: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy674 = yylhsminor.yy674; + case 281: /* signed_literal ::= NK_STRING */ +{ yylhsminor.yy632 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy632 = yylhsminor.yy632; break; - case 281: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy674 = yylhsminor.yy674; + case 282: /* signed_literal ::= NK_BOOL */ +{ yylhsminor.yy632 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy632 = yylhsminor.yy632; break; - case 282: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + case 283: /* signed_literal ::= TIMESTAMP NK_STRING */ +{ yymsp[-1].minor.yy632 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - case 283: /* signed_literal ::= duration_literal */ - case 285: /* signed_literal ::= literal_func */ yytestcase(yyruleno==285); - case 342: /* star_func_para ::= expression */ yytestcase(yyruleno==342); - case 397: /* select_item ::= common_expression */ yytestcase(yyruleno==397); - case 443: /* search_condition ::= common_expression */ yytestcase(yyruleno==443); -{ yylhsminor.yy674 = releaseRawExprNode(pCxt, yymsp[0].minor.yy674); } - yymsp[0].minor.yy674 = yylhsminor.yy674; + case 284: /* signed_literal ::= duration_literal */ + case 286: /* signed_literal ::= literal_func */ yytestcase(yyruleno==286); + case 343: /* star_func_para ::= expression */ yytestcase(yyruleno==343); + case 398: /* select_item ::= common_expression */ yytestcase(yyruleno==398); + case 444: /* search_condition ::= common_expression */ yytestcase(yyruleno==444); +{ yylhsminor.yy632 = releaseRawExprNode(pCxt, yymsp[0].minor.yy632); } + yymsp[0].minor.yy632 = yylhsminor.yy632; break; - case 284: /* signed_literal ::= NULL */ -{ yylhsminor.yy674 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy674 = yylhsminor.yy674; + case 285: /* signed_literal ::= NULL */ +{ yylhsminor.yy632 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy632 = yylhsminor.yy632; break; - case 304: /* expression ::= NK_LP expression NK_RP */ - case 369: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==369); -{ yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy674)); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 305: /* expression ::= NK_LP expression NK_RP */ + case 370: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==370); +{ yylhsminor.yy632 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy632)); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; - case 305: /* expression ::= NK_PLUS expression */ + case 306: /* expression ::= NK_PLUS expression */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy674)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy632); + yylhsminor.yy632 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy632)); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; + yymsp[-1].minor.yy632 = yylhsminor.yy632; break; - case 306: /* expression ::= NK_MINUS expression */ + case 307: /* expression ::= NK_MINUS expression */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy674), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy632); + yylhsminor.yy632 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy632), NULL)); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; + yymsp[-1].minor.yy632 = yylhsminor.yy632; break; - case 307: /* expression ::= expression NK_PLUS expression */ + case 308: /* expression ::= expression NK_PLUS expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy674); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy632); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy632); + yylhsminor.yy632 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy632), releaseRawExprNode(pCxt, yymsp[0].minor.yy632))); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; - case 308: /* expression ::= expression NK_MINUS expression */ + case 309: /* expression ::= expression NK_MINUS expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy674); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy632); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy632); + yylhsminor.yy632 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy632), releaseRawExprNode(pCxt, yymsp[0].minor.yy632))); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; - case 309: /* expression ::= expression NK_STAR expression */ + case 310: /* expression ::= expression NK_STAR expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy674); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy632); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy632); + yylhsminor.yy632 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy632), releaseRawExprNode(pCxt, yymsp[0].minor.yy632))); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; - case 310: /* expression ::= expression NK_SLASH expression */ + case 311: /* expression ::= expression NK_SLASH expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy674); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy632); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy632); + yylhsminor.yy632 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy632), releaseRawExprNode(pCxt, yymsp[0].minor.yy632))); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; - case 311: /* expression ::= expression NK_REM expression */ + case 312: /* expression ::= expression NK_REM expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy674); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy632); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy632); + yylhsminor.yy632 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy632), releaseRawExprNode(pCxt, yymsp[0].minor.yy632))); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; - case 312: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 313: /* expression ::= column_reference NK_ARROW NK_STRING */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy632); + yylhsminor.yy632 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy632), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; - break; - case 313: /* expression_list ::= expression */ -{ yylhsminor.yy530 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy674)); } - yymsp[0].minor.yy530 = yylhsminor.yy530; - break; - case 314: /* expression_list ::= expression_list NK_COMMA expression */ -{ yylhsminor.yy530 = addNodeToList(pCxt, yymsp[-2].minor.yy530, releaseRawExprNode(pCxt, yymsp[0].minor.yy674)); } - yymsp[-2].minor.yy530 = yylhsminor.yy530; - break; - case 315: /* column_reference ::= column_name */ -{ yylhsminor.yy674 = createRawExprNode(pCxt, &yymsp[0].minor.yy421, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy421)); } - yymsp[0].minor.yy674 = yylhsminor.yy674; - break; - case 316: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy421, createColumnNode(pCxt, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy421)); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; - break; - case 317: /* pseudo_column ::= ROWTS */ - case 318: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==318); - case 320: /* pseudo_column ::= QSTARTTS */ yytestcase(yyruleno==320); - case 321: /* pseudo_column ::= QENDTS */ yytestcase(yyruleno==321); - case 322: /* pseudo_column ::= WSTARTTS */ yytestcase(yyruleno==322); - case 323: /* pseudo_column ::= WENDTS */ yytestcase(yyruleno==323); - case 324: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==324); - case 330: /* literal_func ::= NOW */ yytestcase(yyruleno==330); -{ yylhsminor.yy674 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy674 = yylhsminor.yy674; - break; - case 319: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy421)))); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; - break; - case 325: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 326: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==326); -{ yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy421, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy421, yymsp[-1].minor.yy530)); } - yymsp[-3].minor.yy674 = yylhsminor.yy674; - break; - case 327: /* function_expression ::= CAST NK_LP expression AS type_name NK_RP */ -{ yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy674), yymsp[-1].minor.yy690)); } - yymsp[-5].minor.yy674 = yylhsminor.yy674; - break; - case 329: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy421, NULL)); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; - break; - case 338: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy530 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy530 = yylhsminor.yy530; - break; - case 343: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 400: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==400); -{ yylhsminor.yy674 = createColumnNode(pCxt, &yymsp[-2].minor.yy421, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; - break; - case 344: /* predicate ::= expression compare_op expression */ - case 349: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==349); + yymsp[-2].minor.yy632 = yylhsminor.yy632; + break; + case 314: /* expression_list ::= expression */ +{ yylhsminor.yy424 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy632)); } + yymsp[0].minor.yy424 = yylhsminor.yy424; + break; + case 315: /* expression_list ::= expression_list NK_COMMA expression */ +{ yylhsminor.yy424 = addNodeToList(pCxt, yymsp[-2].minor.yy424, releaseRawExprNode(pCxt, yymsp[0].minor.yy632)); } + yymsp[-2].minor.yy424 = yylhsminor.yy424; + break; + case 316: /* column_reference ::= column_name */ +{ yylhsminor.yy632 = createRawExprNode(pCxt, &yymsp[0].minor.yy209, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy209)); } + yymsp[0].minor.yy632 = yylhsminor.yy632; + break; + case 317: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy632 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy209, createColumnNode(pCxt, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy209)); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; + break; + case 318: /* pseudo_column ::= ROWTS */ + case 319: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==319); + case 321: /* pseudo_column ::= QSTARTTS */ yytestcase(yyruleno==321); + case 322: /* pseudo_column ::= QENDTS */ yytestcase(yyruleno==322); + case 323: /* pseudo_column ::= WSTARTTS */ yytestcase(yyruleno==323); + case 324: /* pseudo_column ::= WENDTS */ yytestcase(yyruleno==324); + case 325: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==325); + case 331: /* literal_func ::= NOW */ yytestcase(yyruleno==331); +{ yylhsminor.yy632 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy632 = yylhsminor.yy632; + break; + case 320: /* pseudo_column ::= table_name NK_DOT TBNAME */ +{ yylhsminor.yy632 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy209)))); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; + break; + case 326: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 327: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==327); +{ yylhsminor.yy632 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy209, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy209, yymsp[-1].minor.yy424)); } + yymsp[-3].minor.yy632 = yylhsminor.yy632; + break; + case 328: /* function_expression ::= CAST NK_LP expression AS type_name NK_RP */ +{ yylhsminor.yy632 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy632), yymsp[-1].minor.yy304)); } + yymsp[-5].minor.yy632 = yylhsminor.yy632; + break; + case 330: /* literal_func ::= noarg_func NK_LP NK_RP */ +{ yylhsminor.yy632 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy209, NULL)); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; + break; + case 339: /* star_func_para_list ::= NK_STAR */ +{ yylhsminor.yy424 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy424 = yylhsminor.yy424; + break; + case 344: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 401: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==401); +{ yylhsminor.yy632 = createColumnNode(pCxt, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; + break; + case 345: /* predicate ::= expression compare_op expression */ + case 350: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==350); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy674); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy28, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy632); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy632); + yylhsminor.yy632 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy380, releaseRawExprNode(pCxt, yymsp[-2].minor.yy632), releaseRawExprNode(pCxt, yymsp[0].minor.yy632))); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; - case 345: /* predicate ::= expression BETWEEN expression AND expression */ + case 346: /* predicate ::= expression BETWEEN expression AND expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy674); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy674), releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy632); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy632); + yylhsminor.yy632 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy632), releaseRawExprNode(pCxt, yymsp[-2].minor.yy632), releaseRawExprNode(pCxt, yymsp[0].minor.yy632))); } - yymsp[-4].minor.yy674 = yylhsminor.yy674; + yymsp[-4].minor.yy632 = yylhsminor.yy632; break; - case 346: /* predicate ::= expression NOT BETWEEN expression AND expression */ + case 347: /* predicate ::= expression NOT BETWEEN expression AND expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy674); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy674), releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy632); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy632); + yylhsminor.yy632 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy632), releaseRawExprNode(pCxt, yymsp[-2].minor.yy632), releaseRawExprNode(pCxt, yymsp[0].minor.yy632))); } - yymsp[-5].minor.yy674 = yylhsminor.yy674; + yymsp[-5].minor.yy632 = yylhsminor.yy632; break; - case 347: /* predicate ::= expression IS NULL */ + case 348: /* predicate ::= expression IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy632); + yylhsminor.yy632 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy632), NULL)); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; - case 348: /* predicate ::= expression IS NOT NULL */ + case 349: /* predicate ::= expression IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy674), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy632); + yylhsminor.yy632 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy632), NULL)); } - yymsp[-3].minor.yy674 = yylhsminor.yy674; + yymsp[-3].minor.yy632 = yylhsminor.yy632; break; - case 350: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy28 = OP_TYPE_LOWER_THAN; } + case 351: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy380 = OP_TYPE_LOWER_THAN; } break; - case 351: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy28 = OP_TYPE_GREATER_THAN; } + case 352: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy380 = OP_TYPE_GREATER_THAN; } break; - case 352: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy28 = OP_TYPE_LOWER_EQUAL; } + case 353: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy380 = OP_TYPE_LOWER_EQUAL; } break; - case 353: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy28 = OP_TYPE_GREATER_EQUAL; } + case 354: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy380 = OP_TYPE_GREATER_EQUAL; } break; - case 354: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy28 = OP_TYPE_NOT_EQUAL; } + case 355: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy380 = OP_TYPE_NOT_EQUAL; } break; - case 355: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy28 = OP_TYPE_EQUAL; } + case 356: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy380 = OP_TYPE_EQUAL; } break; - case 356: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy28 = OP_TYPE_LIKE; } + case 357: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy380 = OP_TYPE_LIKE; } break; - case 357: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy28 = OP_TYPE_NOT_LIKE; } + case 358: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy380 = OP_TYPE_NOT_LIKE; } break; - case 358: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy28 = OP_TYPE_MATCH; } + case 359: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy380 = OP_TYPE_MATCH; } break; - case 359: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy28 = OP_TYPE_NMATCH; } + case 360: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy380 = OP_TYPE_NMATCH; } break; - case 360: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy28 = OP_TYPE_JSON_CONTAINS; } + case 361: /* compare_op ::= CONTAINS */ +{ yymsp[0].minor.yy380 = OP_TYPE_JSON_CONTAINS; } break; - case 361: /* in_op ::= IN */ -{ yymsp[0].minor.yy28 = OP_TYPE_IN; } + case 362: /* in_op ::= IN */ +{ yymsp[0].minor.yy380 = OP_TYPE_IN; } break; - case 362: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy28 = OP_TYPE_NOT_IN; } + case 363: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy380 = OP_TYPE_NOT_IN; } break; - case 363: /* in_predicate_value ::= NK_LP expression_list NK_RP */ -{ yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy530)); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 364: /* in_predicate_value ::= NK_LP expression_list NK_RP */ +{ yylhsminor.yy632 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy424)); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; - case 365: /* boolean_value_expression ::= NOT boolean_primary */ + case 366: /* boolean_value_expression ::= NOT boolean_primary */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy674), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy632); + yylhsminor.yy632 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy632), NULL)); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; + yymsp[-1].minor.yy632 = yylhsminor.yy632; break; - case 366: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 367: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy674); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy632); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy632); + yylhsminor.yy632 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy632), releaseRawExprNode(pCxt, yymsp[0].minor.yy632))); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; - case 367: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 368: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy674); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy674); - yylhsminor.yy674 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy632); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy632); + yylhsminor.yy632 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy632), releaseRawExprNode(pCxt, yymsp[0].minor.yy632))); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; - case 374: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy674 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy674, yymsp[0].minor.yy674, NULL); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 375: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy632 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy632, yymsp[0].minor.yy632, NULL); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; - case 377: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy674 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy421, &yymsp[0].minor.yy421); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; + case 378: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy632 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy209, &yymsp[0].minor.yy209); } + yymsp[-1].minor.yy632 = yylhsminor.yy632; break; - case 378: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy674 = createRealTableNode(pCxt, &yymsp[-3].minor.yy421, &yymsp[-1].minor.yy421, &yymsp[0].minor.yy421); } - yymsp[-3].minor.yy674 = yylhsminor.yy674; + case 379: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy632 = createRealTableNode(pCxt, &yymsp[-3].minor.yy209, &yymsp[-1].minor.yy209, &yymsp[0].minor.yy209); } + yymsp[-3].minor.yy632 = yylhsminor.yy632; break; - case 379: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy674 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy674), &yymsp[0].minor.yy421); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; + case 380: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy632 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy632), &yymsp[0].minor.yy209); } + yymsp[-1].minor.yy632 = yylhsminor.yy632; break; - case 381: /* alias_opt ::= */ -{ yymsp[1].minor.yy421 = nil_token; } + case 382: /* alias_opt ::= */ +{ yymsp[1].minor.yy209 = nil_token; } break; - case 382: /* alias_opt ::= table_alias */ -{ yylhsminor.yy421 = yymsp[0].minor.yy421; } - yymsp[0].minor.yy421 = yylhsminor.yy421; + case 383: /* alias_opt ::= table_alias */ +{ yylhsminor.yy209 = yymsp[0].minor.yy209; } + yymsp[0].minor.yy209 = yylhsminor.yy209; break; - case 383: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy421 = yymsp[0].minor.yy421; } + case 384: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy209 = yymsp[0].minor.yy209; } break; - case 384: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 385: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==385); -{ yymsp[-2].minor.yy674 = yymsp[-1].minor.yy674; } + case 385: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 386: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==386); +{ yymsp[-2].minor.yy632 = yymsp[-1].minor.yy632; } break; - case 386: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -{ yylhsminor.yy674 = createJoinTableNode(pCxt, yymsp[-4].minor.yy636, yymsp[-5].minor.yy674, yymsp[-2].minor.yy674, yymsp[0].minor.yy674); } - yymsp[-5].minor.yy674 = yylhsminor.yy674; + case 387: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +{ yylhsminor.yy632 = createJoinTableNode(pCxt, yymsp[-4].minor.yy612, yymsp[-5].minor.yy632, yymsp[-2].minor.yy632, yymsp[0].minor.yy632); } + yymsp[-5].minor.yy632 = yylhsminor.yy632; break; - case 387: /* join_type ::= */ -{ yymsp[1].minor.yy636 = JOIN_TYPE_INNER; } + case 388: /* join_type ::= */ +{ yymsp[1].minor.yy612 = JOIN_TYPE_INNER; } break; - case 388: /* join_type ::= INNER */ -{ yymsp[0].minor.yy636 = JOIN_TYPE_INNER; } + case 389: /* join_type ::= INNER */ +{ yymsp[0].minor.yy612 = JOIN_TYPE_INNER; } break; - case 389: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + case 390: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ { - yymsp[-8].minor.yy674 = createSelectStmt(pCxt, yymsp[-7].minor.yy621, yymsp[-6].minor.yy530, yymsp[-5].minor.yy674); - yymsp[-8].minor.yy674 = addWhereClause(pCxt, yymsp[-8].minor.yy674, yymsp[-4].minor.yy674); - yymsp[-8].minor.yy674 = addPartitionByClause(pCxt, yymsp[-8].minor.yy674, yymsp[-3].minor.yy530); - yymsp[-8].minor.yy674 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy674, yymsp[-2].minor.yy674); - yymsp[-8].minor.yy674 = addGroupByClause(pCxt, yymsp[-8].minor.yy674, yymsp[-1].minor.yy530); - yymsp[-8].minor.yy674 = addHavingClause(pCxt, yymsp[-8].minor.yy674, yymsp[0].minor.yy674); + yymsp[-8].minor.yy632 = createSelectStmt(pCxt, yymsp[-7].minor.yy137, yymsp[-6].minor.yy424, yymsp[-5].minor.yy632); + yymsp[-8].minor.yy632 = addWhereClause(pCxt, yymsp[-8].minor.yy632, yymsp[-4].minor.yy632); + yymsp[-8].minor.yy632 = addPartitionByClause(pCxt, yymsp[-8].minor.yy632, yymsp[-3].minor.yy424); + yymsp[-8].minor.yy632 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy632, yymsp[-2].minor.yy632); + yymsp[-8].minor.yy632 = addGroupByClause(pCxt, yymsp[-8].minor.yy632, yymsp[-1].minor.yy424); + yymsp[-8].minor.yy632 = addHavingClause(pCxt, yymsp[-8].minor.yy632, yymsp[0].minor.yy632); } break; - case 392: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy621 = false; } + case 393: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy137 = false; } break; - case 393: /* select_list ::= NK_STAR */ -{ yymsp[0].minor.yy530 = NULL; } + case 394: /* select_list ::= NK_STAR */ +{ yymsp[0].minor.yy424 = NULL; } break; - case 398: /* select_item ::= common_expression column_alias */ -{ yylhsminor.yy674 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy674), &yymsp[0].minor.yy421); } - yymsp[-1].minor.yy674 = yylhsminor.yy674; + case 399: /* select_item ::= common_expression column_alias */ +{ yylhsminor.yy632 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy632), &yymsp[0].minor.yy209); } + yymsp[-1].minor.yy632 = yylhsminor.yy632; break; - case 399: /* select_item ::= common_expression AS column_alias */ -{ yylhsminor.yy674 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), &yymsp[0].minor.yy421); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 400: /* select_item ::= common_expression AS column_alias */ +{ yylhsminor.yy632 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy632), &yymsp[0].minor.yy209); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; - case 404: /* partition_by_clause_opt ::= PARTITION BY expression_list */ - case 421: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==421); - case 433: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==433); -{ yymsp[-2].minor.yy530 = yymsp[0].minor.yy530; } + case 405: /* partition_by_clause_opt ::= PARTITION BY expression_list */ + case 422: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==422); + case 434: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==434); +{ yymsp[-2].minor.yy424 = yymsp[0].minor.yy424; } break; - case 406: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ -{ yymsp[-5].minor.yy674 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy674), releaseRawExprNode(pCxt, yymsp[-1].minor.yy674)); } + case 407: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ +{ yymsp[-5].minor.yy632 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy632), releaseRawExprNode(pCxt, yymsp[-1].minor.yy632)); } break; - case 407: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ -{ yymsp[-3].minor.yy674 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy674)); } + case 408: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ +{ yymsp[-3].minor.yy632 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy632)); } break; - case 408: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy674 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy674), NULL, yymsp[-1].minor.yy674, yymsp[0].minor.yy674); } + case 409: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy632 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy632), NULL, yymsp[-1].minor.yy632, yymsp[0].minor.yy632); } break; - case 409: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy674 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy674), releaseRawExprNode(pCxt, yymsp[-3].minor.yy674), yymsp[-1].minor.yy674, yymsp[0].minor.yy674); } + case 410: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy632 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy632), releaseRawExprNode(pCxt, yymsp[-3].minor.yy632), yymsp[-1].minor.yy632, yymsp[0].minor.yy632); } break; - case 411: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ -{ yymsp[-3].minor.yy674 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy674); } + case 412: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ +{ yymsp[-3].minor.yy632 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy632); } break; - case 413: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy674 = createFillNode(pCxt, yymsp[-1].minor.yy320, NULL); } + case 414: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy632 = createFillNode(pCxt, yymsp[-1].minor.yy54, NULL); } break; - case 414: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ -{ yymsp[-5].minor.yy674 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy530)); } + case 415: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ +{ yymsp[-5].minor.yy632 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy424)); } break; - case 415: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy320 = FILL_MODE_NONE; } + case 416: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy54 = FILL_MODE_NONE; } break; - case 416: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy320 = FILL_MODE_PREV; } + case 417: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy54 = FILL_MODE_PREV; } break; - case 417: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy320 = FILL_MODE_NULL; } + case 418: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy54 = FILL_MODE_NULL; } break; - case 418: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy320 = FILL_MODE_LINEAR; } + case 419: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy54 = FILL_MODE_LINEAR; } break; - case 419: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy320 = FILL_MODE_NEXT; } + case 420: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy54 = FILL_MODE_NEXT; } break; - case 422: /* group_by_list ::= expression */ -{ yylhsminor.yy530 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); } - yymsp[0].minor.yy530 = yylhsminor.yy530; + case 423: /* group_by_list ::= expression */ +{ yylhsminor.yy424 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy632))); } + yymsp[0].minor.yy424 = yylhsminor.yy424; break; - case 423: /* group_by_list ::= group_by_list NK_COMMA expression */ -{ yylhsminor.yy530 = addNodeToList(pCxt, yymsp[-2].minor.yy530, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy674))); } - yymsp[-2].minor.yy530 = yylhsminor.yy530; + case 424: /* group_by_list ::= group_by_list NK_COMMA expression */ +{ yylhsminor.yy424 = addNodeToList(pCxt, yymsp[-2].minor.yy424, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy632))); } + yymsp[-2].minor.yy424 = yylhsminor.yy424; break; - case 426: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 427: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy674 = addOrderByClause(pCxt, yymsp[-3].minor.yy674, yymsp[-2].minor.yy530); - yylhsminor.yy674 = addSlimitClause(pCxt, yylhsminor.yy674, yymsp[-1].minor.yy674); - yylhsminor.yy674 = addLimitClause(pCxt, yylhsminor.yy674, yymsp[0].minor.yy674); + yylhsminor.yy632 = addOrderByClause(pCxt, yymsp[-3].minor.yy632, yymsp[-2].minor.yy424); + yylhsminor.yy632 = addSlimitClause(pCxt, yylhsminor.yy632, yymsp[-1].minor.yy632); + yylhsminor.yy632 = addLimitClause(pCxt, yylhsminor.yy632, yymsp[0].minor.yy632); } - yymsp[-3].minor.yy674 = yylhsminor.yy674; + yymsp[-3].minor.yy632 = yylhsminor.yy632; break; - case 428: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ -{ yylhsminor.yy674 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy674, yymsp[0].minor.yy674); } - yymsp[-3].minor.yy674 = yylhsminor.yy674; + case 429: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ +{ yylhsminor.yy632 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy632, yymsp[0].minor.yy632); } + yymsp[-3].minor.yy632 = yylhsminor.yy632; break; - case 429: /* query_expression_body ::= query_expression_body UNION query_expression_body */ -{ yylhsminor.yy674 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy674, yymsp[0].minor.yy674); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 430: /* query_expression_body ::= query_expression_body UNION query_expression_body */ +{ yylhsminor.yy632 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy632, yymsp[0].minor.yy632); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; - case 431: /* query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ -{ yymsp[-5].minor.yy674 = yymsp[-4].minor.yy674; } - yy_destructor(yypParser,351,&yymsp[-3].minor); - yy_destructor(yypParser,352,&yymsp[-2].minor); - yy_destructor(yypParser,353,&yymsp[-1].minor); + case 432: /* query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ +{ yymsp[-5].minor.yy632 = yymsp[-4].minor.yy632; } + yy_destructor(yypParser,352,&yymsp[-3].minor); + yy_destructor(yypParser,353,&yymsp[-2].minor); + yy_destructor(yypParser,354,&yymsp[-1].minor); break; - case 435: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 439: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==439); -{ yymsp[-1].minor.yy674 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 436: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 440: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==440); +{ yymsp[-1].minor.yy632 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 436: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 440: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==440); -{ yymsp[-3].minor.yy674 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 437: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 441: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==441); +{ yymsp[-3].minor.yy632 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 437: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 441: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==441); -{ yymsp[-3].minor.yy674 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 438: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 442: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==442); +{ yymsp[-3].minor.yy632 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 442: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy674 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy674); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 443: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy632 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy632); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; - case 446: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy674 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy674), yymsp[-1].minor.yy610, yymsp[0].minor.yy107); } - yymsp[-2].minor.yy674 = yylhsminor.yy674; + case 447: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy632 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy632), yymsp[-1].minor.yy578, yymsp[0].minor.yy217); } + yymsp[-2].minor.yy632 = yylhsminor.yy632; break; - case 447: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy610 = ORDER_ASC; } + case 448: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy578 = ORDER_ASC; } break; - case 448: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy610 = ORDER_ASC; } + case 449: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy578 = ORDER_ASC; } break; - case 449: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy610 = ORDER_DESC; } + case 450: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy578 = ORDER_DESC; } break; - case 450: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy107 = NULL_ORDER_DEFAULT; } + case 451: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy217 = NULL_ORDER_DEFAULT; } break; - case 451: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy107 = NULL_ORDER_FIRST; } + case 452: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy217 = NULL_ORDER_FIRST; } break; - case 452: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy107 = NULL_ORDER_LAST; } + case 453: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy217 = NULL_ORDER_LAST; } break; default: break; diff --git a/source/libs/parser/test/mockCatalog.cpp b/source/libs/parser/test/mockCatalog.cpp index 2ba5b97062aeb5b7b1ecea2504fcc1092ca27afd..3729a2e1dc3e4480b65390b72fe1e6dcff815db7 100644 --- a/source/libs/parser/test/mockCatalog.cpp +++ b/source/libs/parser/test/mockCatalog.cpp @@ -157,6 +157,28 @@ void generateTestST1(MockCatalogService* mcs) { mcs->createSubTable("test", "st1", "st1s3", 1); } +/* + * Super Table: st2 + * Field | Type | DataType | Bytes | + * ========================================================================== + * ts | column | TIMESTAMP | 8 | + * c1 | column | INT | 4 | + * c2 | column | VARCHAR | 20 | + * jtag | tag | json | -- | + * Child Table: st2s1, st2s2 + */ +void generateTestST2(MockCatalogService* mcs) { + ITableBuilder& builder = mcs->createTableBuilder("test", "st2", TSDB_SUPER_TABLE, 3, 1) + .setPrecision(TSDB_TIME_PRECISION_MILLI) + .addColumn("ts", TSDB_DATA_TYPE_TIMESTAMP) + .addColumn("c1", TSDB_DATA_TYPE_INT) + .addColumn("c2", TSDB_DATA_TYPE_BINARY, 20) + .addTag("jtag", TSDB_DATA_TYPE_JSON); + builder.done(); + mcs->createSubTable("test", "st2", "st2s1", 1); + mcs->createSubTable("test", "st2", "st2s2", 2); +} + void generateFunctions(MockCatalogService* mcs) { mcs->createFunction("udf1", TSDB_FUNC_TYPE_SCALAR, TSDB_DATA_TYPE_INT, tDataTypes[TSDB_DATA_TYPE_INT].bytes, 0); mcs->createFunction("udf2", TSDB_FUNC_TYPE_AGGREGATE, TSDB_DATA_TYPE_DOUBLE, tDataTypes[TSDB_DATA_TYPE_DOUBLE].bytes, @@ -283,6 +305,7 @@ void generateMetaData() { generatePerformanceSchema(g_mockCatalogService.get()); generateTestT1(g_mockCatalogService.get()); generateTestST1(g_mockCatalogService.get()); + generateTestST2(g_mockCatalogService.get()); generateFunctions(g_mockCatalogService.get()); g_mockCatalogService->showTables(); } diff --git a/source/libs/parser/test/mockCatalogService.cpp b/source/libs/parser/test/mockCatalogService.cpp index 010d4a2f7243d550709b4942a43d35962fbf7168..68f9e9d36d517a0cbfd34417c8276aadd680f49a 100644 --- a/source/libs/parser/test/mockCatalogService.cpp +++ b/source/libs/parser/test/mockCatalogService.cpp @@ -584,3 +584,35 @@ int32_t MockCatalogService::catalogGetTableIndex(const SName* pTableName, SArray int32_t MockCatalogService::catalogGetAllMeta(const SCatalogReq* pCatalogReq, SMetaData* pMetaData) const { return impl_->catalogGetAllMeta(pCatalogReq, pMetaData); } + +void MockCatalogService::destoryCatalogReq(SCatalogReq* pReq) { + taosArrayDestroy(pReq->pDbVgroup); + taosArrayDestroy(pReq->pDbCfg); + taosArrayDestroy(pReq->pDbInfo); + taosArrayDestroy(pReq->pTableMeta); + taosArrayDestroy(pReq->pTableHash); + taosArrayDestroy(pReq->pUdf); + taosArrayDestroy(pReq->pIndex); + taosArrayDestroy(pReq->pUser); + taosArrayDestroy(pReq->pTableIndex); + delete pReq; +} + +void MockCatalogService::destoryMetaRes(void* p) { + SMetaRes* pRes = (SMetaRes*)p; + taosMemoryFree(pRes->pRes); +} + +void MockCatalogService::destoryMetaData(SMetaData* pData) { + taosArrayDestroyEx(pData->pDbVgroup, destoryMetaRes); + taosArrayDestroyEx(pData->pDbCfg, destoryMetaRes); + taosArrayDestroyEx(pData->pDbInfo, destoryMetaRes); + taosArrayDestroyEx(pData->pTableMeta, destoryMetaRes); + taosArrayDestroyEx(pData->pTableHash, destoryMetaRes); + taosArrayDestroyEx(pData->pTableIndex, destoryMetaRes); + taosArrayDestroyEx(pData->pUdfList, destoryMetaRes); + taosArrayDestroyEx(pData->pIndex, destoryMetaRes); + taosArrayDestroyEx(pData->pUser, destoryMetaRes); + taosArrayDestroyEx(pData->pQnodeList, destoryMetaRes); + delete pData; +} diff --git a/source/libs/parser/test/mockCatalogService.h b/source/libs/parser/test/mockCatalogService.h index c4ab091b7a76c3ed1562e9c2e91903471e340fef..1c98a7d9d52f47804d56fd144e9228b61f679ed1 100644 --- a/source/libs/parser/test/mockCatalogService.h +++ b/source/libs/parser/test/mockCatalogService.h @@ -50,6 +50,10 @@ struct MockTableMeta { class MockCatalogServiceImpl; class MockCatalogService { public: + static void destoryCatalogReq(SCatalogReq* pReq); + static void destoryMetaRes(void* p); + static void destoryMetaData(SMetaData* pData); + MockCatalogService(); ~MockCatalogService(); ITableBuilder& createTableBuilder(const std::string& db, const std::string& tbname, int8_t tableType, diff --git a/source/libs/parser/test/parInitialATest.cpp b/source/libs/parser/test/parInitialATest.cpp index f554651b90e6ef343ffb0f72bc2508f6c91a5246..3c1d931f37c51436067acc315e8bc57ea49cd8ca 100644 --- a/source/libs/parser/test/parInitialATest.cpp +++ b/source/libs/parser/test/parInitialATest.cpp @@ -76,6 +76,11 @@ TEST_F(ParserInitialATest, alterSTable) { SMAlterStbReq expect = {0}; + auto clearAlterStbReq = [&]() { + tFreeSMAltertbReq(&expect); + memset(&expect, 0, sizeof(SMAlterStbReq)); + }; + auto setAlterStbReqFunc = [&](const char* pTbname, int8_t alterType, int32_t numOfFields = 0, const char* pField1Name = nullptr, int8_t field1Type = 0, int32_t field1Bytes = 0, const char* pField2Name = nullptr, const char* pComment = nullptr, @@ -139,39 +144,49 @@ TEST_F(ParserInitialATest, alterSTable) { ASSERT_EQ(pField->type, pExpectField->type); ASSERT_EQ(pField->bytes, pExpectField->bytes); } + tFreeSMAltertbReq(&req); }); setAlterStbReqFunc("st1", TSDB_ALTER_TABLE_UPDATE_OPTIONS, 0, nullptr, 0, 0, nullptr, nullptr, 10); run("ALTER TABLE st1 TTL 10"); + clearAlterStbReq(); setAlterStbReqFunc("st1", TSDB_ALTER_TABLE_UPDATE_OPTIONS, 0, nullptr, 0, 0, nullptr, "test"); run("ALTER TABLE st1 COMMENT 'test'"); + clearAlterStbReq(); setAlterStbReqFunc("st1", TSDB_ALTER_TABLE_ADD_COLUMN, 1, "cc1", TSDB_DATA_TYPE_BIGINT); run("ALTER TABLE st1 ADD COLUMN cc1 BIGINT"); + clearAlterStbReq(); setAlterStbReqFunc("st1", TSDB_ALTER_TABLE_DROP_COLUMN, 1, "c1"); run("ALTER TABLE st1 DROP COLUMN c1"); + clearAlterStbReq(); setAlterStbReqFunc("st1", TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, 1, "c1", TSDB_DATA_TYPE_VARCHAR, 20 + VARSTR_HEADER_SIZE); run("ALTER TABLE st1 MODIFY COLUMN c1 VARCHAR(20)"); + clearAlterStbReq(); // setAlterStbReqFunc("st1", TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, 2, "c1", 0, 0, "cc1"); // run("ALTER TABLE st1 RENAME COLUMN c1 cc1"); setAlterStbReqFunc("st1", TSDB_ALTER_TABLE_ADD_TAG, 1, "tag11", TSDB_DATA_TYPE_BIGINT); run("ALTER TABLE st1 ADD TAG tag11 BIGINT"); + clearAlterStbReq(); setAlterStbReqFunc("st1", TSDB_ALTER_TABLE_DROP_TAG, 1, "tag1"); run("ALTER TABLE st1 DROP TAG tag1"); + clearAlterStbReq(); setAlterStbReqFunc("st1", TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, 1, "tag1", TSDB_DATA_TYPE_VARCHAR, 20 + VARSTR_HEADER_SIZE); run("ALTER TABLE st1 MODIFY TAG tag1 VARCHAR(20)"); + clearAlterStbReq(); setAlterStbReqFunc("st1", TSDB_ALTER_TABLE_UPDATE_TAG_NAME, 2, "tag1", 0, 0, "tag11"); run("ALTER TABLE st1 RENAME TAG tag1 tag11"); + clearAlterStbReq(); // todo // ADD {FULLTEXT | SMA} INDEX index_name (col_name [, col_name] ...) [index_option] @@ -188,9 +203,16 @@ TEST_F(ParserInitialATest, alterTable) { SVAlterTbReq expect = {0}; + auto clearAlterTbReq = [&]() { + free(expect.tbName); + free(expect.colName); + free(expect.colNewName); + free(expect.tagName); + memset(&expect, 0, sizeof(SVAlterTbReq)); + }; + auto setAlterColFunc = [&](const char* pTbname, int8_t alterType, const char* pColName, int8_t dataType = 0, int32_t dataBytes = 0, const char* pNewColName = nullptr) { - memset(&expect, 0, sizeof(SVAlterTbReq)); expect.tbName = strdup(pTbname); expect.action = alterType; expect.colName = strdup(pColName); @@ -213,7 +235,6 @@ TEST_F(ParserInitialATest, alterTable) { }; auto setAlterTagFunc = [&](const char* pTbname, const char* pTagName, uint8_t* pNewVal, uint32_t bytes) { - memset(&expect, 0, sizeof(SVAlterTbReq)); expect.tbName = strdup(pTbname); expect.action = TSDB_ALTER_TABLE_UPDATE_TAG_VAL; expect.tagName = strdup(pTagName); @@ -224,7 +245,6 @@ TEST_F(ParserInitialATest, alterTable) { }; auto setAlterOptionsFunc = [&](const char* pTbname, int32_t ttl, char* pComment = nullptr) { - memset(&expect, 0, sizeof(SVAlterTbReq)); expect.tbName = strdup(pTbname); expect.action = TSDB_ALTER_TABLE_UPDATE_OPTIONS; if (-1 != ttl) { @@ -281,25 +301,32 @@ TEST_F(ParserInitialATest, alterTable) { setAlterOptionsFunc("t1", 10, nullptr); run("ALTER TABLE t1 TTL 10"); + clearAlterTbReq(); setAlterOptionsFunc("t1", -1, (char*)"test"); run("ALTER TABLE t1 COMMENT 'test'"); + clearAlterTbReq(); setAlterColFunc("t1", TSDB_ALTER_TABLE_ADD_COLUMN, "cc1", TSDB_DATA_TYPE_BIGINT); run("ALTER TABLE t1 ADD COLUMN cc1 BIGINT"); + clearAlterTbReq(); setAlterColFunc("t1", TSDB_ALTER_TABLE_DROP_COLUMN, "c1"); run("ALTER TABLE t1 DROP COLUMN c1"); + clearAlterTbReq(); setAlterColFunc("t1", TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, "c2", TSDB_DATA_TYPE_VARCHAR, 30 + VARSTR_HEADER_SIZE); run("ALTER TABLE t1 MODIFY COLUMN c2 VARCHAR(30)"); + clearAlterTbReq(); setAlterColFunc("t1", TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, "c1", 0, 0, "cc1"); run("ALTER TABLE t1 RENAME COLUMN c1 cc1"); + clearAlterTbReq(); int32_t val = 10; setAlterTagFunc("st1s1", "tag1", (uint8_t*)&val, sizeof(val)); run("ALTER TABLE st1s1 SET TAG tag1=10"); + clearAlterTbReq(); // todo // ADD {FULLTEXT | SMA} INDEX index_name (col_name [, col_name] ...) [index_option] diff --git a/source/libs/parser/test/parInitialCTest.cpp b/source/libs/parser/test/parInitialCTest.cpp index f306947f76604e4e52d6764edae6c685e0e49e20..919d4c041d685826498f7fa87952ab03621abe7e 100644 --- a/source/libs/parser/test/parInitialCTest.cpp +++ b/source/libs/parser/test/parInitialCTest.cpp @@ -67,8 +67,12 @@ TEST_F(ParserInitialCTest, createDatabase) { SCreateDbReq expect = {0}; - auto setCreateDbReqFunc = [&](const char* pDbname, int8_t igExists = 0) { + auto clearCreateDbReq = [&]() { + tFreeSCreateDbReq(&expect); memset(&expect, 0, sizeof(SCreateDbReq)); + }; + + auto setCreateDbReqFunc = [&](const char* pDbname, int8_t igExists = 0) { int32_t len = snprintf(expect.db, sizeof(expect.db), "0.%s", pDbname); expect.db[len] = '\0'; expect.ignoreExist = igExists; @@ -166,10 +170,12 @@ TEST_F(ParserInitialCTest, createDatabase) { ASSERT_EQ(pReten->keepUnit, pExpectReten->keepUnit); } } + tFreeSCreateDbReq(&req); }); setCreateDbReqFunc("wxy_db"); run("CREATE DATABASE wxy_db"); + clearCreateDbReq(); setCreateDbReqFunc("wxy_db", 1); setDbBufferFunc(64); @@ -211,6 +217,7 @@ TEST_F(ParserInitialCTest, createDatabase) { "VGROUPS 100 " "SINGLE_STABLE 1 " "SCHEMALESS 1"); + clearCreateDbReq(); setCreateDbReqFunc("wxy_db", 1); setDbDaysFunc(100); @@ -218,6 +225,7 @@ TEST_F(ParserInitialCTest, createDatabase) { run("CREATE DATABASE IF NOT EXISTS wxy_db " "DAYS 100m " "KEEP 1440m,300h,400d "); + clearCreateDbReq(); } TEST_F(ParserInitialCTest, createDatabaseSemanticCheck) { @@ -309,10 +317,14 @@ TEST_F(ParserInitialCTest, createStable) { SMCreateStbReq expect = {0}; + auto clearCreateStbReq = [&]() { + tFreeSMCreateStbReq(&expect); + memset(&expect, 0, sizeof(SMCreateStbReq)); + }; + auto setCreateStbReqFunc = [&](const char* pTbname, int8_t igExists = 0, float xFilesFactor = TSDB_DEFAULT_ROLLUP_FILE_FACTOR, int32_t ttl = TSDB_DEFAULT_TABLE_TTL, const char* pComment = nullptr) { - memset(&expect, 0, sizeof(SMCreateStbReq)); int32_t len = snprintf(expect.name, sizeof(expect.name), "0.test.%s", pTbname); expect.name[len] = '\0'; expect.igExists = igExists; @@ -396,6 +408,7 @@ TEST_F(ParserInitialCTest, createStable) { if (expect.ast2Len > 0) { ASSERT_EQ(std::string(req.pAst2), std::string(expect.pAst2)); } + tFreeSMCreateStbReq(&req); }); setCreateStbReqFunc("t1"); @@ -403,6 +416,7 @@ TEST_F(ParserInitialCTest, createStable) { addFieldToCreateStbReqFunc(true, "c1", TSDB_DATA_TYPE_INT); addFieldToCreateStbReqFunc(false, "id", TSDB_DATA_TYPE_INT); run("CREATE STABLE t1(ts TIMESTAMP, c1 INT) TAGS(id INT)"); + clearCreateStbReq(); setCreateStbReqFunc("t1", 1, 0.1, 100, "test create table"); addFieldToCreateStbReqFunc(true, "ts", TSDB_DATA_TYPE_TIMESTAMP, 0, 0); @@ -443,6 +457,7 @@ TEST_F(ParserInitialCTest, createStable) { "a8 BINARY(20), a9 SMALLINT, a10 SMALLINT UNSIGNED COMMENT 'test column comment', a11 TINYINT, " "a12 TINYINT UNSIGNED, a13 BOOL, a14 NCHAR(30), a15 VARCHAR(50)) " "TTL 100 COMMENT 'test create table' SMA(c1, c2, c3) ROLLUP (MIN) FILE_FACTOR 0.1"); + clearCreateStbReq(); } TEST_F(ParserInitialCTest, createStableSemanticCheck) { @@ -455,13 +470,62 @@ TEST_F(ParserInitialCTest, createStableSemanticCheck) { TEST_F(ParserInitialCTest, createStream) { useDb("root", "test"); + SCMCreateStreamReq expect = {0}; + + auto clearCreateStreamReq = [&]() { + tFreeSCMCreateStreamReq(&expect); + memset(&expect, 0, sizeof(SCMCreateStreamReq)); + }; + + auto setCreateStbReqFunc = + [&](const char* pStream, const char* pSrcDb, const char* pSql, const char* pDstStb = nullptr, int8_t igExists = 0, + int8_t triggerType = STREAM_TRIGGER_AT_ONCE, int64_t maxDelay = 0, int64_t watermark = 0) { + snprintf(expect.name, sizeof(expect.name), "0.%s", pStream); + snprintf(expect.sourceDB, sizeof(expect.sourceDB), "0.%s", pSrcDb); + if (NULL != pDstStb) { + snprintf(expect.targetStbFullName, sizeof(expect.targetStbFullName), "0.test.%s", pDstStb); + } + expect.igExists = igExists; + expect.sql = strdup(pSql); + expect.triggerType = triggerType; + expect.maxDelay = maxDelay; + expect.watermark = watermark; + }; + + setCheckDdlFunc([&](const SQuery* pQuery, ParserStage stage) { + ASSERT_EQ(nodeType(pQuery->pRoot), QUERY_NODE_CREATE_STREAM_STMT); + SCMCreateStreamReq req = {0}; + ASSERT_TRUE(TSDB_CODE_SUCCESS == + tDeserializeSCMCreateStreamReq(pQuery->pCmdMsg->pMsg, pQuery->pCmdMsg->msgLen, &req)); + + ASSERT_EQ(std::string(req.name), std::string(expect.name)); + ASSERT_EQ(std::string(req.sourceDB), std::string(expect.sourceDB)); + ASSERT_EQ(std::string(req.targetStbFullName), std::string(expect.targetStbFullName)); + ASSERT_EQ(req.igExists, expect.igExists); + ASSERT_EQ(std::string(req.sql), std::string(expect.sql)); + ASSERT_EQ(req.triggerType, expect.triggerType); + ASSERT_EQ(req.maxDelay, expect.maxDelay); + ASSERT_EQ(req.watermark, expect.watermark); + tFreeSCMCreateStreamReq(&req); + }); + + setCreateStbReqFunc("s1", "test", "create stream s1 as select * from t1"); run("CREATE STREAM s1 AS SELECT * FROM t1"); + clearCreateStreamReq(); + setCreateStbReqFunc("s1", "test", "create stream if not exists s1 as select * from t1", nullptr, 1); run("CREATE STREAM IF NOT EXISTS s1 AS SELECT * FROM t1"); + clearCreateStreamReq(); + setCreateStbReqFunc("s1", "test", "create stream s1 into st1 as select * from t1", "st1"); run("CREATE STREAM s1 INTO st1 AS SELECT * FROM t1"); + clearCreateStreamReq(); - run("CREATE STREAM IF NOT EXISTS s1 TRIGGER WINDOW_CLOSE WATERMARK 10s INTO st1 AS SELECT * FROM t1"); + setCreateStbReqFunc("s1", "test", + "create stream if not exists s1 trigger max_delay 20s watermark 10s into st1 as select * from t1", + "st1", 1, STREAM_TRIGGER_MAX_DELAY, 20 * MILLISECOND_PER_SECOND, 10 * MILLISECOND_PER_SECOND); + run("CREATE STREAM IF NOT EXISTS s1 TRIGGER MAX_DELAY 20s WATERMARK 10s INTO st1 AS SELECT * FROM t1"); + clearCreateStreamReq(); } TEST_F(ParserInitialCTest, createTable) { @@ -497,9 +561,10 @@ TEST_F(ParserInitialCTest, createTopic) { SCMCreateTopicReq expect = {0}; + auto clearCreateTopicReq = [&]() { memset(&expect, 0, sizeof(SCMCreateTopicReq)); }; + auto setCreateTopicReqFunc = [&](const char* pTopicName, int8_t igExists, const char* pSql, const char* pAst, const char* pDbName = nullptr, const char* pTbname = nullptr) { - memset(&expect, 0, sizeof(SMCreateStbReq)); snprintf(expect.name, sizeof(expect.name), "0.%s", pTopicName); expect.igExists = igExists; expect.sql = (char*)pSql; @@ -538,19 +603,24 @@ TEST_F(ParserInitialCTest, createTopic) { default: ASSERT_TRUE(false); } + tFreeSCMCreateTopicReq(&req); }); setCreateTopicReqFunc("tp1", 0, "create topic tp1 as select * from t1", "ast"); run("CREATE TOPIC tp1 AS SELECT * FROM t1"); + clearCreateTopicReq(); setCreateTopicReqFunc("tp1", 1, "create topic if not exists tp1 as select ts, ceil(c1) from t1", "ast"); run("CREATE TOPIC IF NOT EXISTS tp1 AS SELECT ts, CEIL(c1) FROM t1"); + clearCreateTopicReq(); setCreateTopicReqFunc("tp1", 0, "create topic tp1 as database test", nullptr, "test"); run("CREATE TOPIC tp1 AS DATABASE test"); + clearCreateTopicReq(); setCreateTopicReqFunc("tp1", 1, "create topic if not exists tp1 as stable st1", nullptr, "test", "st1"); run("CREATE TOPIC IF NOT EXISTS tp1 AS STABLE st1"); + clearCreateTopicReq(); } TEST_F(ParserInitialCTest, createUser) { diff --git a/source/libs/parser/test/parInsertTest.cpp b/source/libs/parser/test/parInsertTest.cpp index eae83e222385f8e7a7af1be56bb3647b3e806358..29edca0d406293d97fac14844964f8dc6b4d4b95 100644 --- a/source/libs/parser/test/parInsertTest.cpp +++ b/source/libs/parser/test/parInsertTest.cpp @@ -35,6 +35,9 @@ string toString(int32_t code) { return tstrerror(code); } // [...]; class InsertTest : public Test { protected: + InsertTest() : res_(nullptr) {} + ~InsertTest() { reset(); } + void setDatabase(const string& acctId, const string& db) { acctId_ = acctId; db_ = db; @@ -51,7 +54,7 @@ class InsertTest : public Test { } int32_t run() { - code_ = parseInsertSql(&cxt_, &res_); + code_ = parseInsertSql(&cxt_, &res_, nullptr); if (code_ != TSDB_CODE_SUCCESS) { cout << "code:" << toString(code_) << ", msg:" << errMagBuf_ << endl; } @@ -60,29 +63,31 @@ class InsertTest : public Test { int32_t runAsync() { cxt_.async = true; - code_ = parseInsertSyntax(&cxt_, &res_); + unique_ptr metaCache(new SParseMetaCache(), _destoryParseMetaCache); + code_ = parseInsertSyntax(&cxt_, &res_, metaCache.get()); if (code_ != TSDB_CODE_SUCCESS) { cout << "parseInsertSyntax code:" << toString(code_) << ", msg:" << errMagBuf_ << endl; return code_; } - SCatalogReq catalogReq = {0}; - code_ = buildCatalogReq(res_->pMetaCache, &catalogReq); + unique_ptr catalogReq(new SCatalogReq(), + MockCatalogService::destoryCatalogReq); + code_ = buildCatalogReq(metaCache.get(), catalogReq.get()); if (code_ != TSDB_CODE_SUCCESS) { cout << "buildCatalogReq code:" << toString(code_) << ", msg:" << errMagBuf_ << endl; return code_; } - SMetaData metaData = {0}; - g_mockCatalogService->catalogGetAllMeta(&catalogReq, &metaData); + unique_ptr metaData(new SMetaData(), MockCatalogService::destoryMetaData); + g_mockCatalogService->catalogGetAllMeta(catalogReq.get(), metaData.get()); - code_ = putMetaDataToCache(&catalogReq, &metaData, res_->pMetaCache); + code_ = putMetaDataToCache(catalogReq.get(), metaData.get(), metaCache.get()); if (code_ != TSDB_CODE_SUCCESS) { cout << "putMetaDataToCache code:" << toString(code_) << ", msg:" << errMagBuf_ << endl; return code_; } - code_ = parseInsertSql(&cxt_, &res_); + code_ = parseInsertSql(&cxt_, &res_, metaCache.get()); if (code_ != TSDB_CODE_SUCCESS) { cout << "parseInsertSql code:" << toString(code_) << ", msg:" << errMagBuf_ << endl; return code_; @@ -139,12 +144,18 @@ class InsertTest : public Test { static const int max_err_len = 1024; static const int max_sql_len = 1024 * 1024; + static void _destoryParseMetaCache(SParseMetaCache* pMetaCache) { + destoryParseMetaCache(pMetaCache); + delete pMetaCache; + } + void reset() { memset(&cxt_, 0, sizeof(cxt_)); memset(errMagBuf_, 0, max_err_len); cxt_.pMsg = errMagBuf_; cxt_.msgLen = max_err_len; code_ = TSDB_CODE_SUCCESS; + qDestroyQuery(res_); res_ = nullptr; } diff --git a/source/libs/parser/test/parTestMain.cpp b/source/libs/parser/test/parTestMain.cpp index ecc535feb0cdf08aa8eba88ff1b0e3d79718e9f7..bcaccbab071e06ee6d76b6498fb52d0330a066d9 100644 --- a/source/libs/parser/test/parTestMain.cpp +++ b/source/libs/parser/test/parTestMain.cpp @@ -45,6 +45,7 @@ class ParserEnv : public testing::Environment { destroyMetaDataEnv(); taosCleanupKeywordsTable(); fmFuncMgtDestroy(); + taosCloseLog(); } ParserEnv() {} diff --git a/source/libs/parser/test/parTestUtil.cpp b/source/libs/parser/test/parTestUtil.cpp index fab7ed35b1cb408a5cdd6f455994da07a26596fd..13ab116552b3d9cc73319dbe52a317198c527679 100644 --- a/source/libs/parser/test/parTestUtil.cpp +++ b/source/libs/parser/test/parTestUtil.cpp @@ -78,33 +78,12 @@ class ParserTestBaseImpl { return; } - reset(expect, checkStage); - try { - SParseContext cxt = {0}; - setParseContext(sql, &cxt); - - SQuery* pQuery = nullptr; - doParse(&cxt, &pQuery); - - doAuthenticate(&cxt, pQuery); - - doTranslate(&cxt, pQuery); - - doCalculateConstant(&cxt, pQuery); - - if (g_dump) { - dump(); - } - } catch (const TerminateFlag& e) { - // success and terminate - return; - } catch (...) { - dump(); - throw; - } + runInternalFuncs(sql, expect, checkStage); + runApis(sql, expect, checkStage); if (g_testAsyncApis) { - runAsync(sql, expect, checkStage); + runAsyncInternalFuncs(sql, expect, checkStage); + runAsyncApis(sql, expect, checkStage); } } @@ -131,34 +110,63 @@ class ParserTestBaseImpl { string calcConstAst_; }; + enum TestInterfaceType { + TEST_INTERFACE_INTERNAL = 1, + TEST_INTERFACE_API, + TEST_INTERFACE_ASYNC_INTERNAL, + TEST_INTERFACE_ASYNC_API + }; + + static void _destoryParseMetaCache(SParseMetaCache* pMetaCache) { + destoryParseMetaCache(pMetaCache); + delete pMetaCache; + } + bool checkResultCode(const string& pFunc, int32_t resultCode) { return !(stmtEnv_.checkFunc_.empty()) - ? (("*" == stmtEnv_.checkFunc_ || stmtEnv_.checkFunc_ == pFunc) ? stmtEnv_.expect_ == resultCode - : TSDB_CODE_SUCCESS == resultCode) + ? ((stmtEnv_.checkFunc_ == pFunc) ? stmtEnv_.expect_ == resultCode : TSDB_CODE_SUCCESS == resultCode) : true; } - string stageFunc(ParserStage stage) { - switch (stage) { - case PARSER_STAGE_PARSE: - return "parse"; - case PARSER_STAGE_TRANSLATE: - return "translate"; - case PARSER_STAGE_CALC_CONST: - return "calculateConstant"; - case PARSER_STAGE_ALL: - return "*"; + string stageFunc(ParserStage stage, TestInterfaceType type) { + switch (type) { + case TEST_INTERFACE_INTERNAL: + case TEST_INTERFACE_ASYNC_INTERNAL: + switch (stage) { + case PARSER_STAGE_PARSE: + return "parse"; + case PARSER_STAGE_TRANSLATE: + return "translate"; + case PARSER_STAGE_CALC_CONST: + return "calculateConstant"; + default: + break; + } + break; + case TEST_INTERFACE_API: + return "qParseSql"; + case TEST_INTERFACE_ASYNC_API: + switch (stage) { + case PARSER_STAGE_PARSE: + return "qParseSqlSyntax"; + case PARSER_STAGE_TRANSLATE: + case PARSER_STAGE_CALC_CONST: + return "qAnalyseSqlSemantic"; + default: + break; + } + break; default: break; } return "unknown"; } - void reset(int32_t expect, ParserStage checkStage) { + void reset(int32_t expect, ParserStage checkStage, TestInterfaceType type) { stmtEnv_.sql_.clear(); stmtEnv_.msgBuf_.fill(0); stmtEnv_.expect_ = expect; - stmtEnv_.checkFunc_ = stageFunc(checkStage); + stmtEnv_.checkFunc_ = stageFunc(checkStage, type); res_.parsedAst_.clear(); res_.translatedAst_.clear(); @@ -167,12 +175,18 @@ class ParserTestBaseImpl { void dump() { cout << "==========================================sql : [" << stmtEnv_.sql_ << "]" << endl; - cout << "raw syntax tree : " << endl; - cout << res_.parsedAst_ << endl; - cout << "translated syntax tree : " << endl; - cout << res_.translatedAst_ << endl; - cout << "optimized syntax tree : " << endl; - cout << res_.calcConstAst_ << endl; + if (!res_.parsedAst_.empty()) { + cout << "raw syntax tree : " << endl; + cout << res_.parsedAst_ << endl; + } + if (!res_.translatedAst_.empty()) { + cout << "translated syntax tree : " << endl; + cout << res_.translatedAst_ << endl; + } + if (!res_.calcConstAst_.empty()) { + cout << "optimized syntax tree : " << endl; + cout << res_.calcConstAst_ << endl; + } } void setParseContext(const string& sql, SParseContext* pCxt, bool async = false) { @@ -196,9 +210,8 @@ class ParserTestBaseImpl { res_.parsedAst_ = toString((*pQuery)->pRoot); } - void doCollectMetaKey(SParseContext* pCxt, SQuery* pQuery) { - DO_WITH_THROW(collectMetaKey, pCxt, pQuery); - ASSERT_NE(pQuery->pMetaCache, nullptr); + void doCollectMetaKey(SParseContext* pCxt, SQuery* pQuery, SParseMetaCache* pMetaCache) { + DO_WITH_THROW(collectMetaKey, pCxt, pQuery, pMetaCache); } void doBuildCatalogReq(const SParseMetaCache* pMetaCache, SCatalogReq* pCatalogReq) { @@ -213,10 +226,12 @@ class ParserTestBaseImpl { DO_WITH_THROW(putMetaDataToCache, pCatalogReq, pMetaData, pMetaCache); } - void doAuthenticate(SParseContext* pCxt, SQuery* pQuery) { DO_WITH_THROW(authenticate, pCxt, pQuery); } + void doAuthenticate(SParseContext* pCxt, SQuery* pQuery, SParseMetaCache* pMetaCache) { + DO_WITH_THROW(authenticate, pCxt, pQuery, pMetaCache); + } - void doTranslate(SParseContext* pCxt, SQuery* pQuery) { - DO_WITH_THROW(translate, pCxt, pQuery); + void doTranslate(SParseContext* pCxt, SQuery* pQuery, SParseMetaCache* pMetaCache) { + DO_WITH_THROW(translate, pCxt, pQuery, pMetaCache); checkQuery(pQuery, PARSER_STAGE_TRANSLATE); res_.translatedAst_ = toString(pQuery->pRoot); } @@ -226,6 +241,24 @@ class ParserTestBaseImpl { res_.calcConstAst_ = toString(pQuery->pRoot); } + void doParseSql(SParseContext* pCxt, SQuery** pQuery) { + DO_WITH_THROW(qParseSql, pCxt, pQuery); + ASSERT_NE(*pQuery, nullptr); + res_.calcConstAst_ = toString((*pQuery)->pRoot); + } + + void doParseSqlSyntax(SParseContext* pCxt, SQuery** pQuery, SCatalogReq* pCatalogReq) { + DO_WITH_THROW(qParseSqlSyntax, pCxt, pQuery, pCatalogReq); + ASSERT_NE(*pQuery, nullptr); + res_.parsedAst_ = toString((*pQuery)->pRoot); + } + + void doAnalyseSqlSemantic(SParseContext* pCxt, const SCatalogReq* pCatalogReq, const SMetaData* pMetaData, + SQuery* pQuery) { + DO_WITH_THROW(qAnalyseSqlSemantic, pCxt, pCatalogReq, pMetaData, pQuery); + res_.calcConstAst_ = toString(pQuery->pRoot); + } + string toString(const SNode* pRoot) { char* pStr = NULL; int32_t len = 0; @@ -237,31 +270,84 @@ class ParserTestBaseImpl { void checkQuery(const SQuery* pQuery, ParserStage stage) { pBase_->checkDdl(pQuery, stage); } - void runAsync(const string& sql, int32_t expect, ParserStage checkStage) { - reset(expect, checkStage); + void runInternalFuncs(const string& sql, int32_t expect, ParserStage checkStage) { + reset(expect, checkStage, TEST_INTERFACE_INTERNAL); + try { + SParseContext cxt = {0}; + setParseContext(sql, &cxt); + + SQuery* pQuery = nullptr; + doParse(&cxt, &pQuery); + unique_ptr query(pQuery, qDestroyQuery); + + doAuthenticate(&cxt, pQuery, nullptr); + + doTranslate(&cxt, pQuery, nullptr); + + doCalculateConstant(&cxt, pQuery); + + if (g_dump) { + dump(); + } + } catch (const TerminateFlag& e) { + // success and terminate + return; + } catch (...) { + dump(); + throw; + } + } + + void runApis(const string& sql, int32_t expect, ParserStage checkStage) { + reset(expect, checkStage, TEST_INTERFACE_API); + try { + SParseContext cxt = {0}; + setParseContext(sql, &cxt); + + SQuery* pQuery = nullptr; + doParseSql(&cxt, &pQuery); + unique_ptr query(pQuery, qDestroyQuery); + + if (g_dump) { + dump(); + } + } catch (const TerminateFlag& e) { + // success and terminate + return; + } catch (...) { + dump(); + throw; + } + } + + void runAsyncInternalFuncs(const string& sql, int32_t expect, ParserStage checkStage) { + reset(expect, checkStage, TEST_INTERFACE_ASYNC_INTERNAL); try { SParseContext cxt = {0}; setParseContext(sql, &cxt, true); SQuery* pQuery = nullptr; doParse(&cxt, &pQuery); + unique_ptr query(pQuery, qDestroyQuery); - doCollectMetaKey(&cxt, pQuery); + unique_ptr metaCache(new SParseMetaCache(), _destoryParseMetaCache); + doCollectMetaKey(&cxt, pQuery, metaCache.get()); - SCatalogReq catalogReq = {0}; - doBuildCatalogReq(pQuery->pMetaCache, &catalogReq); + unique_ptr catalogReq(new SCatalogReq(), + MockCatalogService::destoryCatalogReq); + doBuildCatalogReq(metaCache.get(), catalogReq.get()); string err; thread t1([&]() { try { - SMetaData metaData = {0}; - doGetAllMeta(&catalogReq, &metaData); + unique_ptr metaData(new SMetaData(), MockCatalogService::destoryMetaData); + doGetAllMeta(catalogReq.get(), metaData.get()); - doPutMetaDataToCache(&catalogReq, &metaData, pQuery->pMetaCache); + doPutMetaDataToCache(catalogReq.get(), metaData.get(), metaCache.get()); - doAuthenticate(&cxt, pQuery); + doAuthenticate(&cxt, pQuery, metaCache.get()); - doTranslate(&cxt, pQuery); + doTranslate(&cxt, pQuery, metaCache.get()); doCalculateConstant(&cxt, pQuery); } catch (const TerminateFlag& e) { @@ -290,6 +376,51 @@ class ParserTestBaseImpl { } } + void runAsyncApis(const string& sql, int32_t expect, ParserStage checkStage) { + reset(expect, checkStage, TEST_INTERFACE_ASYNC_API); + try { + SParseContext cxt = {0}; + setParseContext(sql, &cxt); + + unique_ptr catalogReq(new SCatalogReq(), + MockCatalogService::destoryCatalogReq); + SQuery* pQuery = nullptr; + doParseSqlSyntax(&cxt, &pQuery, catalogReq.get()); + unique_ptr query(pQuery, qDestroyQuery); + + string err; + thread t1([&]() { + try { + unique_ptr metaData(new SMetaData(), MockCatalogService::destoryMetaData); + doGetAllMeta(catalogReq.get(), metaData.get()); + + doAnalyseSqlSemantic(&cxt, catalogReq.get(), metaData.get(), pQuery); + } catch (const TerminateFlag& e) { + // success and terminate + } catch (const runtime_error& e) { + err = e.what(); + } catch (...) { + err = "unknown error"; + } + }); + + t1.join(); + if (!err.empty()) { + throw runtime_error(err); + } + + if (g_dump) { + dump(); + } + } catch (const TerminateFlag& e) { + // success and terminate + return; + } catch (...) { + dump(); + throw; + } + } + caseEnv caseEnv_; stmtEnv stmtEnv_; stmtRes res_; diff --git a/source/libs/parser/test/parTestUtil.h b/source/libs/parser/test/parTestUtil.h index ad21252c2b768fde82fd8577acc18d502ba4a9e3..afdb76344837781c14145eb565187d482b161399 100644 --- a/source/libs/parser/test/parTestUtil.h +++ b/source/libs/parser/test/parTestUtil.h @@ -27,7 +27,7 @@ namespace ParserTest { class ParserTestBaseImpl; -enum ParserStage { PARSER_STAGE_PARSE, PARSER_STAGE_TRANSLATE, PARSER_STAGE_CALC_CONST, PARSER_STAGE_ALL }; +enum ParserStage { PARSER_STAGE_PARSE = 1, PARSER_STAGE_TRANSLATE, PARSER_STAGE_CALC_CONST }; class ParserTestBase : public testing::Test { public: diff --git a/source/libs/planner/src/planLogicCreater.c b/source/libs/planner/src/planLogicCreater.c index d67b19419206afef703f545e2d116ec4265d5883..17ab06cac9cc201d67fbc93728b372f1ef4b62a0 100644 --- a/source/libs/planner/src/planLogicCreater.c +++ b/source/libs/planner/src/planLogicCreater.c @@ -138,7 +138,7 @@ static int32_t createRootLogicNode(SLogicPlanContext* pCxt, void* pStmt, uint8_t code = pushLogicNode(pCxt, pRoot, pNode); } if (TSDB_CODE_SUCCESS != code) { - nodesDestroyNode(pNode); + nodesDestroyNode((SNode*)pNode); } return code; } @@ -173,8 +173,8 @@ static EScanType getScanType(SLogicPlanContext* pCxt, SNodeList* pScanPseudoCols return SCAN_TYPE_TAG; } -static SNodeptr createPrimaryKeyCol(uint64_t tableId) { - SColumnNode* pCol = nodesMakeNode(QUERY_NODE_COLUMN); +static SNode* createPrimaryKeyCol(uint64_t tableId) { + SColumnNode* pCol = (SColumnNode*)nodesMakeNode(QUERY_NODE_COLUMN); if (NULL == pCol) { return NULL; } @@ -184,7 +184,7 @@ static SNodeptr createPrimaryKeyCol(uint64_t tableId) { pCol->colId = PRIMARYKEY_TIMESTAMP_COL_ID; pCol->colType = COLUMN_TYPE_COLUMN; strcpy(pCol->colName, "#primarykey"); - return pCol; + return (SNode*)pCol; } static int32_t addPrimaryKeyCol(uint64_t tableId, SNodeList** pCols) { @@ -282,7 +282,7 @@ static int32_t createScanLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect if (TSDB_CODE_SUCCESS == code) { *pLogicNode = (SLogicNode*)pScan; } else { - nodesDestroyNode(pScan); + nodesDestroyNode((SNode*)pScan); } return code; @@ -349,7 +349,7 @@ static int32_t createJoinLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect if (TSDB_CODE_SUCCESS == code) { *pLogicNode = (SLogicNode*)pJoin; } else { - nodesDestroyNode(pJoin); + nodesDestroyNode((SNode*)pJoin); } return code; @@ -377,7 +377,7 @@ static int32_t createLogicNodeByTable(SLogicPlanContext* pCxt, SSelectStmt* pSel if (TSDB_CODE_SUCCESS == code) { pNode->pConditions = nodesCloneNode(pSelect->pWhere); if (NULL != pSelect->pWhere && NULL == pNode->pConditions) { - nodesDestroyNode(pNode); + nodesDestroyNode((SNode*)pNode); return TSDB_CODE_OUT_OF_MEMORY; } pNode->precision = pSelect->precision; @@ -387,7 +387,7 @@ static int32_t createLogicNodeByTable(SLogicPlanContext* pCxt, SSelectStmt* pSel } static SColumnNode* createColumnByExpr(const char* pStmtName, SExprNode* pExpr) { - SColumnNode* pCol = nodesMakeNode(QUERY_NODE_COLUMN); + SColumnNode* pCol = (SColumnNode*)nodesMakeNode(QUERY_NODE_COLUMN); if (NULL == pCol) { return NULL; } @@ -451,7 +451,7 @@ static int32_t createAggLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect, if (TSDB_CODE_SUCCESS == code) { *pLogicNode = (SLogicNode*)pAgg; } else { - nodesDestroyNode(pAgg); + nodesDestroyNode((SNode*)pAgg); } return code; @@ -482,7 +482,7 @@ static int32_t createIndefRowsFuncLogicNode(SLogicPlanContext* pCxt, SSelectStmt if (TSDB_CODE_SUCCESS == code) { *pLogicNode = (SLogicNode*)pIdfRowsFunc; } else { - nodesDestroyNode(pIdfRowsFunc); + nodesDestroyNode((SNode*)pIdfRowsFunc); } return code; @@ -514,7 +514,7 @@ static int32_t createWindowLogicNodeFinalize(SLogicPlanContext* pCxt, SSelectStm if (TSDB_CODE_SUCCESS == code) { *pLogicNode = (SLogicNode*)pWindow; } else { - nodesDestroyNode(pWindow); + nodesDestroyNode((SNode*)pWindow); } return code; @@ -522,7 +522,7 @@ static int32_t createWindowLogicNodeFinalize(SLogicPlanContext* pCxt, SSelectStm static int32_t createWindowLogicNodeByState(SLogicPlanContext* pCxt, SStateWindowNode* pState, SSelectStmt* pSelect, SLogicNode** pLogicNode) { - SWindowLogicNode* pWindow = nodesMakeNode(QUERY_NODE_LOGIC_PLAN_WINDOW); + SWindowLogicNode* pWindow = (SWindowLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_WINDOW); if (NULL == pWindow) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -532,7 +532,7 @@ static int32_t createWindowLogicNodeByState(SLogicPlanContext* pCxt, SStateWindo pWindow->pTspk = nodesCloneNode(pState->pCol); if (NULL == pWindow->pTspk) { - nodesDestroyNode(pWindow); + nodesDestroyNode((SNode*)pWindow); return TSDB_CODE_OUT_OF_MEMORY; } @@ -541,7 +541,7 @@ static int32_t createWindowLogicNodeByState(SLogicPlanContext* pCxt, SStateWindo static int32_t createWindowLogicNodeBySession(SLogicPlanContext* pCxt, SSessionWindowNode* pSession, SSelectStmt* pSelect, SLogicNode** pLogicNode) { - SWindowLogicNode* pWindow = nodesMakeNode(QUERY_NODE_LOGIC_PLAN_WINDOW); + SWindowLogicNode* pWindow = (SWindowLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_WINDOW); if (NULL == pWindow) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -549,9 +549,9 @@ static int32_t createWindowLogicNodeBySession(SLogicPlanContext* pCxt, SSessionW pWindow->winType = WINDOW_TYPE_SESSION; pWindow->sessionGap = ((SValueNode*)pSession->pGap)->datum.i; - pWindow->pTspk = nodesCloneNode(pSession->pCol); + pWindow->pTspk = nodesCloneNode((SNode*)pSession->pCol); if (NULL == pWindow->pTspk) { - nodesDestroyNode(pWindow); + nodesDestroyNode((SNode*)pWindow); return TSDB_CODE_OUT_OF_MEMORY; } @@ -560,7 +560,7 @@ static int32_t createWindowLogicNodeBySession(SLogicPlanContext* pCxt, SSessionW static int32_t createWindowLogicNodeByInterval(SLogicPlanContext* pCxt, SIntervalWindowNode* pInterval, SSelectStmt* pSelect, SLogicNode** pLogicNode) { - SWindowLogicNode* pWindow = nodesMakeNode(QUERY_NODE_LOGIC_PLAN_WINDOW); + SWindowLogicNode* pWindow = (SWindowLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_WINDOW); if (NULL == pWindow) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -576,7 +576,7 @@ static int32_t createWindowLogicNodeByInterval(SLogicPlanContext* pCxt, SInterva pWindow->pTspk = nodesCloneNode(pInterval->pCol); if (NULL == pWindow->pTspk) { - nodesDestroyNode(pWindow); + nodesDestroyNode((SNode*)pWindow); return TSDB_CODE_OUT_OF_MEMORY; } @@ -610,7 +610,7 @@ static int32_t createFillLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect SFillNode* pFillNode = (SFillNode*)(((SIntervalWindowNode*)pSelect->pWindow)->pFill); - SFillLogicNode* pFill = nodesMakeNode(QUERY_NODE_LOGIC_PLAN_FILL); + SFillLogicNode* pFill = (SFillLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_FILL); if (NULL == pFill) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -628,7 +628,7 @@ static int32_t createFillLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect if (TSDB_CODE_SUCCESS == code) { *pLogicNode = (SLogicNode*)pFill; } else { - nodesDestroyNode(pFill); + nodesDestroyNode((SNode*)pFill); } return code; @@ -639,7 +639,7 @@ static int32_t createSortLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect return TSDB_CODE_SUCCESS; } - SSortLogicNode* pSort = nodesMakeNode(QUERY_NODE_LOGIC_PLAN_SORT); + SSortLogicNode* pSort = (SSortLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_SORT); if (NULL == pSort) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -656,7 +656,7 @@ static int32_t createSortLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect if (TSDB_CODE_SUCCESS == code) { *pLogicNode = (SLogicNode*)pSort; } else { - nodesDestroyNode(pSort); + nodesDestroyNode((SNode*)pSort); } return code; @@ -671,7 +671,7 @@ static int32_t createColumnByProjections(SLogicPlanContext* pCxt, const char* pS SNode* pNode; FOREACH(pNode, pExprs) { - if (TSDB_CODE_SUCCESS != nodesListAppend(pList, createColumnByExpr(pStmtName, (SExprNode*)pNode))) { + if (TSDB_CODE_SUCCESS != nodesListAppend(pList, (SNode*)createColumnByExpr(pStmtName, (SExprNode*)pNode))) { nodesDestroyList(pList); return TSDB_CODE_OUT_OF_MEMORY; } @@ -718,7 +718,7 @@ static int32_t createProjectLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSel if (TSDB_CODE_SUCCESS == code) { *pLogicNode = (SLogicNode*)pProject; } else { - nodesDestroyNode(pProject); + nodesDestroyNode((SNode*)pProject); } return code; @@ -729,7 +729,7 @@ static int32_t createPartitionLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pS return TSDB_CODE_SUCCESS; } - SPartitionLogicNode* pPartition = nodesMakeNode(QUERY_NODE_LOGIC_PLAN_PARTITION); + SPartitionLogicNode* pPartition = (SPartitionLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_PARTITION); if (NULL == pPartition) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -747,7 +747,7 @@ static int32_t createPartitionLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pS if (TSDB_CODE_SUCCESS == code) { *pLogicNode = (SLogicNode*)pPartition; } else { - nodesDestroyNode(pPartition); + nodesDestroyNode((SNode*)pPartition); } return code; @@ -783,7 +783,7 @@ static int32_t createDistinctLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSe if (TSDB_CODE_SUCCESS == code) { *pLogicNode = (SLogicNode*)pAgg; } else { - nodesDestroyNode(pAgg); + nodesDestroyNode((SNode*)pAgg); } return code; @@ -820,7 +820,7 @@ static int32_t createSelectLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSele if (TSDB_CODE_SUCCESS == code) { *pLogicNode = pRoot; } else { - nodesDestroyNode(pRoot); + nodesDestroyNode((SNode*)pRoot); } return code; @@ -836,7 +836,7 @@ static int32_t createSetOpSortLogicNode(SLogicPlanContext* pCxt, SSetOperator* p return TSDB_CODE_SUCCESS; } - SSortLogicNode* pSort = nodesMakeNode(QUERY_NODE_LOGIC_PLAN_SORT); + SSortLogicNode* pSort = (SSortLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_SORT); if (NULL == pSort) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -858,7 +858,7 @@ static int32_t createSetOpSortLogicNode(SLogicPlanContext* pCxt, SSetOperator* p if (TSDB_CODE_SUCCESS == code) { *pLogicNode = (SLogicNode*)pSort; } else { - nodesDestroyNode(pSort); + nodesDestroyNode((SNode*)pSort); } return code; @@ -894,7 +894,7 @@ static int32_t createSetOpProjectLogicNode(SLogicPlanContext* pCxt, SSetOperator if (TSDB_CODE_SUCCESS == code) { *pLogicNode = (SLogicNode*)pProject; } else { - nodesDestroyNode(pProject); + nodesDestroyNode((SNode*)pProject); } return code; @@ -925,7 +925,7 @@ static int32_t createSetOpAggLogicNode(SLogicPlanContext* pCxt, SSetOperator* pS if (TSDB_CODE_SUCCESS == code) { *pLogicNode = (SLogicNode*)pAgg; } else { - nodesDestroyNode(pAgg); + nodesDestroyNode((SNode*)pAgg); } return code; @@ -964,7 +964,7 @@ static int32_t createSetOpLogicNode(SLogicPlanContext* pCxt, SSetOperator* pSetO if (TSDB_CODE_SUCCESS == code) { *pLogicNode = (SLogicNode*)pSetOp; } else { - nodesDestroyNode(pSetOp); + nodesDestroyNode((SNode*)pSetOp); } return code; @@ -981,7 +981,7 @@ static int32_t createSetOperatorLogicNode(SLogicPlanContext* pCxt, SSetOperator* if (TSDB_CODE_SUCCESS == code) { *pLogicNode = pRoot; } else { - nodesDestroyNode(pRoot); + nodesDestroyNode((SNode*)pRoot); } return code; @@ -1003,7 +1003,7 @@ static int32_t getMsgType(ENodeType sqlType) { } static int32_t createVnodeModifLogicNode(SLogicPlanContext* pCxt, SVnodeModifOpStmt* pStmt, SLogicNode** pLogicNode) { - SVnodeModifyLogicNode* pModif = nodesMakeNode(QUERY_NODE_LOGIC_PLAN_VNODE_MODIFY); + SVnodeModifyLogicNode* pModif = (SVnodeModifyLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_VNODE_MODIFY); if (NULL == pModif) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -1047,7 +1047,7 @@ static int32_t createDeleteScanLogicNode(SLogicPlanContext* pCxt, SDeleteStmt* p if (TSDB_CODE_SUCCESS == code) { *pLogicNode = (SLogicNode*)pScan; } else { - nodesDestroyNode(pScan); + nodesDestroyNode((SNode*)pScan); } return code; @@ -1071,7 +1071,7 @@ static int32_t createDeleteAggLogicNode(SLogicPlanContext* pCxt, SDeleteStmt* pD if (TSDB_CODE_SUCCESS == code) { *pLogicNode = (SLogicNode*)pAgg; } else { - nodesDestroyNode(pAgg); + nodesDestroyNode((SNode*)pAgg); } return code; @@ -1094,7 +1094,7 @@ static int32_t createVnodeModifLogicNodeByDelete(SLogicPlanContext* pCxt, SDelet pModify->deleteTimeRange = pDelete->timeRange; pModify->pAffectedRows = nodesCloneNode(pDelete->pCountFunc); if (NULL == pModify->pAffectedRows) { - nodesDestroyNode(pModify); + nodesDestroyNode((SNode*)pModify); return TSDB_CODE_OUT_OF_MEMORY; } @@ -1115,7 +1115,7 @@ static int32_t createDeleteLogicNode(SLogicPlanContext* pCxt, SDeleteStmt* pDele if (TSDB_CODE_SUCCESS == code) { *pLogicNode = pRoot; } else { - nodesDestroyNode(pRoot); + nodesDestroyNode((SNode*)pRoot); } return code; @@ -1171,7 +1171,7 @@ int32_t createLogicPlan(SPlanContext* pCxt, SLogicSubplan** pLogicSubplan) { if (TSDB_CODE_SUCCESS == code) { *pLogicSubplan = pSubplan; } else { - nodesDestroyNode(pSubplan); + nodesDestroyNode((SNode*)pSubplan); } return code; diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index ae689c53d6d3e4e7e6004724285d9cf379cb5d50..65d73b4cdb706252c534b45f90eb8fed50f60507 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -247,7 +247,7 @@ static int32_t osdOptimize(SOptimizeContext* pCxt, SLogicSubplan* pLogicSubplan) } static int32_t cpdMergeCond(SNode** pDst, SNode** pSrc) { - SLogicConditionNode* pLogicCond = nodesMakeNode(QUERY_NODE_LOGIC_CONDITION); + SLogicConditionNode* pLogicCond = (SLogicConditionNode*)nodesMakeNode(QUERY_NODE_LOGIC_CONDITION); if (NULL == pLogicCond) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -262,7 +262,7 @@ static int32_t cpdMergeCond(SNode** pDst, SNode** pSrc) { if (TSDB_CODE_SUCCESS == code) { *pDst = (SNode*)pLogicCond; } else { - nodesDestroyNode(pLogicCond); + nodesDestroyNode((SNode*)pLogicCond); } return code; } @@ -662,13 +662,13 @@ static int32_t opkGetScanNodesImpl(SLogicNode* pNode, bool* pNotOptimize, SNodeL switch (nodeType(pNode)) { case QUERY_NODE_LOGIC_PLAN_SCAN: if (TSDB_SUPER_TABLE != ((SScanLogicNode*)pNode)->tableType) { - return nodesListMakeAppend(pScanNodes, pNode); + return nodesListMakeAppend(pScanNodes, (SNode*)pNode); } break; case QUERY_NODE_LOGIC_PLAN_JOIN: - code = opkGetScanNodesImpl(nodesListGetNode(pNode->pChildren, 0), pNotOptimize, pScanNodes); + code = opkGetScanNodesImpl((SLogicNode*)nodesListGetNode(pNode->pChildren, 0), pNotOptimize, pScanNodes); if (TSDB_CODE_SUCCESS == code) { - code = opkGetScanNodesImpl(nodesListGetNode(pNode->pChildren, 1), pNotOptimize, pScanNodes); + code = opkGetScanNodesImpl((SLogicNode*)nodesListGetNode(pNode->pChildren, 1), pNotOptimize, pScanNodes); } return code; case QUERY_NODE_LOGIC_PLAN_AGG: @@ -683,7 +683,7 @@ static int32_t opkGetScanNodesImpl(SLogicNode* pNode, bool* pNotOptimize, SNodeL return TSDB_CODE_SUCCESS; } - return opkGetScanNodesImpl(nodesListGetNode(pNode->pChildren, 0), pNotOptimize, pScanNodes); + return opkGetScanNodesImpl((SLogicNode*)nodesListGetNode(pNode->pChildren, 0), pNotOptimize, pScanNodes); } static int32_t opkGetScanNodes(SLogicNode* pNode, SNodeList** pScanNodes) { @@ -721,12 +721,12 @@ static int32_t opkDoOptimized(SOptimizeContext* pCxt, SSortLogicNode* pSort, SNo SNode* pDownNode = opkRewriteDownNode(pSort); SNode* pNode; FOREACH(pNode, pSort->node.pParent->pChildren) { - if (nodesEqualNode(pNode, pSort)) { + if (nodesEqualNode(pNode, (SNode*)pSort)) { REPLACE_NODE(pDownNode); break; } } - nodesDestroyNode(pSort); + nodesDestroyNode((SNode*)pSort); return TSDB_CODE_SUCCESS; } @@ -736,7 +736,7 @@ static int32_t opkOptimizeImpl(SOptimizeContext* pCxt, SSortLogicNode* pSort) { return TSDB_CODE_SUCCESS; } SNodeList* pScanNodes = NULL; - int32_t code = opkGetScanNodes(nodesListGetNode(pSort->node.pChildren, 0), &pScanNodes); + int32_t code = opkGetScanNodes((SLogicNode*)nodesListGetNode(pSort->node.pChildren, 0), &pScanNodes); if (TSDB_CODE_SUCCESS == code && NULL != pScanNodes) { code = opkDoOptimized(pCxt, pSort, pScanNodes); } @@ -768,7 +768,7 @@ static bool smaOptMayBeOptimized(SLogicNode* pNode) { } static int32_t smaOptCreateMerge(SLogicNode* pChild, SNodeList* pMergeKeys, SNodeList* pTargets, SLogicNode** pOutput) { - SMergeLogicNode* pMerge = nodesMakeNode(QUERY_NODE_LOGIC_PLAN_MERGE); + SMergeLogicNode* pMerge = (SMergeLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_MERGE); if (NULL == pMerge) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -778,7 +778,7 @@ static int32_t smaOptCreateMerge(SLogicNode* pChild, SNodeList* pMergeKeys, SNod pMerge->node.pTargets = pTargets; pMerge->pInputs = nodesCloneList(pChild->pTargets); if (NULL == pMerge->pInputs) { - nodesDestroyNode(pMerge); + nodesDestroyNode((SNode*)pMerge); return TSDB_CODE_OUT_OF_MEMORY; } @@ -788,9 +788,9 @@ static int32_t smaOptCreateMerge(SLogicNode* pChild, SNodeList* pMergeKeys, SNod static int32_t smaOptRecombinationNode(SLogicSubplan* pLogicSubplan, SLogicNode* pInterval, SLogicNode* pMerge, SLogicNode* pSmaScan) { - int32_t code = nodesListMakeAppend(&pMerge->pChildren, pInterval); + int32_t code = nodesListMakeAppend(&pMerge->pChildren, (SNode*)pInterval); if (TSDB_CODE_SUCCESS == code) { - code = nodesListMakeAppend(&pMerge->pChildren, pSmaScan); + code = nodesListMakeAppend(&pMerge->pChildren, (SNode*)pSmaScan); } if (TSDB_CODE_SUCCESS == code) { code = replaceLogicNode(pLogicSubplan, pInterval, pMerge); @@ -802,7 +802,7 @@ static int32_t smaOptRecombinationNode(SLogicSubplan* pLogicSubplan, SLogicNode* static int32_t smaOptCreateSmaScan(SScanLogicNode* pScan, STableIndexInfo* pIndex, SNodeList* pCols, SLogicNode** pOutput) { - SScanLogicNode* pSmaScan = nodesMakeNode(QUERY_NODE_LOGIC_PLAN_SCAN); + SScanLogicNode* pSmaScan = (SScanLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_SCAN); if (NULL == pSmaScan) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -819,7 +819,7 @@ static int32_t smaOptCreateSmaScan(SScanLogicNode* pScan, STableIndexInfo* pInde pSmaScan->pVgroupList = taosMemoryCalloc(1, sizeof(SVgroupsInfo) + sizeof(SVgroupInfo)); pSmaScan->node.pTargets = nodesCloneList(pCols); if (NULL == pSmaScan->pVgroupList || NULL == pSmaScan->node.pTargets) { - nodesDestroyNode(pSmaScan); + nodesDestroyNode((SNode*)pSmaScan); return TSDB_CODE_OUT_OF_MEMORY; } pSmaScan->pVgroupList->numOfVgroups = 1; @@ -851,7 +851,7 @@ static bool smaOptEqualInterval(SScanLogicNode* pScan, SWindowLogicNode* pWindow } static SNode* smaOptCreateSmaCol(SNode* pFunc, uint64_t tableId, int32_t colId) { - SColumnNode* pCol = nodesMakeNode(QUERY_NODE_COLUMN); + SColumnNode* pCol = (SColumnNode*)nodesMakeNode(QUERY_NODE_COLUMN); if (NULL == pCol) { return NULL; } @@ -926,32 +926,32 @@ static int32_t smaOptCouldApplyIndex(SScanLogicNode* pScan, STableIndexInfo* pIn } static SNode* smaOptCreateWStartTs() { - SFunctionNode* pWStart = nodesMakeNode(QUERY_NODE_FUNCTION); + SFunctionNode* pWStart = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION); if (NULL == pWStart) { return NULL; } strcpy(pWStart->functionName, "_wstartts"); snprintf(pWStart->node.aliasName, sizeof(pWStart->node.aliasName), "%s.%p", pWStart->functionName, pWStart); if (TSDB_CODE_SUCCESS != fmGetFuncInfo(pWStart, NULL, 0)) { - nodesDestroyNode(pWStart); + nodesDestroyNode((SNode*)pWStart); return NULL; } return (SNode*)pWStart; } static int32_t smaOptCreateMergeKey(SNode* pCol, SNodeList** pMergeKeys) { - SOrderByExprNode* pMergeKey = nodesMakeNode(QUERY_NODE_ORDER_BY_EXPR); + SOrderByExprNode* pMergeKey = (SOrderByExprNode*)nodesMakeNode(QUERY_NODE_ORDER_BY_EXPR); if (NULL == pMergeKey) { return TSDB_CODE_OUT_OF_MEMORY; } pMergeKey->pExpr = nodesCloneNode(pCol); if (NULL == pMergeKey->pExpr) { - nodesDestroyNode(pMergeKey); + nodesDestroyNode((SNode*)pMergeKey); return TSDB_CODE_OUT_OF_MEMORY; } pMergeKey->order = ORDER_ASC; pMergeKey->nullOrder = NULL_ORDER_FIRST; - return nodesListMakeStrictAppend(pMergeKeys, pMergeKey); + return nodesListMakeStrictAppend(pMergeKeys, (SNode*)pMergeKey); } static int32_t smaOptRewriteInterval(SWindowLogicNode* pInterval, int32_t wstrartIndex, SNodeList** pMergeKeys) { diff --git a/source/libs/planner/src/planPhysiCreater.c b/source/libs/planner/src/planPhysiCreater.c index 6391772abeeb80bde74419263c829026fec9c7e6..8502ffc04adbf0a8195fc9d12a912dd51ecef41f 100644 --- a/source/libs/planner/src/planPhysiCreater.c +++ b/source/libs/planner/src/planPhysiCreater.c @@ -56,14 +56,14 @@ static int32_t getSlotKey(SNode* pNode, const char* pStmtName, char* pKey) { return sprintf(pKey, "%s", ((SExprNode*)pNode)->aliasName); } -static SNode* createSlotDesc(SPhysiPlanContext* pCxt, const SNode* pNode, int16_t slotId, bool output) { +static SNode* createSlotDesc(SPhysiPlanContext* pCxt, const SNode* pNode, int16_t slotId, bool output, bool reserve) { SSlotDescNode* pSlot = (SSlotDescNode*)nodesMakeNode(QUERY_NODE_SLOT_DESC); if (NULL == pSlot) { return NULL; } pSlot->slotId = slotId; pSlot->dataType = ((SExprNode*)pNode)->resType; - pSlot->reserve = false; + pSlot->reserve = reserve; pSlot->output = output; return (SNode*)pSlot; } @@ -131,7 +131,7 @@ static int32_t buildDataBlockSlots(SPhysiPlanContext* pCxt, SNodeList* pList, SD int16_t slotId = 0; SNode* pNode = NULL; FOREACH(pNode, pList) { - code = nodesListStrictAppend(pDataBlockDesc->pSlots, createSlotDesc(pCxt, pNode, slotId, true)); + code = nodesListStrictAppend(pDataBlockDesc->pSlots, createSlotDesc(pCxt, pNode, slotId, true, false)); if (TSDB_CODE_SUCCESS == code) { code = putSlotToHash(pDataBlockDesc->dataBlockId, slotId, pNode, pHash); } @@ -147,7 +147,7 @@ static int32_t buildDataBlockSlots(SPhysiPlanContext* pCxt, SNodeList* pList, SD } static int32_t createDataBlockDesc(SPhysiPlanContext* pCxt, SNodeList* pList, SDataBlockDescNode** pDataBlockDesc) { - SDataBlockDescNode* pDesc = nodesMakeNode(QUERY_NODE_DATABLOCK_DESC); + SDataBlockDescNode* pDesc = (SDataBlockDescNode*)nodesMakeNode(QUERY_NODE_DATABLOCK_DESC); if (NULL == pDesc) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -162,7 +162,7 @@ static int32_t createDataBlockDesc(SPhysiPlanContext* pCxt, SNodeList* pList, SD if (TSDB_CODE_SUCCESS == code) { *pDataBlockDesc = pDesc; } else { - nodesDestroyNode(pDesc); + nodesDestroyNode((SNode*)pDesc); } return code; @@ -181,7 +181,7 @@ static int16_t getUnsetSlotId(const SArray* pSlotIdsInfo) { } static int32_t addDataBlockSlotsImpl(SPhysiPlanContext* pCxt, SNodeList* pList, SDataBlockDescNode* pDataBlockDesc, - const char* pStmtName, bool output) { + const char* pStmtName, bool output, bool reserve) { if (NULL == pList) { return TSDB_CODE_SUCCESS; } @@ -196,7 +196,7 @@ static int32_t addDataBlockSlotsImpl(SPhysiPlanContext* pCxt, SNodeList* pList, int32_t len = getSlotKey(pExpr, pStmtName, name); SSlotIndex* pIndex = taosHashGet(pHash, name, len); if (NULL == pIndex) { - code = nodesListStrictAppend(pDataBlockDesc->pSlots, createSlotDesc(pCxt, pExpr, nextSlotId, output)); + code = nodesListStrictAppend(pDataBlockDesc->pSlots, createSlotDesc(pCxt, pExpr, nextSlotId, output, reserve)); if (TSDB_CODE_SUCCESS == code) { code = putSlotToHashImpl(pDataBlockDesc->dataBlockId, nextSlotId, name, len, pHash); } @@ -226,7 +226,7 @@ static int32_t addDataBlockSlotsImpl(SPhysiPlanContext* pCxt, SNodeList* pList, } static int32_t addDataBlockSlots(SPhysiPlanContext* pCxt, SNodeList* pList, SDataBlockDescNode* pDataBlockDesc) { - return addDataBlockSlotsImpl(pCxt, pList, pDataBlockDesc, NULL, false); + return addDataBlockSlotsImpl(pCxt, pList, pDataBlockDesc, NULL, false, false); } static int32_t addDataBlockSlot(SPhysiPlanContext* pCxt, SNode** pNode, SDataBlockDescNode* pDataBlockDesc) { @@ -248,11 +248,11 @@ static int32_t addDataBlockSlot(SPhysiPlanContext* pCxt, SNode** pNode, SDataBlo static int32_t addDataBlockSlotsForProject(SPhysiPlanContext* pCxt, const char* pStmtName, SNodeList* pList, SDataBlockDescNode* pDataBlockDesc) { - return addDataBlockSlotsImpl(pCxt, pList, pDataBlockDesc, pStmtName, true); + return addDataBlockSlotsImpl(pCxt, pList, pDataBlockDesc, pStmtName, true, false); } static int32_t pushdownDataBlockSlots(SPhysiPlanContext* pCxt, SNodeList* pList, SDataBlockDescNode* pDataBlockDesc) { - return addDataBlockSlotsImpl(pCxt, pList, pDataBlockDesc, NULL, true); + return addDataBlockSlotsImpl(pCxt, pList, pDataBlockDesc, NULL, true, true); } typedef struct SSetSlotIdCxt { @@ -350,7 +350,7 @@ static SPhysiNode* makePhysiNode(SPhysiPlanContext* pCxt, SLogicNode* pLogicNode int32_t code = createDataBlockDesc(pCxt, pLogicNode->pTargets, &pPhysiNode->pOutputDataBlockDesc); if (TSDB_CODE_SUCCESS != code) { - nodesDestroyNode(pPhysiNode); + nodesDestroyNode((SNode*)pPhysiNode); return NULL; } pPhysiNode->pOutputDataBlockDesc->precision = pLogicNode->precision; @@ -439,7 +439,7 @@ static int32_t createScanPhysiNodeFinalize(SPhysiPlanContext* pCxt, SSubplan* pS if (TSDB_CODE_SUCCESS == code) { *pPhyNode = (SPhysiNode*)pScanPhysiNode; } else { - nodesDestroyNode(pScanPhysiNode); + nodesDestroyNode((SNode*)pScanPhysiNode); } return code; @@ -486,7 +486,7 @@ static int32_t createTableScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubp pTableScan->dataRequired = pScanLogicNode->dataRequired; pTableScan->pDynamicScanFuncs = nodesCloneList(pScanLogicNode->pDynamicScanFuncs); if (NULL != pScanLogicNode->pDynamicScanFuncs && NULL == pTableScan->pDynamicScanFuncs) { - nodesDestroyNode(pTableScan); + nodesDestroyNode((SNode*)pTableScan); return TSDB_CODE_OUT_OF_MEMORY; } pTableScan->interval = pScanLogicNode->interval; @@ -584,7 +584,7 @@ static int32_t createJoinPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren if (TSDB_CODE_SUCCESS == code) { *pPhyNode = (SPhysiNode*)pJoin; } else { - nodesDestroyNode(pJoin); + nodesDestroyNode((SNode*)pJoin); } return code; @@ -635,7 +635,7 @@ static int32_t rewriteValueToOperator(SRewritePrecalcExprsCxt* pCxt, SNode** pNo } pOper->pLeft = nodesMakeNode(QUERY_NODE_LEFT_VALUE); if (NULL == pOper->pLeft) { - nodesDestroyNode(pOper); + nodesDestroyNode((SNode*)pOper); return TSDB_CODE_OUT_OF_MEMORY; } SValueNode* pVal = (SValueNode*)*pNode; @@ -782,7 +782,7 @@ static int32_t createAggPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren, if (TSDB_CODE_SUCCESS == code) { *pPhyNode = (SPhysiNode*)pAgg; } else { - nodesDestroyNode(pAgg); + nodesDestroyNode((SNode*)pAgg); } nodesDestroyList(pPrecalcExprs); @@ -823,7 +823,7 @@ static int32_t createIndefRowsFuncPhysiNode(SPhysiPlanContext* pCxt, SNodeList* if (TSDB_CODE_SUCCESS == code) { *pPhyNode = (SPhysiNode*)pIdfRowsFunc; } else { - nodesDestroyNode(pIdfRowsFunc); + nodesDestroyNode((SNode*)pIdfRowsFunc); } return code; @@ -855,7 +855,7 @@ static int32_t createProjectPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChild if (TSDB_CODE_SUCCESS == code) { *pPhyNode = (SPhysiNode*)pProject; } else { - nodesDestroyNode(pProject); + nodesDestroyNode((SNode*)pProject); } return code; @@ -904,7 +904,7 @@ static int32_t createStreamScanPhysiNodeByExchange(SPhysiPlanContext* pCxt, SExc if (TSDB_CODE_SUCCESS == code) { *pPhyNode = (SPhysiNode*)pScan; } else { - nodesDestroyNode(pScan); + nodesDestroyNode((SNode*)pScan); } return code; @@ -952,7 +952,7 @@ static int32_t createWindowPhysiNodeFinalize(SPhysiPlanContext* pCxt, SNodeList* if (TSDB_CODE_SUCCESS == code) { *pPhyNode = (SPhysiNode*)pWindow; } else { - nodesDestroyNode(pWindow); + nodesDestroyNode((SNode*)pWindow); } return code; @@ -1037,7 +1037,7 @@ static int32_t createStateWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pC } if (TSDB_CODE_SUCCESS != code) { - nodesDestroyNode(pState); + nodesDestroyNode((SNode*)pState); return code; } @@ -1094,7 +1094,7 @@ static int32_t createSortPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren if (TSDB_CODE_SUCCESS == code) { *pPhyNode = (SPhysiNode*)pSort; } else { - nodesDestroyNode(pSort); + nodesDestroyNode((SNode*)pSort); } return code; @@ -1117,7 +1117,7 @@ static int32_t createPartitionPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChi if (TSDB_CODE_SUCCESS == code && NULL != pPrecalcExprs) { code = setListSlotId(pCxt, pChildTupe->dataBlockId, -1, pPrecalcExprs, &pPart->pExprs); if (TSDB_CODE_SUCCESS == code) { - code = addDataBlockSlots(pCxt, pPart->pExprs, pChildTupe); + code = pushdownDataBlockSlots(pCxt, pPart->pExprs, pChildTupe); } } @@ -1135,7 +1135,7 @@ static int32_t createPartitionPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChi if (TSDB_CODE_SUCCESS == code) { *pPhyNode = (SPhysiNode*)pPart; } else { - nodesDestroyNode(pPart); + nodesDestroyNode((SNode*)pPart); } return code; @@ -1174,28 +1174,28 @@ static int32_t createFillPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren if (TSDB_CODE_SUCCESS == code) { *pPhyNode = (SPhysiNode*)pFill; } else { - nodesDestroyNode(pFill); + nodesDestroyNode((SNode*)pFill); } return code; } static int32_t createExchangePhysiNodeByMerge(SMergePhysiNode* pMerge) { - SExchangePhysiNode* pExchange = nodesMakeNode(QUERY_NODE_PHYSICAL_PLAN_EXCHANGE); + SExchangePhysiNode* pExchange = (SExchangePhysiNode*)nodesMakeNode(QUERY_NODE_PHYSICAL_PLAN_EXCHANGE); if (NULL == pExchange) { return TSDB_CODE_OUT_OF_MEMORY; } pExchange->srcGroupId = pMerge->srcGroupId; pExchange->singleChannel = true; pExchange->node.pParent = (SPhysiNode*)pMerge; - pExchange->node.pOutputDataBlockDesc = nodesCloneNode(pMerge->node.pOutputDataBlockDesc); + pExchange->node.pOutputDataBlockDesc = (SDataBlockDescNode*)nodesCloneNode((SNode*)pMerge->node.pOutputDataBlockDesc); if (NULL == pExchange->node.pOutputDataBlockDesc) { - nodesDestroyNode(pExchange); + nodesDestroyNode((SNode*)pExchange); return TSDB_CODE_OUT_OF_MEMORY; } SNode* pSlot = NULL; FOREACH(pSlot, pExchange->node.pOutputDataBlockDesc->pSlots) { ((SSlotDescNode*)pSlot)->output = true; } - return nodesListMakeStrictAppend(&pMerge->node.pChildren, pExchange); + return nodesListMakeStrictAppend(&pMerge->node.pChildren, (SNode*)pExchange); } static int32_t createMergePhysiNode(SPhysiPlanContext* pCxt, SMergeLogicNode* pMergeLogicNode, SPhysiNode** pPhyNode) { @@ -1235,7 +1235,7 @@ static int32_t createMergePhysiNode(SPhysiPlanContext* pCxt, SMergeLogicNode* pM if (TSDB_CODE_SUCCESS == code) { *pPhyNode = (SPhysiNode*)pMerge; } else { - nodesDestroyNode(pMerge); + nodesDestroyNode((SNode*)pMerge); } return code; @@ -1287,7 +1287,7 @@ static int32_t createPhysiNode(SPhysiPlanContext* pCxt, SLogicNode* pLogicNode, SPhysiNode* pChild = NULL; code = createPhysiNode(pCxt, (SLogicNode*)pLogicChild, pSubplan, &pChild); if (TSDB_CODE_SUCCESS == code) { - code = nodesListStrictAppend(pChildren, pChild); + code = nodesListStrictAppend(pChildren, (SNode*)pChild); } } @@ -1311,7 +1311,7 @@ static int32_t createPhysiNode(SPhysiPlanContext* pCxt, SLogicNode* pLogicNode, } static int32_t createDataInserter(SPhysiPlanContext* pCxt, SVgDataBlocks* pBlocks, SDataSinkNode** pSink) { - SDataInserterNode* pInserter = nodesMakeNode(QUERY_NODE_PHYSICAL_PLAN_INSERT); + SDataInserterNode* pInserter = (SDataInserterNode*)nodesMakeNode(QUERY_NODE_PHYSICAL_PLAN_INSERT); if (NULL == pInserter) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -1325,14 +1325,14 @@ static int32_t createDataInserter(SPhysiPlanContext* pCxt, SVgDataBlocks* pBlock } static int32_t createDataDispatcher(SPhysiPlanContext* pCxt, const SPhysiNode* pRoot, SDataSinkNode** pSink) { - SDataDispatcherNode* pDispatcher = nodesMakeNode(QUERY_NODE_PHYSICAL_PLAN_DISPATCH); + SDataDispatcherNode* pDispatcher = (SDataDispatcherNode*)nodesMakeNode(QUERY_NODE_PHYSICAL_PLAN_DISPATCH); if (NULL == pDispatcher) { return TSDB_CODE_OUT_OF_MEMORY; } - pDispatcher->sink.pInputDataBlockDesc = nodesCloneNode(pRoot->pOutputDataBlockDesc); + pDispatcher->sink.pInputDataBlockDesc = (SDataBlockDescNode*)nodesCloneNode((SNode*)pRoot->pOutputDataBlockDesc); if (NULL == pDispatcher->sink.pInputDataBlockDesc) { - nodesDestroyNode(pDispatcher); + nodesDestroyNode((SNode*)pDispatcher); return TSDB_CODE_OUT_OF_MEMORY; } @@ -1341,7 +1341,7 @@ static int32_t createDataDispatcher(SPhysiPlanContext* pCxt, const SPhysiNode* p } static SSubplan* makeSubplan(SPhysiPlanContext* pCxt, SLogicSubplan* pLogicSubplan) { - SSubplan* pSubplan = nodesMakeNode(QUERY_NODE_PHYSICAL_SUBPLAN); + SSubplan* pSubplan = (SSubplan*)nodesMakeNode(QUERY_NODE_PHYSICAL_SUBPLAN); if (NULL == pSubplan) { return NULL; } @@ -1361,7 +1361,7 @@ static int32_t buildInsertSubplan(SPhysiPlanContext* pCxt, SVnodeModifyLogicNode static int32_t createDataDeleter(SPhysiPlanContext* pCxt, SVnodeModifyLogicNode* pModify, const SPhysiNode* pRoot, SDataSinkNode** pSink) { - SDataDeleterNode* pDeleter = nodesMakeNode(QUERY_NODE_PHYSICAL_PLAN_DELETE); + SDataDeleterNode* pDeleter = (SDataDeleterNode*)nodesMakeNode(QUERY_NODE_PHYSICAL_PLAN_DELETE); if (NULL == pDeleter) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -1374,7 +1374,7 @@ static int32_t createDataDeleter(SPhysiPlanContext* pCxt, SVnodeModifyLogicNode* int32_t code = setNodeSlotId(pCxt, pRoot->pOutputDataBlockDesc->dataBlockId, -1, pModify->pAffectedRows, &pDeleter->pAffectedRows); if (TSDB_CODE_SUCCESS == code) { - pDeleter->sink.pInputDataBlockDesc = nodesCloneNode(pRoot->pOutputDataBlockDesc); + pDeleter->sink.pInputDataBlockDesc = (SDataBlockDescNode*)nodesCloneNode((SNode*)pRoot->pOutputDataBlockDesc); if (NULL == pDeleter->sink.pInputDataBlockDesc) { code = TSDB_CODE_OUT_OF_MEMORY; } @@ -1383,7 +1383,7 @@ static int32_t createDataDeleter(SPhysiPlanContext* pCxt, SVnodeModifyLogicNode* if (TSDB_CODE_SUCCESS == code) { *pSink = (SDataSinkNode*)pDeleter; } else { - nodesDestroyNode(pDeleter); + nodesDestroyNode((SNode*)pDeleter); } return TSDB_CODE_SUCCESS; @@ -1437,38 +1437,38 @@ static int32_t createPhysiSubplan(SPhysiPlanContext* pCxt, SLogicSubplan* pLogic if (TSDB_CODE_SUCCESS == code) { *pPhysiSubplan = pSubplan; } else { - nodesDestroyNode(pSubplan); + nodesDestroyNode((SNode*)pSubplan); } return code; } static SQueryPlan* makeQueryPhysiPlan(SPhysiPlanContext* pCxt) { - SQueryPlan* pPlan = nodesMakeNode(QUERY_NODE_PHYSICAL_PLAN); + SQueryPlan* pPlan = (SQueryPlan*)nodesMakeNode(QUERY_NODE_PHYSICAL_PLAN); if (NULL == pPlan) { return NULL; } pPlan->pSubplans = nodesMakeList(); if (NULL == pPlan->pSubplans) { - nodesDestroyNode(pPlan); + nodesDestroyNode((SNode*)pPlan); return NULL; } pPlan->queryId = pCxt->pPlanCxt->queryId; return pPlan; } -static int32_t pushSubplan(SPhysiPlanContext* pCxt, SNodeptr pSubplan, int32_t level, SNodeList* pSubplans) { - SNodeListNode* pGroup; +static int32_t pushSubplan(SPhysiPlanContext* pCxt, SNode* pSubplan, int32_t level, SNodeList* pSubplans) { + SNodeListNode* pGroup = NULL; if (level >= LIST_LENGTH(pSubplans)) { - pGroup = nodesMakeNode(QUERY_NODE_NODE_LIST); + pGroup = (SNodeListNode*)nodesMakeNode(QUERY_NODE_NODE_LIST); if (NULL == pGroup) { return TSDB_CODE_OUT_OF_MEMORY; } - if (TSDB_CODE_SUCCESS != nodesListStrictAppend(pSubplans, pGroup)) { + if (TSDB_CODE_SUCCESS != nodesListStrictAppend(pSubplans, (SNode*)pGroup)) { return TSDB_CODE_OUT_OF_MEMORY; } } else { - pGroup = nodesListGetNode(pSubplans, level); + pGroup = (SNodeListNode*)nodesListGetNode(pSubplans, level); } if (NULL == pGroup->pNodeList) { pGroup->pNodeList = nodesMakeList(); @@ -1476,7 +1476,7 @@ static int32_t pushSubplan(SPhysiPlanContext* pCxt, SNodeptr pSubplan, int32_t l return TSDB_CODE_OUT_OF_MEMORY; } } - return nodesListStrictAppend(pGroup->pNodeList, pSubplan); + return nodesListStrictAppend(pGroup->pNodeList, (SNode*)pSubplan); } static int32_t buildPhysiPlan(SPhysiPlanContext* pCxt, SLogicSubplan* pLogicSubplan, SSubplan* pParent, @@ -1485,19 +1485,19 @@ static int32_t buildPhysiPlan(SPhysiPlanContext* pCxt, SLogicSubplan* pLogicSubp int32_t code = createPhysiSubplan(pCxt, pLogicSubplan, &pSubplan); if (TSDB_CODE_SUCCESS == code) { - code = pushSubplan(pCxt, pSubplan, pLogicSubplan->level, pQueryPlan->pSubplans); + code = pushSubplan(pCxt, (SNode*)pSubplan, pLogicSubplan->level, pQueryPlan->pSubplans); ++(pQueryPlan->numOfSubplans); } if (TSDB_CODE_SUCCESS != code) { - nodesDestroyNode(pSubplan); + nodesDestroyNode((SNode*)pSubplan); return code; } if (TSDB_CODE_SUCCESS == code && NULL != pParent) { - code = nodesListMakeAppend(&pParent->pChildren, pSubplan); + code = nodesListMakeAppend(&pParent->pChildren, (SNode*)pSubplan); if (TSDB_CODE_SUCCESS == code) { - code = nodesListMakeAppend(&pSubplan->pParents, pParent); + code = nodesListMakeAppend(&pSubplan->pParents, (SNode*)pParent); } } @@ -1515,7 +1515,7 @@ static int32_t buildPhysiPlan(SPhysiPlanContext* pCxt, SLogicSubplan* pLogicSubp } static int32_t doCreatePhysiPlan(SPhysiPlanContext* pCxt, SQueryLogicPlan* pLogicPlan, SQueryPlan** pPhysiPlan) { - SQueryPlan* pPlan = makeQueryPhysiPlan(pCxt); + SQueryPlan* pPlan = (SQueryPlan*)makeQueryPhysiPlan(pCxt); if (NULL == pPlan) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -1533,7 +1533,7 @@ static int32_t doCreatePhysiPlan(SPhysiPlanContext* pCxt, SQueryLogicPlan* pLogi if (TSDB_CODE_SUCCESS == code) { *pPhysiPlan = pPlan; } else { - nodesDestroyNode(pPlan); + nodesDestroyNode((SNode*)pPlan); } return code; diff --git a/source/libs/planner/src/planScaleOut.c b/source/libs/planner/src/planScaleOut.c index 5dd016afb8acff5b0759f986a88feb3a71746b17..9707b36f4a6266e39798166ba6ef86dced17e969 100644 --- a/source/libs/planner/src/planScaleOut.c +++ b/source/libs/planner/src/planScaleOut.c @@ -21,13 +21,13 @@ typedef struct SScaleOutContext { } SScaleOutContext; static SLogicSubplan* singleCloneSubLogicPlan(SScaleOutContext* pCxt, SLogicSubplan* pSrc, int32_t level) { - SLogicSubplan* pDst = nodesMakeNode(QUERY_NODE_LOGIC_SUBPLAN); + SLogicSubplan* pDst = (SLogicSubplan*)nodesMakeNode(QUERY_NODE_LOGIC_SUBPLAN); if (NULL == pDst) { return NULL; } - pDst->pNode = nodesCloneNode(pSrc->pNode); + pDst->pNode = (SLogicNode*)nodesCloneNode((SNode*)pSrc->pNode); if (NULL == pDst->pNode) { - nodesDestroyNode(pDst); + nodesDestroyNode((SNode*)pDst); return NULL; } pDst->subplanType = pSrc->subplanType; @@ -73,7 +73,7 @@ static int32_t scaleOutByVgroups(SScaleOutContext* pCxt, SLogicSubplan* pSubplan } code = setScanVgroup(pNewSubplan->pNode, pSubplan->pVgroupList->vgroups + i); if (TSDB_CODE_SUCCESS == code) { - code = nodesListStrictAppend(pGroup, pNewSubplan); + code = nodesListStrictAppend(pGroup, (SNode*)pNewSubplan); } if (TSDB_CODE_SUCCESS != code) { break; @@ -95,7 +95,7 @@ static int32_t scaleOutForModify(SScaleOutContext* pCxt, SLogicSubplan* pSubplan } ((SVnodeModifyLogicNode*)pNewSubplan->pNode)->pVgDataBlocks = (SVgDataBlocks*)taosArrayGetP(pNode->pDataBlocks, i); - if (TSDB_CODE_SUCCESS != nodesListStrictAppend(pGroup, pNewSubplan)) { + if (TSDB_CODE_SUCCESS != nodesListStrictAppend(pGroup, (SNode*)pNewSubplan)) { return TSDB_CODE_OUT_OF_MEMORY; } } @@ -104,7 +104,7 @@ static int32_t scaleOutForModify(SScaleOutContext* pCxt, SLogicSubplan* pSubplan } static int32_t scaleOutForMerge(SScaleOutContext* pCxt, SLogicSubplan* pSubplan, int32_t level, SNodeList* pGroup) { - return nodesListStrictAppend(pGroup, singleCloneSubLogicPlan(pCxt, pSubplan, level)); + return nodesListStrictAppend(pGroup, (SNode*)singleCloneSubLogicPlan(pCxt, pSubplan, level)); } static int32_t scaleOutForScan(SScaleOutContext* pCxt, SLogicSubplan* pSubplan, int32_t level, SNodeList* pGroup) { @@ -189,7 +189,7 @@ static SQueryLogicPlan* makeQueryLogicPlan() { } pLogicPlan->pTopSubplans = nodesMakeList(); if (NULL == pLogicPlan->pTopSubplans) { - nodesDestroyNode(pLogicPlan); + nodesDestroyNode((SNode*)pLogicPlan); return NULL; } return pLogicPlan; @@ -206,7 +206,7 @@ int32_t scaleOutLogicPlan(SPlanContext* pCxt, SLogicSubplan* pLogicSubplan, SQue if (TSDB_CODE_SUCCESS == code) { *pLogicPlan = pPlan; } else { - nodesDestroyNode(pPlan); + nodesDestroyNode((SNode*)pPlan); } return code; diff --git a/source/libs/planner/src/planSpliter.c b/source/libs/planner/src/planSpliter.c index f33856c4ceb6a23bde613bda02457acf0acb7dd3..2fc79255af409fc7da2e849cede5e96d28f67f7a 100644 --- a/source/libs/planner/src/planSpliter.c +++ b/source/libs/planner/src/planSpliter.c @@ -50,7 +50,7 @@ static void splSetSubplanVgroups(SLogicSubplan* pSubplan, SLogicNode* pNode) { } static SLogicSubplan* splCreateScanSubplan(SSplitContext* pCxt, SLogicNode* pNode, int32_t flag) { - SLogicSubplan* pSubplan = nodesMakeNode(QUERY_NODE_LOGIC_SUBPLAN); + SLogicSubplan* pSubplan = (SLogicSubplan*)nodesMakeNode(QUERY_NODE_LOGIC_SUBPLAN); if (NULL == pSubplan) { return NULL; } @@ -65,7 +65,7 @@ static SLogicSubplan* splCreateScanSubplan(SSplitContext* pCxt, SLogicNode* pNod } static int32_t splCreateExchangeNode(SSplitContext* pCxt, SLogicNode* pChild, SExchangeLogicNode** pOutput) { - SExchangeLogicNode* pExchange = nodesMakeNode(QUERY_NODE_LOGIC_PLAN_EXCHANGE); + SExchangeLogicNode* pExchange = (SExchangeLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_EXCHANGE); if (NULL == pExchange) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -90,7 +90,7 @@ static int32_t splCreateExchangeNodeForSubplan(SSplitContext* pCxt, SLogicSubpla if (TSDB_CODE_SUCCESS == code) { pSubplan->subplanType = subplanType; } else { - nodesDestroyNode(pExchange); + nodesDestroyNode((SNode*)pExchange); } return code; } @@ -191,21 +191,21 @@ static int32_t stbSplRewriteFuns(const SNodeList* pFuncs, SNodeList** pPartialFu SFunctionNode* pMergeFunc = NULL; int32_t code = TSDB_CODE_SUCCESS; if (fmIsWindowPseudoColumnFunc(pFunc->funcId)) { - pPartFunc = nodesCloneNode(pFunc); - pMergeFunc = nodesCloneNode(pFunc); + pPartFunc = (SFunctionNode*)nodesCloneNode(pNode); + pMergeFunc = (SFunctionNode*)nodesCloneNode(pNode); if (NULL == pPartFunc || NULL == pMergeFunc) { - nodesDestroyNode(pPartFunc); - nodesDestroyNode(pMergeFunc); + nodesDestroyNode((SNode*)pPartFunc); + nodesDestroyNode((SNode*)pMergeFunc); code = TSDB_CODE_OUT_OF_MEMORY; } } else { code = fmGetDistMethod(pFunc, &pPartFunc, &pMergeFunc); } if (TSDB_CODE_SUCCESS == code) { - code = nodesListMakeStrictAppend(pPartialFuncs, pPartFunc); + code = nodesListMakeStrictAppend(pPartialFuncs, (SNode*)pPartFunc); } if (TSDB_CODE_SUCCESS == code) { - code = nodesListMakeStrictAppend(pMergeFuncs, pMergeFunc); + code = nodesListMakeStrictAppend(pMergeFuncs, (SNode*)pMergeFunc); } if (TSDB_CODE_SUCCESS != code) { nodesDestroyList(*pPartialFuncs); @@ -227,7 +227,7 @@ static int32_t stbSplAppendWStart(SNodeList* pFuncs, int32_t* pIndex) { ++index; } - SFunctionNode* pWStart = nodesMakeNode(QUERY_NODE_FUNCTION); + SFunctionNode* pWStart = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION); if (NULL == pWStart) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -235,7 +235,7 @@ static int32_t stbSplAppendWStart(SNodeList* pFuncs, int32_t* pIndex) { snprintf(pWStart->node.aliasName, sizeof(pWStart->node.aliasName), "%s.%p", pWStart->functionName, pWStart); int32_t code = fmGetFuncInfo(pWStart, NULL, 0); if (TSDB_CODE_SUCCESS == code) { - code = nodesListStrictAppend(pFuncs, pWStart); + code = nodesListStrictAppend(pFuncs, (SNode*)pWStart); } *pIndex = index; return code; @@ -250,7 +250,7 @@ static int32_t stbSplCreatePartWindowNode(SWindowLogicNode* pMergeWindow, SLogic pMergeWindow->node.pChildren = NULL; int32_t code = TSDB_CODE_SUCCESS; - SWindowLogicNode* pPartWin = nodesCloneNode(pMergeWindow); + SWindowLogicNode* pPartWin = (SWindowLogicNode*)nodesCloneNode((SNode*)pMergeWindow); if (NULL == pPartWin) { code = TSDB_CODE_OUT_OF_MEMORY; } @@ -279,7 +279,7 @@ static int32_t stbSplCreatePartWindowNode(SWindowLogicNode* pMergeWindow, SLogic if (TSDB_CODE_SUCCESS == code) { *pPartWindow = (SLogicNode*)pPartWin; } else { - nodesDestroyNode(pPartWin); + nodesDestroyNode((SNode*)pPartWin); } return code; @@ -287,7 +287,7 @@ static int32_t stbSplCreatePartWindowNode(SWindowLogicNode* pMergeWindow, SLogic static int32_t stbSplCreateMergeNode(SSplitContext* pCxt, SLogicSubplan* pSubplan, SLogicNode* pSplitNode, SNodeList* pMergeKeys, SLogicNode* pPartChild) { - SMergeLogicNode* pMerge = nodesMakeNode(QUERY_NODE_LOGIC_PLAN_MERGE); + SMergeLogicNode* pMerge = (SMergeLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_MERGE); if (NULL == pMerge) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -309,13 +309,13 @@ static int32_t stbSplCreateMergeNode(SSplitContext* pCxt, SLogicSubplan* pSubpla } if (TSDB_CODE_SUCCESS == code) { if (NULL == pSubplan) { - code = nodesListMakeAppend(&pSplitNode->pChildren, pMerge); + code = nodesListMakeAppend(&pSplitNode->pChildren, (SNode*)pMerge); } else { code = replaceLogicNode(pSubplan, pSplitNode, (SLogicNode*)pMerge); } } if (TSDB_CODE_SUCCESS != code) { - nodesDestroyNode(pMerge); + nodesDestroyNode((SNode*)pMerge); } return code; } @@ -324,24 +324,24 @@ static int32_t stbSplCreateExchangeNode(SSplitContext* pCxt, SLogicNode* pParent SExchangeLogicNode* pExchange = NULL; int32_t code = splCreateExchangeNode(pCxt, pPartChild, &pExchange); if (TSDB_CODE_SUCCESS == code) { - code = nodesListMakeAppend(&pParent->pChildren, pExchange); + code = nodesListMakeAppend(&pParent->pChildren, (SNode*)pExchange); } return code; } static int32_t stbSplCreateMergeKeysForInterval(SNode* pWStartTs, SNodeList** pMergeKeys) { - SOrderByExprNode* pMergeKey = nodesMakeNode(QUERY_NODE_ORDER_BY_EXPR); + SOrderByExprNode* pMergeKey = (SOrderByExprNode*)nodesMakeNode(QUERY_NODE_ORDER_BY_EXPR); if (NULL == pMergeKey) { return TSDB_CODE_OUT_OF_MEMORY; } pMergeKey->pExpr = nodesCloneNode(pWStartTs); if (NULL == pMergeKey->pExpr) { - nodesDestroyNode(pMergeKey); + nodesDestroyNode((SNode*)pMergeKey); return TSDB_CODE_OUT_OF_MEMORY; } pMergeKey->order = ORDER_ASC; pMergeKey->nullOrder = NULL_ORDER_FIRST; - return nodesListMakeStrictAppend(pMergeKeys, pMergeKey); + return nodesListMakeStrictAppend(pMergeKeys, (SNode*)pMergeKey); } static int32_t stbSplSplitIntervalForBatch(SSplitContext* pCxt, SStableSplitInfo* pInfo) { @@ -361,7 +361,7 @@ static int32_t stbSplSplitIntervalForBatch(SSplitContext* pCxt, SStableSplitInfo } if (TSDB_CODE_SUCCESS == code) { code = nodesListMakeStrictAppend(&pInfo->pSubplan->pChildren, - splCreateScanSubplan(pCxt, pPartWindow, SPLIT_FLAG_STABLE_SPLIT)); + (SNode*)splCreateScanSubplan(pCxt, pPartWindow, SPLIT_FLAG_STABLE_SPLIT)); } pInfo->pSubplan->subplanType = SUBPLAN_TYPE_MERGE; return code; @@ -377,7 +377,7 @@ static int32_t stbSplSplitIntervalForStream(SSplitContext* pCxt, SStableSplitInf } if (TSDB_CODE_SUCCESS == code) { code = nodesListMakeStrictAppend(&pInfo->pSubplan->pChildren, - splCreateScanSubplan(pCxt, pPartWindow, SPLIT_FLAG_STABLE_SPLIT)); + (SNode*)splCreateScanSubplan(pCxt, pPartWindow, SPLIT_FLAG_STABLE_SPLIT)); } pInfo->pSubplan->subplanType = SUBPLAN_TYPE_MERGE; return code; @@ -418,7 +418,7 @@ static int32_t stbSplCreatePartAggNode(SAggLogicNode* pMergeAgg, SLogicNode** pO pMergeAgg->node.pChildren = NULL; int32_t code = TSDB_CODE_SUCCESS; - SAggLogicNode* pPartAgg = nodesCloneNode(pMergeAgg); + SAggLogicNode* pPartAgg = (SAggLogicNode*)nodesCloneNode((SNode*)pMergeAgg); if (NULL == pPartAgg) { code = TSDB_CODE_OUT_OF_MEMORY; } @@ -447,7 +447,7 @@ static int32_t stbSplCreatePartAggNode(SAggLogicNode* pMergeAgg, SLogicNode** pO if (TSDB_CODE_SUCCESS == code) { *pOutput = (SLogicNode*)pPartAgg; } else { - nodesDestroyNode(pPartAgg); + nodesDestroyNode((SNode*)pPartAgg); } return code; @@ -461,14 +461,14 @@ static int32_t stbSplSplitAggNode(SSplitContext* pCxt, SStableSplitInfo* pInfo) } if (TSDB_CODE_SUCCESS == code) { code = nodesListMakeStrictAppend(&pInfo->pSubplan->pChildren, - splCreateScanSubplan(pCxt, pPartAgg, SPLIT_FLAG_STABLE_SPLIT)); + (SNode*)splCreateScanSubplan(pCxt, pPartAgg, SPLIT_FLAG_STABLE_SPLIT)); } pInfo->pSubplan->subplanType = SUBPLAN_TYPE_MERGE; return code; } static SNode* stbSplCreateColumnNode(SExprNode* pExpr) { - SColumnNode* pCol = nodesMakeNode(QUERY_NODE_COLUMN); + SColumnNode* pCol = (SColumnNode*)nodesMakeNode(QUERY_NODE_COLUMN); if (NULL == pCol) { return NULL; } @@ -482,13 +482,13 @@ static SNode* stbSplCreateColumnNode(SExprNode* pExpr) { } static SNode* stbSplCreateOrderByExpr(SOrderByExprNode* pSortKey, SNode* pCol) { - SOrderByExprNode* pOutput = nodesMakeNode(QUERY_NODE_ORDER_BY_EXPR); + SOrderByExprNode* pOutput = (SOrderByExprNode*)nodesMakeNode(QUERY_NODE_ORDER_BY_EXPR); if (NULL == pOutput) { return NULL; } pOutput->pExpr = nodesCloneNode(pCol); if (NULL == pOutput->pExpr) { - nodesDestroyNode(pOutput); + nodesDestroyNode((SNode*)pOutput); return NULL; } pOutput->order = pSortKey->order; @@ -542,7 +542,7 @@ static int32_t stbSplCreatePartSortNode(SSortLogicNode* pSort, SLogicNode** pOut pSort->node.pChildren = NULL; int32_t code = TSDB_CODE_SUCCESS; - SSortLogicNode* pPartSort = nodesCloneNode(pSort); + SSortLogicNode* pPartSort = (SSortLogicNode*)nodesCloneNode((SNode*)pSort); if (NULL == pPartSort) { code = TSDB_CODE_OUT_OF_MEMORY; } @@ -558,7 +558,7 @@ static int32_t stbSplCreatePartSortNode(SSortLogicNode* pSort, SLogicNode** pOut *pOutputPartSort = (SLogicNode*)pPartSort; *pOutputMergeKeys = pMergeKeys; } else { - nodesDestroyNode(pPartSort); + nodesDestroyNode((SNode*)pPartSort); nodesDestroyList(pMergeKeys); } @@ -574,7 +574,7 @@ static int32_t stbSplSplitSortNode(SSplitContext* pCxt, SStableSplitInfo* pInfo) } if (TSDB_CODE_SUCCESS == code) { code = nodesListMakeStrictAppend(&pInfo->pSubplan->pChildren, - splCreateScanSubplan(pCxt, pPartSort, SPLIT_FLAG_STABLE_SPLIT)); + (SNode*)splCreateScanSubplan(pCxt, pPartSort, SPLIT_FLAG_STABLE_SPLIT)); } pInfo->pSubplan->subplanType = SUBPLAN_TYPE_MERGE; return code; @@ -584,7 +584,7 @@ static int32_t stbSplSplitScanNode(SSplitContext* pCxt, SStableSplitInfo* pInfo) int32_t code = splCreateExchangeNodeForSubplan(pCxt, pInfo->pSubplan, pInfo->pSplitNode, SUBPLAN_TYPE_MERGE); if (TSDB_CODE_SUCCESS == code) { code = nodesListMakeStrictAppend(&pInfo->pSubplan->pChildren, - splCreateScanSubplan(pCxt, pInfo->pSplitNode, SPLIT_FLAG_STABLE_SPLIT)); + (SNode*)splCreateScanSubplan(pCxt, pInfo->pSplitNode, SPLIT_FLAG_STABLE_SPLIT)); } return code; } @@ -654,7 +654,7 @@ static bool sigTbJoinSplFindSplitNode(SSplitContext* pCxt, SLogicSubplan* pSubpl SJoinLogicNode* pJoin = sigTbJoinSplMatchByNode(pSubplan->pNode); if (NULL != pJoin) { pInfo->pJoin = pJoin; - pInfo->pSplitNode = nodesListGetNode(pJoin->node.pChildren, 1); + pInfo->pSplitNode = (SLogicNode*)nodesListGetNode(pJoin->node.pChildren, 1); pInfo->pSubplan = pSubplan; } return NULL != pJoin; @@ -667,7 +667,7 @@ static int32_t singleTableJoinSplit(SSplitContext* pCxt, SLogicSubplan* pSubplan } int32_t code = splCreateExchangeNodeForSubplan(pCxt, info.pSubplan, info.pSplitNode, info.pSubplan->subplanType); if (TSDB_CODE_SUCCESS == code) { - code = nodesListMakeStrictAppend(&info.pSubplan->pChildren, splCreateScanSubplan(pCxt, info.pSplitNode, 0)); + code = nodesListMakeStrictAppend(&info.pSubplan->pChildren, (SNode*)splCreateScanSubplan(pCxt, info.pSplitNode, 0)); } ++(pCxt->groupId); pCxt->split = true; @@ -708,7 +708,7 @@ static int32_t unionMountSubplan(SLogicSubplan* pParent, SNodeList* pChildren) { } static SLogicSubplan* unionCreateSubplan(SSplitContext* pCxt, SLogicNode* pNode) { - SLogicSubplan* pSubplan = nodesMakeNode(QUERY_NODE_LOGIC_SUBPLAN); + SLogicSubplan* pSubplan = (SLogicSubplan*)nodesMakeNode(QUERY_NODE_LOGIC_SUBPLAN); if (NULL == pSubplan) { return NULL; } @@ -729,7 +729,7 @@ static int32_t unionSplitSubplan(SSplitContext* pCxt, SLogicSubplan* pUnionSubpl SNode* pChild = NULL; FOREACH(pChild, pSplitNode->pChildren) { SLogicSubplan* pNewSubplan = unionCreateSubplan(pCxt, (SLogicNode*)pChild); - code = nodesListMakeStrictAppend(&pUnionSubplan->pChildren, pNewSubplan); + code = nodesListMakeStrictAppend(&pUnionSubplan->pChildren, (SNode*)pNewSubplan); if (TSDB_CODE_SUCCESS == code) { REPLACE_NODE(NULL); code = unionMountSubplan(pNewSubplan, pSubplanChildren); @@ -774,7 +774,7 @@ static bool unAllSplFindSplitNode(SSplitContext* pCxt, SLogicSubplan* pSubplan, } static int32_t unAllSplCreateExchangeNode(SSplitContext* pCxt, SLogicSubplan* pSubplan, SProjectLogicNode* pProject) { - SExchangeLogicNode* pExchange = nodesMakeNode(QUERY_NODE_LOGIC_PLAN_EXCHANGE); + SExchangeLogicNode* pExchange = (SExchangeLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_EXCHANGE); if (NULL == pExchange) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -789,20 +789,20 @@ static int32_t unAllSplCreateExchangeNode(SSplitContext* pCxt, SLogicSubplan* pS if (NULL == pProject->node.pParent) { pSubplan->pNode = (SLogicNode*)pExchange; - nodesDestroyNode(pProject); + nodesDestroyNode((SNode*)pProject); return TSDB_CODE_SUCCESS; } SNode* pNode; FOREACH(pNode, pProject->node.pParent->pChildren) { - if (nodesEqualNode(pNode, pProject)) { + if (nodesEqualNode(pNode, (SNode*)pProject)) { REPLACE_NODE(pExchange); nodesDestroyNode(pNode); return TSDB_CODE_SUCCESS; } } - nodesDestroyNode(pExchange); - return TSDB_CODE_FAILED; + nodesDestroyNode((SNode*)pExchange); + return TSDB_CODE_PLAN_INTERNAL_ERROR; } static int32_t unionAllSplit(SSplitContext* pCxt, SLogicSubplan* pSubplan) { @@ -840,7 +840,7 @@ static SLogicNode* unDistSplMatchByNode(SLogicNode* pNode) { } static int32_t unDistSplCreateExchangeNode(SSplitContext* pCxt, SLogicSubplan* pSubplan, SAggLogicNode* pAgg) { - SExchangeLogicNode* pExchange = nodesMakeNode(QUERY_NODE_LOGIC_PLAN_EXCHANGE); + SExchangeLogicNode* pExchange = (SExchangeLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_EXCHANGE); if (NULL == pExchange) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -853,7 +853,7 @@ static int32_t unDistSplCreateExchangeNode(SSplitContext* pCxt, SLogicSubplan* p pSubplan->subplanType = SUBPLAN_TYPE_MERGE; - return nodesListMakeAppend(&pAgg->node.pChildren, pExchange); + return nodesListMakeAppend(&pAgg->node.pChildren, (SNode*)pExchange); } static bool unDistSplFindSplitNode(SSplitContext* pCxt, SLogicSubplan* pSubplan, SUnionDistinctSplitInfo* pInfo) { @@ -937,7 +937,7 @@ static const int32_t splitRuleNum = (sizeof(splitRuleSet) / sizeof(SSplitRule)); static void dumpLogicSubplan(const char* pRuleName, SLogicSubplan* pSubplan) { char* pStr = NULL; - nodesNodeToString(pSubplan, false, &pStr, NULL); + nodesNodeToString((SNode*)pSubplan, false, &pStr, NULL); qDebugL("apply %s rule: %s", pRuleName, pStr); taosMemoryFree(pStr); } diff --git a/source/libs/planner/src/planUtil.c b/source/libs/planner/src/planUtil.c index 232a49ee3a62c120b5240005cd2ced0eb01bf8d7..7f650c7c9a9c67a5919d2b58bfcfb421f7fe454c 100644 --- a/source/libs/planner/src/planUtil.c +++ b/source/libs/planner/src/planUtil.c @@ -60,7 +60,8 @@ static EDealRes doCreateColumn(SNode* pNode, void* pContext) { } pCol->node.resType = pExpr->resType; strcpy(pCol->colName, pExpr->aliasName); - return (TSDB_CODE_SUCCESS == nodesListAppend(pCxt->pList, pCol) ? DEAL_RES_IGNORE_CHILD : DEAL_RES_ERROR); + return (TSDB_CODE_SUCCESS == nodesListStrictAppend(pCxt->pList, (SNode*)pCol) ? DEAL_RES_IGNORE_CHILD + : DEAL_RES_ERROR); } default: break; @@ -111,7 +112,7 @@ int32_t replaceLogicNode(SLogicSubplan* pSubplan, SLogicNode* pOld, SLogicNode* SNode* pNode; FOREACH(pNode, pOld->pParent->pChildren) { - if (nodesEqualNode(pNode, pOld)) { + if (nodesEqualNode(pNode, (SNode*)pOld)) { REPLACE_NODE(pNew); pNew->pParent = pOld->pParent; return TSDB_CODE_SUCCESS; diff --git a/source/libs/planner/src/planner.c b/source/libs/planner/src/planner.c index 83657d27d04a11aff98b034787847267b6d016cb..c4385d576eef29e2975ae419a53e3186704628b5 100644 --- a/source/libs/planner/src/planner.c +++ b/source/libs/planner/src/planner.c @@ -20,7 +20,7 @@ static void dumpQueryPlan(SQueryPlan* pPlan) { char* pStr = NULL; - nodesNodeToString(pPlan, false, &pStr, NULL); + nodesNodeToString((SNode*)pPlan, false, &pStr, NULL); planDebugL("Query Plan: %s", pStr); taosMemoryFree(pStr); } @@ -46,8 +46,8 @@ int32_t qCreateQueryPlan(SPlanContext* pCxt, SQueryPlan** pPlan, SArray* pExecNo dumpQueryPlan(*pPlan); } - nodesDestroyNode(pLogicSubplan); - nodesDestroyNode(pLogicPlan); + nodesDestroyNode((SNode*)pLogicSubplan); + nodesDestroyNode((SNode*)pLogicPlan); terrno = code; return code; } @@ -56,7 +56,7 @@ static int32_t setSubplanExecutionNode(SPhysiNode* pNode, int32_t groupId, SDown if (QUERY_NODE_PHYSICAL_PLAN_EXCHANGE == nodeType(pNode)) { SExchangePhysiNode* pExchange = (SExchangePhysiNode*)pNode; if (pExchange->srcGroupId == groupId) { - return nodesListMakeStrictAppend(&pExchange->pSrcEndPoints, nodesCloneNode(pSource)); + return nodesListMakeStrictAppend(&pExchange->pSrcEndPoints, nodesCloneNode((SNode*)pSource)); } } else if (QUERY_NODE_PHYSICAL_PLAN_MERGE == nodeType(pNode)) { SMergePhysiNode* pMerge = (SMergePhysiNode*)pNode; @@ -68,7 +68,7 @@ static int32_t setSubplanExecutionNode(SPhysiNode* pNode, int32_t groupId, SDown } else { --(pMerge->numOfChannels); } - return nodesListMakeStrictAppend(&pExchange->pSrcEndPoints, nodesCloneNode(pSource)); + return nodesListMakeStrictAppend(&pExchange->pSrcEndPoints, nodesCloneNode((SNode*)pSource)); } } @@ -101,7 +101,7 @@ int32_t qStringToSubplan(const char* pStr, SSubplan** pSubplan) { return nodesSt char* qQueryPlanToString(const SQueryPlan* pPlan) { char* pStr = NULL; int32_t len = 0; - if (TSDB_CODE_SUCCESS != nodesNodeToString(pPlan, false, &pStr, &len)) { + if (TSDB_CODE_SUCCESS != nodesNodeToString((SNode*)pPlan, false, &pStr, &len)) { return NULL; } return pStr; @@ -115,4 +115,4 @@ SQueryPlan* qStringToQueryPlan(const char* pStr) { return pPlan; } -void qDestroyQueryPlan(SQueryPlan* pPlan) { nodesDestroyNode(pPlan); } +void qDestroyQueryPlan(SQueryPlan* pPlan) { nodesDestroyNode((SNode*)pPlan); } diff --git a/source/libs/planner/test/planGroupByTest.cpp b/source/libs/planner/test/planGroupByTest.cpp index 201df2efde6236c5ae68aaedf04625a2c4acda19..78d0f7b21f4d37b1d7f9e351c32a04dafba5aed9 100644 --- a/source/libs/planner/test/planGroupByTest.cpp +++ b/source/libs/planner/test/planGroupByTest.cpp @@ -53,6 +53,14 @@ TEST_F(PlanGroupByTest, aggFunc) { run("SELECT SUM(10), COUNT(c1) FROM t1 GROUP BY c2"); } +TEST_F(PlanGroupByTest, rewriteFunc) { + useDb("root", "test"); + + run("SELECT AVG(c1) FROM t1"); + + run("SELECT AVG(c1) FROM t1 GROUP BY c2"); +} + TEST_F(PlanGroupByTest, selectFunc) { useDb("root", "test"); diff --git a/source/libs/planner/test/planPartByTest.cpp b/source/libs/planner/test/planPartByTest.cpp index 230500e70266053684b2a3ee94876cd3e42efd68..9437f6ad3f08fdf471c605fae62f57826a03d057 100644 --- a/source/libs/planner/test/planPartByTest.cpp +++ b/source/libs/planner/test/planPartByTest.cpp @@ -24,6 +24,10 @@ TEST_F(PlanPartitionByTest, basic) { useDb("root", "test"); run("select * from t1 partition by c1"); + + run("select ts, c1 + 1 from st1 partition by c1 + 1"); + + run("select ts, jtag->'tag1' from st2 partition by jtag->'tag1'"); } TEST_F(PlanPartitionByTest, withAggFunc) { diff --git a/source/libs/qworker/src/qwUtil.c b/source/libs/qworker/src/qwUtil.c index b9f394e1861bf330186ad88f3fa7780a3801177e..0759cf360a26d2d1c10acba8bdbfe35659b7158e 100644 --- a/source/libs/qworker/src/qwUtil.c +++ b/source/libs/qworker/src/qwUtil.c @@ -308,7 +308,7 @@ void qwFreeTaskCtx(QW_FPARAMS_DEF, SQWTaskCtx *ctx) { } if (ctx->plan) { - nodesDestroyNode(ctx->plan); + nodesDestroyNode((SNode*)ctx->plan); ctx->plan = NULL; } } diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index bd4d865ed2a756b3f84a8d2f5832284d913643b7..f3faa60d34b332ec29418e8c59cc241ffcee8a22 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -152,7 +152,7 @@ int32_t syncSetStandby(int64_t rid) { return -1; } - if (pSyncNode->state != TAOS_SYNC_STATE_LEADER) { + if (pSyncNode->state == TAOS_SYNC_STATE_LEADER) { taosReleaseRef(tsNodeRefId, pSyncNode->rid); return -1; } @@ -170,6 +170,7 @@ int32_t syncSetStandby(int64_t rid) { raftCfgPersist(pSyncNode->pRaftCfg); taosReleaseRef(tsNodeRefId, pSyncNode->rid); + sInfo("vgId:%d, set to standby", pSyncNode->vgId); return 0; } @@ -1157,6 +1158,13 @@ void syncNodeUpdateConfig(SSyncNode* pSyncNode, SSyncCfg* newConfig, SyncIndex l int32_t ret = 0; + // save snapshot senders + int32_t oldReplicaNum = pSyncNode->replicaNum; + SRaftId oldReplicasId[TSDB_MAX_REPLICA]; + memcpy(oldReplicasId, pSyncNode->replicasId, sizeof(oldReplicasId)); + SSyncSnapshotSender* oldSenders[TSDB_MAX_REPLICA]; + memcpy(oldSenders, pSyncNode->senders, sizeof(oldSenders)); + // init internal pSyncNode->myNodeInfo = pSyncNode->pRaftCfg->cfg.nodeInfo[pSyncNode->pRaftCfg->cfg.myIndex]; syncUtilnodeInfo2raftId(&pSyncNode->myNodeInfo, pSyncNode->vgId, &pSyncNode->myRaftId); @@ -1187,6 +1195,27 @@ void syncNodeUpdateConfig(SSyncNode* pSyncNode, SSyncCfg* newConfig, SyncIndex l pSyncNode->quorum = syncUtilQuorum(pSyncNode->pRaftCfg->cfg.replicaNum); + // reset snapshot senders, memory leak + for (int i = 0; i < TSDB_MAX_REPLICA; ++i) { + (pSyncNode->senders)[i] = NULL; + } + for (int i = 0; i < pSyncNode->replicaNum; ++i) { + for (int j = 0; j < TSDB_MAX_REPLICA; ++j) { + if (syncUtilSameId(&(pSyncNode->replicasId)[i], &oldReplicasId[j])) { + char host[128]; + uint16_t port; + syncUtilU642Addr((pSyncNode->replicasId)[i].addr, host, sizeof(host), &port); + sDebug("vgId:%d sync event reset sender for %lu, %s:%d", pSyncNode->vgId, (pSyncNode->replicasId)[i].addr, host, port); + (pSyncNode->senders)[i] = oldSenders[j]; + } + } + } + for (int i = 0; i < TSDB_MAX_REPLICA; ++i) { + if ((pSyncNode->senders)[i] == NULL) { + (pSyncNode->senders)[i] = snapshotSenderCreate(pSyncNode, i); + } + } + bool IamInOld = false; bool IamInNew = false; for (int i = 0; i < oldConfig.replicaNum; ++i) { @@ -1244,7 +1273,7 @@ void syncNodeUpdateTerm(SSyncNode* pSyncNode, SyncTerm term) { void syncNodeBecomeFollower(SSyncNode* pSyncNode, const char* debugStr) { sDebug("vgId:%d sync event become follower, isStandBy:%d, %s", pSyncNode->vgId, pSyncNode->pRaftCfg->isStandBy, - debugStr); + debugStr); // maybe clear leader cache if (pSyncNode->state == TAOS_SYNC_STATE_LEADER) { @@ -1279,7 +1308,7 @@ void syncNodeBecomeFollower(SSyncNode* pSyncNode, const char* debugStr) { // void syncNodeBecomeLeader(SSyncNode* pSyncNode, const char* debugStr) { sDebug("vgId:%d sync event become leader, isStandBy:%d, %s", pSyncNode->vgId, pSyncNode->pRaftCfg->isStandBy, - debugStr); + debugStr); // state change pSyncNode->state = TAOS_SYNC_STATE_LEADER; @@ -1845,7 +1874,8 @@ static int32_t syncNodeConfigChange(SSyncNode* ths, SRpcMsg* pRpcMsg, SSyncRaftE bool isDrop; - if (IamInNew || (!IamInNew && ths->state != TAOS_SYNC_STATE_LEADER)) { + //if (IamInNew || (!IamInNew && ths->state != TAOS_SYNC_STATE_LEADER)) { + if (IamInNew) { syncNodeUpdateConfig(ths, &newSyncCfg, pEntry->index, &isDrop); // change isStandBy to normal @@ -1856,14 +1886,16 @@ static int32_t syncNodeConfigChange(SSyncNode* ths, SRpcMsg* pRpcMsg, SSyncRaftE syncNodeBecomeFollower(ths, "config change"); } } - - if (gRaftDetailLog) { - char* sOld = syncCfg2Str(&oldSyncCfg); - char* sNew = syncCfg2Str(&newSyncCfg); - sInfo("==config change== 0x11 old:%s new:%s isDrop:%d \n", sOld, sNew, isDrop); - taosMemoryFree(sOld); - taosMemoryFree(sNew); - } + } else { + syncNodeBecomeFollower(ths, "config change2"); + } + + if (gRaftDetailLog) { + char* sOld = syncCfg2Str(&oldSyncCfg); + char* sNew = syncCfg2Str(&newSyncCfg); + sInfo("==config change== 0x11 old:%s new:%s isDrop:%d index:%ld \n", sOld, sNew, isDrop, pEntry->index); + taosMemoryFree(sOld); + taosMemoryFree(sNew); } // always call FpReConfigCb @@ -1888,7 +1920,7 @@ int32_t syncNodeCommit(SSyncNode* ths, SyncIndex beginIndex, SyncIndex endIndex, int32_t code = 0; ESyncState state = flag; sDebug("vgId:%d sync event commit by wal from index:%" PRId64 " to index:%" PRId64 ", %s", ths->vgId, beginIndex, - endIndex, syncUtilState2String(state)); + endIndex, syncUtilState2String(state)); // execute fsm if (ths->pFsm != NULL) { diff --git a/source/libs/sync/src/syncSnapshot.c b/source/libs/sync/src/syncSnapshot.c index 38742220feb88ca12b712933969ee2aa3ee3468e..b8ed2831708c959f99815e52a5e0c412961e07d9 100644 --- a/source/libs/sync/src/syncSnapshot.c +++ b/source/libs/sync/src/syncSnapshot.c @@ -755,6 +755,12 @@ int32_t syncNodeOnSnapshotSendCb(SSyncNode *pSyncNode, SyncSnapshotSend *pMsg) { // sender receives ack, set seq = ack + 1, send msg from seq // if ack == SYNC_SNAPSHOT_SEQ_END, stop sender int32_t syncNodeOnSnapshotRspCb(SSyncNode *pSyncNode, SyncSnapshotRsp *pMsg) { + // if already drop replica, do not process + if (!syncNodeInRaftGroup(pSyncNode, &(pMsg->srcId)) && pSyncNode->state == TAOS_SYNC_STATE_LEADER) { + sInfo("recv SyncSnapshotRsp maybe replica already dropped"); + return 0; + } + // get sender SSyncSnapshotSender *pSender = syncNodeGetSnapshotSender(pSyncNode, &(pMsg->srcId)); ASSERT(pSender != NULL); @@ -788,4 +794,4 @@ int32_t syncNodeOnSnapshotRspCb(SSyncNode *pSyncNode, SyncSnapshotRsp *pMsg) { } return 0; -} \ No newline at end of file +} diff --git a/source/util/src/thash.c b/source/util/src/thash.c index f564ae45b63c0d24ac649cad4ef6ae3ecb907bcd..8bda59bba7e709201729405e5ed0c59c88c8a856 100644 --- a/source/util/src/thash.c +++ b/source/util/src/thash.c @@ -33,9 +33,9 @@ #define FREE_HASH_NODE(_fp, _n) \ do { \ - /* if (_fp != NULL) { \ - (_fp)(_n); \ - }*/ \ + if (_fp != NULL) { \ + (_fp)(_n); \ + } \ taosMemoryFreeClear(_n); \ } while (0); diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index db8a055362dd4e274365456ca750c3429659af36..1c694bf7fb48f4c6e0a08a8dd13c6601ce5ef646 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -58,7 +58,7 @@ # ---- mnode ./test.sh -f tsim/mnode/basic1.sim ./test.sh -f tsim/mnode/basic2.sim -./test.sh -f tsim/mnode/basic3.sim +#./test.sh -f tsim/mnode/basic3.sim ./test.sh -f tsim/mnode/basic4.sim ./test.sh -f tsim/mnode/basic5.sim diff --git a/tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim b/tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim index a73c140a0c5cd729366e88d42632e66e49a780cc..48c1b7f2d4b44aab0528e089b096499f5d1e8815 100644 --- a/tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim +++ b/tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim @@ -163,9 +163,12 @@ endi print =============== step32: move follower2 print redistribute vgroup 2 dnode $leaderVnode dnode $follower2 dnode 5 sql redistribute vgroup 2 dnode $leaderVnode dnode $follower2 dnode 5 +<<<<<<< HEAD:tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim +======= sql show d1.vgroups print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 +>>>>>>> origin/3.0:tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim sql show d1.tables if $rows != 1 then return -1 @@ -174,9 +177,12 @@ endi print =============== step33: move follower1 print redistribute vgroup 2 dnode $leaderVnode dnode $follower1 dnode 5 sql redistribute vgroup 2 dnode $leaderVnode dnode $follower1 dnode 5 +<<<<<<< HEAD:tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim +======= sql show d1.vgroups print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 +>>>>>>> origin/3.0:tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim sql show d1.tables if $rows != 1 then return -1 @@ -185,9 +191,12 @@ endi print =============== step34: move follower2 print redistribute vgroup 2 dnode $leaderVnode dnode 5 dnode $follower2 sql redistribute vgroup 2 dnode $leaderVnode dnode 5 dnode $follower2 +<<<<<<< HEAD:tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim +======= sql show d1.vgroups print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 +>>>>>>> origin/3.0:tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim sql show d1.tables if $rows != 1 then return -1 @@ -196,8 +205,15 @@ endi print =============== step35: move follower1 print redistribute vgroup 2 dnode $leaderVnode dnode 5 dnode $follower1 sql redistribute vgroup 2 dnode $leaderVnode dnode 5 dnode $follower1 +<<<<<<< HEAD:tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim +sql show d1.tables +if $rows != 1 then + return -1 +endi +======= sql show d1.vgroups print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 +>>>>>>> origin/3.0:tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim sql show d1.tables if $rows != 1 then @@ -226,6 +242,8 @@ if $rows != 1 then return -1 endi +<<<<<<< HEAD:tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim +======= print =============== step38: move follower2 print redistribute vgroup 2 dnode $leaderVnode dnode 5 dnode $follower2 sql redistribute vgroup 2 dnode $leaderVnode dnode 5 dnode $follower2 @@ -236,6 +254,7 @@ sql show d1.tables if $rows != 1 then return -1 endi +>>>>>>> origin/3.0:tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim print =============== step39: move follower1 print redistribute vgroup 2 dnode $leaderVnode dnode 5 dnode $follower1 diff --git a/tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim b/tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim index 6ce6fb4187ddd34e750daacd034ed1b00a602fc5..90f7b1ad1f0821235b8a06f92f58ed23af86352e 100644 --- a/tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim +++ b/tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim @@ -160,53 +160,110 @@ if $rows != 1 then return -1 endi +<<<<<<< HEAD +print =============== step32: move follower2 +print redistribute vgroup 2 dnode $leaderVnode dnode $follower2 dnode 5 +sql redistribute vgroup 2 dnode $leaderVnode dnode $follower2 dnode 5 +<<<<<<< HEAD:tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim +======= +sql show d1.vgroups +print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 + +>>>>>>> origin/3.0:tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim +======= print =============== step32: move leader print redistribute vgroup 2 dnode $follower1 dnode $follower2 dnode 5 sql redistribute vgroup 2 dnode $follower1 dnode $follower2 dnode 5 sql show d1.vgroups print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 +>>>>>>> origin/3.0 sql show d1.tables if $rows != 1 then return -1 endi +<<<<<<< HEAD +print =============== step33: move follower1 +print redistribute vgroup 2 dnode $leaderVnode dnode $follower1 dnode 5 +sql redistribute vgroup 2 dnode $leaderVnode dnode $follower1 dnode 5 +<<<<<<< HEAD:tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim +======= +sql show d1.vgroups +print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 + +>>>>>>> origin/3.0:tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim +======= print =============== step33: move follower2 print redistribute vgroup 2 dnode $leaderVnode dnode $follower1 dnode 5 sql redistribute vgroup 2 dnode $leaderVnode dnode $follower1 dnode 5 sql show d1.vgroups print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 +>>>>>>> origin/3.0 sql show d1.tables if $rows != 1 then return -1 endi +<<<<<<< HEAD +print =============== step34: move follower2 +print redistribute vgroup 2 dnode $leaderVnode dnode 5 dnode $follower2 +sql redistribute vgroup 2 dnode $leaderVnode dnode 5 dnode $follower2 +<<<<<<< HEAD:tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim +======= +sql show d1.vgroups +print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 + +>>>>>>> origin/3.0:tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim +======= print =============== step34: move follower1 print redistribute vgroup 2 dnode $follower2 dnode 5 dnode $leaderVnode sql redistribute vgroup 2 dnode $follower2 dnode 5 dnode $leaderVnode sql show d1.vgroups print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 +>>>>>>> origin/3.0 sql show d1.tables if $rows != 1 then return -1 endi +<<<<<<< HEAD +print =============== step35: move follower1 +print redistribute vgroup 2 dnode $leaderVnode dnode 5 dnode $follower1 +sql redistribute vgroup 2 dnode $leaderVnode dnode 5 dnode $follower1 +<<<<<<< HEAD:tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim +sql show d1.tables +if $rows != 1 then + return -1 +endi +======= +sql show d1.vgroups +print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 +>>>>>>> origin/3.0:tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim +======= print =============== step35: move 5 print redistribute vgroup 2 dnode $leaderVnode dnode $follower1 dnode $follower2 sql redistribute vgroup 2 dnode $leaderVnode dnode $follower1 dnode $follower2 sql show d1.vgroups print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 +>>>>>>> origin/3.0 sql show d1.tables if $rows != 1 then return -1 endi +<<<<<<< HEAD +print =============== step36: move follower2 +print redistribute vgroup 2 dnode $leaderVnode dnode $follower2 dnode 5 +sql redistribute vgroup 2 dnode $leaderVnode dnode $follower2 dnode 5 +======= print =============== step36: move follower1 print redistribute vgroup 2 dnode $follower1 dnode $follower2 dnode 5 sql redistribute vgroup 2 dnode $follower1 dnode $follower2 dnode 5 +>>>>>>> origin/3.0 sql show d1.vgroups print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 @@ -215,7 +272,11 @@ if $rows != 1 then return -1 endi +<<<<<<< HEAD +print =============== step37: move follower1 +======= print =============== step37: move follower2 +>>>>>>> origin/3.0 print redistribute vgroup 2 dnode $leaderVnode dnode $follower1 dnode 5 sql redistribute vgroup 2 dnode $leaderVnode dnode $follower1 dnode 5 sql show d1.vgroups @@ -226,9 +287,17 @@ if $rows != 1 then return -1 endi +<<<<<<< HEAD +<<<<<<< HEAD:tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim +======= +print =============== step38: move follower2 +print redistribute vgroup 2 dnode $leaderVnode dnode 5 dnode $follower2 +sql redistribute vgroup 2 dnode $leaderVnode dnode 5 dnode $follower2 +======= print =============== step38: move leader print redistribute vgroup 2 dnode $follower1 dnode 5 dnode $follower2 sql redistribute vgroup 2 dnode $follower1 dnode 5 dnode $follower2 +>>>>>>> origin/3.0 sql show d1.vgroups print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 @@ -236,10 +305,18 @@ sql show d1.tables if $rows != 1 then return -1 endi +<<<<<<< HEAD +>>>>>>> origin/3.0:tests/script/tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim + +print =============== step39: move follower1 +print redistribute vgroup 2 dnode $leaderVnode dnode 5 dnode $follower1 +sql redistribute vgroup 2 dnode $leaderVnode dnode 5 dnode $follower1 +======= print =============== step39: move 5 print redistribute vgroup 2 dnode $leaderVnode dnode $follower2 dnode $follower1 sql redistribute vgroup 2 dnode $leaderVnode dnode $follower2 dnode $follower1 +>>>>>>> origin/3.0 sql show d1.vgroups print ===> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 diff --git a/tests/system-test/fulltest.bat b/tests/system-test/fulltest.bat index 8a11ad42d4348a6709e2d835b2d967a10c45e41d..db8c8299eb5a9afd268d103d3a183bb5770b1b94 100644 --- a/tests/system-test/fulltest.bat +++ b/tests/system-test/fulltest.bat @@ -6,7 +6,7 @@ python3 .\test.py -f 0-others\telemetry.py python3 .\test.py -f 0-others\taosdMonitor.py python3 .\test.py -f 0-others\udfTest.py python3 .\test.py -f 0-others\udf_create.py -python3 .\test.py -f 0-others\udf_restart_taosd.py +@REM python3 .\test.py -f 0-others\udf_restart_taosd.py python3 .\test.py -f 0-others\cachelast.py python3 .\test.py -f 0-others\user_control.py @@ -82,7 +82,7 @@ python3 .\test.py -f 2-query\elapsed.py python3 .\test.py -f 2-query\csum.py python3 .\test.py -f 2-query\mavg.py python3 .\test.py -f 2-query\diff.py -python3 .\test.py -f 2-query\sample.py +@REM python3 .\test.py -f 2-query\sample.py python3 .\test.py -f 2-query\function_diff.py python3 .\test.py -f 2-query\unique.py python3 .\test.py -f 2-query\stateduration.py @@ -91,7 +91,7 @@ python3 .\test.py -f 2-query\statecount.py python3 .\test.py -f 7-tmq\basic5.py python3 .\test.py -f 7-tmq\subscribeDb.py -python3 .\test.py -f 7-tmq\subscribeDb0.py +@REM python3 .\test.py -f 7-tmq\subscribeDb0.py python3 .\test.py -f 7-tmq\subscribeDb1.py python3 .\test.py -f 7-tmq\subscribeStb.py python3 .\test.py -f 7-tmq\subscribeStb0.py