diff --git a/deps/arm/dm_static/libdmodule.a b/deps/arm/dm_static/libdmodule.a index fff5943606..dbad0112cf 100644 Binary files a/deps/arm/dm_static/libdmodule.a and b/deps/arm/dm_static/libdmodule.a differ diff --git a/deps/darwin/arm/dm_static/libdmodule.a b/deps/darwin/arm/dm_static/libdmodule.a index 09c501f2ef..2aab587b18 100644 Binary files a/deps/darwin/arm/dm_static/libdmodule.a and b/deps/darwin/arm/dm_static/libdmodule.a differ diff --git a/deps/darwin/x64/dm_static/libdmodule.a b/deps/darwin/x64/dm_static/libdmodule.a index 2230393565..1fb6794f65 100644 Binary files a/deps/darwin/x64/dm_static/libdmodule.a and b/deps/darwin/x64/dm_static/libdmodule.a differ diff --git a/deps/x86/dm_static/libdmodule.a b/deps/x86/dm_static/libdmodule.a index 995713ce7b..9d37818a79 100644 Binary files a/deps/x86/dm_static/libdmodule.a and b/deps/x86/dm_static/libdmodule.a differ diff --git a/docs/en/07-develop/01-connect/index.md b/docs/en/07-develop/01-connect/index.md index 3f09f9fb6a..11375bd060 100644 --- a/docs/en/07-develop/01-connect/index.md +++ b/docs/en/07-develop/01-connect/index.md @@ -177,7 +177,7 @@ Just need to add the reference to [TDengine.Connector](https://www.nuget.org/pac - + 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 19c8e58f32..0000000000 --- a/docs/en/07-develop/04-query-data/_cs_async.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```csharp -{{#include docs/examples/csharp/asyncQuery/Program.cs}} -``` diff --git a/docs/en/07-develop/04-query-data/index.mdx b/docs/en/07-develop/04-query-data/index.mdx index 413baf6b2c..70b1140748 100644 --- a/docs/en/07-develop/04-query-data/index.mdx +++ b/docs/en/07-develop/04-query-data/index.mdx @@ -15,7 +15,6 @@ import CQuery from "./_c.mdx"; import PhpQuery from "./_php.mdx"; import PyAsync from "./_py_async.mdx"; import NodeAsync from "./_js_async.mdx"; -import CsAsync from "./_cs_async.mdx"; import CAsync from "./_c_async.mdx"; ## Introduction @@ -174,9 +173,6 @@ Please note that async query can only be used with a native connection. - - - diff --git a/docs/en/07-develop/07-tmq.mdx b/docs/en/07-develop/07-tmq.mdx index 8e7bbf22e9..b920d61a59 100644 --- a/docs/en/07-develop/07-tmq.mdx +++ b/docs/en/07-develop/07-tmq.mdx @@ -248,23 +248,23 @@ function close() ```csharp +class ConsumerBuilder + ConsumerBuilder(IEnumerable> config) -virtual IConsumer Build() - -Consumer(ConsumerBuilder builder) +public IConsumer Build() void Subscribe(IEnumerable topics) void Subscribe(string topic) -ConsumeResult Consume(int millisecondsTimeout) +ConsumeResult Consume(int millisecondsTimeout) List Subscription() void Unsubscribe() -void Commit(ConsumeResult consumerResult) +List Commit() void Close() ``` @@ -500,25 +500,19 @@ let consumer = taos.consumer({ ```csharp -using TDengineTMQ; - -// Create consumer groups on demand (GourpID) and enable automatic commits (EnableAutoCommit), -// an automatic commit interval (AutoCommitIntervalMs), and a username (TDConnectUser) and password (TDConnectPasswd) -var cfg = new ConsumerConfig - { - EnableAutoCommit = "true" - AutoCommitIntervalMs = "1000" - GourpId = "TDengine-TMQ-C#", - TDConnectUser = "root", - TDConnectPasswd = "taosdata", - AutoOffsetReset = "latest" - MsgWithTableName = "true", - TDConnectIp = "127.0.0.1", - TDConnectPort = "6030" - }; - -var consumer = new ConsumerBuilder(cfg).Build(); - +var cfg = new Dictionary() +{ + { "group.id", "group1" }, + { "auto.offset.reset", "latest" }, + { "td.connect.ip", "127.0.0.1" }, + { "td.connect.user", "root" }, + { "td.connect.pass", "taosdata" }, + { "td.connect.port", "6030" }, + { "client.id", "tmq_example" }, + { "enable.auto.commit", "true" }, + { "msg.with.table.name", "false" }, +}; +var consumer = new ConsumerBuilder>(cfg).Build(); ``` @@ -747,10 +741,12 @@ while(true){ ## Consume data while (true) { - var consumerRes = consumer.Consume(100); - // process ConsumeResult - ProcessMsg(consumerRes); - consumer.Commit(consumerRes); + using (var result = consumer.Consume(500)) + { + if (result == null) continue; + ProcessMsg(result); + consumer.Commit(); + } } ``` diff --git a/docs/en/14-reference/03-connector/09-csharp.mdx b/docs/en/14-reference/03-connector/09-csharp.mdx index 282be3af6b..25bef1cf51 100644 --- a/docs/en/14-reference/03-connector/09-csharp.mdx +++ b/docs/en/14-reference/03-connector/09-csharp.mdx @@ -1,5 +1,5 @@ --- -title: C# Connector +title: TDengine C# Connector sidebar_label: C# description: This document describes the TDengine C# connector. toc_max_heading_level: 4 @@ -8,21 +8,16 @@ toc_max_heading_level: 4 import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -import Preparition from "./_preparation.mdx" -import CSInsert from "../../07-develop/03-insert-data/_cs_sql.mdx" -import CSInfluxLine from "../../07-develop/03-insert-data/_cs_line.mdx" -import CSOpenTSDBTelnet from "../../07-develop/03-insert-data/_cs_opts_telnet.mdx" -import CSOpenTSDBJson from "../../07-develop/03-insert-data/_cs_opts_json.mdx" -import CSQuery from "../../07-develop/04-query-data/_cs.mdx" -import CSAsyncQuery from "../../07-develop/04-query-data/_cs_async.mdx" +`TDengine.Connector` is the C# language connector provided by TDengine. C# developers can use it to develop C# application software that accesses TDengine cluster data. -`TDengine.Connector` is a C# language connector provided by TDengine that allows C# developers to develop C# applications that access TDengine cluster data. +The `TDengine.Connector` connector supports establishing a connection with the TDengine running instance through the TDengine client driver (taosc), and provides functions such as data writing, query, data subscription, schemaless data writing, and parameter binding interface data writing. `TDengine.Connector` also supports WebSocket since v3.0.1, establishes WebSocket connection, and provides functions such as data writing, query, and parameter binding interface data writing. -The `TDengine.Connector` connector supports connect to TDengine instances via the TDengine client driver (taosc), providing data writing, querying, subscription, schemaless writing, bind interface, etc.The `TDengine.Connector` also supports WebSocket from v3.0.1 and developers can build connection through DSN, which supports data writing, querying, and parameter binding, etc. +This article introduces how to install `TDengine.Connector` in a Linux or Windows environment, and connect to the TDengine cluster through `TDengine.Connector` to perform basic operations such as data writing and querying. -This article describes how to install `TDengine.Connector` in a Linux or Windows environment and connect to TDengine clusters via `TDengine.Connector` to perform basic operations such as data writing and querying. - -Note: TDengine Connector 3.x is not compatible with TDengine 2.x. In an environment with TDengine 2.x, you must use TDengine.Connector 1.x for the C# connector. +:::warning +* `TDengine.Connector` version 3.1.0 has been completely refactored and is no longer compatible with 3.0.2 and previous versions. For 3.0.2 documents, please refer to [nuget](https://www.nuget.org/packages/TDengine.Connector/3.0.2) +* `TDengine.Connector` 3.x is not compatible with TDengine 2.x. If you need to use the C# connector in an environment running TDengine 2.x version, please use the 1.x version of TDengine.Connector. +::: The source code of `TDengine.Connector` is hosted on [GitHub](https://github.com/taosdata/taos-connector-dotnet/tree/3.0). @@ -30,286 +25,1164 @@ The source code of `TDengine.Connector` is hosted on [GitHub](https://github.com The supported platforms are the same as those supported by the TDengine client driver. -:::note -Please note TDengine does not support 32bit Windows any more. +:::warning +TDengine no longer supports 32-bit Windows platforms. ::: ## Version support -Please refer to [version support list](../#version-support) +| **Connector version** | **TDengine version** | +|-----------------------|----------------------| +| 3.1.0 | 3.2.1.0/3.1.1.18 | -## Supported features +## Handling exceptions - +`TDengine.Connector` will throw an exception and the application needs to handle the exception. The taosc exception type `TDengineError` contains error code and error information, and the application can handle it based on the error code and error information. - +## TDengine DataType vs. C# DataType -1. Connection Management -2. General Query -3. Continuous Query -4. Parameter Binding -5. Subscription -6. Schemaless +| TDengine DataType | C# Type | +|-------------------|-------------------------| +| TIMESTAMP | DateTime | +| TINYINT | sbyte | +| SMALLINT | short | +| INT | int | +| BIGINT | long | +| TINYINT UNSIGNED | byte | +| SMALLINT UNSIGNED | ushort | +| INT UNSIGNED | uint | +| BIGINT UNSIGNED | ulong | +| FLOAT | float | +| DOUBLE | double | +| BOOL | bool | +| BINARY | byte[] | +| NCHAR | string (utf-8 encoding) | +| JSON | byte[] | - - - - -1. Connection Management -2. General Query -3. Continuous Query -4. Parameter Binding - - - +**Note**: JSON type is only supported in tag. ## Installation Steps ### Pre-installation preparation -* Install the [.NET SDK](https://dotnet.microsoft.com/download) +* Install [.NET SDK](https://dotnet.microsoft.com/download) * [Nuget Client](https://docs.microsoft.com/en-us/nuget/install-nuget-client-tools) (optional installation) -* Install TDengine client driver, please refer to [Install client driver](../#install-client-driver) for details +* Install the TDengine client driver. For specific steps, please refer to [Installing the client driver](../#install-client-driver) -### Install `TDengine.Connector` +### Install the connectors - - +Nuget package `TDengine.Connector` can be added to the current project through dotnet CLI under the path of the current .NET project. -You can reference the `TDengine.Connector` published in Nuget to the current project via the `dotnet` CLI under the path of the existing .NET project. - -``` bash +```bash dotnet add package TDengine.Connector ``` -You may also modify the current.NET project file. You can include the following 'ItemGroup' in your project file (.csproj). +You can also modify the `.csproj` file of the current project and add the following ItemGroup. ``` XML - - - + + + ``` - - +## Establishing a connection -In this scenario, modifying your project file is required in order to copy the WebSocket dependency dynamic library from the nuget package into your project. -```XML - - - - - - - - - -``` - -Notice: `TDengine.Connector` only version>= 3.0.2 includes the dynamic library for WebSocket. - - - - -## Establish a Connection - - - - - + + ``` csharp -using TDengineDriver; - -namespace TDengineExample +var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); +using (var client = DbDriver.Open(builder)) { - - internal class EstablishConnection - { - static void Main(String[] args) - { - string host = "localhost"; - short port = 6030; - string username = "root"; - string password = "taosdata"; - string dbname = ""; - - var conn = TDengine.Connect(host, username, password, dbname, port); - if (conn == IntPtr.Zero) - { - Console.WriteLine("Connect to TDengine failed"); - } - else - { - Console.WriteLine("Connect to TDengine success"); - } - TDengine.Close(conn); - TDengine.Cleanup(); - } - } + Console.WriteLine("connected") } - ``` + - - -The structure of the DSN description string is as follows: - -```text -[]://[[:@]:][/][?=[&=]] -|------------|---|-----------|-----------|------|------|------------|-----------------------| -| protocol | | username | password | host | port | database | params | -``` - -The parameters are described as follows: - -* **protocol**: Specify which connection method to use (support http/ws). For example, `ws://localhost:6041` uses Websocket to establish connections. -* **username/password**: Username and password used to create connections. -* **host/port**: Specifies the server and port to establish a connection. Websocket connections default to `localhost:6041`. -* **database**: Specify the default database to connect to. It's optional. -* **params**: Optional parameters. - -A sample DSN description string is as follows: - -```text -ws://localhost:6041/test -``` - -``` csharp -{{#include docs/examples/csharp/wsConnect/Program.cs}} +```csharp +var builder = new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); +using (var client = DbDriver.Open(builder)) +{ + Console.WriteLine("connected") +} ``` +The parameters supported by `ConnectionStringBuilder` are as follows: +* protocol: connection protocol, optional value is Native or WebSocket, default is Native +* host: the address of the running instance of TDengine or taosadapter, +* port: The port of the running instance of TDengine or taosadapter. + * When using WebSocket without SSL, the default is 6041. + * When using WebSocket with SSL, the default is 443. +* useSSL: Whether to use SSL, the default is false, only valid when the protocol is WebSocket +* token: The token used to connect to TDengine Cloud, only valid when the protocol is WebSocket +* username: username to connect to TDengine +* password: password to connect to TDengine +* db: database connected to TDengine +* timezone: The time zone for parsing time results, the default is `TimeZoneInfo.Local`, use the `TimeZoneInfo.FindSystemTimeZoneById` method to parse the string into a `TimeZoneInfo` object. +* connTimeout: WebSocket connection timeout, only valid when the protocol is WebSocket, the default is 1 minute, use the `TimeSpan.Parse` method to parse the string into a `TimeSpan` object. +* readTimeout: WebSocket read timeout, only valid when the protocol is WebSocket, the default is 5 minutes, use the `TimeSpan.Parse` method to parse the string into a `TimeSpan` object. +* writeTimeout: WebSocket write timeout, only valid when the protocol is WebSocket, the default is 10 seconds, use the `TimeSpan.Parse` method to parse the string into a `TimeSpan` object. + +### Specify the URL and Properties to get the connection + +The C# connector does not support this feature + +### Priority of configuration parameters + +The C# connector does not support this feature + ## Usage examples -### Write data +### Create database and tables -#### SQL Write - - - - - - - - - - + + ```csharp -{{#include docs/examples/csharp/wsInsert/Program.cs}} +using System; +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace NativeQuery +{ + internal class Query + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec("create database power"); + client.Exec("CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + } +} +``` + + + + +```csharp +using System; +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace WSQuery +{ + internal class Query + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec("create database power"); + client.Exec("CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + } +} ``` -#### InfluxDB line protocol write +### Insert data - + + -#### OpenTSDB Telnet line protocol write +```csharp +using System; +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; - - -#### OpenTSDB JSON line protocol write - - - -#### Parameter Binding - - - - - -``` csharp -{{#include docs/examples/csharp/stmtInsert/Program.cs}} +namespace NativeQuery +{ + internal class Query + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + string insertQuery = + "INSERT INTO " + + "power.d1001 USING power.meters TAGS(2,'California.SanFrancisco') " + + "VALUES " + + "('2023-10-03 14:38:05.000', 10.30000, 219, 0.31000) " + + "('2023-10-03 14:38:15.000', 12.60000, 218, 0.33000) " + + "('2023-10-03 14:38:16.800', 12.30000, 221, 0.31000) " + + "power.d1002 USING power.meters TAGS(3, 'California.SanFrancisco') " + + "VALUES " + + "('2023-10-03 14:38:16.650', 10.30000, 218, 0.25000) " + + "power.d1003 USING power.meters TAGS(2,'California.LosAngeles') " + + "VALUES " + + "('2023-10-03 14:38:05.500', 11.80000, 221, 0.28000) " + + "('2023-10-03 14:38:16.600', 13.40000, 223, 0.29000) " + + "power.d1004 USING power.meters TAGS(3,'California.LosAngeles') " + + "VALUES " + + "('2023-10-03 14:38:05.000', 10.80000, 223, 0.29000) " + + "('2023-10-03 14:38:06.500', 11.50000, 221, 0.35000)"; + client.Exec(insertQuery); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + } +} ``` - - + ```csharp -{{#include docs/examples/csharp/wsStmt/Program.cs}} +using System; +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace WSQuery +{ + internal class Query + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + string insertQuery = + "INSERT INTO " + + "power.d1001 USING power.meters TAGS(2,'California.SanFrancisco') " + + "VALUES " + + "('2023-10-03 14:38:05.000', 10.30000, 219, 0.31000) " + + "('2023-10-03 14:38:15.000', 12.60000, 218, 0.33000) " + + "('2023-10-03 14:38:16.800', 12.30000, 221, 0.31000) " + + "power.d1002 USING power.meters TAGS(3, 'California.SanFrancisco') " + + "VALUES " + + "('2023-10-03 14:38:16.650', 10.30000, 218, 0.25000) " + + "power.d1003 USING power.meters TAGS(2,'California.LosAngeles') " + + "VALUES " + + "('2023-10-03 14:38:05.500', 11.80000, 221, 0.28000) " + + "('2023-10-03 14:38:16.600', 13.40000, 223, 0.29000) " + + "power.d1004 USING power.meters TAGS(3,'California.LosAngeles') " + + "VALUES " + + "('2023-10-03 14:38:05.000', 10.80000, 223, 0.29000) " + + "('2023-10-03 14:38:06.500', 11.50000, 221, 0.35000)"; + client.Exec(insertQuery); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + } +} ``` -### Query data +### Querying data -#### Synchronous Query - - - - - - - - - - + + ```csharp -{{#include docs/examples/csharp/wsQuery/Program.cs}} +using System; +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace NativeQuery +{ + internal class Query + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec("use power"); + string query = "SELECT * FROM meters"; + using (var rows = client.Query(query)) + { + while (rows.Read()) + { + Console.WriteLine($"{((DateTime)rows.GetValue(0)):yyyy-MM-dd HH:mm:ss.fff}, {rows.GetValue(1)}, {rows.GetValue(2)}, {rows.GetValue(3)}, {rows.GetValue(4)}, {Encoding.UTF8.GetString((byte[])rows.GetValue(5))}"); + } + } + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + } +} +``` + + + + +```csharp +using System; +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace WSQuery +{ + internal class Query + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec("use power"); + string query = "SELECT * FROM meters"; + using (var rows = client.Query(query)) + { + while (rows.Read()) + { + Console.WriteLine($"{((DateTime)rows.GetValue(0)):yyyy-MM-dd HH:mm:ss.fff}, {rows.GetValue(1)}, {rows.GetValue(2)}, {rows.GetValue(3)}, {rows.GetValue(4)}, {Encoding.UTF8.GetString((byte[])rows.GetValue(5))}"); + } + } + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + } +} ``` -#### Asynchronous query +### execute SQL with reqId - + + + +```csharp +using System; +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace NativeQueryWithReqID +{ + internal abstract class QueryWithReqID + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec($"create database if not exists test_db",ReqId.GetReqId()); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + } +} +``` + + + + +```csharp +using System; +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace WSQueryWithReqID +{ + internal abstract class QueryWithReqID + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec($"create database if not exists test_db",ReqId.GetReqId()); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + } +} +``` + + + + +### Writing data via parameter binding + + + + +```csharp +using System; +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace NativeStmt +{ + internal abstract class NativeStmt + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec("create database power"); + client.Exec( + "CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"); + using (var stmt = client.StmtInit()) + { + stmt.Prepare( + "Insert into power.d1001 using power.meters tags(2,'California.SanFrancisco') values(?,?,?,?)"); + var ts = new DateTime(2023, 10, 03, 14, 38, 05, 000); + stmt.BindRow(new object[] { ts, (float)10.30000, (int)219, (float)0.31000 }); + stmt.AddBatch(); + stmt.Exec(); + var affected = stmt.Affected(); + Console.WriteLine($"affected rows: {affected}"); + } + } + catch (Exception e) + { + Console.WriteLine(e); + throw; + } + } + } + } +} +``` + + + + +```csharp +using System; +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace WSStmt +{ + internal abstract class WSStmt + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec("create database power"); + client.Exec( + "CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"); + using (var stmt = client.StmtInit()) + { + stmt.Prepare( + "Insert into power.d1001 using power.meters tags(2,'California.SanFrancisco') values(?,?,?,?)"); + var ts = new DateTime(2023, 10, 03, 14, 38, 05, 000); + stmt.BindRow(new object[] { ts, (float)10.30000, (int)219, (float)0.31000 }); + stmt.AddBatch(); + stmt.Exec(); + var affected = stmt.Affected(); + Console.WriteLine($"affected rows: {affected}"); + } + } + catch (Exception e) + { + Console.WriteLine(e); + throw; + } + } + } + } +} +``` + + + + +Note: When using BindRow, you need to pay attention to the one-to-one correspondence between the original C# column type and the TDengine column type. For the specific correspondence, please refer to [TDengine DataType and C# DataType](#tdengine-datatype-vs-c-datatype). + +### Schemaless Writing + + + + +```csharp +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace NativeSchemaless +{ + internal class Program + { + public static void Main(string[] args) + { + var builder = + new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + client.Exec("create database sml"); + client.Exec("use sml"); + var influxDBData = + "st,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000"; + client.SchemalessInsert(new string[] { influxDBData }, + TDengineSchemalessProtocol.TSDB_SML_LINE_PROTOCOL, + TDengineSchemalessPrecision.TSDB_SML_TIMESTAMP_NANO_SECONDS, 0, ReqId.GetReqId()); + var telnetData = "stb0_0 1626006833 4 host=host0 interface=eth0"; + client.SchemalessInsert(new string[] { telnetData }, + TDengineSchemalessProtocol.TSDB_SML_TELNET_PROTOCOL, + TDengineSchemalessPrecision.TSDB_SML_TIMESTAMP_MILLI_SECONDS, 0, ReqId.GetReqId()); + var jsonData = + "{\"metric\": \"meter_current\",\"timestamp\": 1626846400,\"value\": 10.3, \"tags\": {\"groupid\": 2, \"location\": \"California.SanFrancisco\", \"id\": \"d1001\"}}"; + client.SchemalessInsert(new string[] { jsonData }, TDengineSchemalessProtocol.TSDB_SML_JSON_PROTOCOL, + TDengineSchemalessPrecision.TSDB_SML_TIMESTAMP_MILLI_SECONDS, 0, ReqId.GetReqId()); + } + } + } +} +``` + + + + +```csharp +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace WSSchemaless +{ + internal class Program + { + public static void Main(string[] args) + { + var builder = + new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + client.Exec("create database sml"); + client.Exec("use sml"); + var influxDBData = + "st,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000"; + client.SchemalessInsert(new string[] { influxDBData }, + TDengineSchemalessProtocol.TSDB_SML_LINE_PROTOCOL, + TDengineSchemalessPrecision.TSDB_SML_TIMESTAMP_NANO_SECONDS, 0, ReqId.GetReqId()); + var telnetData = "stb0_0 1626006833 4 host=host0 interface=eth0"; + client.SchemalessInsert(new string[] { telnetData }, + TDengineSchemalessProtocol.TSDB_SML_TELNET_PROTOCOL, + TDengineSchemalessPrecision.TSDB_SML_TIMESTAMP_MILLI_SECONDS, 0, ReqId.GetReqId()); + var jsonData = + "{\"metric\": \"meter_current\",\"timestamp\": 1626846400,\"value\": 10.3, \"tags\": {\"groupid\": 2, \"location\": \"California.SanFrancisco\", \"id\": \"d1001\"}}"; + client.SchemalessInsert(new string[] { jsonData }, TDengineSchemalessProtocol.TSDB_SML_JSON_PROTOCOL, + TDengineSchemalessPrecision.TSDB_SML_TIMESTAMP_MILLI_SECONDS, 0, ReqId.GetReqId()); + } + } + } +} +``` + + + + +### Schemaless with reqId + +```csharp +public void SchemalessInsert(string[] lines, TDengineSchemalessProtocol protocol, + TDengineSchemalessPrecision precision, + int ttl, long reqId) +``` + +### Data Subscription + +#### Create a Topic + + + + +```csharp +using System; +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace NativeSubscription +{ + internal class Program + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec("create database power"); + client.Exec("CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"); + client.Exec("CREATE TOPIC topic_meters as SELECT * from power.meters"); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + } +} +``` + + + + +```csharp +using System; +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace WSSubscription +{ + internal class Program + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec("create database power"); + client.Exec("CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"); + client.Exec("CREATE TOPIC topic_meters as SELECT * from power.meters"); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + } +} +``` + + + + +#### Create a Consumer + + + + +```csharp +var cfg = new Dictionary() +{ + { "group.id", "group1" }, + { "auto.offset.reset", "latest" }, + { "td.connect.ip", "127.0.0.1" }, + { "td.connect.user", "root" }, + { "td.connect.pass", "taosdata" }, + { "td.connect.port", "6030" }, + { "client.id", "tmq_example" }, + { "enable.auto.commit", "true" }, + { "msg.with.table.name", "false" }, +}; +var consumer = new ConsumerBuilder>(cfg).Build(); +``` + + + + +```csharp +var cfg = new Dictionary() +{ + { "td.connect.type", "WebSocket" }, + { "group.id", "group1" }, + { "auto.offset.reset", "latest" }, + { "td.connect.ip", "localhost" }, + { "td.connect.port","6041"}, + { "useSSL", "false" }, + { "td.connect.user", "root" }, + { "td.connect.pass", "taosdata" }, + { "client.id", "tmq_example" }, + { "enable.auto.commit", "true" }, + { "msg.with.table.name", "false" }, +}; +var consumer = new ConsumerBuilder>(cfg).Build(); +``` + + + + +The configuration parameters supported by consumer are as follows: +* td.connect.type: connection type, optional value is Native or WebSocket, default is Native +* td.connect.ip: The address of the TDengine running instance or taosadapter +* td.connect.port: The port of the running instance of TDengine or taosadapter. + * When using WebSocket without SSL, the default is 6041. + * When using WebSocket with SSL, the default is 443. +* useSSL: Whether to use SSL, the default is false, only valid when the protocol is WebSocket +* token: The token used to connect to TDengine Cloud, only valid when the protocol is WebSocket +* td.connect.user: username to connect to TDengine +* td.connect.pass: Password for connecting to TDengine +* group.id: consumer group ID +* client.id: consumer ID +* enable.auto.commit: Whether to automatically commit offset, the default is true +* auto.commit.interval.ms: The interval for automatically submitting offsets, the default is 5000 milliseconds +* auto.offset.reset: When offset does not exist, where to start consumption, the optional value is earliest or latest, the default is latest +* msg.with.table.name: Whether the message contains the table name + +Supports subscribing to the result set `Dictionary` where the key is the column name and the value is the column value. + +If you use object to receive column values, you need to pay attention to: +* There needs to be a one-to-one correspondence between the original C# column type and the TDengine column type. For specific correspondence, please refer to [TDengine DataType and C# DataType] (#tdengine-datatype-and-c-datatype). +* The column name is consistent with the class attribute name and can be get and set. +* Explicitly set the value parser `ConsumerBuilder.SetValueDeserializer(new ReferenceDeserializer());` + +An example is as follows + +Result class + +```csharp + class Result + { + public DateTime ts { get; set; } + public float current { get; set; } + public int voltage { get; set; } + public float phase { get; set; } + } +``` + +Set up parser + +```csharp +var tmqBuilder = new ConsumerBuilder(cfg); +tmqBuilder.SetValueDeserializer(new ReferenceDeserializer()); +var consumer = tmqBuilder.Build(); +``` + +You can also implement a custom deserializer, implement the `IDeserializer` interface and pass it in through the `ConsumerBuilder.SetValueDeserializer` method. + +```csharp + public interface IDeserializer + { + T Deserialize(ITMQRows data, bool isNull, SerializationContext context); + } +``` + +#### Subscribe to consume data + +```csharp +consumer.Subscribe(new List() { "topic_meters" }); +while (true) +{ + using (var cr = consumer.Consume(500)) + { + if (cr == null) continue; + foreach (var message in cr.Message) + { + Console.WriteLine( + $"message {{{((DateTime)message.Value["ts"]).ToString("yyyy-MM-dd HH:mm:ss.fff")}, " + + $"{message.Value["current"]}, {message.Value["voltage"]}, {message.Value["phase"]}}}"); + } + } +} +``` + +#### Assignment subscription Offset + +```csharp +consumer.Assignment.ForEach(a => +{ + Console.WriteLine($"{a}, seek to 0"); + consumer.Seek(new TopicPartitionOffset(a.Topic, a.Partition, 0)); + Thread.Sleep(TimeSpan.FromSeconds(1)); +}); +``` + +#### Commit offset + +```csharp +public void Commit(ConsumeResult consumerResult) +public List Commit() +public void Commit(IEnumerable offsets) +``` + +#### Close subscriptions + +```csharp +consumer.Unsubscribe(); +consumer.Close(); +``` + +#### Full Sample Code + + + + +```csharp +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using TDengine.Driver; +using TDengine.Driver.Client; +using TDengine.TMQ; + +namespace NativeSubscription +{ + internal class Program + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec("CREATE DATABASE power"); + client.Exec("USE power"); + client.Exec( + "CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"); + client.Exec("CREATE TOPIC topic_meters as SELECT * from power.meters"); + var cfg = new Dictionary() + { + { "group.id", "group1" }, + { "auto.offset.reset", "latest" }, + { "td.connect.ip", "127.0.0.1" }, + { "td.connect.user", "root" }, + { "td.connect.pass", "taosdata" }, + { "td.connect.port", "6030" }, + { "client.id", "tmq_example" }, + { "enable.auto.commit", "true" }, + { "msg.with.table.name", "false" }, + }; + var consumer = new ConsumerBuilder>(cfg).Build(); + consumer.Subscribe(new List() { "topic_meters" }); + Task.Run(InsertData); + while (true) + { + using (var cr = consumer.Consume(500)) + { + if (cr == null) continue; + foreach (var message in cr.Message) + { + Console.WriteLine( + $"message {{{((DateTime)message.Value["ts"]).ToString("yyyy-MM-dd HH:mm:ss.fff")}, " + + $"{message.Value["current"]}, {message.Value["voltage"]}, {message.Value["phase"]}}}"); + } + consumer.Commit(); + } + } + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + + static void InsertData() + { + var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + while (true) + { + client.Exec("INSERT into power.d1001 using power.meters tags(2,'California.SanFrancisco') values(now,11.5,219,0.30)"); + Task.Delay(1000).Wait(); + } + } + } + } +} +``` + + + + +```csharp +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using TDengine.Driver; +using TDengine.Driver.Client; +using TDengine.TMQ; + +namespace WSSubscription +{ + internal class Program + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec("CREATE DATABASE power"); + client.Exec("USE power"); + client.Exec( + "CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"); + client.Exec("CREATE TOPIC topic_meters as SELECT * from power.meters"); + var cfg = new Dictionary() + { + { "td.connect.type", "WebSocket" }, + { "group.id", "group1" }, + { "auto.offset.reset", "latest" }, + { "td.connect.ip", "localhost" }, + { "td.connect.port","6041"}, + { "useSSL", "false" }, + { "td.connect.user", "root" }, + { "td.connect.pass", "taosdata" }, + { "client.id", "tmq_example" }, + { "enable.auto.commit", "true" }, + { "msg.with.table.name", "false" }, + }; + var consumer = new ConsumerBuilder>(cfg).Build(); + consumer.Subscribe(new List() { "topic_meters" }); + Task.Run(InsertData); + while (true) + { + using (var cr = consumer.Consume(500)) + { + if (cr == null) continue; + foreach (var message in cr.Message) + { + Console.WriteLine( + $"message {{{((DateTime)message.Value["ts"]).ToString("yyyy-MM-dd HH:mm:ss.fff")}, " + + $"{message.Value["current"]}, {message.Value["voltage"]}, {message.Value["phase"]}}}"); + } + consumer.Commit(); + } + } + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + + static void InsertData() + { + var builder = new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + while (true) + { + client.Exec("INSERT into power.d1001 using power.meters tags(2,'California.SanFrancisco') values(now,11.5,219,0.30)"); + Task.Delay(1000).Wait(); + } + } + } + } +} +``` + + + + +### ADO.NET + +The C# connector supports the ADO.NET interface, and you can connect to the TDengine running instance through the ADO.NET interface to perform operations such as data writing and querying. + + + + +```csharp +using System; +using TDengine.Data.Client; + +namespace NativeADO +{ + internal class Program + { + public static void Main(string[] args) + { + const string connectionString = "host=localhost;port=6030;username=root;password=taosdata"; + using (var connection = new TDengineConnection(connectionString)) + { + try + { + connection.Open(); + using (var command = new TDengineCommand(connection)) + { + command.CommandText = "create database power"; + command.ExecuteNonQuery(); + connection.ChangeDatabase("power"); + command.CommandText = + "CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"; + command.ExecuteNonQuery(); + command.CommandText = "INSERT INTO " + + "power.d1001 USING power.meters TAGS(2,'California.SanFrancisco') " + + "VALUES " + + "(?,?,?,?)"; + var parameters = command.Parameters; + parameters.Add(new TDengineParameter("@0", new DateTime(2023,10,03,14,38,05,000))); + parameters.Add(new TDengineParameter("@1", (float)10.30000)); + parameters.Add(new TDengineParameter("@2", (int)219)); + parameters.Add(new TDengineParameter("@3", (float)0.31000)); + command.ExecuteNonQuery(); + command.Parameters.Clear(); + command.CommandText = "SELECT * FROM meters"; + using (var reader = command.ExecuteReader()) + { + while (reader.Read()) + { + Console.WriteLine( + $"{((DateTime) reader.GetValue(0)):yyyy-MM-dd HH:mm:ss.fff}, {reader.GetValue(1)}, {reader.GetValue(2)}, {reader.GetValue(3)}, {reader.GetValue(4)}, {System.Text.Encoding.UTF8.GetString((byte[]) reader.GetValue(5))}"); + } + } + } + } + catch (Exception e) + { + Console.WriteLine(e); + throw; + } + } + } + } +} +``` + + + + +```csharp +using System; +using TDengine.Data.Client; + +namespace WSADO +{ + internal class Program + { + public static void Main(string[] args) + { + const string connectionString = "protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"; + using (var connection = new TDengineConnection(connectionString)) + { + try + { + connection.Open(); + using (var command = new TDengineCommand(connection)) + { + command.CommandText = "create database power"; + command.ExecuteNonQuery(); + connection.ChangeDatabase("power"); + command.CommandText = + "CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"; + command.ExecuteNonQuery(); + command.CommandText = "INSERT INTO " + + "power.d1001 USING power.meters TAGS(2,'California.SanFrancisco') " + + "VALUES " + + "(?,?,?,?)"; + var parameters = command.Parameters; + parameters.Add(new TDengineParameter("@0", new DateTime(2023,10,03,14,38,05,000))); + parameters.Add(new TDengineParameter("@1", (float)10.30000)); + parameters.Add(new TDengineParameter("@2", (int)219)); + parameters.Add(new TDengineParameter("@3", (float)0.31000)); + command.ExecuteNonQuery(); + command.Parameters.Clear(); + command.CommandText = "SELECT * FROM meters"; + using (var reader = command.ExecuteReader()) + { + while (reader.Read()) + { + Console.WriteLine( + $"{((DateTime) reader.GetValue(0)):yyyy-MM-dd HH:mm:ss.fff}, {reader.GetValue(1)}, {reader.GetValue(2)}, {reader.GetValue(3)}, {reader.GetValue(4)}, {System.Text.Encoding.UTF8.GetString((byte[]) reader.GetValue(5))}"); + } + } + } + } + catch (Exception e) + { + Console.WriteLine(e); + throw; + } + } + } + } +} +``` + + + + +* The connection parameters are consistent with those in [Establishing a connection](#establishing-a-connection). +* The name of TDengineParameter needs to start with @, such as @0, @1, @2, etc. The value needs to have a one-to-one correspondence between the C# column type and the TDengine column type. For the specific correspondence, please refer to [TDengine DataType and C# DataType](#tdengine-datatype-vs-c-datatype). ### More sample programs -|Sample program |Sample program description | -|--------------------------------------------------------------------------------------------------------------------|--------------------------------------------| -| [CURD](https://github.com/taosdata/taos-connector-dotnet/blob/3.0/examples/NET6Examples/Query/Query.cs) | Table creation, data insertion, and query examples with TDengine.Connector | -| [JSON Tag](https://github.com/taosdata/taos-connector-dotnet/blob/3.0/examples/NET6Examples/JSONTag) | Writing and querying JSON tag data with TDengine Connector | -| [stmt](https://github.com/taosdata/taos-connector-dotnet/tree/3.0/examples/NET6Examples/Stmt) | Parameter binding with TDengine Connector | -| [schemaless](https://github.com/taosdata/taos-connector-dotnet/blob/3.0/examples/NET6Examples/schemaless) | Schemaless writes with TDengine Connector | -| [async query](https://github.com/taosdata/taos-connector-dotnet/blob/3.0/examples/NET6Examples/AsyncQuery/QueryAsync.cs) | Asynchronous queries with TDengine Connector | -| [Subscription](https://github.com/taosdata/taos-connector-dotnet/blob/3.0/examples/NET6Examples/TMQ/TMQ.cs) | Subscription example with TDengine Connector | -| [Basic WebSocket Usage](https://github.com/taosdata/taos-connector-dotnet/blob/3.0/examples/FrameWork45/WS/WebSocketSample.cs) | WebSocket basic data in and out with TDengine connector | -| [WebSocket Parameter Binding](https://github.com/taosdata/taos-connector-dotnet/blob/3.0/examples/FrameWork45/WS/WebSocketSTMT.cs) | WebSocket parameter binding example | - -## Important update records - -| TDengine.Connector | Description | -|--------------------|--------------------------------| -| 3.0.2 | Support .NET Framework 4.5 and above. Support .Net standard 2.0. Nuget package includes dynamic library for WebSocket.| -| 3.0.1 | Support WebSocket and Cloud, With function query, insert, and parameter binding| -| 3.0.0 | Supports TDengine 3.0.0.0. TDengine 2.x is not supported. Added `TDengine.Impl.GetData()` interface to deserialize query results. | -| 1.0.7 | Fixed TDengine.Query() memory leak. | -| 1.0.6 | Fix schemaless bug in 1.0.4 and 1.0.5. | -| 1.0.5 | Fix Windows sync query Chinese error bug. | 1.0.4 | Fix schemaless bug. | -| 1.0.4 | Add asynchronous query, subscription, and other functions. Fix the binding parameter bug. | -| 1.0.3 | Add parameter binding, schemaless, JSON tag, etc. | -| 1.0.2 | Add connection management, synchronous query, error messages, etc. | - -## Other descriptions - -### Third-party driver - -`Taos` is an ADO.NET connector for TDengine, supporting Linux and Windows platforms. Community contributor `Maikebing@@maikebing contributes the connector`. Please refer to: - -* Interface download: - -## Frequently Asked Questions - -1. "Unable to establish connection", "Unable to resolve FQDN" - - Usually, it's caused by an incorrect FQDN configuration. Please refer to this section in the [FAQ](https://docs.tdengine.com/2.4/train-faq/faq/#2-how-to-handle-unable-to-establish-connection) to troubleshoot. - -2. Unhandled exception. System.DllNotFoundException: Unable to load DLL 'taos' or one of its dependencies: The specified module cannot be found. - - This is usually because the program did not find the dependent client driver. The solution is to copy `C:\TDengine\driver\taos.dll` to the `C:\Windows\System32\` directory on Windows, and create the following soft link on Linux `ln -s /usr/local/taos/driver/libtaos.so.x.x .x.x /usr/lib/libtaos.so` will work. - -## API Reference - -[API Reference](https://docs.taosdata.com/api/connector-csharp/html/860d2ac1-dd52-39c9-e460-0829c4e5a40b.htm) +[sample program](https://github.com/taosdata/taos-connector-dotnet/tree/3.0/examples) \ No newline at end of file diff --git a/docs/examples/csharp/.gitignore b/docs/examples/csharp/.gitignore index c228f1be2a..b0df020f44 100644 --- a/docs/examples/csharp/.gitignore +++ b/docs/examples/csharp/.gitignore @@ -1,5 +1,5 @@ .vs -asyncQuery/bin +.idea connect/bin influxdbLine/bin optsJSON/bin @@ -12,7 +12,6 @@ wsConnect/bin wsInsert/bin wsQuery/bin wsStmt/bin -asyncQuery/obj connect/obj influxdbLine/obj optsJSON/obj diff --git a/docs/examples/csharp/asyncQuery/Program.cs b/docs/examples/csharp/asyncQuery/Program.cs deleted file mode 100644 index 864f06a15e..0000000000 --- a/docs/examples/csharp/asyncQuery/Program.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System; -using System.Collections.Generic; -using TDengineDriver; -using TDengineDriver.Impl; -using System.Runtime.InteropServices; - -namespace TDengineExample -{ - public class AsyncQueryExample - { - static void Main() - { - IntPtr conn = GetConnection(); - try - { - QueryAsyncCallback queryAsyncCallback = new QueryAsyncCallback(QueryCallback); - TDengine.QueryAsync(conn, "select * from meters", queryAsyncCallback, IntPtr.Zero); - Thread.Sleep(2000); - } - finally - { - TDengine.Close(conn); - } - - } - - static void QueryCallback(IntPtr param, IntPtr taosRes, int code) - { - if (code == 0 && taosRes != IntPtr.Zero) - { - FetchRawBlockAsyncCallback fetchRowAsyncCallback = new FetchRawBlockAsyncCallback(FetchRawBlockCallback); - TDengine.FetchRawBlockAsync(taosRes, fetchRowAsyncCallback, param); - } - else - { - throw new Exception($"async query data failed,code:{code},reason:{TDengine.Error(taosRes)}"); - } - } - - // Iteratively call this interface until "numOfRows" is no greater than 0. - static void FetchRawBlockCallback(IntPtr param, IntPtr taosRes, int numOfRows) - { - if (numOfRows > 0) - { - Console.WriteLine($"{numOfRows} rows async retrieved"); - IntPtr pdata = TDengine.GetRawBlock(taosRes); - List metaList = TDengine.FetchFields(taosRes); - List dataList = LibTaos.ReadRawBlock(pdata, metaList, numOfRows); - - for (int i = 0; i < dataList.Count; i++) - { - if (i != 0 && (i + 1) % metaList.Count == 0) - { - Console.WriteLine("{0}\t|", dataList[i]); - } - else - { - Console.Write("{0}\t|", dataList[i]); - } - } - Console.WriteLine(""); - TDengine.FetchRawBlockAsync(taosRes, FetchRawBlockCallback, param); - } - else - { - if (numOfRows == 0) - { - Console.WriteLine("async retrieve complete."); - } - else - { - throw new Exception($"FetchRawBlockCallback callback error, error code {numOfRows}"); - } - TDengine.FreeResult(taosRes); - } - } - - static IntPtr GetConnection() - { - string host = "localhost"; - short port = 6030; - string username = "root"; - string password = "taosdata"; - string dbname = "power"; - var conn = TDengine.Connect(host, username, password, dbname, port); - if (conn == IntPtr.Zero) - { - throw new Exception("Connect to TDengine failed"); - } - else - { - Console.WriteLine("Connect to TDengine success"); - } - return conn; - } - } -} - -// //output: -// // Connect to TDengine success -// // 8 rows async retrieved - -// // 1538548685500 | 11.8 | 221 | 0.28 | california.losangeles | 2 | -// // 1538548696600 | 13.4 | 223 | 0.29 | california.losangeles | 2 | -// // 1538548685000 | 10.8 | 223 | 0.29 | california.losangeles | 3 | -// // 1538548686500 | 11.5 | 221 | 0.35 | california.losangeles | 3 | -// // 1538548685000 | 10.3 | 219 | 0.31 | california.sanfrancisco | 2 | -// // 1538548695000 | 12.6 | 218 | 0.33 | california.sanfrancisco | 2 | -// // 1538548696800 | 12.3 | 221 | 0.31 | california.sanfrancisco | 2 | -// // 1538548696650 | 10.3 | 218 | 0.25 | california.sanfrancisco | 3 | -// // async retrieve complete. \ No newline at end of file diff --git a/docs/examples/csharp/asyncQuery/asyncquery.csproj b/docs/examples/csharp/asyncQuery/asyncquery.csproj deleted file mode 100644 index 7c5b693f28..0000000000 --- a/docs/examples/csharp/asyncQuery/asyncquery.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - Exe - net6.0 - enable - enable - TDengineExample.AsyncQueryExample - - - - - - - diff --git a/docs/examples/csharp/connect/Program.cs b/docs/examples/csharp/connect/Program.cs index 955db40c7c..0152b61b03 100644 --- a/docs/examples/csharp/connect/Program.cs +++ b/docs/examples/csharp/connect/Program.cs @@ -1,4 +1,5 @@ -using TDengineDriver; +using TDengine.Driver; +using TDengine.Driver.Client; namespace TDengineExample { @@ -7,23 +8,11 @@ namespace TDengineExample { static void Main(String[] args) { - string host = "localhost"; - short port = 6030; - string username = "root"; - string password = "taosdata"; - string dbname = ""; - - var conn = TDengine.Connect(host, username, password, dbname, port); - if (conn == IntPtr.Zero) + var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) { - throw new Exception("Connect to TDengine failed"); + Console.WriteLine("connected"); } - else - { - Console.WriteLine("Connect to TDengine success"); - } - TDengine.Close(conn); - TDengine.Cleanup(); } } } diff --git a/docs/examples/csharp/connect/connect.csproj b/docs/examples/csharp/connect/connect.csproj index a08e86d4b4..e4412a68db 100644 --- a/docs/examples/csharp/connect/connect.csproj +++ b/docs/examples/csharp/connect/connect.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/examples/csharp/csharp.sln b/docs/examples/csharp/csharp.sln index 560dde55cb..59c198b4c9 100644 --- a/docs/examples/csharp/csharp.sln +++ b/docs/examples/csharp/csharp.sln @@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30114.105 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "asyncquery", "asyncQuery\asyncquery.csproj", "{E2A5F00C-14E7-40E1-A2DE-6AB2975616D3}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "connect", "connect\connect.csproj", "{CCC5042D-93FC-4AE0-B2F6-7E692FD476B7}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "influxdbline", "influxdbLine\influxdbline.csproj", "{6A24FB80-1E3C-4E2D-A5AB-914FA583874D}" @@ -38,10 +36,6 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E2A5F00C-14E7-40E1-A2DE-6AB2975616D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E2A5F00C-14E7-40E1-A2DE-6AB2975616D3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E2A5F00C-14E7-40E1-A2DE-6AB2975616D3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E2A5F00C-14E7-40E1-A2DE-6AB2975616D3}.Release|Any CPU.Build.0 = Release|Any CPU {CCC5042D-93FC-4AE0-B2F6-7E692FD476B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CCC5042D-93FC-4AE0-B2F6-7E692FD476B7}.Debug|Any CPU.Build.0 = Debug|Any CPU {CCC5042D-93FC-4AE0-B2F6-7E692FD476B7}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/docs/examples/csharp/influxdbLine/Program.cs b/docs/examples/csharp/influxdbLine/Program.cs index a620c01609..fcf2928f0c 100644 --- a/docs/examples/csharp/influxdbLine/Program.cs +++ b/docs/examples/csharp/influxdbLine/Program.cs @@ -1,4 +1,5 @@ -using TDengineDriver; +using TDengine.Driver; +using TDengine.Driver.Client; namespace TDengineExample { @@ -6,60 +7,23 @@ namespace TDengineExample { static void Main() { - IntPtr conn = GetConnection(); - PrepareDatabase(conn); - string[] lines = { - "meters,location=California.LosAngeles,groupid=2 current=11.8,voltage=221,phase=0.28 1648432611249", - "meters,location=California.LosAngeles,groupid=2 current=13.4,voltage=223,phase=0.29 1648432611250", - "meters,location=California.LosAngeles,groupid=3 current=10.8,voltage=223,phase=0.29 1648432611249", - "meters,location=California.LosAngeles,groupid=3 current=11.3,voltage=221,phase=0.35 1648432611250" - }; - IntPtr res = TDengine.SchemalessInsert(conn, lines, lines.Length, (int)TDengineSchemalessProtocol.TSDB_SML_LINE_PROTOCOL, (int)TDengineSchemalessPrecision.TSDB_SML_TIMESTAMP_MILLI_SECONDS); - if (TDengine.ErrorNo(res) != 0) + var builder = + new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) { - throw new Exception("SchemalessInsert failed since " + TDengine.Error(res)); - } - else - { - int affectedRows = TDengine.AffectRows(res); - Console.WriteLine($"SchemalessInsert success, affected {affectedRows} rows"); - } - TDengine.FreeResult(res); - - } - static IntPtr GetConnection() - { - string host = "localhost"; - short port = 6030; - string username = "root"; - string password = "taosdata"; - string dbname = ""; - var conn = TDengine.Connect(host, username, password, dbname, port); - if (conn == IntPtr.Zero) - { - throw new Exception("Connect to TDengine failed"); - } - else - { - Console.WriteLine("Connect to TDengine success"); - } - return conn; - } - - static void PrepareDatabase(IntPtr conn) - { - IntPtr res = TDengine.Query(conn, "CREATE DATABASE test WAL_RETENTION_PERIOD 3600"); - if (TDengine.ErrorNo(res) != 0) - { - throw new Exception("failed to create database, reason: " + TDengine.Error(res)); - } - res = TDengine.Query(conn, "USE test"); - if (TDengine.ErrorNo(res) != 0) - { - throw new Exception("failed to change database, reason: " + TDengine.Error(res)); + client.Exec("CREATE DATABASE test WAL_RETENTION_PERIOD 3600"); + client.Exec("use test"); + string[] lines = { + "meters,location=California.LosAngeles,groupid=2 current=11.8,voltage=221,phase=0.28 1648432611249", + "meters,location=California.LosAngeles,groupid=2 current=13.4,voltage=223,phase=0.29 1648432611250", + "meters,location=California.LosAngeles,groupid=3 current=10.8,voltage=223,phase=0.29 1648432611249", + "meters,location=California.LosAngeles,groupid=3 current=11.3,voltage=221,phase=0.35 1648432611250" + }; + client.SchemalessInsert(lines, + TDengineSchemalessProtocol.TSDB_SML_LINE_PROTOCOL, + TDengineSchemalessPrecision.TSDB_SML_TIMESTAMP_MILLI_SECONDS, 0, ReqId.GetReqId()); } } - } } diff --git a/docs/examples/csharp/influxdbLine/influxdbline.csproj b/docs/examples/csharp/influxdbLine/influxdbline.csproj index 4889f8fde9..4fe883b6cb 100644 --- a/docs/examples/csharp/influxdbLine/influxdbline.csproj +++ b/docs/examples/csharp/influxdbLine/influxdbline.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/examples/csharp/optsJSON/Program.cs b/docs/examples/csharp/optsJSON/Program.cs index 8dcc1dce92..a93c4dad0f 100644 --- a/docs/examples/csharp/optsJSON/Program.cs +++ b/docs/examples/csharp/optsJSON/Program.cs @@ -1,69 +1,28 @@ -using TDengineDriver; +using TDengine.Driver; +using TDengine.Driver.Client; namespace TDengineExample { internal class OptsJsonExample { - static void Main() + public static void Main(string[] args) { - IntPtr conn = GetConnection(); - try + var builder = + new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) { - PrepareDatabase(conn); - string[] lines = { "[{\"metric\": \"meters.current\", \"timestamp\": 1648432611249, \"value\": 10.3, \"tags\": {\"location\": \"California.SanFrancisco\", \"groupid\": 2}}," + - " {\"metric\": \"meters.voltage\", \"timestamp\": 1648432611249, \"value\": 219, \"tags\": {\"location\": \"California.LosAngeles\", \"groupid\": 1}}, " + - "{\"metric\": \"meters.current\", \"timestamp\": 1648432611250, \"value\": 12.6, \"tags\": {\"location\": \"California.SanFrancisco\", \"groupid\": 2}}," + - " {\"metric\": \"meters.voltage\", \"timestamp\": 1648432611250, \"value\": 221, \"tags\": {\"location\": \"California.LosAngeles\", \"groupid\": 1}}]" - }; - - IntPtr res = TDengine.SchemalessInsert(conn, lines, 1, (int)TDengineSchemalessProtocol.TSDB_SML_JSON_PROTOCOL, (int)TDengineSchemalessPrecision.TSDB_SML_TIMESTAMP_NOT_CONFIGURED); - if (TDengine.ErrorNo(res) != 0) + client.Exec("CREATE DATABASE test WAL_RETENTION_PERIOD 3600"); + client.Exec("use test"); + string[] lines = { - throw new Exception("SchemalessInsert failed since " + TDengine.Error(res)); - } - else - { - int affectedRows = TDengine.AffectRows(res); - Console.WriteLine($"SchemalessInsert success, affected {affectedRows} rows"); - } - TDengine.FreeResult(res); - } - finally - { - TDengine.Close(conn); - } - } - static IntPtr GetConnection() - { - string host = "localhost"; - short port = 6030; - string username = "root"; - string password = "taosdata"; - string dbname = ""; - var conn = TDengine.Connect(host, username, password, dbname, port); - if (conn == IntPtr.Zero) - { - throw new Exception("Connect to TDengine failed"); - } - else - { - Console.WriteLine("Connect to TDengine success"); - } - return conn; - } - - static void PrepareDatabase(IntPtr conn) - { - IntPtr res = TDengine.Query(conn, "CREATE DATABASE test WAL_RETENTION_PERIOD 3600"); - if (TDengine.ErrorNo(res) != 0) - { - throw new Exception("failed to create database, reason: " + TDengine.Error(res)); - } - res = TDengine.Query(conn, "USE test"); - if (TDengine.ErrorNo(res) != 0) - { - throw new Exception("failed to change database, reason: " + TDengine.Error(res)); + "[{\"metric\": \"meters.current\", \"timestamp\": 1648432611249, \"value\": 10.3, \"tags\": {\"location\": \"California.SanFrancisco\", \"groupid\": 2}}," + + " {\"metric\": \"meters.voltage\", \"timestamp\": 1648432611249, \"value\": 219, \"tags\": {\"location\": \"California.LosAngeles\", \"groupid\": 1}}, " + + "{\"metric\": \"meters.current\", \"timestamp\": 1648432611250, \"value\": 12.6, \"tags\": {\"location\": \"California.SanFrancisco\", \"groupid\": 2}}," + + " {\"metric\": \"meters.voltage\", \"timestamp\": 1648432611250, \"value\": 221, \"tags\": {\"location\": \"California.LosAngeles\", \"groupid\": 1}}]" + }; + client.SchemalessInsert(lines, TDengineSchemalessProtocol.TSDB_SML_JSON_PROTOCOL, + TDengineSchemalessPrecision.TSDB_SML_TIMESTAMP_MILLI_SECONDS, 0, ReqId.GetReqId()); } } } -} +} \ No newline at end of file diff --git a/docs/examples/csharp/optsJSON/optsJSON.csproj b/docs/examples/csharp/optsJSON/optsJSON.csproj index 208f04c82d..9c3edf53e3 100644 --- a/docs/examples/csharp/optsJSON/optsJSON.csproj +++ b/docs/examples/csharp/optsJSON/optsJSON.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/examples/csharp/optsTelnet/Program.cs b/docs/examples/csharp/optsTelnet/Program.cs index ccd29d0cfc..b64aa9fe2d 100644 --- a/docs/examples/csharp/optsTelnet/Program.cs +++ b/docs/examples/csharp/optsTelnet/Program.cs @@ -1,72 +1,31 @@ -using TDengineDriver; +using TDengine.Driver; +using TDengine.Driver.Client; namespace TDengineExample { internal class OptsTelnetExample { - static void Main() + public static void Main(string[] args) { - IntPtr conn = GetConnection(); - try + var builder = + new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) { - PrepareDatabase(conn); + client.Exec("CREATE DATABASE test WAL_RETENTION_PERIOD 3600"); + client.Exec("USE test"); string[] lines = { - "meters.current 1648432611249 10.3 location=California.SanFrancisco groupid=2", - "meters.current 1648432611250 12.6 location=California.SanFrancisco groupid=2", - "meters.current 1648432611249 10.8 location=California.LosAngeles groupid=3", - "meters.current 1648432611250 11.3 location=California.LosAngeles groupid=3", - "meters.voltage 1648432611249 219 location=California.SanFrancisco groupid=2", - "meters.voltage 1648432611250 218 location=California.SanFrancisco groupid=2", - "meters.voltage 1648432611249 221 location=California.LosAngeles groupid=3", - "meters.voltage 1648432611250 217 location=California.LosAngeles groupid=3", - }; - IntPtr res = TDengine.SchemalessInsert(conn, lines, lines.Length, (int)TDengineSchemalessProtocol.TSDB_SML_TELNET_PROTOCOL, (int)TDengineSchemalessPrecision.TSDB_SML_TIMESTAMP_NOT_CONFIGURED); - if (TDengine.ErrorNo(res) != 0) - { - throw new Exception("SchemalessInsert failed since " + TDengine.Error(res)); - } - else - { - int affectedRows = TDengine.AffectRows(res); - Console.WriteLine($"SchemalessInsert success, affected {affectedRows} rows"); - } - TDengine.FreeResult(res); - } - catch - { - TDengine.Close(conn); - } - } - static IntPtr GetConnection() - { - string host = "localhost"; - short port = 6030; - string username = "root"; - string password = "taosdata"; - string dbname = ""; - var conn = TDengine.Connect(host, username, password, dbname, port); - if (conn == IntPtr.Zero) - { - throw new Exception("Connect to TDengine failed"); - } - else - { - Console.WriteLine("Connect to TDengine success"); - } - return conn; - } - - static void PrepareDatabase(IntPtr conn) - { - IntPtr res = TDengine.Query(conn, "CREATE DATABASE test WAL_RETENTION_PERIOD 3600"); - if (TDengine.ErrorNo(res) != 0) - { - throw new Exception("failed to create database, reason: " + TDengine.Error(res)); - } - res = TDengine.Query(conn, "USE test"); - if (TDengine.ErrorNo(res) != 0) - { - throw new Exception("failed to change database, reason: " + TDengine.Error(res)); + "meters.current 1648432611249 10.3 location=California.SanFrancisco groupid=2", + "meters.current 1648432611250 12.6 location=California.SanFrancisco groupid=2", + "meters.current 1648432611249 10.8 location=California.LosAngeles groupid=3", + "meters.current 1648432611250 11.3 location=California.LosAngeles groupid=3", + "meters.voltage 1648432611249 219 location=California.SanFrancisco groupid=2", + "meters.voltage 1648432611250 218 location=California.SanFrancisco groupid=2", + "meters.voltage 1648432611249 221 location=California.LosAngeles groupid=3", + "meters.voltage 1648432611250 217 location=California.LosAngeles groupid=3", + }; + client.SchemalessInsert(lines, + TDengineSchemalessProtocol.TSDB_SML_TELNET_PROTOCOL, + TDengineSchemalessPrecision.TSDB_SML_TIMESTAMP_MILLI_SECONDS, 0, ReqId.GetReqId()); } } } diff --git a/docs/examples/csharp/optsTelnet/optstelnet.csproj b/docs/examples/csharp/optsTelnet/optstelnet.csproj index 32c76ec418..4d6941e962 100644 --- a/docs/examples/csharp/optsTelnet/optstelnet.csproj +++ b/docs/examples/csharp/optsTelnet/optstelnet.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/examples/csharp/query/Program.cs b/docs/examples/csharp/query/Program.cs index 84c7f9db1f..4c354d9a5e 100644 --- a/docs/examples/csharp/query/Program.cs +++ b/docs/examples/csharp/query/Program.cs @@ -1,80 +1,35 @@ -using TDengineDriver; -using TDengineDriver.Impl; -using System.Runtime.InteropServices; +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; namespace TDengineExample { internal class QueryExample { - static void Main() + public static void Main(string[] args) { - IntPtr conn = GetConnection(); - try + var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) { - // run query - IntPtr res = TDengine.Query(conn, "SELECT * FROM meters LIMIT 2"); - if (TDengine.ErrorNo(res) != 0) + try { - throw new Exception("Failed to query since: " + TDengine.Error(res)); - } - - // get filed count - int fieldCount = TDengine.FieldCount(res); - Console.WriteLine("fieldCount=" + fieldCount); - - // print column names - List metas = LibTaos.GetMeta(res); - for (int i = 0; i < metas.Count; i++) - { - Console.Write(metas[i].name + "\t"); - } - Console.WriteLine(); - - // print values - List resData = LibTaos.GetData(res); - for (int i = 0; i < resData.Count; i++) - { - Console.Write($"|{resData[i].ToString()} \t"); - if (((i + 1) % metas.Count == 0)) + client.Exec("use power"); + string query = "SELECT * FROM meters"; + using (var rows = client.Query(query)) { - Console.WriteLine(""); + while (rows.Read()) + { + Console.WriteLine( + $"{((DateTime)rows.GetValue(0)):yyyy-MM-dd HH:mm:ss.fff}, {rows.GetValue(1)}, {rows.GetValue(2)}, {rows.GetValue(3)}, {rows.GetValue(4)}, {Encoding.UTF8.GetString((byte[])rows.GetValue(5))}"); + } } } - Console.WriteLine(); - - // Free result after use - TDengine.FreeResult(res); + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } } - finally - { - TDengine.Close(conn); - } - - } - static IntPtr GetConnection() - { - string host = "localhost"; - short port = 6030; - string username = "root"; - string password = "taosdata"; - string dbname = "power"; - var conn = TDengine.Connect(host, username, password, dbname, port); - if (conn == IntPtr.Zero) - { - throw new Exception("Connect to TDengine failed"); - } - else - { - Console.WriteLine("Connect to TDengine success"); - } - return conn; } } -} - -// output: -// Connect to TDengine success -// fieldCount=6 -// ts current voltage phase location groupid -// 1648432611249 10.3 219 0.31 California.SanFrancisco 2 -// 1648432611749 12.6 218 0.33 California.SanFrancisco 2 \ No newline at end of file +} \ No newline at end of file diff --git a/docs/examples/csharp/query/query.csproj b/docs/examples/csharp/query/query.csproj index 360d73b2c0..9924d331af 100644 --- a/docs/examples/csharp/query/query.csproj +++ b/docs/examples/csharp/query/query.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/examples/csharp/sqlInsert/Program.cs b/docs/examples/csharp/sqlInsert/Program.cs index 25a945a459..c3c700aba2 100644 --- a/docs/examples/csharp/sqlInsert/Program.cs +++ b/docs/examples/csharp/sqlInsert/Program.cs @@ -1,69 +1,47 @@ -using TDengineDriver; - +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; namespace TDengineExample { internal class SQLInsertExample { - static void Main() + public static void Main(string[] args) { - IntPtr conn = GetConnection(); - try + var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) { - IntPtr res = TDengine.Query(conn, "CREATE DATABASE power WAL_RETENTION_PERIOD 3600"); - CheckRes(conn, res, "failed to create database"); - res = TDengine.Query(conn, "USE power"); - CheckRes(conn, res, "failed to change database"); - res = TDengine.Query(conn, "CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (location BINARY(64), groupId INT)"); - CheckRes(conn, res, "failed to create stable"); - var sql = "INSERT INTO d1001 USING meters TAGS('California.SanFrancisco', 2) VALUES ('2018-10-03 14:38:05.000', 10.30000, 219, 0.31000) ('2018-10-03 14:38:15.000', 12.60000, 218, 0.33000) ('2018-10-03 14:38:16.800', 12.30000, 221, 0.31000) " + - "d1002 USING power.meters TAGS('California.SanFrancisco', 3) VALUES('2018-10-03 14:38:16.650', 10.30000, 218, 0.25000) " + - "d1003 USING power.meters TAGS('California.LosAngeles', 2) VALUES('2018-10-03 14:38:05.500', 11.80000, 221, 0.28000)('2018-10-03 14:38:16.600', 13.40000, 223, 0.29000) " + - "d1004 USING power.meters TAGS('California.LosAngeles', 3) VALUES('2018-10-03 14:38:05.000', 10.80000, 223, 0.29000)('2018-10-03 14:38:06.500', 11.50000, 221, 0.35000)"; - res = TDengine.Query(conn, sql); - CheckRes(conn, res, "failed to insert data"); - int affectedRows = TDengine.AffectRows(res); - Console.WriteLine("affectedRows " + affectedRows); - TDengine.FreeResult(res); - } - finally - { - TDengine.Close(conn); - } - - } - - static IntPtr GetConnection() - { - string host = "localhost"; - short port = 6030; - string username = "root"; - string password = "taosdata"; - string dbname = ""; - var conn = TDengine.Connect(host, username, password, dbname, port); - if (conn == IntPtr.Zero) - { - throw new Exception("Connect to TDengine failed"); - } - else - { - Console.WriteLine("Connect to TDengine success"); - } - return conn; - } - - static void CheckRes(IntPtr conn, IntPtr res, String errorMsg) - { - if (TDengine.ErrorNo(res) != 0) - { - throw new Exception($"{errorMsg} since: {TDengine.Error(res)}"); + try + { + client.Exec("create database power"); + client.Exec("CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"); + string insertQuery = + "INSERT INTO " + + "power.d1001 USING power.meters TAGS(2,'California.SanFrancisco') " + + "VALUES " + + "('2023-10-03 14:38:05.000', 10.30000, 219, 0.31000) " + + "('2023-10-03 14:38:15.000', 12.60000, 218, 0.33000) " + + "('2023-10-03 14:38:16.800', 12.30000, 221, 0.31000) " + + "power.d1002 USING power.meters TAGS(3, 'California.SanFrancisco') " + + "VALUES " + + "('2023-10-03 14:38:16.650', 10.30000, 218, 0.25000) " + + "power.d1003 USING power.meters TAGS(2,'California.LosAngeles') " + + "VALUES " + + "('2023-10-03 14:38:05.500', 11.80000, 221, 0.28000) " + + "('2023-10-03 14:38:16.600', 13.40000, 223, 0.29000) " + + "power.d1004 USING power.meters TAGS(3,'California.LosAngeles') " + + "VALUES " + + "('2023-10-03 14:38:05.000', 10.80000, 223, 0.29000) " + + "('2023-10-03 14:38:06.500', 11.50000, 221, 0.35000)"; + client.Exec(insertQuery); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } } } - } } - -// output: -// Connect to TDengine success -// affectedRows 8 diff --git a/docs/examples/csharp/sqlInsert/sqlinsert.csproj b/docs/examples/csharp/sqlInsert/sqlinsert.csproj index 1b6f745c82..aa8e1402ae 100644 --- a/docs/examples/csharp/sqlInsert/sqlinsert.csproj +++ b/docs/examples/csharp/sqlInsert/sqlinsert.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/examples/csharp/stmtInsert/Program.cs b/docs/examples/csharp/stmtInsert/Program.cs index 2e856a49bb..e6b11a63e4 100644 --- a/docs/examples/csharp/stmtInsert/Program.cs +++ b/docs/examples/csharp/stmtInsert/Program.cs @@ -1,109 +1,38 @@ -using TDengineDriver; +using TDengine.Driver; +using TDengine.Driver.Client; namespace TDengineExample { internal class StmtInsertExample { - private static IntPtr conn; - private static IntPtr stmt; - static void Main() + public static void Main(string[] args) { - conn = GetConnection(); - try + var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) { - PrepareSTable(); - // 1. init and prepare - stmt = TDengine.StmtInit(conn); - if (stmt == IntPtr.Zero) + try { - throw new Exception("failed to init stmt."); + client.Exec($"create database power"); + client.Exec( + "CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"); + using (var stmt = client.StmtInit()) + { + stmt.Prepare( + "Insert into power.d1001 using power.meters tags(2,'California.SanFrancisco') values(?,?,?,?)"); + var ts = new DateTime(2023, 10, 03, 14, 38, 05, 000); + stmt.BindRow(new object[] { ts, (float)10.30000, (int)219, (float)0.31000 }); + stmt.AddBatch(); + stmt.Exec(); + var affected = stmt.Affected(); + Console.WriteLine($"affected rows: {affected}"); + } } - int res = TDengine.StmtPrepare(stmt, "INSERT INTO ? USING meters TAGS(?, ?) VALUES(?, ?, ?, ?)"); - CheckStmtRes(res, "failed to prepare stmt"); - - // 2. bind table name and tags - TAOS_MULTI_BIND[] tags = new TAOS_MULTI_BIND[2] { TaosMultiBind.MultiBindBinary(new string[] { "California.SanFrancisco" }), TaosMultiBind.MultiBindInt(new int?[] { 2 }) }; - res = TDengine.StmtSetTbnameTags(stmt, "d1001", tags); - CheckStmtRes(res, "failed to bind table name and tags"); - - // 3. bind values - TAOS_MULTI_BIND[] values = new TAOS_MULTI_BIND[4] { - TaosMultiBind.MultiBindTimestamp(new long[2] { 1648432611249, 1648432611749}), - TaosMultiBind.MultiBindFloat(new float?[2] { 10.3f, 12.6f}), - TaosMultiBind.MultiBindInt(new int?[2] { 219, 218}), - TaosMultiBind.MultiBindFloat(new float?[2]{ 0.31f, 0.33f}) - }; - res = TDengine.StmtBindParamBatch(stmt, values); - CheckStmtRes(res, "failed to bind params"); - - // 4. add batch - res = TDengine.StmtAddBatch(stmt); - CheckStmtRes(res, "failed to add batch"); - - // 5. execute - res = TDengine.StmtExecute(stmt); - CheckStmtRes(res, "failed to execute"); - - // 6. free - TaosMultiBind.FreeTaosBind(tags); - TaosMultiBind.FreeTaosBind(values); - } - finally - { - TDengine.Close(conn); - } - - } - - static IntPtr GetConnection() - { - string host = "localhost"; - short port = 6030; - string username = "root"; - string password = "taosdata"; - string dbname = ""; - var conn = TDengine.Connect(host, username, password, dbname, port); - if (conn == IntPtr.Zero) - { - throw new Exception("Connect to TDengine failed"); - } - else - { - Console.WriteLine("Connect to TDengine success"); - } - return conn; - } - - static void PrepareSTable() - { - IntPtr res = TDengine.Query(conn, "CREATE DATABASE power WAL_RETENTION_PERIOD 3600"); - CheckResPtr(res, "failed to create database"); - res = TDengine.Query(conn, "USE power"); - CheckResPtr(res, "failed to change database"); - res = TDengine.Query(conn, "CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (location BINARY(64), groupId INT)"); - CheckResPtr(res, "failed to create stable"); - } - - static void CheckStmtRes(int res, string errorMsg) - { - if (res != 0) - { - Console.WriteLine(errorMsg + ", " + TDengine.StmtErrorStr(stmt)); - int code = TDengine.StmtClose(stmt); - if (code != 0) + catch (Exception e) { - throw new Exception($"failed to close stmt, {code} reason: {TDengine.StmtErrorStr(stmt)} "); + Console.WriteLine(e); + throw; } } } - - static void CheckResPtr(IntPtr res, string errorMsg) - { - if (TDengine.ErrorNo(res) != 0) - { - throw new Exception(errorMsg + " since:" + TDengine.Error(res)); - } - } - } -} +} \ No newline at end of file diff --git a/docs/examples/csharp/stmtInsert/stmtinsert.csproj b/docs/examples/csharp/stmtInsert/stmtinsert.csproj index f5b2b67397..9fa3109b80 100644 --- a/docs/examples/csharp/stmtInsert/stmtinsert.csproj +++ b/docs/examples/csharp/stmtInsert/stmtinsert.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/examples/csharp/subscribe/Program.cs b/docs/examples/csharp/subscribe/Program.cs index 1fba209f22..d7c1a52117 100644 --- a/docs/examples/csharp/subscribe/Program.cs +++ b/docs/examples/csharp/subscribe/Program.cs @@ -1,95 +1,72 @@ -using System; -using TDengineTMQ; -using TDengineDriver; -using System.Runtime.InteropServices; + +using TDengine.Driver; +using TDengine.Driver.Client; +using TDengine.TMQ; namespace TMQExample { internal class SubscribeDemo { - static void Main(string[] args) + public static void Main(string[] args) { - IntPtr conn = GetConnection(); - string topic = "topic_example"; - //create topic - IntPtr res = TDengine.Query(conn, $"create topic if not exists {topic} as select * from meters"); - - if (TDengine.ErrorNo(res) != 0 ) + var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) { - throw new Exception($"create topic failed, reason:{TDengine.Error(res)}"); - } - - var cfg = new ConsumerConfig - { - GourpId = "group_1", - TDConnectUser = "root", - TDConnectPasswd = "taosdata", - MsgWithTableName = "true", - TDConnectIp = "127.0.0.1", - }; - - // create consumer - var consumer = new ConsumerBuilder(cfg) - .Build(); - - // subscribe - consumer.Subscribe(topic); - - // consume - for (int i = 0; i < 5; i++) - { - var consumeRes = consumer.Consume(300); - // print consumeResult - foreach (KeyValuePair kv in consumeRes.Message) + try { - Console.WriteLine("topic partitions:\n{0}", kv.Key.ToString()); - - kv.Value.Metas.ForEach(meta => + client.Exec("CREATE DATABASE power"); + client.Exec("USE power"); + client.Exec( + "CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"); + client.Exec("CREATE TOPIC topic_meters as SELECT * from power.meters"); + var cfg = new Dictionary() { - Console.Write("{0} {1}({2}) \t|", meta.name, meta.TypeName(), meta.size); - }); - Console.WriteLine(""); - kv.Value.Datas.ForEach(data => + { "group.id", "group1" }, + { "auto.offset.reset", "latest" }, + { "td.connect.ip", "127.0.0.1" }, + { "td.connect.user", "root" }, + { "td.connect.pass", "taosdata" }, + { "td.connect.port", "6030" }, + { "client.id", "tmq_example" }, + { "enable.auto.commit", "true" }, + { "msg.with.table.name", "false" }, + }; + var consumer = new ConsumerBuilder>(cfg).Build(); + consumer.Subscribe(new List() { "topic_meters" }); + Task.Run(InsertData); + while (true) { - Console.WriteLine(data.ToString()); - }); + using (var cr = consumer.Consume(500)) + { + if (cr == null) continue; + foreach (var message in cr.Message) + { + Console.WriteLine( + $"message {{{((DateTime)message.Value["ts"]).ToString("yyyy-MM-dd HH:mm:ss.fff")}, " + + $"{message.Value["current"]}, {message.Value["voltage"]}, {message.Value["phase"]}}}"); + } + } + } + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; } - - consumer.Commit(consumeRes); - Console.WriteLine("\n================ {0} done ", i); - } - - // retrieve topic list - List topics = consumer.Subscription(); - topics.ForEach(t => Console.WriteLine("topic name:{0}", t)); - - // unsubscribe - consumer.Unsubscribe(); - - // close consumer after use.Otherwise will lead memory leak. - consumer.Close(); - TDengine.Close(conn); - } - static IntPtr GetConnection() + static void InsertData() { - string host = "localhost"; - short port = 6030; - string username = "root"; - string password = "taosdata"; - string dbname = "power"; - var conn = TDengine.Connect(host, username, password, dbname, port); - if (conn == IntPtr.Zero) + var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) { - throw new Exception("Connect to TDengine failed"); + while (true) + { + client.Exec("INSERT into power.d1001 using power.meters tags(2,'California.SanFrancisco') values(now,11.5,219,0.30)"); + Task.Delay(1000).Wait(); + } } - else - { - Console.WriteLine("Connect to TDengine success"); - } - return conn; } } diff --git a/docs/examples/csharp/subscribe/subscribe.csproj b/docs/examples/csharp/subscribe/subscribe.csproj index 191b3f9e9b..df6618d214 100644 --- a/docs/examples/csharp/subscribe/subscribe.csproj +++ b/docs/examples/csharp/subscribe/subscribe.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/examples/csharp/wsConnect/Program.cs b/docs/examples/csharp/wsConnect/Program.cs index a534bb8a65..edf0eb31e6 100644 --- a/docs/examples/csharp/wsConnect/Program.cs +++ b/docs/examples/csharp/wsConnect/Program.cs @@ -1,28 +1,18 @@ using System; -using TDengineWS.Impl; +using TDengine.Driver; +using TDengine.Driver.Client; namespace Examples { public class WSConnExample { - static int Main(string[] args) + static void Main(string[] args) { - string DSN = "ws://root:taosdata@127.0.0.1:6041/test"; - IntPtr wsConn = LibTaosWS.WSConnectWithDSN(DSN); - - if (wsConn == IntPtr.Zero) + var builder = new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) { - Console.WriteLine("get WS connection failed"); - return -1; + Console.WriteLine("connected"); } - else - { - Console.WriteLine("Establish connect success."); - // close connection. - LibTaosWS.WSClose(wsConn); - } - - return 0; } } } diff --git a/docs/examples/csharp/wsConnect/wsConnect.csproj b/docs/examples/csharp/wsConnect/wsConnect.csproj index c7988b6e9c..01ab149af5 100644 --- a/docs/examples/csharp/wsConnect/wsConnect.csproj +++ b/docs/examples/csharp/wsConnect/wsConnect.csproj @@ -6,7 +6,7 @@ - + diff --git a/docs/examples/csharp/wsInsert/Program.cs b/docs/examples/csharp/wsInsert/Program.cs index 7fa6af805c..73136477e7 100644 --- a/docs/examples/csharp/wsInsert/Program.cs +++ b/docs/examples/csharp/wsInsert/Program.cs @@ -1,61 +1,46 @@ using System; -using TDengineWS.Impl; +using TDengine.Driver; +using TDengine.Driver.Client; namespace Examples { public class WSInsertExample { - static int Main(string[] args) + public static void Main(string[] args) { - string DSN = "ws://root:taosdata@127.0.0.1:6041/test"; - IntPtr wsConn = LibTaosWS.WSConnectWithDSN(DSN); - - // Assert if connection is validate - if (wsConn == IntPtr.Zero) + var builder = new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) { - Console.WriteLine("get WS connection failed"); - return -1; - } - else - { - Console.WriteLine("Establish connect success."); - } - - string createTable = "CREATE STABLE test.meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupId int);"; - string insert = "INSERT INTO test.d1001 USING test.meters TAGS('California.SanFrancisco', 2) VALUES ('2018-10-03 14:38:05.000', 10.30000, 219, 0.31000) ('2018-10-03 14:38:15.000', 12.60000, 218, 0.33000) ('2018-10-03 14:38:16.800', 12.30000, 221, 0.31000)" + - "test.d1002 USING test.meters TAGS('California.SanFrancisco', 3) VALUES('2018-10-03 14:38:16.650', 10.30000, 218, 0.25000)" + - "test.d1003 USING test.meters TAGS('California.LosAngeles', 2) VALUES('2018-10-03 14:38:05.500', 11.80000, 221, 0.28000)('2018-10-03 14:38:16.600', 13.40000, 223, 0.29000) " + - "test.d1004 USING test.meters TAGS('California.LosAngeles', 3) VALUES('2018-10-03 14:38:05.000', 10.80000, 223, 0.29000)('2018-10-03 14:38:06.500', 11.50000, 221, 0.35000)"; - - IntPtr wsRes = LibTaosWS.WSQuery(wsConn, createTable); - ValidInsert("create table", wsRes); - LibTaosWS.WSFreeResult(wsRes); - - wsRes = LibTaosWS.WSQuery(wsConn, insert); - ValidInsert("insert data", wsRes); - LibTaosWS.WSFreeResult(wsRes); - - // close connection. - LibTaosWS.WSClose(wsConn); - - return 0; - } - - static void ValidInsert(string desc, IntPtr wsRes) - { - int code = LibTaosWS.WSErrorNo(wsRes); - if (code != 0) - { - Console.WriteLine($"execute SQL failed: reason: {LibTaosWS.WSErrorStr(wsRes)}, code:{code}"); - } - else - { - Console.WriteLine("{0} success affect {2} rows, cost {1} nanoseconds", desc, LibTaosWS.WSTakeTiming(wsRes), LibTaosWS.WSAffectRows(wsRes)); + try + { + client.Exec("create database power"); + client.Exec("CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"); + string insertQuery = + "INSERT INTO " + + "power.d1001 USING power.meters TAGS(2,'California.SanFrancisco') " + + "VALUES " + + "('2023-10-03 14:38:05.000', 10.30000, 219, 0.31000) " + + "('2023-10-03 14:38:15.000', 12.60000, 218, 0.33000) " + + "('2023-10-03 14:38:16.800', 12.30000, 221, 0.31000) " + + "power.d1002 USING power.meters TAGS(3, 'California.SanFrancisco') " + + "VALUES " + + "('2023-10-03 14:38:16.650', 10.30000, 218, 0.25000) " + + "power.d1003 USING power.meters TAGS(2,'California.LosAngeles') " + + "VALUES " + + "('2023-10-03 14:38:05.500', 11.80000, 221, 0.28000) " + + "('2023-10-03 14:38:16.600', 13.40000, 223, 0.29000) " + + "power.d1004 USING power.meters TAGS(3,'California.LosAngeles') " + + "VALUES " + + "('2023-10-03 14:38:05.000', 10.80000, 223, 0.29000) " + + "('2023-10-03 14:38:06.500', 11.50000, 221, 0.35000)"; + client.Exec(insertQuery); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } } } } - } -// Establish connect success. -// create table success affect 0 rows, cost 3717542 nanoseconds -// insert data success affect 8 rows, cost 2613637 nanoseconds diff --git a/docs/examples/csharp/wsInsert/wsInsert.csproj b/docs/examples/csharp/wsInsert/wsInsert.csproj index 5aa419b2c8..0459e8e38b 100644 --- a/docs/examples/csharp/wsInsert/wsInsert.csproj +++ b/docs/examples/csharp/wsInsert/wsInsert.csproj @@ -6,7 +6,7 @@ enable - + diff --git a/docs/examples/csharp/wsQuery/Program.cs b/docs/examples/csharp/wsQuery/Program.cs index 8ee900a05a..40aac24597 100644 --- a/docs/examples/csharp/wsQuery/Program.cs +++ b/docs/examples/csharp/wsQuery/Program.cs @@ -1,79 +1,36 @@ using System; -using TDengineWS.Impl; -using System.Collections.Generic; -using TDengineDriver; +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; namespace Examples { public class WSQueryExample { - static int Main(string[] args) + public static void Main(string[] args) { - string DSN = "ws://root:taosdata@127.0.0.1:6041/test"; - IntPtr wsConn = LibTaosWS.WSConnectWithDSN(DSN); - if (wsConn == IntPtr.Zero) + var builder = new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) { - Console.WriteLine("get WS connection failed"); - return -1; - } - else - { - Console.WriteLine("Establish connect success."); - } - - string select = "select * from test.meters"; - - // optional:wsRes = LibTaosWS.WSQuery(wsConn, select); - IntPtr wsRes = LibTaosWS.WSQueryTimeout(wsConn, select, 1); - // Assert if query execute success. - int code = LibTaosWS.WSErrorNo(wsRes); - if (code != 0) - { - Console.WriteLine($"execute SQL failed: reason: {LibTaosWS.WSErrorStr(wsRes)}, code:{code}"); - LibTaosWS.WSFreeResult(wsRes); - return -1; - } - - // get meta data - List metas = LibTaosWS.WSGetFields(wsRes); - // get retrieved data - List dataSet = LibTaosWS.WSGetData(wsRes); - - // do something with result. - foreach (var meta in metas) - { - Console.Write("{0} {1}({2}) \t|\t", meta.name, meta.TypeName(), meta.size); - } - Console.WriteLine(""); - - for (int i = 0; i < dataSet.Count;) - { - for (int j = 0; j < metas.Count; j++) + try { - Console.Write("{0}\t|\t", dataSet[i]); - i++; + client.Exec("use power"); + string query = "SELECT * FROM meters"; + using (var rows = client.Query(query)) + { + while (rows.Read()) + { + Console.WriteLine( + $"{((DateTime)rows.GetValue(0)):yyyy-MM-dd HH:mm:ss.fff}, {rows.GetValue(1)}, {rows.GetValue(2)}, {rows.GetValue(3)}, {rows.GetValue(4)}, {Encoding.UTF8.GetString((byte[])rows.GetValue(5))}"); + } + } + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; } - Console.WriteLine(""); } - - // Free result after use. - LibTaosWS.WSFreeResult(wsRes); - - // close connection. - LibTaosWS.WSClose(wsConn); - - return 0; } } -} - -// Establish connect success. -// ts TIMESTAMP(8) | current FLOAT(4) | voltage INT(4) | phase FLOAT(4) | location BINARY(64) | groupid INT(4) | -// 1538548685000 | 10.8 | 223 | 0.29 | California.LosAngeles | 3 | -// 1538548686500 | 11.5 | 221 | 0.35 | California.LosAngeles | 3 | -// 1538548685500 | 11.8 | 221 | 0.28 | California.LosAngeles | 2 | -// 1538548696600 | 13.4 | 223 | 0.29 | California.LosAngeles | 2 | -// 1538548685000 | 10.3 | 219 | 0.31 | California.SanFrancisco | 2 | -// 1538548695000 | 12.6 | 218 | 0.33 | California.SanFrancisco | 2 | -// 1538548696800 | 12.3 | 221 | 0.31 | California.SanFrancisco | 2 | -// 1538548696650 | 10.3 | 218 | 0.25 | California.SanFrancisco | 3 | +} \ No newline at end of file diff --git a/docs/examples/csharp/wsQuery/wsQuery.csproj b/docs/examples/csharp/wsQuery/wsQuery.csproj index bcc7c19a59..ff283947b4 100644 --- a/docs/examples/csharp/wsQuery/wsQuery.csproj +++ b/docs/examples/csharp/wsQuery/wsQuery.csproj @@ -7,7 +7,7 @@ - + diff --git a/docs/examples/csharp/wsStmt/Program.cs b/docs/examples/csharp/wsStmt/Program.cs index f8673357db..5166dfea92 100644 --- a/docs/examples/csharp/wsStmt/Program.cs +++ b/docs/examples/csharp/wsStmt/Program.cs @@ -1,98 +1,41 @@ using System; -using TDengineWS.Impl; -using TDengineDriver; -using System.Runtime.InteropServices; +using TDengine.Driver; +using TDengine.Driver.Client; namespace Examples { public class WSStmtExample { - static int Main(string[] args) + public static void Main(string[] args) { - const string DSN = "ws://root:taosdata@127.0.0.1:6041/test"; - const string table = "meters"; - const string database = "test"; - const string childTable = "d1005"; - string insert = $"insert into ? using {database}.{table} tags(?,?) values(?,?,?,?)"; - const int numOfTags = 2; - const int numOfColumns = 4; - - // Establish connection - IntPtr wsConn = LibTaosWS.WSConnectWithDSN(DSN); - if (wsConn == IntPtr.Zero) + var builder = + new ConnectionStringBuilder( + "protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) { - Console.WriteLine($"get WS connection failed"); - return -1; - } - else - { - Console.WriteLine("Establish connect success..."); - } - - // init stmt - IntPtr wsStmt = LibTaosWS.WSStmtInit(wsConn); - if (wsStmt != IntPtr.Zero) - { - int code = LibTaosWS.WSStmtPrepare(wsStmt, insert); - ValidStmtStep(code, wsStmt, "WSStmtPrepare"); - - TAOS_MULTI_BIND[] wsTags = new TAOS_MULTI_BIND[] { WSMultiBind.WSBindNchar(new string[] { "California.SanDiego" }), WSMultiBind.WSBindInt(new int?[] { 4 }) }; - code = LibTaosWS.WSStmtSetTbnameTags(wsStmt, $"{database}.{childTable}", wsTags, numOfTags); - ValidStmtStep(code, wsStmt, "WSStmtSetTbnameTags"); - - TAOS_MULTI_BIND[] data = new TAOS_MULTI_BIND[4]; - data[0] = WSMultiBind.WSBindTimestamp(new long[] { 1538548687000, 1538548688000, 1538548689000, 1538548690000, 1538548691000 }); - data[1] = WSMultiBind.WSBindFloat(new float?[] { 10.30F, 10.40F, 10.50F, 10.60F, 10.70F }); - data[2] = WSMultiBind.WSBindInt(new int?[] { 223, 221, 222, 220, 219 }); - data[3] = WSMultiBind.WSBindFloat(new float?[] { 0.31F, 0.32F, 0.33F, 0.35F, 0.28F }); - code = LibTaosWS.WSStmtBindParamBatch(wsStmt, data, numOfColumns); - ValidStmtStep(code, wsStmt, "WSStmtBindParamBatch"); - - code = LibTaosWS.WSStmtAddBatch(wsStmt); - ValidStmtStep(code, wsStmt, "WSStmtAddBatch"); - - IntPtr stmtAffectRowPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(Int32))); - code = LibTaosWS.WSStmtExecute(wsStmt, stmtAffectRowPtr); - ValidStmtStep(code, wsStmt, "WSStmtExecute"); - Console.WriteLine("WS STMT insert {0} rows...", Marshal.ReadInt32(stmtAffectRowPtr)); - Marshal.FreeHGlobal(stmtAffectRowPtr); - - LibTaosWS.WSStmtClose(wsStmt); - - // Free unmanaged memory - WSMultiBind.WSFreeTaosBind(wsTags); - WSMultiBind.WSFreeTaosBind(data); - - //check result with SQL "SELECT * FROM test.d1005;" - } - else - { - Console.WriteLine("Init STMT failed..."); - } - - // close connection. - LibTaosWS.WSClose(wsConn); - - return 0; - } - - static void ValidStmtStep(int code, IntPtr wsStmt, string desc) - { - if (code != 0) - { - Console.WriteLine($"{desc} failed,reason: {LibTaosWS.WSErrorStr(wsStmt)}, code: {code}"); - } - else - { - Console.WriteLine("{0} success...", desc); + try + { + client.Exec($"create database power"); + client.Exec( + "CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"); + using (var stmt = client.StmtInit()) + { + stmt.Prepare( + "Insert into power.d1001 using power.meters tags(2,'California.SanFrancisco') values(?,?,?,?)"); + var ts = new DateTime(2023, 10, 03, 14, 38, 05, 000); + stmt.BindRow(new object[] { ts, (float)10.30000, (int)219, (float)0.31000 }); + stmt.AddBatch(); + stmt.Exec(); + var affected = stmt.Affected(); + Console.WriteLine($"affected rows: {affected}"); + } + } + catch (Exception e) + { + Console.WriteLine(e); + throw; + } } } } -} - -// WSStmtPrepare success... -// WSStmtSetTbnameTags success... -// WSStmtBindParamBatch success... -// WSStmtAddBatch success... -// WSStmtExecute success... -// WS STMT insert 5 rows... +} \ No newline at end of file diff --git a/docs/examples/csharp/wsStmt/wsStmt.csproj b/docs/examples/csharp/wsStmt/wsStmt.csproj index bcc7c19a59..ff283947b4 100644 --- a/docs/examples/csharp/wsStmt/wsStmt.csproj +++ b/docs/examples/csharp/wsStmt/wsStmt.csproj @@ -7,7 +7,7 @@ - + diff --git a/docs/zh/07-develop/01-connect/index.md b/docs/zh/07-develop/01-connect/index.md index 83032067d9..9d954f78ce 100644 --- a/docs/zh/07-develop/01-connect/index.md +++ b/docs/zh/07-develop/01-connect/index.md @@ -176,7 +176,7 @@ npm install @tdengine/rest - + diff --git a/docs/zh/07-develop/04-query-data/_cs_async.mdx b/docs/zh/07-develop/04-query-data/_cs_async.mdx deleted file mode 100644 index 19c8e58f32..0000000000 --- a/docs/zh/07-develop/04-query-data/_cs_async.mdx +++ /dev/null @@ -1,3 +0,0 @@ -```csharp -{{#include docs/examples/csharp/asyncQuery/Program.cs}} -``` diff --git a/docs/zh/07-develop/04-query-data/index.mdx b/docs/zh/07-develop/04-query-data/index.mdx index d4d6d8192d..e892f9fc8d 100644 --- a/docs/zh/07-develop/04-query-data/index.mdx +++ b/docs/zh/07-develop/04-query-data/index.mdx @@ -16,7 +16,6 @@ import CQuery from "./_c.mdx"; import PhpQuery from "./_php.mdx"; import PyAsync from "./_py_async.mdx"; import NodeAsync from "./_js_async.mdx"; -import CsAsync from "./_cs_async.mdx"; import CAsync from "./_c_async.mdx"; ## 主要查询功能 @@ -175,9 +174,6 @@ Query OK, 6 rows in database (0.005515s) - - - diff --git a/docs/zh/07-develop/07-tmq.mdx b/docs/zh/07-develop/07-tmq.mdx index d3b27fedc3..f945f53b5c 100644 --- a/docs/zh/07-develop/07-tmq.mdx +++ b/docs/zh/07-develop/07-tmq.mdx @@ -248,23 +248,23 @@ function close() ```csharp +class ConsumerBuilder + ConsumerBuilder(IEnumerable> config) -virtual IConsumer Build() - -Consumer(ConsumerBuilder builder) +public IConsumer Build() void Subscribe(IEnumerable topics) void Subscribe(string topic) -ConsumeResult Consume(int millisecondsTimeout) +ConsumeResult Consume(int millisecondsTimeout) List Subscription() void Unsubscribe() -void Commit(ConsumeResult consumerResult) +List Commit() void Close() ``` @@ -501,25 +501,19 @@ let consumer = taos.consumer({ ```csharp -using TDengineTMQ; - -// 根据需要,设置消费组 (GourpId)、自动提交 (EnableAutoCommit)、 -// 自动提交时间间隔 (AutoCommitIntervalMs)、用户名 (TDConnectUser)、密码 (TDConnectPasswd) 等参数 -var cfg = new ConsumerConfig - { - EnableAutoCommit = "true" - AutoCommitIntervalMs = "1000" - GourpId = "TDengine-TMQ-C#", - TDConnectUser = "root", - TDConnectPasswd = "taosdata", - AutoOffsetReset = "latest" - MsgWithTableName = "true", - TDConnectIp = "127.0.0.1", - TDConnectPort = "6030" - }; - -var consumer = new ConsumerBuilder(cfg).Build(); - +var cfg = new Dictionary() +{ + { "group.id", "group1" }, + { "auto.offset.reset", "latest" }, + { "td.connect.ip", "127.0.0.1" }, + { "td.connect.user", "root" }, + { "td.connect.pass", "taosdata" }, + { "td.connect.port", "6030" }, + { "client.id", "tmq_example" }, + { "enable.auto.commit", "true" }, + { "msg.with.table.name", "false" }, +}; +var consumer = new ConsumerBuilder>(cfg).Build(); ``` @@ -748,10 +742,12 @@ while(true){ // 消费数据 while (true) { - var consumerRes = consumer.Consume(100); - // process ConsumeResult - ProcessMsg(consumerRes); - consumer.Commit(consumerRes); + using (var result = consumer.Consume(500)) + { + if (result == null) continue; + ProcessMsg(result); + consumer.Commit(); + } } ``` diff --git a/docs/zh/08-connector/40-csharp.mdx b/docs/zh/08-connector/40-csharp.mdx index 325c71da88..f88002d3dc 100644 --- a/docs/zh/08-connector/40-csharp.mdx +++ b/docs/zh/08-connector/40-csharp.mdx @@ -1,27 +1,22 @@ --- toc_max_heading_level: 4 sidebar_label: C# -title: C# Connector +title: TDengine C# Connector --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -import Preparation from "./_preparation.mdx" -import CSInsert from "../07-develop/03-insert-data/_cs_sql.mdx" -import CSInfluxLine from "../07-develop/03-insert-data/_cs_line.mdx" -import CSOpenTSDBTelnet from "../07-develop/03-insert-data/_cs_opts_telnet.mdx" -import CSOpenTSDBJson from "../07-develop/03-insert-data/_cs_opts_json.mdx" -import CSQuery from "../07-develop/04-query-data/_cs.mdx" -import CSAsyncQuery from "../07-develop/04-query-data/_cs_async.mdx" - `TDengine.Connector` 是 TDengine 提供的 C# 语言连接器。C# 开发人员可以通过它开发存取 TDengine 集群数据的 C# 应用软件。 -`TDengine.Connector` 连接器支持通过 TDengine 客户端驱动(taosc)建立与 TDengine 运行实例的连接,提供数据写入、查询、数据订阅、schemaless 数据写入、参数绑定接口数据写入等功能。 `TDengine.Connector` 自 v3.0.1 起还支持 WebSocket,通过 DSN 建立 WebSocket 连接,提供数据写入、查询、参数绑定接口数据写入等功能。 +`TDengine.Connector` 连接器支持通过 TDengine 客户端驱动(taosc)建立与 TDengine 运行实例的连接,提供数据写入、查询、数据订阅、schemaless 数据写入、参数绑定接口数据写入等功能。 `TDengine.Connector` 自 v3.0.1 起还支持 WebSocket 连接,提供数据写入、查询、参数绑定接口数据写入等功能。 本文介绍如何在 Linux 或 Windows 环境中安装 `TDengine.Connector`,并通过 `TDengine.Connector` 连接 TDengine 集群,进行数据写入、查询等基本操作。 -注意:`TDengine.Connector` 3.x 不兼容 TDengine 2.x,如果在运行 TDengine 2.x 版本的环境下需要使用 C# 连接器请使用 TDengine.Connector 的 1.x 版本 。 +:::warning +* `TDengine.Connector` 3.1.0 版本进行了完整的重构,不再兼容 3.0.2 及以前版本。3.0.2 文档请参考 [nuget](https://www.nuget.org/packages/TDengine.Connector/3.0.2) +* `TDengine.Connector` 3.x 不兼容 TDengine 2.x,如果在运行 TDengine 2.x 版本的环境下需要使用 C# 连接器请使用 TDengine.Connector 的 1.x 版本。 +::: `TDengine.Connector` 的源码托管在 [GitHub](https://github.com/taosdata/taos-connector-dotnet/tree/3.0)。 @@ -29,39 +24,43 @@ import CSAsyncQuery from "../07-develop/04-query-data/_cs_async.mdx" 支持的平台和 TDengine 客户端驱动支持的平台一致。 -:::note -注意 TDengine 不再支持 32 位 Windows 平台。 +:::warning +TDengine 不再支持 32 位 Windows 平台。 ::: ## 版本支持 -请参考[版本支持列表](../#版本支持) +| **Connector version** | **TDengine version** | +|-----------------------|----------------------| +| 3.1.0 | 3.2.1.0/3.1.1.18 | -## 支持的功能特性 +## 处理异常 - +`TDengine.Connector` 会抛出异常,应用程序需要处理异常。taosc 异常类型 `TDengineError`,包含错误码和错误信息,应用程序可以根据错误码和错误信息进行处理。 - +## TDengine DataType 和 C# DataType -1. 连接管理 -2. 普通查询 -3. 连续查询 -4. 参数绑定 -5. 数据订阅(TMQ) -6. Schemaless - - +| TDengine DataType | C# Type | +|-------------------|------------------| +| TIMESTAMP | DateTime | +| TINYINT | sbyte | +| SMALLINT | short | +| INT | int | +| BIGINT | long | +| TINYINT UNSIGNED | byte | +| SMALLINT UNSIGNED | ushort | +| INT UNSIGNED | uint | +| BIGINT UNSIGNED | ulong | +| FLOAT | float | +| DOUBLE | double | +| BOOL | bool | +| BINARY | byte[] | +| NCHAR | string (utf-8编码) | +| JSON | byte[] | - - -1. 连接管理 -2. 普通查询 -3. 连续查询 -4. 参数绑定 - - - - +:::note +JSON 类型仅在 tag 中支持。 +::: ## 安装步骤 @@ -71,10 +70,7 @@ import CSAsyncQuery from "../07-develop/04-query-data/_cs_async.mdx" * [Nuget 客户端](https://docs.microsoft.com/en-us/nuget/install-nuget-client-tools) (可选安装) * 安装 TDengine 客户端驱动,具体步骤请参考[安装客户端驱动](../#安装客户端驱动) -### 安装 TDengine.Connector - - - +### 安装连接器 可以在当前 .NET 项目的路径下,通过 dotnet CLI 添加 Nuget package `TDengine.Connector` 到当前项目。 @@ -86,234 +82,1109 @@ dotnet add package TDengine.Connector ``` XML - + ``` - - - - -需要修改目标项目的 `.csproj` 项目文件,将 `.nupkg` 中的 `runtimes` 目录中的动态库复制到当前项目的 `$(OutDir)` 目录下。 - -```XML - - - - - - - - - -``` - -注意:`TDengine.Connector` 自 version>= 3.0.2 的 nuget package 中才会有动态库( taosws.dll,libtaows.so )。 - - - - ## 建立连接 - - + -使用 host、username、password、port 等信息建立连接。 - ``` csharp -using TDengineDriver; - -namespace TDengineExample +var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); +using (var client = DbDriver.Open(builder)) { + Console.WriteLine("connected"); +} +``` - internal class EstablishConnection + + + +```csharp +var builder = new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); +using (var client = DbDriver.Open(builder)) +{ + Console.WriteLine("connected"); +} +``` + + + +ConnectionStringBuilder 支持的参数如下: +* protocol: 连接协议,可选值为 Native 或 WebSocket,默认为 Native +* host: TDengine 或 taosadapter 运行实例的地址 +* port: TDengine 或 taosadapter 运行实例的端口 + * 当 protocol 为 WebSocket 时 useSSL 为 false 时,port 默认为 6041 + * 当 protocol 为 WebSocket 时 useSSL 为 true 时,port 默认为 443 +* useSSL: 是否使用 SSL 连接,仅当 protocol 为 WebSocket 时有效,默认为 false +* token: 连接 TDengine cloud 的 token,仅当 protocol 为 WebSocket 时有效 +* username: 连接 TDengine 的用户名 +* password: 连接 TDengine 的密码 +* db: 连接 TDengine 的数据库 +* timezone: 解析时间结果的时区,默认为 `TimeZoneInfo.Local`,使用 `TimeZoneInfo.FindSystemTimeZoneById` 方法解析字符串为 `TimeZoneInfo` 对象。 +* connTimeout: WebSocket 连接超时时间,仅当 protocol 为 WebSocket 时有效,默认为 1 分钟,使用 `TimeSpan.Parse` 方法解析字符串为 `TimeSpan` 对象。 +* readTimeout: WebSocket 读超时时间,仅当 protocol 为 WebSocket 时有效,默认为 5 分钟,使用 `TimeSpan.Parse` 方法解析字符串为 `TimeSpan` 对象。 +* writeTimeout: WebSocket 写超时时间,仅当 protocol 为 WebSocket 时有效,默认为 10 秒,使用 `TimeSpan.Parse` 方法解析字符串为 `TimeSpan` 对象。 + +### 指定 URL 和 Properties 获取连接 + +C# 连接器不支持此功能 + +### 配置参数的优先级 + +C# 连接器不支持此功能 + +## 使用示例 + +### 创建数据库和表 + + + + +```csharp +using System; +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace NativeQuery +{ + internal class Query { - static void Main(String[] args) + public static void Main(string[] args) { - string host = "localhost"; - short port = 6030; - string username = "root"; - string password = "taosdata"; - string dbname = ""; - - var conn = TDengine.Connect(host, username, password, dbname, port); - if (conn == IntPtr.Zero) + var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) { - Console.WriteLine("Connect to TDengine failed"); + try + { + client.Exec("create database power"); + client.Exec("CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } } - else - { - Console.WriteLine("Connect to TDengine success"); - } - TDengine.Close(conn); - TDengine.Cleanup(); } } } ``` + - +```csharp +using System; +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; -使用 DSN 建立 WebSocket 连接 DSN 连接。 描述字符串基本结构如下: - -```text -[]://[[:@]:][/][?=[&=]] -|------------|---|-----------|-----------|------|------|------------|-----------------------| -| protocol | | username | password | host | port | database | params | -``` - -各部分意义见下表: - -* **protocol**: 显示指定以何种方式建立连接,例如:`ws://localhost:6041` 指定以 Websocket 方式建立连接(支持 http/ws )。 - -* **username/password**: 用于创建连接的用户名及密码(默认 `root/taosdata` )。 - -* **host/port**: 指定创建连接的服务器及端口,WebSocket 连接默认为 `localhost:6041` 。 - -* **database**: 指定默认连接的数据库名,可选参数。 - -* **params**:其他可选参数。 - -``` csharp -{{#include docs/examples/csharp/wsConnect/Program.cs}} +namespace WSQuery +{ + internal class Query + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec("create database power"); + client.Exec("CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + } +} ``` -## 使用示例 - -### 写入数据 - -#### SQL 写入 - - +### 插入数据 + - +```csharp +using System; +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace NativeQuery +{ + internal class Query + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + string insertQuery = + "INSERT INTO " + + "power.d1001 USING power.meters TAGS(2,'California.SanFrancisco') " + + "VALUES " + + "('2023-10-03 14:38:05.000', 10.30000, 219, 0.31000) " + + "('2023-10-03 14:38:15.000', 12.60000, 218, 0.33000) " + + "('2023-10-03 14:38:16.800', 12.30000, 221, 0.31000) " + + "power.d1002 USING power.meters TAGS(3, 'California.SanFrancisco') " + + "VALUES " + + "('2023-10-03 14:38:16.650', 10.30000, 218, 0.25000) " + + "power.d1003 USING power.meters TAGS(2,'California.LosAngeles') " + + "VALUES " + + "('2023-10-03 14:38:05.500', 11.80000, 221, 0.28000) " + + "('2023-10-03 14:38:16.600', 13.40000, 223, 0.29000) " + + "power.d1004 USING power.meters TAGS(3,'California.LosAngeles') " + + "VALUES " + + "('2023-10-03 14:38:05.000', 10.80000, 223, 0.29000) " + + "('2023-10-03 14:38:06.500', 11.50000, 221, 0.35000)"; + client.Exec(insertQuery); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + } +} +``` - - + ```csharp -{{#include docs/examples/csharp/wsInsert/Program.cs}} +using System; +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace WSQuery +{ + internal class Query + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + string insertQuery = + "INSERT INTO " + + "power.d1001 USING power.meters TAGS(2,'California.SanFrancisco') " + + "VALUES " + + "('2023-10-03 14:38:05.000', 10.30000, 219, 0.31000) " + + "('2023-10-03 14:38:15.000', 12.60000, 218, 0.33000) " + + "('2023-10-03 14:38:16.800', 12.30000, 221, 0.31000) " + + "power.d1002 USING power.meters TAGS(3, 'California.SanFrancisco') " + + "VALUES " + + "('2023-10-03 14:38:16.650', 10.30000, 218, 0.25000) " + + "power.d1003 USING power.meters TAGS(2,'California.LosAngeles') " + + "VALUES " + + "('2023-10-03 14:38:05.500', 11.80000, 221, 0.28000) " + + "('2023-10-03 14:38:16.600', 13.40000, 223, 0.29000) " + + "power.d1004 USING power.meters TAGS(3,'California.LosAngeles') " + + "VALUES " + + "('2023-10-03 14:38:05.000', 10.80000, 223, 0.29000) " + + "('2023-10-03 14:38:06.500', 11.50000, 221, 0.35000)"; + client.Exec(insertQuery); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + } +} ``` - - - -#### InfluxDB 行协议写入 - - - -#### OpenTSDB Telnet 行协议写入 - - - -#### OpenTSDB JSON 行协议写入 - - - -#### 参数绑定 - - - - - -``` csharp -{{#include docs/examples/csharp/stmtInsert/Program.cs}} -``` - - - - - -```csharp -{{#include docs/examples/csharp/wsStmt/Program.cs}} -``` - - - ### 查询数据 -#### 同步查询 - - - + - - - - - - ```csharp -{{#include docs/examples/csharp/wsQuery/Program.cs}} +using System; +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace NativeQuery +{ + internal class Query + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec("use power"); + string query = "SELECT * FROM meters"; + using (var rows = client.Query(query)) + { + while (rows.Read()) + { + Console.WriteLine($"{((DateTime)rows.GetValue(0)):yyyy-MM-dd HH:mm:ss.fff}, {rows.GetValue(1)}, {rows.GetValue(2)}, {rows.GetValue(3)}, {rows.GetValue(4)}, {Encoding.UTF8.GetString((byte[])rows.GetValue(5))}"); + } + } + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + } +} ``` + +```csharp +using System; +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace WSQuery +{ + internal class Query + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec("use power"); + string query = "SELECT * FROM meters"; + using (var rows = client.Query(query)) + { + while (rows.Read()) + { + Console.WriteLine($"{((DateTime)rows.GetValue(0)):yyyy-MM-dd HH:mm:ss.fff}, {rows.GetValue(1)}, {rows.GetValue(2)}, {rows.GetValue(3)}, {rows.GetValue(4)}, {Encoding.UTF8.GetString((byte[])rows.GetValue(5))}"); + } + } + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + } +} +``` + + -#### 异步查询 +### 执行带有 reqId 的 SQL - + + + +```csharp +using System; +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace NativeQueryWithReqID +{ + internal abstract class QueryWithReqID + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec($"create database if not exists test_db",ReqId.GetReqId()); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + } +} +``` + + + + +```csharp +using System; +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace WSQueryWithReqID +{ + internal abstract class QueryWithReqID + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec($"create database if not exists test_db",ReqId.GetReqId()); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + } +} +``` + + + + +### 通过参数绑定写入数据 + + + + +```csharp +using System; +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace NativeStmt +{ + internal abstract class NativeStmt + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec("create database power"); + client.Exec( + "CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"); + using (var stmt = client.StmtInit()) + { + stmt.Prepare( + "Insert into power.d1001 using power.meters tags(2,'California.SanFrancisco') values(?,?,?,?)"); + var ts = new DateTime(2023, 10, 03, 14, 38, 05, 000); + stmt.BindRow(new object[] { ts, (float)10.30000, (int)219, (float)0.31000 }); + stmt.AddBatch(); + stmt.Exec(); + var affected = stmt.Affected(); + Console.WriteLine($"affected rows: {affected}"); + } + } + catch (Exception e) + { + Console.WriteLine(e); + throw; + } + } + } + } +} +``` + + + + +```csharp +using System; +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace WSStmt +{ + internal abstract class WSStmt + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec("create database power"); + client.Exec( + "CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"); + using (var stmt = client.StmtInit()) + { + stmt.Prepare( + "Insert into power.d1001 using power.meters tags(2,'California.SanFrancisco') values(?,?,?,?)"); + var ts = new DateTime(2023, 10, 03, 14, 38, 05, 000); + stmt.BindRow(new object[] { ts, (float)10.30000, (int)219, (float)0.31000 }); + stmt.AddBatch(); + stmt.Exec(); + var affected = stmt.Affected(); + Console.WriteLine($"affected rows: {affected}"); + } + } + catch (Exception e) + { + Console.WriteLine(e); + throw; + } + } + } + } +} +``` + + + + +注意:使用 BindRow 需要注意原始 C# 列类型与 TDengine 列类型的需要一一对应,具体对应关系请参考 [TDengine DataType 和 C# DataType](#tdengine-datatype-和-c-datatype)。 + +### 无模式写入 + + + + +```csharp +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace NativeSchemaless +{ + internal class Program + { + public static void Main(string[] args) + { + var builder = + new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + client.Exec("create database sml"); + client.Exec("use sml"); + var influxDBData = + "st,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000"; + client.SchemalessInsert(new string[] { influxDBData }, + TDengineSchemalessProtocol.TSDB_SML_LINE_PROTOCOL, + TDengineSchemalessPrecision.TSDB_SML_TIMESTAMP_NANO_SECONDS, 0, ReqId.GetReqId()); + var telnetData = "stb0_0 1626006833 4 host=host0 interface=eth0"; + client.SchemalessInsert(new string[] { telnetData }, + TDengineSchemalessProtocol.TSDB_SML_TELNET_PROTOCOL, + TDengineSchemalessPrecision.TSDB_SML_TIMESTAMP_MILLI_SECONDS, 0, ReqId.GetReqId()); + var jsonData = + "{\"metric\": \"meter_current\",\"timestamp\": 1626846400,\"value\": 10.3, \"tags\": {\"groupid\": 2, \"location\": \"California.SanFrancisco\", \"id\": \"d1001\"}}"; + client.SchemalessInsert(new string[] { jsonData }, TDengineSchemalessProtocol.TSDB_SML_JSON_PROTOCOL, + TDengineSchemalessPrecision.TSDB_SML_TIMESTAMP_MILLI_SECONDS, 0, ReqId.GetReqId()); + } + } + } +} +``` + + + + +```csharp +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace WSSchemaless +{ + internal class Program + { + public static void Main(string[] args) + { + var builder = + new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + client.Exec("create database sml"); + client.Exec("use sml"); + var influxDBData = + "st,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000"; + client.SchemalessInsert(new string[] { influxDBData }, + TDengineSchemalessProtocol.TSDB_SML_LINE_PROTOCOL, + TDengineSchemalessPrecision.TSDB_SML_TIMESTAMP_NANO_SECONDS, 0, ReqId.GetReqId()); + var telnetData = "stb0_0 1626006833 4 host=host0 interface=eth0"; + client.SchemalessInsert(new string[] { telnetData }, + TDengineSchemalessProtocol.TSDB_SML_TELNET_PROTOCOL, + TDengineSchemalessPrecision.TSDB_SML_TIMESTAMP_MILLI_SECONDS, 0, ReqId.GetReqId()); + var jsonData = + "{\"metric\": \"meter_current\",\"timestamp\": 1626846400,\"value\": 10.3, \"tags\": {\"groupid\": 2, \"location\": \"California.SanFrancisco\", \"id\": \"d1001\"}}"; + client.SchemalessInsert(new string[] { jsonData }, TDengineSchemalessProtocol.TSDB_SML_JSON_PROTOCOL, + TDengineSchemalessPrecision.TSDB_SML_TIMESTAMP_MILLI_SECONDS, 0, ReqId.GetReqId()); + } + } + } +} +``` + + + + +### 执行带有 reqId 的无模式写入 + +```csharp +public void SchemalessInsert(string[] lines, TDengineSchemalessProtocol protocol, + TDengineSchemalessPrecision precision, + int ttl, long reqId) +``` + +### 数据订阅 + +#### 创建 Topic + + + + +```csharp +using System; +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace NativeSubscription +{ + internal class Program + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec("create database power"); + client.Exec("CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"); + client.Exec("CREATE TOPIC topic_meters as SELECT * from power.meters"); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + } +} +``` + + + + +```csharp +using System; +using System.Text; +using TDengine.Driver; +using TDengine.Driver.Client; + +namespace WSSubscription +{ + internal class Program + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec("create database power"); + client.Exec("CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"); + client.Exec("CREATE TOPIC topic_meters as SELECT * from power.meters"); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + } +} +``` + + + + +#### 创建 Consumer + + + + +```csharp +var cfg = new Dictionary() +{ + { "group.id", "group1" }, + { "auto.offset.reset", "latest" }, + { "td.connect.ip", "127.0.0.1" }, + { "td.connect.user", "root" }, + { "td.connect.pass", "taosdata" }, + { "td.connect.port", "6030" }, + { "client.id", "tmq_example" }, + { "enable.auto.commit", "true" }, + { "msg.with.table.name", "false" }, +}; +var consumer = new ConsumerBuilder>(cfg).Build(); +``` + + + + +```csharp +var cfg = new Dictionary() +{ + { "td.connect.type", "WebSocket" }, + { "group.id", "group1" }, + { "auto.offset.reset", "latest" }, + { "td.connect.ip", "localhost" }, + { "td.connect.port", "6041" }, + { "useSSL", "false" }, + { "td.connect.user", "root" }, + { "td.connect.pass", "taosdata" }, + { "client.id", "tmq_example" }, + { "enable.auto.commit", "true" }, + { "msg.with.table.name", "false" }, +}; +var consumer = new ConsumerBuilder>(cfg).Build(); +``` + + + + +consumer 支持的配置参数如下: +* td.connect.type: 连接类型,可选值为 Native 或 WebSocket,默认为 Native +* td.connect.ip: TDengine 或 taosadapter 运行实例的地址 +* td.connect.port: TDengine 或 taosadapter 运行实例的端口 + * 当 td.connect.type 为 WebSocket 且 useSSL 为 false 时,td.connect.port 默认为 6041 + * 当 td.connect.type 为 WebSocket 且 useSSL 为 true 时,td.connect.port 默认为 443 +* useSSL: 是否使用 SSL 连接,仅当 td.connect.type 为 WebSocket 时有效,默认为 false +* token: 连接 TDengine cloud 的 token,仅当 td.connect.type 为 WebSocket 时有效 + +* td.connect.user: 连接 TDengine 的用户名 +* td.connect.pass: 连接 TDengine 的密码 +* group.id: 消费者组 ID +* client.id: 消费者 ID +* enable.auto.commit: 是否自动提交 offset,默认为 true +* auto.commit.interval.ms: 自动提交 offset 的间隔时间,默认为 5000 毫秒 +* auto.offset.reset: 当 offset 不存在时,从哪里开始消费,可选值为 earliest 或 latest,默认为 latest +* msg.with.table.name: 消息是否包含表名 + + +支持订阅结果集 `Dictionary` key 为列名,value 为列值。 + +如果使用 object 接收列值,需要注意: +* 原始 C# 列类型与 TDengine 列类型的需要一一对应,具体对应关系请参考 [TDengine DataType 和 C# DataType](#tdengine-datatype-和-c-datatype)。 +* 列名与 class 属性名一致,并可读写。 +* 明确设置 value 解析器`ConsumerBuilder.SetValueDeserializer(new ReferenceDeserializer());` + +样例如下 + +结果 class + +```csharp + class Result + { + public DateTime ts { get; set; } + public float current { get; set; } + public int voltage { get; set; } + public float phase { get; set; } + } +``` + +设置解析器 + +```csharp +var tmqBuilder = new ConsumerBuilder(cfg); +tmqBuilder.SetValueDeserializer(new ReferenceDeserializer()); +var consumer = tmqBuilder.Build(); +``` + +也可实现自定义解析器,实现 `IDeserializer` 接口并通过`ConsumerBuilder.SetValueDeserializer`方法传入。 + +```csharp + public interface IDeserializer + { + T Deserialize(ITMQRows data, bool isNull, SerializationContext context); + } +``` + +#### 订阅消费数据 + +```csharp +consumer.Subscribe(new List() { "topic_meters" }); +while (true) +{ + using (var cr = consumer.Consume(500)) + { + if (cr == null) continue; + foreach (var message in cr.Message) + { + Console.WriteLine( + $"message {{{((DateTime)message.Value["ts"]).ToString("yyyy-MM-dd HH:mm:ss.fff")}, " + + $"{message.Value["current"]}, {message.Value["voltage"]}, {message.Value["phase"]}}}"); + } + } +} +``` + +#### 指定订阅 Offset + +```csharp +consumer.Assignment.ForEach(a => +{ + Console.WriteLine($"{a}, seek to 0"); + consumer.Seek(new TopicPartitionOffset(a.Topic, a.Partition, 0)); + Thread.Sleep(TimeSpan.FromSeconds(1)); +}); +``` + +#### 提交 Offset + +```csharp +public void Commit(ConsumeResult consumerResult) +public List Commit() +public void Commit(IEnumerable offsets) +``` + +#### 关闭订阅 + +```csharp +consumer.Unsubscribe(); +consumer.Close(); +``` + +#### 完整示例 + + + + +```csharp +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using TDengine.Driver; +using TDengine.Driver.Client; +using TDengine.TMQ; + +namespace NativeSubscription +{ + internal class Program + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec("CREATE DATABASE power"); + client.Exec("USE power"); + client.Exec( + "CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"); + client.Exec("CREATE TOPIC topic_meters as SELECT * from power.meters"); + var cfg = new Dictionary() + { + { "group.id", "group1" }, + { "auto.offset.reset", "latest" }, + { "td.connect.ip", "127.0.0.1" }, + { "td.connect.user", "root" }, + { "td.connect.pass", "taosdata" }, + { "td.connect.port", "6030" }, + { "client.id", "tmq_example" }, + { "enable.auto.commit", "true" }, + { "msg.with.table.name", "false" }, + }; + var consumer = new ConsumerBuilder>(cfg).Build(); + consumer.Subscribe(new List() { "topic_meters" }); + Task.Run(InsertData); + while (true) + { + using (var cr = consumer.Consume(500)) + { + if (cr == null) continue; + foreach (var message in cr.Message) + { + Console.WriteLine( + $"message {{{((DateTime)message.Value["ts"]).ToString("yyyy-MM-dd HH:mm:ss.fff")}, " + + $"{message.Value["current"]}, {message.Value["voltage"]}, {message.Value["phase"]}}}"); + } + consumer.Commit(); + } + } + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + + static void InsertData() + { + var builder = new ConnectionStringBuilder("host=localhost;port=6030;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + while (true) + { + client.Exec("INSERT into power.d1001 using power.meters tags(2,'California.SanFrancisco') values(now,11.5,219,0.30)"); + Task.Delay(1000).Wait(); + } + } + } + } +} +``` + + + + +```csharp +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using TDengine.Driver; +using TDengine.Driver.Client; +using TDengine.TMQ; + +namespace WSSubscription +{ + internal class Program + { + public static void Main(string[] args) + { + var builder = new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + try + { + client.Exec("CREATE DATABASE power"); + client.Exec("USE power"); + client.Exec( + "CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"); + client.Exec("CREATE TOPIC topic_meters as SELECT * from power.meters"); + var cfg = new Dictionary() + { + { "td.connect.type", "WebSocket" }, + { "group.id", "group1" }, + { "auto.offset.reset", "latest" }, + { "td.connect.ip", "localhost" }, + { "td.connect.port", "6041" }, + { "useSSL", "false" }, + { "td.connect.user", "root" }, + { "td.connect.pass", "taosdata" }, + { "client.id", "tmq_example" }, + { "enable.auto.commit", "true" }, + { "msg.with.table.name", "false" }, + }; + var consumer = new ConsumerBuilder>(cfg).Build(); + consumer.Subscribe(new List() { "topic_meters" }); + Task.Run(InsertData); + while (true) + { + using (var cr = consumer.Consume(500)) + { + if (cr == null) continue; + foreach (var message in cr.Message) + { + Console.WriteLine( + $"message {{{((DateTime)message.Value["ts"]).ToString("yyyy-MM-dd HH:mm:ss.fff")}, " + + $"{message.Value["current"]}, {message.Value["voltage"]}, {message.Value["phase"]}}}"); + } + consumer.Commit(); + } + } + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + throw; + } + } + } + + static void InsertData() + { + var builder = new ConnectionStringBuilder("protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"); + using (var client = DbDriver.Open(builder)) + { + while (true) + { + client.Exec("INSERT into power.d1001 using power.meters tags(2,'California.SanFrancisco') values(now,11.5,219,0.30)"); + Task.Delay(1000).Wait(); + } + } + } + } +} +``` + + + + +### ADO.NET + +C# 连接器支持 ADO.NET 接口,可以通过 ADO.NET 接口连接 TDengine 运行实例,进行数据写入、查询等操作。 + + + + +```csharp +using System; +using TDengine.Data.Client; + +namespace NativeADO +{ + internal class Program + { + public static void Main(string[] args) + { + const string connectionString = "host=localhost;port=6030;username=root;password=taosdata"; + using (var connection = new TDengineConnection(connectionString)) + { + try + { + connection.Open(); + using (var command = new TDengineCommand(connection)) + { + command.CommandText = "create database power"; + command.ExecuteNonQuery(); + connection.ChangeDatabase("power"); + command.CommandText = + "CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"; + command.ExecuteNonQuery(); + command.CommandText = "INSERT INTO " + + "power.d1001 USING power.meters TAGS(2,'California.SanFrancisco') " + + "VALUES " + + "(?,?,?,?)"; + var parameters = command.Parameters; + parameters.Add(new TDengineParameter("@0", new DateTime(2023,10,03,14,38,05,000))); + parameters.Add(new TDengineParameter("@1", (float)10.30000)); + parameters.Add(new TDengineParameter("@2", (int)219)); + parameters.Add(new TDengineParameter("@3", (float)0.31000)); + command.ExecuteNonQuery(); + command.Parameters.Clear(); + command.CommandText = "SELECT * FROM meters"; + using (var reader = command.ExecuteReader()) + { + while (reader.Read()) + { + Console.WriteLine( + $"{((DateTime) reader.GetValue(0)):yyyy-MM-dd HH:mm:ss.fff}, {reader.GetValue(1)}, {reader.GetValue(2)}, {reader.GetValue(3)}, {reader.GetValue(4)}, {System.Text.Encoding.UTF8.GetString((byte[]) reader.GetValue(5))}"); + } + } + } + } + catch (Exception e) + { + Console.WriteLine(e); + throw; + } + } + } + } +} +``` + + + + +```csharp +using System; +using TDengine.Data.Client; + +namespace WSADO +{ + internal class Program + { + public static void Main(string[] args) + { + const string connectionString = "protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata"; + using (var connection = new TDengineConnection(connectionString)) + { + try + { + connection.Open(); + using (var command = new TDengineCommand(connection)) + { + command.CommandText = "create database power"; + command.ExecuteNonQuery(); + connection.ChangeDatabase("power"); + command.CommandText = + "CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (groupId INT, location BINARY(24))"; + command.ExecuteNonQuery(); + command.CommandText = "INSERT INTO " + + "power.d1001 USING power.meters TAGS(2,'California.SanFrancisco') " + + "VALUES " + + "(?,?,?,?)"; + var parameters = command.Parameters; + parameters.Add(new TDengineParameter("@0", new DateTime(2023,10,03,14,38,05,000))); + parameters.Add(new TDengineParameter("@1", (float)10.30000)); + parameters.Add(new TDengineParameter("@2", (int)219)); + parameters.Add(new TDengineParameter("@3", (float)0.31000)); + command.ExecuteNonQuery(); + command.Parameters.Clear(); + command.CommandText = "SELECT * FROM meters"; + using (var reader = command.ExecuteReader()) + { + while (reader.Read()) + { + Console.WriteLine( + $"{((DateTime) reader.GetValue(0)):yyyy-MM-dd HH:mm:ss.fff}, {reader.GetValue(1)}, {reader.GetValue(2)}, {reader.GetValue(3)}, {reader.GetValue(4)}, {System.Text.Encoding.UTF8.GetString((byte[]) reader.GetValue(5))}"); + } + } + } + } + catch (Exception e) + { + Console.WriteLine(e); + throw; + } + } + } + } +} +``` + + + + +* 连接参数与[建立连接](#建立连接)中的连接参数一致。 +* TDengineParameter 的 name 需要以 @ 开头,如 @0、@1、@2 等,value 需要 C# 列类型与 TDengine 列类型一一对应,具体对应关系请参考 [TDengine DataType 和 C# DataType](#tdengine-datatype-和-c-datatype)。 ### 更多示例程序 -|示例程序 | 示例程序描述 | -|--------------------------------------------------------------------------------------------------------------------|--------------------------------------------| -| [CURD](https://github.com/taosdata/taos-connector-dotnet/blob/3.0/examples/NET6Examples/Query/Query.cs) | 使用 TDengine.Connector 实现的建表、插入、查询示例 | -| [JSON Tag](https://github.com/taosdata/taos-connector-dotnet/blob/3.0/examples/NET6Examples/JSONTag) | 使用 TDengine.Connector 实现的写入和查询 JSON tag 类型数据的示例 | -| [stmt](https://github.com/taosdata/taos-connector-dotnet/tree/3.0/examples/NET6Examples/Stmt) | 使用 TDengine.Connector 实现的参数绑定插入和查询的示例 | -| [schemaless](https://github.com/taosdata/taos-connector-dotnet/blob/3.0/examples/NET6Examples/schemaless) | 使用 TDengine.Connector 实现的使用 schemaless 写入的示例 | -| [async query](https://github.com/taosdata/taos-connector-dotnet/blob/3.0/examples/NET6Examples/AsyncQuery/QueryAsync.cs) | 使用 TDengine.Connector 实现的异步查询的示例 | -| [数据订阅(TMQ)](https://github.com/taosdata/taos-connector-dotnet/blob/3.0/examples/NET6Examples/TMQ/TMQ.cs) | 使用 TDengine.Connector 实现的订阅数据的示例 | -| [Basic WebSocket Usage](https://github.com/taosdata/taos-connector-dotnet/blob/3.0/examples/FrameWork45/WS/WebSocketSample.cs) | 使用 TDengine.Connector 的 WebSocket 基本的示例 | -| [Basic WebSocket STMT](https://github.com/taosdata/taos-connector-dotnet/blob/3.0/examples/FrameWork45/WS/WebSocketSTMT.cs) | 使用 TDengine.Connector 的 WebSocket STMT 基本的示例 | - -## 重要更新记录 - -| TDengine.Connector | 说明 | -|--------------------|--------------------------------| -| 3.0.2 | 支持 .NET Framework 4.5 及以上,支持 .NET standard 2.0。Nuget Package 包含 WebSocket 动态库。 | -| 3.0.1 | 支持 WebSocket 和 Cloud,查询,插入,参数绑定。 | -| 3.0.0 | 支持 TDengine 3.0.0.0,不兼容 2.x。新增接口TDengine.Impl.GetData(),解析查询结果。 | -| 1.0.7 | 修复 TDengine.Query()内存泄露。 | -| 1.0.6 | 修复 schemaless 在 1.0.4 和 1.0.5 中失效 bug。 | -| 1.0.5 | 修复 Windows 同步查询中文报错 bug。 | -| 1.0.4 | 新增异步查询,订阅等功能。修复绑定参数 bug。 | -| 1.0.3 | 新增参数绑定、schemaless、 json tag等功能。 | -| 1.0.2 | 新增连接管理、同步查询、错误信息等功能。 | - -## 其他说明 - -### 第三方驱动 - -[`IoTSharp.Data.Taos`](https://github.com/IoTSharp/EntityFrameworkCore.Taos) 是一个 TDengine 的 ADO.NET 连接器,其中包含了用于EntityFrameworkCore 的提供程序 IoTSharp.EntityFrameworkCore.Taos 和健康检查组件 IoTSharp.HealthChecks.Taos ,支持 Linux,Windows 平台。该连接器由社区贡献者`麦壳饼@@maikebing` 提供,具体请参考: - -* 接口下载: -* 用法说明: - -## 常见问题 - -1. "Unable to establish connection","Unable to resolve FQDN" - - 一般是因为 FQDN 配置不正确。可以参考[如何彻底搞懂 TDengine 的 FQDN](https://www.taosdata.com/blog/2021/07/29/2741.html)解决。 - -2. Unhandled exception. System.DllNotFoundException: Unable to load DLL 'taos' or one of its dependencies: 找不到指定的模块。 - - 一般是因为程序没有找到依赖的客户端驱动。解决方法为:Windows 下可以将 `C:\TDengine\driver\taos.dll` 拷贝到 `C:\Windows\System32\ ` 目录下,Linux 下建立如下软链接 `ln -s /usr/local/taos/driver/libtaos.so.x.x.x.x /usr/lib/libtaos.so` 即可。 - -## API 参考 - -[API 参考](https://docs.taosdata.com/api/connector-csharp/html/860d2ac1-dd52-39c9-e460-0829c4e5a40b.htm) +[示例程序](https://github.com/taosdata/taos-connector-dotnet/tree/3.0/examples) \ No newline at end of file diff --git a/include/common/systable.h b/include/common/systable.h index b44d8ce1d6..92e7915424 100644 --- a/include/common/systable.h +++ b/include/common/systable.h @@ -50,6 +50,8 @@ extern "C" { #define TSDB_INS_TABLE_STREAM_TASKS "ins_stream_tasks" #define TSDB_INS_TABLE_USER_PRIVILEGES "ins_user_privileges" #define TSDB_INS_TABLE_VIEWS "ins_views" +#define TSDB_INS_TABLE_COMPACTS "ins_compacts" +#define TSDB_INS_TABLE_COMPACT_DETAILS "ins_compact_details" #define TSDB_PERFORMANCE_SCHEMA_DB "performance_schema" #define TSDB_PERFS_TABLE_SMAS "perf_smas" diff --git a/include/common/tglobal.h b/include/common/tglobal.h index 91f8bbc7f3..887f4cb6dc 100644 --- a/include/common/tglobal.h +++ b/include/common/tglobal.h @@ -196,6 +196,7 @@ extern int64_t tsWalFsyncDataSizeLimit; // internal extern int32_t tsTransPullupInterval; +extern int32_t tsCompactPullupInterval; extern int32_t tsMqRebalanceInterval; extern int32_t tsStreamCheckpointInterval; extern float tsSinkDataRate; @@ -214,6 +215,7 @@ extern int32_t tsMaxStreamBackendCache; extern int32_t tsPQSortMemThreshold; extern int32_t tsResolveFQDNRetryTime; +extern bool tsExperimental; // #define NEEDTO_COMPRESSS_MSG(size) (tsCompressMsgSize != -1 && (size) > tsCompressMsgSize) int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDir, const char **envCmd, diff --git a/include/common/tmsg.h b/include/common/tmsg.h index aff1bd55e4..48e014975a 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -144,6 +144,8 @@ typedef enum _mgmt_table { TSDB_MGMT_TABLE_STREAM_TASKS, TSDB_MGMT_TABLE_PRIVILEGES, TSDB_MGMT_TABLE_VIEWS, + TSDB_MGMT_TABLE_COMPACT, + TSDB_MGMT_TABLE_COMPACT_DETAIL, TSDB_MGMT_TABLE_MAX, } EShowType; @@ -307,6 +309,7 @@ typedef enum ENodeType { QUERY_NODE_KILL_CONNECTION_STMT, QUERY_NODE_KILL_QUERY_STMT, QUERY_NODE_KILL_TRANSACTION_STMT, + QUERY_NODE_KILL_COMPACT_STMT, QUERY_NODE_DELETE_STMT, QUERY_NODE_INSERT_STMT, QUERY_NODE_QUERY, @@ -353,6 +356,8 @@ typedef enum ENodeType { QUERY_NODE_SHOW_VNODES_STMT, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT, QUERY_NODE_SHOW_VIEWS_STMT, + QUERY_NODE_SHOW_COMPACTS_STMT, + QUERY_NODE_SHOW_COMPACT_DETAILS_STMT, // logic plan node QUERY_NODE_LOGIC_PLAN_SCAN = 1000, @@ -1384,6 +1389,24 @@ int32_t tSerializeSCompactDbReq(void* buf, int32_t bufLen, SCompactDbReq* pReq); int32_t tDeserializeSCompactDbReq(void* buf, int32_t bufLen, SCompactDbReq* pReq); void tFreeSCompactDbReq(SCompactDbReq* pReq); +typedef struct { + int32_t compactId; + int8_t bAccepted; +} SCompactDbRsp; + +int32_t tSerializeSCompactDbRsp(void* buf, int32_t bufLen, SCompactDbRsp* pRsp); +int32_t tDeserializeSCompactDbRsp(void* buf, int32_t bufLen, SCompactDbRsp* pRsp); + +typedef struct { + int32_t compactId; + int32_t sqlLen; + char* sql; +} SKillCompactReq; + +int32_t tSerializeSKillCompactReq(void* buf, int32_t bufLen, SKillCompactReq* pReq); +int32_t tDeserializeSKillCompactReq(void* buf, int32_t bufLen, SKillCompactReq* pReq); +void tFreeSKillCompactReq(SKillCompactReq *pReq); + typedef struct { char name[TSDB_FUNC_NAME_LEN]; int8_t igExists; @@ -1662,6 +1685,26 @@ int32_t tSerializeSCreateVnodeReq(void* buf, int32_t bufLen, SCreateVnodeReq* pR int32_t tDeserializeSCreateVnodeReq(void* buf, int32_t bufLen, SCreateVnodeReq* pReq); int32_t tFreeSCreateVnodeReq(SCreateVnodeReq* pReq); +typedef struct { + int32_t compactId; + int32_t vgId; + int32_t dnodeId; +} SQueryCompactProgressReq; + +int32_t tSerializeSQueryCompactProgressReq(void* buf, int32_t bufLen, SQueryCompactProgressReq* pReq); +int32_t tDeserializeSQueryCompactProgressReq(void* buf, int32_t bufLen, SQueryCompactProgressReq* pReq); + +typedef struct { + int32_t compactId; + int32_t vgId; + int32_t dnodeId; + int32_t numberFileset; + int32_t finished; +} SQueryCompactProgressRsp; + +int32_t tSerializeSQueryCompactProgressRsp(void* buf, int32_t bufLen, SQueryCompactProgressRsp* pReq); +int32_t tDeserializeSQueryCompactProgressRsp(void* buf, int32_t bufLen, SQueryCompactProgressRsp* pReq); + typedef struct { int32_t vgId; int32_t dnodeId; @@ -1689,11 +1732,21 @@ typedef struct { char db[TSDB_DB_FNAME_LEN]; int64_t compactStartTime; STimeWindow tw; + int32_t compactId; } SCompactVnodeReq; int32_t tSerializeSCompactVnodeReq(void* buf, int32_t bufLen, SCompactVnodeReq* pReq); int32_t tDeserializeSCompactVnodeReq(void* buf, int32_t bufLen, SCompactVnodeReq* pReq); +typedef struct { + int32_t compactId; + int32_t vgId; + int32_t dnodeId; +} SVKillCompactReq; + +int32_t tSerializeSVKillCompactReq(void* buf, int32_t bufLen, SVKillCompactReq* pReq); +int32_t tDeserializeSVKillCompactReq(void* buf, int32_t bufLen, SVKillCompactReq* pReq); + typedef struct { int32_t vgVersion; int32_t buffer; @@ -1889,8 +1942,9 @@ typedef struct { char db[TSDB_DB_FNAME_LEN]; char tb[TSDB_TABLE_NAME_LEN]; char user[TSDB_USER_LEN]; - char filterTb[TSDB_TABLE_NAME_LEN]; + char filterTb[TSDB_TABLE_NAME_LEN]; // for ins_columns int64_t showId; + int64_t compactId; // for compact } SRetrieveTableReq; typedef struct SSysTableSchema { diff --git a/include/common/tmsgdef.h b/include/common/tmsgdef.h index a2f9a5c475..5ad66c64e7 100644 --- a/include/common/tmsgdef.h +++ b/include/common/tmsgdef.h @@ -217,6 +217,8 @@ TD_DEF_MSG_TYPE(TDMT_MND_CREATE_VIEW, "create-view", SCMCreateViewReq, NULL) TD_DEF_MSG_TYPE(TDMT_MND_DROP_VIEW, "drop-view", SCMDropViewReq, NULL) TD_DEF_MSG_TYPE(TDMT_MND_VIEW_META, "view-meta", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_MND_KILL_COMPACT, "kill-compact", SKillCompactReq, NULL) + TD_DEF_MSG_TYPE(TDMT_MND_COMPACT_TIMER, "compact-tmr", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_MAX_MSG, "mnd-max", NULL, NULL) TD_CLOSE_MSG_SEG(TDMT_END_MND_MSG) @@ -256,7 +258,7 @@ TD_DEF_MSG_TYPE(TDMT_VND_EXEC_RSMA, "vnode-exec-rsma", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_DELETE, "delete-data", SVDeleteReq, SVDeleteRsp) TD_DEF_MSG_TYPE(TDMT_VND_BATCH_DEL, "batch-delete", SBatchDeleteReq, NULL) -TD_DEF_MSG_TYPE(TDMT_VND_ALTER_CONFIG, "alter-config", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_VND_ALTER_CONFIG, "alter-config", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_ALTER_REPLICA, "alter-replica", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_ALTER_CONFIRM, "alter-confirm", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_ALTER_HASHRANGE, "alter-hashrange", NULL, NULL) @@ -267,6 +269,8 @@ TD_DEF_MSG_TYPE(TDMT_VND_ALTER_CONFIG, "alter-config", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_CREATE_INDEX, "vnode-create-index", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_DROP_INDEX, "vnode-drop-index", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_DISABLE_WRITE, "vnode-disable-write", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_VND_QUERY_COMPACT_PROGRESS, "vnode-query-compact-progress", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_VND_KILL_COMPACT, "kill-compact", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_MAX_MSG, "vnd-max", NULL, NULL) TD_CLOSE_MSG_SEG(TDMT_END_VND_MSG) diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index cb080ab118..bdee3934fe 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -189,184 +189,180 @@ #define TK_ALIVE 170 #define TK_VIEWS 171 #define TK_VIEW 172 -#define TK_NORMAL 173 -#define TK_CHILD 174 -#define TK_LIKE 175 -#define TK_TBNAME 176 -#define TK_QTAGS 177 -#define TK_AS 178 -#define TK_SYSTEM 179 -#define TK_INDEX 180 -#define TK_FUNCTION 181 -#define TK_INTERVAL 182 -#define TK_COUNT 183 -#define TK_LAST_ROW 184 -#define TK_META 185 -#define TK_ONLY 186 -#define TK_TOPIC 187 -#define TK_CONSUMER 188 -#define TK_GROUP 189 -#define TK_DESC 190 -#define TK_DESCRIBE 191 -#define TK_RESET 192 -#define TK_QUERY 193 -#define TK_CACHE 194 -#define TK_EXPLAIN 195 -#define TK_ANALYZE 196 -#define TK_VERBOSE 197 -#define TK_NK_BOOL 198 -#define TK_RATIO 199 -#define TK_NK_FLOAT 200 -#define TK_OUTPUTTYPE 201 -#define TK_AGGREGATE 202 -#define TK_BUFSIZE 203 -#define TK_LANGUAGE 204 -#define TK_REPLACE 205 -#define TK_STREAM 206 -#define TK_INTO 207 -#define TK_PAUSE 208 -#define TK_RESUME 209 -#define TK_TRIGGER 210 -#define TK_AT_ONCE 211 -#define TK_WINDOW_CLOSE 212 -#define TK_IGNORE 213 -#define TK_EXPIRED 214 -#define TK_FILL_HISTORY 215 -#define TK_UPDATE 216 -#define TK_SUBTABLE 217 -#define TK_UNTREATED 218 -#define TK_KILL 219 -#define TK_CONNECTION 220 -#define TK_TRANSACTION 221 -#define TK_BALANCE 222 -#define TK_VGROUP 223 -#define TK_LEADER 224 -#define TK_MERGE 225 -#define TK_REDISTRIBUTE 226 -#define TK_SPLIT 227 -#define TK_DELETE 228 -#define TK_INSERT 229 -#define TK_NULL 230 -#define TK_NK_QUESTION 231 -#define TK_NK_ALIAS 232 -#define TK_NK_ARROW 233 -#define TK_ROWTS 234 -#define TK_QSTART 235 -#define TK_QEND 236 -#define TK_QDURATION 237 -#define TK_WSTART 238 -#define TK_WEND 239 -#define TK_WDURATION 240 -#define TK_IROWTS 241 -#define TK_ISFILLED 242 -#define TK_CAST 243 -#define TK_NOW 244 -#define TK_TODAY 245 -#define TK_TIMEZONE 246 -#define TK_CLIENT_VERSION 247 -#define TK_SERVER_VERSION 248 -#define TK_SERVER_STATUS 249 -#define TK_CURRENT_USER 250 -#define TK_CASE 251 -#define TK_WHEN 252 -#define TK_THEN 253 -#define TK_ELSE 254 -#define TK_BETWEEN 255 -#define TK_IS 256 -#define TK_NK_LT 257 -#define TK_NK_GT 258 -#define TK_NK_LE 259 -#define TK_NK_GE 260 -#define TK_NK_NE 261 -#define TK_MATCH 262 -#define TK_NMATCH 263 -#define TK_CONTAINS 264 -#define TK_IN 265 -#define TK_JOIN 266 -#define TK_INNER 267 -#define TK_SELECT 268 -#define TK_NK_HINT 269 -#define TK_DISTINCT 270 -#define TK_WHERE 271 -#define TK_PARTITION 272 -#define TK_BY 273 -#define TK_SESSION 274 -#define TK_STATE_WINDOW 275 -#define TK_EVENT_WINDOW 276 -#define TK_SLIDING 277 -#define TK_FILL 278 -#define TK_VALUE 279 -#define TK_VALUE_F 280 -#define TK_NONE 281 -#define TK_PREV 282 -#define TK_NULL_F 283 -#define TK_LINEAR 284 -#define TK_NEXT 285 -#define TK_HAVING 286 -#define TK_RANGE 287 -#define TK_EVERY 288 -#define TK_ORDER 289 -#define TK_SLIMIT 290 -#define TK_SOFFSET 291 -#define TK_LIMIT 292 -#define TK_OFFSET 293 -#define TK_ASC 294 -#define TK_NULLS 295 -#define TK_ABORT 296 -#define TK_AFTER 297 -#define TK_ATTACH 298 -#define TK_BEFORE 299 -#define TK_BEGIN 300 -#define TK_BITAND 301 -#define TK_BITNOT 302 -#define TK_BITOR 303 -#define TK_BLOCKS 304 -#define TK_CHANGE 305 -#define TK_COMMA 306 -#define TK_CONCAT 307 -#define TK_CONFLICT 308 -#define TK_COPY 309 -#define TK_DEFERRED 310 -#define TK_DELIMITERS 311 -#define TK_DETACH 312 -#define TK_DIVIDE 313 -#define TK_DOT 314 -#define TK_EACH 315 -#define TK_FAIL 316 -#define TK_FILE 317 -#define TK_FOR 318 -#define TK_GLOB 319 -#define TK_ID 320 -#define TK_IMMEDIATE 321 -#define TK_IMPORT 322 -#define TK_INITIALLY 323 -#define TK_INSTEAD 324 -#define TK_ISNULL 325 -#define TK_KEY 326 -#define TK_MODULES 327 -#define TK_NK_BITNOT 328 -#define TK_NK_SEMI 329 -#define TK_NOTNULL 330 -#define TK_OF 331 -#define TK_PLUS 332 -#define TK_PRIVILEGE 333 -#define TK_RAISE 334 -#define TK_RESTRICT 335 -#define TK_ROW 336 -#define TK_SEMI 337 -#define TK_STAR 338 -#define TK_STATEMENT 339 -#define TK_STRICT 340 -#define TK_STRING 341 -#define TK_TIMES 342 -#define TK_VALUES 343 -#define TK_VARIABLE 344 -#define TK_WAL 345 - - - - - +#define TK_COMPACTS 173 +#define TK_NORMAL 174 +#define TK_CHILD 175 +#define TK_LIKE 176 +#define TK_TBNAME 177 +#define TK_QTAGS 178 +#define TK_AS 179 +#define TK_SYSTEM 180 +#define TK_INDEX 181 +#define TK_FUNCTION 182 +#define TK_INTERVAL 183 +#define TK_COUNT 184 +#define TK_LAST_ROW 185 +#define TK_META 186 +#define TK_ONLY 187 +#define TK_TOPIC 188 +#define TK_CONSUMER 189 +#define TK_GROUP 190 +#define TK_DESC 191 +#define TK_DESCRIBE 192 +#define TK_RESET 193 +#define TK_QUERY 194 +#define TK_CACHE 195 +#define TK_EXPLAIN 196 +#define TK_ANALYZE 197 +#define TK_VERBOSE 198 +#define TK_NK_BOOL 199 +#define TK_RATIO 200 +#define TK_NK_FLOAT 201 +#define TK_OUTPUTTYPE 202 +#define TK_AGGREGATE 203 +#define TK_BUFSIZE 204 +#define TK_LANGUAGE 205 +#define TK_REPLACE 206 +#define TK_STREAM 207 +#define TK_INTO 208 +#define TK_PAUSE 209 +#define TK_RESUME 210 +#define TK_TRIGGER 211 +#define TK_AT_ONCE 212 +#define TK_WINDOW_CLOSE 213 +#define TK_IGNORE 214 +#define TK_EXPIRED 215 +#define TK_FILL_HISTORY 216 +#define TK_UPDATE 217 +#define TK_SUBTABLE 218 +#define TK_UNTREATED 219 +#define TK_KILL 220 +#define TK_CONNECTION 221 +#define TK_TRANSACTION 222 +#define TK_BALANCE 223 +#define TK_VGROUP 224 +#define TK_LEADER 225 +#define TK_MERGE 226 +#define TK_REDISTRIBUTE 227 +#define TK_SPLIT 228 +#define TK_DELETE 229 +#define TK_INSERT 230 +#define TK_NULL 231 +#define TK_NK_QUESTION 232 +#define TK_NK_ALIAS 233 +#define TK_NK_ARROW 234 +#define TK_ROWTS 235 +#define TK_QSTART 236 +#define TK_QEND 237 +#define TK_QDURATION 238 +#define TK_WSTART 239 +#define TK_WEND 240 +#define TK_WDURATION 241 +#define TK_IROWTS 242 +#define TK_ISFILLED 243 +#define TK_CAST 244 +#define TK_NOW 245 +#define TK_TODAY 246 +#define TK_TIMEZONE 247 +#define TK_CLIENT_VERSION 248 +#define TK_SERVER_VERSION 249 +#define TK_SERVER_STATUS 250 +#define TK_CURRENT_USER 251 +#define TK_CASE 252 +#define TK_WHEN 253 +#define TK_THEN 254 +#define TK_ELSE 255 +#define TK_BETWEEN 256 +#define TK_IS 257 +#define TK_NK_LT 258 +#define TK_NK_GT 259 +#define TK_NK_LE 260 +#define TK_NK_GE 261 +#define TK_NK_NE 262 +#define TK_MATCH 263 +#define TK_NMATCH 264 +#define TK_CONTAINS 265 +#define TK_IN 266 +#define TK_JOIN 267 +#define TK_INNER 268 +#define TK_SELECT 269 +#define TK_NK_HINT 270 +#define TK_DISTINCT 271 +#define TK_WHERE 272 +#define TK_PARTITION 273 +#define TK_BY 274 +#define TK_SESSION 275 +#define TK_STATE_WINDOW 276 +#define TK_EVENT_WINDOW 277 +#define TK_SLIDING 278 +#define TK_FILL 279 +#define TK_VALUE 280 +#define TK_VALUE_F 281 +#define TK_NONE 282 +#define TK_PREV 283 +#define TK_NULL_F 284 +#define TK_LINEAR 285 +#define TK_NEXT 286 +#define TK_HAVING 287 +#define TK_RANGE 288 +#define TK_EVERY 289 +#define TK_ORDER 290 +#define TK_SLIMIT 291 +#define TK_SOFFSET 292 +#define TK_LIMIT 293 +#define TK_OFFSET 294 +#define TK_ASC 295 +#define TK_NULLS 296 +#define TK_ABORT 297 +#define TK_AFTER 298 +#define TK_ATTACH 299 +#define TK_BEFORE 300 +#define TK_BEGIN 301 +#define TK_BITAND 302 +#define TK_BITNOT 303 +#define TK_BITOR 304 +#define TK_BLOCKS 305 +#define TK_CHANGE 306 +#define TK_COMMA 307 +#define TK_CONCAT 308 +#define TK_CONFLICT 309 +#define TK_COPY 310 +#define TK_DEFERRED 311 +#define TK_DELIMITERS 312 +#define TK_DETACH 313 +#define TK_DIVIDE 314 +#define TK_DOT 315 +#define TK_EACH 316 +#define TK_FAIL 317 +#define TK_FILE 318 +#define TK_FOR 319 +#define TK_GLOB 320 +#define TK_ID 321 +#define TK_IMMEDIATE 322 +#define TK_IMPORT 323 +#define TK_INITIALLY 324 +#define TK_INSTEAD 325 +#define TK_ISNULL 326 +#define TK_KEY 327 +#define TK_MODULES 328 +#define TK_NK_BITNOT 329 +#define TK_NK_SEMI 330 +#define TK_NOTNULL 331 +#define TK_OF 332 +#define TK_PLUS 333 +#define TK_PRIVILEGE 334 +#define TK_RAISE 335 +#define TK_RESTRICT 336 +#define TK_ROW 337 +#define TK_SEMI 338 +#define TK_STAR 339 +#define TK_STATEMENT 340 +#define TK_STRICT 341 +#define TK_STRING 342 +#define TK_TIMES 343 +#define TK_VALUES 344 +#define TK_VARIABLE 345 +#define TK_WAL 346 #define TK_NK_SPACE 600 #define TK_NK_COMMENT 601 diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index ac4f5bea0e..6aa1796963 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -46,6 +46,10 @@ extern "C" { #define SHOW_LOCAL_VARIABLES_RESULT_FIELD2_LEN (TSDB_CONFIG_VALUE_LEN + VARSTR_HEADER_SIZE) #define SHOW_LOCAL_VARIABLES_RESULT_FIELD3_LEN (TSDB_CONFIG_SCOPE_LEN + VARSTR_HEADER_SIZE) +#define COMPACT_DB_RESULT_COLS 3 +#define COMPACT_DB_RESULT_FIELD1_LEN 32 +#define COMPACT_DB_RESULT_FIELD3_LEN 128 + #define SHOW_ALIVE_RESULT_COLS 1 #define BIT_FLAG_MASK(n) (1 << n) @@ -335,6 +339,15 @@ typedef struct SShowTableTagsStmt { SNodeList* pTags; } SShowTableTagsStmt; +typedef struct SShowCompactsStmt { + ENodeType type; +} SShowCompactsStmt; + +typedef struct SShowCompactDetailsStmt { + ENodeType type; + SNode* pCompactId; +} SShowCompactDetailsStmt; + typedef enum EIndexType { INDEX_TYPE_SMA = 1, INDEX_TYPE_FULLTEXT, INDEX_TYPE_NORMAL } EIndexType; typedef struct SIndexOptions { diff --git a/include/libs/stream/tstream.h b/include/libs/stream/tstream.h index 8f3e100db6..f6737b4e27 100644 --- a/include/libs/stream/tstream.h +++ b/include/libs/stream/tstream.h @@ -509,11 +509,8 @@ typedef struct SStreamMeta { SArray* chkpSaved; SArray* chkpInUse; SRWLatch chkpDirLock; - - void* qHandle; - int32_t pauseTaskNum; - - void* bkdChkptMgt; + void* qHandle; + void* bkdChkptMgt; } SStreamMeta; int32_t tEncodeStreamEpInfo(SEncoder* pEncoder, const SStreamChildEpInfo* pInfo); @@ -840,11 +837,10 @@ int32_t streamMetaUnregisterTask(SStreamMeta* pMeta, int64_t streamId, int3 int32_t streamMetaGetNumOfTasks(SStreamMeta* pMeta); SStreamTask* streamMetaAcquireTask(SStreamMeta* pMeta, int64_t streamId, int32_t taskId); void streamMetaReleaseTask(SStreamMeta* pMeta, SStreamTask* pTask); -int32_t streamMetaReopen(SStreamMeta* pMeta); +void streamMetaClear(SStreamMeta* pMeta); void streamMetaInitBackend(SStreamMeta* pMeta); int32_t streamMetaCommit(SStreamMeta* pMeta); int32_t streamMetaLoadAllTasks(SStreamMeta* pMeta); -int32_t streamMetaReloadAllTasks(SStreamMeta* pMeta); int64_t streamMetaGetLatestCheckpointId(SStreamMeta* pMeta); void streamMetaNotifyClose(SStreamMeta* pMeta); int32_t streamTaskSetDb(SStreamMeta* pMeta, void* pTask, char* key); diff --git a/source/client/src/clientMsgHandler.c b/source/client/src/clientMsgHandler.c index 5b0b59cc2c..e0cedb9924 100644 --- a/source/client/src/clientMsgHandler.c +++ b/source/client/src/clientMsgHandler.c @@ -16,6 +16,7 @@ #include "catalog.h" #include "clientInt.h" #include "clientLog.h" +#include "cmdnodes.h" #include "os.h" #include "query.h" #include "systable.h" @@ -542,6 +543,118 @@ int32_t processShowVariablesRsp(void* param, SDataBuf* pMsg, int32_t code) { return code; } +static int32_t buildCompactDbBlock(SCompactDbRsp* pRsp, SSDataBlock** block) { + SSDataBlock* pBlock = taosMemoryCalloc(1, sizeof(SSDataBlock)); + pBlock->info.hasVarCol = true; + + pBlock->pDataBlock = taosArrayInit(COMPACT_DB_RESULT_COLS, sizeof(SColumnInfoData)); + + SColumnInfoData infoData = {0}; + infoData.info.type = TSDB_DATA_TYPE_VARCHAR; + infoData.info.bytes = COMPACT_DB_RESULT_FIELD1_LEN; + taosArrayPush(pBlock->pDataBlock, &infoData); + + infoData.info.type = TSDB_DATA_TYPE_INT; + infoData.info.bytes = tDataTypes[TSDB_DATA_TYPE_INT].bytes; + taosArrayPush(pBlock->pDataBlock, &infoData); + + infoData.info.type = TSDB_DATA_TYPE_VARCHAR; + infoData.info.bytes = COMPACT_DB_RESULT_FIELD3_LEN; + taosArrayPush(pBlock->pDataBlock, &infoData); + + blockDataEnsureCapacity(pBlock, 1); + + SColumnInfoData* pResultCol = taosArrayGet(pBlock->pDataBlock, 0); + SColumnInfoData* pIdCol = taosArrayGet(pBlock->pDataBlock, 1); + SColumnInfoData* pReasonCol = taosArrayGet(pBlock->pDataBlock, 2); + char result[COMPACT_DB_RESULT_FIELD1_LEN] = {0}; + char reason[COMPACT_DB_RESULT_FIELD3_LEN] = {0}; + if (pRsp->bAccepted) { + STR_TO_VARSTR(result, "accepted"); + colDataSetVal(pResultCol, 0, result, false); + colDataSetVal(pIdCol, 0, (void*)&pRsp->compactId, false); + STR_TO_VARSTR(reason, "success"); + colDataSetVal(pReasonCol, 0, reason, false); + } else { + STR_TO_VARSTR(result, "rejected"); + colDataSetVal(pResultCol, 0, result, false); + colDataSetNULL(pIdCol, 0); + STR_TO_VARSTR(reason, "compaction is ongoing"); + colDataSetVal(pReasonCol, 0, reason, false); + } + pBlock->info.rows = 1; + + *block = pBlock; + + return TSDB_CODE_SUCCESS; +} + +static int32_t buildRetriveTableRspForCompactDb(SCompactDbRsp* pCompactDb, SRetrieveTableRsp** pRsp) { + SSDataBlock* pBlock = NULL; + int32_t code = buildCompactDbBlock(pCompactDb, &pBlock); + if (code) { + return code; + } + + size_t rspSize = sizeof(SRetrieveTableRsp) + blockGetEncodeSize(pBlock); + *pRsp = taosMemoryCalloc(1, rspSize); + if (NULL == *pRsp) { + blockDataDestroy(pBlock); + return TSDB_CODE_OUT_OF_MEMORY; + } + + (*pRsp)->useconds = 0; + (*pRsp)->completed = 1; + (*pRsp)->precision = 0; + (*pRsp)->compressed = 0; + (*pRsp)->compLen = 0; + (*pRsp)->numOfRows = htobe64((int64_t)pBlock->info.rows); + (*pRsp)->numOfCols = htonl(COMPACT_DB_RESULT_COLS); + + int32_t len = blockEncode(pBlock, (*pRsp)->data, COMPACT_DB_RESULT_COLS); + blockDataDestroy(pBlock); + + if (len != rspSize - sizeof(SRetrieveTableRsp)) { + uError("buildRetriveTableRspForCompactDb error, len:%d != rspSize - sizeof(SRetrieveTableRsp):%" PRIu64, len, + (uint64_t)(rspSize - sizeof(SRetrieveTableRsp))); + return TSDB_CODE_TSC_INVALID_INPUT; + } + + return TSDB_CODE_SUCCESS; +} + + +int32_t processCompactDbRsp(void* param, SDataBuf* pMsg, int32_t code) { + SRequestObj* pRequest = param; + if (code != TSDB_CODE_SUCCESS) { + setErrno(pRequest, code); + } else { + SCompactDbRsp rsp = {0}; + SRetrieveTableRsp* pRes = NULL; + code = tDeserializeSCompactDbRsp(pMsg->pData, pMsg->len, &rsp); + if (TSDB_CODE_SUCCESS == code) { + code = buildRetriveTableRspForCompactDb(&rsp, &pRes); + } + if (TSDB_CODE_SUCCESS == code) { + code = setQueryResultFromRsp(&pRequest->body.resInfo, pRes, false, true); + } + + if (code != 0) { + taosMemoryFree(pRes); + } + } + + taosMemoryFree(pMsg->pData); + taosMemoryFree(pMsg->pEpSet); + + if (pRequest->body.queryFp != NULL) { + pRequest->body.queryFp(((SSyncQueryParam *)pRequest->body.interParam)->userParam, pRequest, code); + } else { + tsem_post(&pRequest->body.rspSem); + } + return code; +} + __async_send_cb_fn_t getMsgRspHandle(int32_t msgType) { switch (msgType) { case TDMT_MND_CONNECT: @@ -558,6 +671,8 @@ __async_send_cb_fn_t getMsgRspHandle(int32_t msgType) { return processAlterStbRsp; case TDMT_MND_SHOW_VARIABLES: return processShowVariablesRsp; + case TDMT_MND_COMPACT_DB: + return processCompactDbRsp; default: return genericRspCallback; } diff --git a/source/common/src/systable.c b/source/common/src/systable.c index 1623d9f062..2e52c77080 100644 --- a/source/common/src/systable.c +++ b/source/common/src/systable.c @@ -334,6 +334,20 @@ static const SSysDbTableSchema userViewsSchema[] = { // {.name = "column_list", .bytes = 2048 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, }; +static const SSysDbTableSchema userCompactsSchema[] = { + {.name = "compact_id", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, + {.name = "db_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, + {.name = "start_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = false}, +}; + +static const SSysDbTableSchema userCompactsDetailSchema[] = { + {.name = "compact_id", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, + {.name = "vgroup_id", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, + {.name = "dnode_id", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, + {.name = "number_fileset", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, + {.name = "finished", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, + {.name = "start_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = false}, +}; static const SSysTableMeta infosMeta[] = { {TSDB_INS_TABLE_DNODES, dnodesSchema, tListLen(dnodesSchema), true}, @@ -362,6 +376,8 @@ static const SSysTableMeta infosMeta[] = { {TSDB_INS_TABLE_VNODES, vnodesSchema, tListLen(vnodesSchema), true}, {TSDB_INS_TABLE_USER_PRIVILEGES, userUserPrivilegesSchema, tListLen(userUserPrivilegesSchema), true}, {TSDB_INS_TABLE_VIEWS, userViewsSchema, tListLen(userViewsSchema), false}, + {TSDB_INS_TABLE_COMPACTS, userCompactsSchema, tListLen(userCompactsSchema), false}, + {TSDB_INS_TABLE_COMPACT_DETAILS, userCompactsDetailSchema, tListLen(userCompactsDetailSchema), false}, }; static const SSysDbTableSchema connectionsSchema[] = { diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 2b7ad21cc7..fd88098b03 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -97,7 +97,7 @@ bool tsMonitorComp = false; // audit bool tsEnableAudit = true; bool tsEnableAuditCreateTable = true; -int32_t tsAuditInterval = 500; +int32_t tsAuditInterval = 5000; // telem #ifdef TD_ENTERPRISE @@ -248,6 +248,7 @@ int32_t tsTtlBatchDropNum = 10000; // number of tables dropped per batch // internal int32_t tsTransPullupInterval = 2; +int32_t tsCompactPullupInterval = 10; int32_t tsMqRebalanceInterval = 2; int32_t tsStreamCheckpointInterval = 60; float tsSinkDataRate = 2.0; @@ -281,6 +282,8 @@ int32_t tsS3BlockCacheSize = 16; // number of blocks int32_t tsS3PageCacheSize = 4096; // number of pages int32_t tsS3UploadDelaySec = 60 * 60 * 24; +bool tsExperimental = true; + #ifndef _STORAGE int32_t taosSetTfsCfg(SConfig *pCfg) { SConfigItem *pItem = cfgGetItem(pCfg, "dataDir"); @@ -528,6 +531,7 @@ static int32_t taosAddClientCfg(SConfig *pCfg) { } if (cfgAddInt32(pCfg, "numOfTaskQueueThreads", tsNumOfTaskQueueThreads, 4, 1024, CFG_SCOPE_CLIENT, CFG_DYN_NONE) != 0) return -1; + if (cfgAddBool(pCfg, "experimental", tsExperimental, CFG_SCOPE_BOTH, CFG_DYN_BOTH) != 0) return -1; return 0; } @@ -707,6 +711,9 @@ static int32_t taosAddServerCfg(SConfig *pCfg) { if (cfgAddInt32(pCfg, "transPullupInterval", tsTransPullupInterval, 1, 10000, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) != 0) return -1; + if (cfgAddInt32(pCfg, "compactPullupInterval", tsCompactPullupInterval, 1, 10000, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) != + 0) + return -1; if (cfgAddInt32(pCfg, "mqRebalanceInterval", tsMqRebalanceInterval, 1, 10000, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) != 0) return -1; @@ -792,6 +799,8 @@ static int32_t taosAddServerCfg(SConfig *pCfg) { return -1; if (cfgAddBool(pCfg, "enableWhiteList", tsEnableWhiteList, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) != 0) return -1; + if (cfgAddBool(pCfg, "experimental", tsExperimental, CFG_SCOPE_BOTH, CFG_DYN_BOTH) != 0) return -1; + GRANT_CFG_ADD; return 0; } @@ -1077,6 +1086,8 @@ static int32_t taosSetClientCfg(SConfig *pCfg) { tsTimeToGetAvailableConn = cfgGetItem(pCfg, "timeToGetAvailableConn")->i32; tsKeepAliveIdle = cfgGetItem(pCfg, "keepAliveIdle")->i32; + + tsExperimental = cfgGetItem(pCfg, "experimental")->bval; return 0; } @@ -1156,6 +1167,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) { tmqMaxTopicNum = cfgGetItem(pCfg, "tmqMaxTopicNum")->i32; tsTransPullupInterval = cfgGetItem(pCfg, "transPullupInterval")->i32; + tsCompactPullupInterval = cfgGetItem(pCfg, "compactPullupInterval")->i32; tsMqRebalanceInterval = cfgGetItem(pCfg, "mqRebalanceInterval")->i32; tsTtlUnit = cfgGetItem(pCfg, "ttlUnit")->i32; tsTtlPushIntervalSec = cfgGetItem(pCfg, "ttlPushInterval")->i32; @@ -1210,6 +1222,8 @@ static int32_t taosSetServerCfg(SConfig *pCfg) { tsS3PageCacheSize = cfgGetItem(pCfg, "s3PageCacheSize")->i32; tsS3UploadDelaySec = cfgGetItem(pCfg, "s3UploadDelaySec")->i32; + tsExperimental = cfgGetItem(pCfg, "experimental")->bval; + GRANT_CFG_GET; return 0; } @@ -1470,6 +1484,7 @@ static int32_t taosCfgDynamicOptionsForServer(SConfig *pCfg, char *name) { {"timeseriesThreshold", &tsTimeSeriesThreshold}, {"tmqMaxTopicNum", &tmqMaxTopicNum}, {"transPullupInterval", &tsTransPullupInterval}, + {"compactPullupInterval", &tsCompactPullupInterval}, {"trimVDbIntervalSec", &tsTrimVDbIntervalSec}, {"ttlBatchDropNum", &tsTtlBatchDropNum}, {"ttlFlushThreshold", &tsTtlFlushThreshold}, @@ -1479,6 +1494,7 @@ static int32_t taosCfgDynamicOptionsForServer(SConfig *pCfg, char *name) { {"s3PageCacheSize", &tsS3PageCacheSize}, {"s3UploadDelaySec", &tsS3UploadDelaySec}, {"supportVnodes", &tsNumOfSupportVnodes}, + {"experimental", &tsExperimental} }; if (taosCfgSetOption(debugOptions, tListLen(debugOptions), pItem, true) != 0) { @@ -1702,6 +1718,7 @@ static int32_t taosCfgDynamicOptionsForClient(SConfig *pCfg, char *name) { {"shellActivityTimer", &tsShellActivityTimer}, {"slowLogThreshold", &tsSlowLogThreshold}, {"useAdapter", &tsUseAdapter}, + {"experimental", &tsExperimental} }; if (taosCfgSetOption(debugOptions, tListLen(debugOptions), pItem, true) != 0) { diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index d69542c98b..918632b7e7 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -1827,7 +1827,7 @@ int32_t tSerializeSGetUserAuthRspImpl(SEncoder *pEncoder, SGetUserAuthRsp *pRsp) char *tb = taosHashIterate(pRsp->readTbs, NULL); while (tb != NULL) { size_t keyLen = 0; - void * key = taosHashGetKey(tb, &keyLen); + void *key = taosHashGetKey(tb, &keyLen); if (tEncodeI32(pEncoder, keyLen) < 0) return -1; if (tEncodeCStr(pEncoder, key) < 0) return -1; @@ -1842,7 +1842,7 @@ int32_t tSerializeSGetUserAuthRspImpl(SEncoder *pEncoder, SGetUserAuthRsp *pRsp) tb = taosHashIterate(pRsp->writeTbs, NULL); while (tb != NULL) { size_t keyLen = 0; - void * key = taosHashGetKey(tb, &keyLen); + void *key = taosHashGetKey(tb, &keyLen); if (tEncodeI32(pEncoder, keyLen) < 0) return -1; if (tEncodeCStr(pEncoder, key) < 0) return -1; @@ -1857,7 +1857,7 @@ int32_t tSerializeSGetUserAuthRspImpl(SEncoder *pEncoder, SGetUserAuthRsp *pRsp) tb = taosHashIterate(pRsp->alterTbs, NULL); while (tb != NULL) { size_t keyLen = 0; - void * key = taosHashGetKey(tb, &keyLen); + void *key = taosHashGetKey(tb, &keyLen); if (tEncodeI32(pEncoder, keyLen) < 0) return -1; if (tEncodeCStr(pEncoder, key) < 0) return -1; @@ -1872,7 +1872,7 @@ int32_t tSerializeSGetUserAuthRspImpl(SEncoder *pEncoder, SGetUserAuthRsp *pRsp) tb = taosHashIterate(pRsp->readViews, NULL); while (tb != NULL) { size_t keyLen = 0; - void * key = taosHashGetKey(tb, &keyLen); + void *key = taosHashGetKey(tb, &keyLen); if (tEncodeI32(pEncoder, keyLen) < 0) return -1; if (tEncodeCStr(pEncoder, key) < 0) return -1; @@ -1887,7 +1887,7 @@ int32_t tSerializeSGetUserAuthRspImpl(SEncoder *pEncoder, SGetUserAuthRsp *pRsp) tb = taosHashIterate(pRsp->writeViews, NULL); while (tb != NULL) { size_t keyLen = 0; - void * key = taosHashGetKey(tb, &keyLen); + void *key = taosHashGetKey(tb, &keyLen); if (tEncodeI32(pEncoder, keyLen) < 0) return -1; if (tEncodeCStr(pEncoder, key) < 0) return -1; @@ -1902,7 +1902,7 @@ int32_t tSerializeSGetUserAuthRspImpl(SEncoder *pEncoder, SGetUserAuthRsp *pRsp) tb = taosHashIterate(pRsp->alterViews, NULL); while (tb != NULL) { size_t keyLen = 0; - void * key = taosHashGetKey(tb, &keyLen); + void *key = taosHashGetKey(tb, &keyLen); if (tEncodeI32(pEncoder, keyLen) < 0) return -1; if (tEncodeCStr(pEncoder, key) < 0) return -1; @@ -1917,7 +1917,7 @@ int32_t tSerializeSGetUserAuthRspImpl(SEncoder *pEncoder, SGetUserAuthRsp *pRsp) int32_t *useDb = taosHashIterate(pRsp->useDbs, NULL); while (useDb != NULL) { size_t keyLen = 0; - void * key = taosHashGetKey(useDb, &keyLen); + void *key = taosHashGetKey(useDb, &keyLen); if (tEncodeI32(pEncoder, keyLen) < 0) return -1; if (tEncodeCStr(pEncoder, key) < 0) return -1; @@ -3424,6 +3424,66 @@ int32_t tDeserializeSCompactDbReq(void *buf, int32_t bufLen, SCompactDbReq *pReq void tFreeSCompactDbReq(SCompactDbReq *pReq) { FREESQL(); } +int32_t tSerializeSCompactDbRsp(void *buf, int32_t bufLen, SCompactDbRsp *pRsp) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + if (tEncodeI32(&encoder, pRsp->compactId) < 0) return -1; + if (tEncodeI8(&encoder, pRsp->bAccepted) < 0) return -1; + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSCompactDbRsp(void *buf, int32_t bufLen, SCompactDbRsp *pRsp) { + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + if (tStartDecode(&decoder) < 0) return -1; + if (tDecodeI32(&decoder, &pRsp->compactId) < 0) return -1; + if (tDecodeI8(&decoder, &pRsp->bAccepted) < 0) return -1; + tEndDecode(&decoder); + + tDecoderClear(&decoder); + return 0; +} + +int32_t tSerializeSKillCompactReq(void *buf, int32_t bufLen, SKillCompactReq *pReq) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + + if (tEncodeI32(&encoder, pReq->compactId) < 0) return -1; + ENCODESQL(); + + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSKillCompactReq(void *buf, int32_t bufLen, SKillCompactReq *pReq) { + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + if (tStartDecode(&decoder) < 0) return -1; + + if (tDecodeI32(&decoder, &pReq->compactId) < 0) return -1; + DECODESQL(); + + tEndDecode(&decoder); + + tDecoderClear(&decoder); + return 0; +} + +void tFreeSKillCompactReq(SKillCompactReq *pReq) { FREESQL(); } + int32_t tSerializeSUseDbRspImp(SEncoder *pEncoder, const SUseDbRsp *pRsp) { if (tEncodeCStr(pEncoder, pRsp->db) < 0) return -1; if (tEncodeI64(pEncoder, pRsp->uid) < 0) return -1; @@ -4259,6 +4319,7 @@ int32_t tSerializeSRetrieveTableReq(void *buf, int32_t bufLen, SRetrieveTableReq if (tEncodeCStr(&encoder, pReq->tb) < 0) return -1; if (tEncodeCStr(&encoder, pReq->filterTb) < 0) return -1; if (tEncodeCStr(&encoder, pReq->user) < 0) return -1; + if (tEncodeI64(&encoder, pReq->compactId) < 0) return -1; tEndEncode(&encoder); int32_t tlen = encoder.pos; @@ -4276,6 +4337,11 @@ int32_t tDeserializeSRetrieveTableReq(void *buf, int32_t bufLen, SRetrieveTableR if (tDecodeCStrTo(&decoder, pReq->tb) < 0) return -1; if (tDecodeCStrTo(&decoder, pReq->filterTb) < 0) return -1; if (tDecodeCStrTo(&decoder, pReq->user) < 0) return -1; + if (!tDecodeIsEnd(&decoder)) { + if (tDecodeI64(&decoder, &pReq->compactId) < 0) return -1; + } else { + pReq->compactId = -1; + } tEndDecode(&decoder); tDecoderClear(&decoder); @@ -5051,6 +5117,75 @@ int32_t tFreeSCreateVnodeReq(SCreateVnodeReq *pReq) { return 0; } +int32_t tSerializeSQueryCompactProgressReq(void *buf, int32_t bufLen, SQueryCompactProgressReq *pReq) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + + if (tEncodeI32(&encoder, pReq->compactId) < 0) return -1; + if (tEncodeI32(&encoder, pReq->vgId) < 0) return -1; + if (tEncodeI32(&encoder, pReq->dnodeId) < 0) return -1; + + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSQueryCompactProgressReq(void *buf, int32_t bufLen, SQueryCompactProgressReq *pReq) { + int32_t headLen = sizeof(SMsgHead); + + SDecoder decoder = {0}; + tDecoderInit(&decoder, ((uint8_t *)buf) + headLen, bufLen - headLen); + + if (tStartDecode(&decoder) < 0) return -1; + + if (tDecodeI32(&decoder, &pReq->compactId) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->vgId) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->dnodeId) < 0) return -1; + + tEndDecode(&decoder); + tDecoderClear(&decoder); + return 0; +} + +int32_t tSerializeSQueryCompactProgressRsp(void *buf, int32_t bufLen, SQueryCompactProgressRsp *pReq) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + + if (tEncodeI32(&encoder, pReq->compactId) < 0) return -1; + if (tEncodeI32(&encoder, pReq->vgId) < 0) return -1; + if (tEncodeI32(&encoder, pReq->dnodeId) < 0) return -1; + if (tEncodeI32(&encoder, pReq->numberFileset) < 0) return -1; + if (tEncodeI32(&encoder, pReq->finished) < 0) return -1; + + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} +int32_t tDeserializeSQueryCompactProgressRsp(void *buf, int32_t bufLen, SQueryCompactProgressRsp *pReq) { + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + if (tStartDecode(&decoder) < 0) return -1; + + if (tDecodeI32(&decoder, &pReq->compactId) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->vgId) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->dnodeId) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->numberFileset) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->finished) < 0) return -1; + + tEndDecode(&decoder); + tDecoderClear(&decoder); + return 0; +} + int32_t tSerializeSDropVnodeReq(void *buf, int32_t bufLen, SDropVnodeReq *pReq) { SEncoder encoder = {0}; tEncoderInit(&encoder, buf, bufLen); @@ -5139,6 +5274,8 @@ int32_t tSerializeSCompactVnodeReq(void *buf, int32_t bufLen, SCompactVnodeReq * if (tEncodeI64(&encoder, pReq->tw.skey) < 0) return -1; if (tEncodeI64(&encoder, pReq->tw.ekey) < 0) return -1; + if (tEncodeI32(&encoder, pReq->compactId) < 0) return -1; + tEndEncode(&encoder); int32_t tlen = encoder.pos; @@ -5165,6 +5302,42 @@ int32_t tDeserializeSCompactVnodeReq(void *buf, int32_t bufLen, SCompactVnodeReq if (tDecodeI64(&decoder, &pReq->tw.ekey) < 0) return -1; } + if (!tDecodeIsEnd(&decoder)) { + if (tDecodeI32(&decoder, &pReq->compactId) < 0) return -1; + } + + tEndDecode(&decoder); + tDecoderClear(&decoder); + return 0; +} + +int32_t tSerializeSVKillCompactReq(void *buf, int32_t bufLen, SVKillCompactReq *pReq) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + + if (tEncodeI32(&encoder, pReq->compactId) < 0) return -1; + if (tEncodeI32(&encoder, pReq->vgId) < 0) return -1; + if (tEncodeI32(&encoder, pReq->dnodeId) < 0) return -1; + + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSVKillCompactReq(void *buf, int32_t bufLen, SVKillCompactReq *pReq) { + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + if (tStartDecode(&decoder) < 0) return -1; + + if (tDecodeI32(&decoder, &pReq->compactId) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->vgId) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->dnodeId) < 0) return -1; + tEndDecode(&decoder); tDecoderClear(&decoder); return 0; @@ -8169,7 +8342,7 @@ int32_t tEncodeMqDataRsp(SEncoder *pEncoder, const SMqDataRsp *pRsp) { for (int32_t i = 0; i < pRsp->blockNum; i++) { int32_t bLen = *(int32_t *)taosArrayGet(pRsp->blockDataLen, i); - void * data = taosArrayGetP(pRsp->blockData, i); + void *data = taosArrayGetP(pRsp->blockData, i); if (tEncodeBinary(pEncoder, (const uint8_t *)data, bLen) < 0) return -1; if (pRsp->withSchema) { SSchemaWrapper *pSW = (SSchemaWrapper *)taosArrayGetP(pRsp->blockSchema, i); @@ -8202,7 +8375,7 @@ int32_t tDecodeMqDataRsp(SDecoder *pDecoder, SMqDataRsp *pRsp) { } for (int32_t i = 0; i < pRsp->blockNum; i++) { - void * data; + void *data; uint64_t bLen; if (tDecodeBinaryAlloc(pDecoder, &data, &bLen) < 0) return -1; taosArrayPush(pRsp->blockData, &data); @@ -8248,7 +8421,7 @@ int32_t tEncodeSTaosxRsp(SEncoder *pEncoder, const STaosxRsp *pRsp) { if (tEncodeI32(pEncoder, pRsp->createTableNum) < 0) return -1; if (pRsp->createTableNum) { for (int32_t i = 0; i < pRsp->createTableNum; i++) { - void * createTableReq = taosArrayGetP(pRsp->createTableReq, i); + void *createTableReq = taosArrayGetP(pRsp->createTableReq, i); int32_t createTableLen = *(int32_t *)taosArrayGet(pRsp->createTableLen, i); if (tEncodeBinary(pEncoder, createTableReq, createTableLen) < 0) return -1; } @@ -8264,7 +8437,7 @@ int32_t tDecodeSTaosxRsp(SDecoder *pDecoder, STaosxRsp *pRsp) { pRsp->createTableLen = taosArrayInit(pRsp->createTableNum, sizeof(int32_t)); pRsp->createTableReq = taosArrayInit(pRsp->createTableNum, sizeof(void *)); for (int32_t i = 0; i < pRsp->createTableNum; i++) { - void * pCreate = NULL; + void *pCreate = NULL; uint64_t len; if (tDecodeBinaryAlloc(pDecoder, &pCreate, &len) < 0) return -1; int32_t l = (int32_t)len; @@ -8566,7 +8739,7 @@ void tDestroySubmitTbData(SSubmitTbData *pTbData, int32_t flag) { taosArrayDestroy(pTbData->aCol); } else { int32_t nRow = TARRAY_SIZE(pTbData->aRowP); - SRow ** rows = (SRow **)TARRAY_DATA(pTbData->aRowP); + SRow **rows = (SRow **)TARRAY_DATA(pTbData->aRowP); for (int32_t i = 0; i < nRow; ++i) { tRowDestroy(rows[i]); diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c index 737a0338ef..d6de406987 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c @@ -192,6 +192,8 @@ SArray *mmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_MND_CREATE_VIEW, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_DROP_VIEW, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_VIEW_META, mmPutMsgToReadQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_MND_KILL_COMPACT, mmPutMsgToReadQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_VND_QUERY_COMPACT_PROGRESS_RSP, mmPutMsgToReadQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SCH_QUERY, mmPutMsgToQueryQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SCH_MERGE_QUERY, mmPutMsgToQueryQueue, 1) == NULL) goto _OVER; @@ -221,6 +223,7 @@ SArray *mmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_UPDATE_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_RESET_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_HEARTBEAT, mmPutMsgToReadQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_VND_KILL_COMPACT_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_ALTER_CONFIG_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_ALTER_REPLICA_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c index a535ab17d7..9438f953a9 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c @@ -818,6 +818,8 @@ SArray *vmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_SCH_QUERY_HEARTBEAT, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_CREATE_INDEX, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_DROP_INDEX, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_VND_QUERY_COMPACT_PROGRESS, vmPutMsgToFetchQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_VND_KILL_COMPACT, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_DEPLOY, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_DROP, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; diff --git a/source/dnode/mgmt/node_mgmt/inc/dmMgmt.h b/source/dnode/mgmt/node_mgmt/inc/dmMgmt.h index 83f9f13c82..c646bb4bdd 100644 --- a/source/dnode/mgmt/node_mgmt/inc/dmMgmt.h +++ b/source/dnode/mgmt/node_mgmt/inc/dmMgmt.h @@ -70,6 +70,21 @@ typedef struct SUdfdData { int32_t dnodeId; } SUdfdData; +#ifndef TD_MODULE_OPTIMIZE +typedef struct SDnode { + int8_t once; + bool stop; + EDndRunStatus status; + SStartupInfo startup; + SDnodeData data; + SUdfdData udfdData; + TdThreadMutex mutex; + TdFilePtr lockfile; + STfs *pTfs; + SMgmtWrapper wrappers[NODE_END]; + SDnodeTrans trans; +} SDnode; +#else typedef struct SDnode { int8_t once; bool stop; @@ -83,6 +98,7 @@ typedef struct SDnode { STfs *pTfs; SMgmtWrapper wrappers[NODE_END]; } SDnode; +#endif // dmEnv.c SDnode *dmInstance(); @@ -97,8 +113,12 @@ int32_t dmMarkWrapper(SMgmtWrapper *pWrapper); void dmReleaseWrapper(SMgmtWrapper *pWrapper); int32_t dmInitVars(SDnode *pDnode); void dmClearVars(SDnode *pDnode); -int32_t dmInitModule(SDnode *pDnode, SMgmtWrapper *wrappers); -bool dmRequireNode(SDnode *pDnode, SMgmtWrapper *pWrapper); +#ifdef TD_MODULE_OPTIMIZE +int32_t dmInitModule(SDnode *pDnode, SMgmtWrapper *wrappers); +bool dmRequireNode(SDnode *pDnode, SMgmtWrapper *pWrapper); +#else +int32_t dmInitModule(SDnode *pDnode); +#endif SMgmtInputOpt dmBuildMgmtInputOpt(SMgmtWrapper *pWrapper); void dmSetStatus(SDnode *pDnode, EDndRunStatus stype); void dmProcessServerStartupStatus(SDnode *pDnode, SRpcMsg *pMsg); @@ -119,7 +139,11 @@ int32_t dmInitStatusClient(SDnode *pDnode); void dmCleanupClient(SDnode *pDnode); void dmCleanupStatusClient(SDnode *pDnode); SMsgCb dmGetMsgcb(SDnode *pDnode); +#ifdef TD_MODULE_OPTIMIZE int32_t dmInitMsgHandle(SDnode *pDnode, SMgmtWrapper *wrappers); +#else +int32_t dmInitMsgHandle(SDnode *pDnode); +#endif int32_t dmProcessNodeMsg(SMgmtWrapper *pWrapper, SRpcMsg *pMsg); // dmMonitor.c diff --git a/source/dnode/mgmt/node_mgmt/src/dmMgmt.c b/source/dnode/mgmt/node_mgmt/src/dmMgmt.c index 409ee45cd3..84465640c0 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmMgmt.c +++ b/source/dnode/mgmt/node_mgmt/src/dmMgmt.c @@ -24,6 +24,22 @@ #include "tglobal.h" #endif +#ifndef TD_MODULE_OPTIMIZE +static bool dmRequireNode(SDnode *pDnode, SMgmtWrapper *pWrapper) { + SMgmtInputOpt input = dmBuildMgmtInputOpt(pWrapper); + + bool required = false; + int32_t code = (*pWrapper->func.requiredFp)(&input, &required); + if (!required) { + dDebug("node:%s, does not require startup", pWrapper->name); + } else { + dDebug("node:%s, required to startup", pWrapper->name); + } + + return required; +} +#endif + int32_t dmInitDnode(SDnode *pDnode) { dDebug("start to create dnode"); int32_t code = -1; @@ -65,11 +81,15 @@ int32_t dmInitDnode(SDnode *pDnode) { if (pDnode->lockfile == NULL) { goto _OVER; } - +#ifdef TD_MODULE_OPTIMIZE if (dmInitModule(pDnode, pDnode->wrappers) != 0) { goto _OVER; } - +#else + if (dmInitModule(pDnode) != 0) { + goto _OVER; + } +#endif indexInit(tsNumOfCommitThreads); streamMetaInit(); diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index ad5ca2cecf..1ea61f0e93 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -251,6 +251,7 @@ _OVER: dmReleaseWrapper(pWrapper); } +#ifdef TD_MODULE_OPTIMIZE int32_t dmInitMsgHandle(SDnode *pDnode, SMgmtWrapper *wrappers) { SDnodeTrans *pTrans = &pDnode->trans; @@ -276,6 +277,33 @@ int32_t dmInitMsgHandle(SDnode *pDnode, SMgmtWrapper *wrappers) { return 0; } +#else +int32_t dmInitMsgHandle(SDnode *pDnode) { + SDnodeTrans *pTrans = &pDnode->trans; + + for (EDndNodeType ntype = DNODE; ntype < NODE_END; ++ntype) { + SMgmtWrapper *pWrapper = &pDnode->wrappers[ntype]; + SArray *pArray = (*pWrapper->func.getHandlesFp)(); + if (pArray == NULL) return -1; + + for (int32_t i = 0; i < taosArrayGetSize(pArray); ++i) { + SMgmtHandle *pMgmt = taosArrayGet(pArray, i); + SDnodeHandle *pHandle = &pTrans->msgHandles[TMSG_INDEX(pMgmt->msgType)]; + if (pMgmt->needCheckVgId) { + pHandle->needCheckVgId = pMgmt->needCheckVgId; + } + if (!pMgmt->needCheckVgId) { + pHandle->defaultNtype = ntype; + } + pWrapper->msgFps[TMSG_INDEX(pMgmt->msgType)] = pMgmt->msgFp; + } + + taosArrayDestroy(pArray); + } + + return 0; +} +#endif static inline int32_t dmSendReq(const SEpSet *pEpSet, SRpcMsg *pMsg) { SDnode *pDnode = dmInstance(); diff --git a/source/dnode/mnode/impl/inc/mndCompact.h b/source/dnode/mnode/impl/inc/mndCompact.h new file mode 100644 index 0000000000..43cf78a90e --- /dev/null +++ b/source/dnode/mnode/impl/inc/mndCompact.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#ifndef _TD_MND_COMPACT_H_ +#define _TD_MND_COMPACT_H_ + +#include "mndInt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int32_t mndInitCompact(SMnode *pMnode); +void mndCleanupCompact(SMnode *pMnode); + +void tFreeCompactObj(SCompactObj *pCompact); +int32_t tSerializeSCompactObj(void *buf, int32_t bufLen, const SCompactObj *pObj); +int32_t tDeserializeSCompactObj(void *buf, int32_t bufLen, SCompactObj *pObj); + +SSdbRaw* mndCompactActionEncode(SCompactObj *pCompact); +SSdbRow* mndCompactActionDecode(SSdbRaw *pRaw); + +int32_t mndCompactActionInsert(SSdb *pSdb, SCompactObj *pCompact); +int32_t mndCompactActionDelete(SSdb *pSdb, SCompactObj *pCompact); +int32_t mndCompactActionUpdate(SSdb *pSdb, SCompactObj *pOldCompact, SCompactObj *pNewCompact); + +int32_t mndAddCompactToTran(SMnode *pMnode, STrans *pTrans, SCompactObj* pCompact, SDbObj *pDb, SCompactDbRsp *rsp); + +int32_t mndRetrieveCompact(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows); + +int32_t mndProcessKillCompactReq(SRpcMsg *pReq); + +int32_t mndProcessQueryCompactRsp(SRpcMsg *pReq); + +SCompactObj *mndAcquireCompact(SMnode *pMnode, int64_t compactId); +void mndReleaseCompact(SMnode *pMnode, SCompactObj *pCompact); + +void mndCompactSendProgressReq(SMnode *pMnode, SCompactObj *pCompact); + +#ifdef __cplusplus +} +#endif + +#endif /*_TD_MND_COMPACT_H_*/ diff --git a/source/dnode/mnode/impl/inc/mndCompactDetail.h b/source/dnode/mnode/impl/inc/mndCompactDetail.h new file mode 100644 index 0000000000..601af3b64b --- /dev/null +++ b/source/dnode/mnode/impl/inc/mndCompactDetail.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#ifndef _TD_MND_COMPACT_DETAIL_H_ +#define _TD_MND_COMPACT_DETAIL_H_ + +#include "mndInt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int32_t mndInitCompactDetail(SMnode *pMnode); +void mndCleanupCompactDetail(SMnode *pMnode); + +void tFreeCompactDetailObj(SCompactDetailObj *pCompact); +int32_t tSerializeSCompactDetailObj(void *buf, int32_t bufLen, const SCompactDetailObj *pObj); +int32_t tDeserializeSCompactDetailObj(void *buf, int32_t bufLen, SCompactDetailObj *pObj); + +SSdbRaw* mndCompactDetailActionEncode(SCompactDetailObj *pCompact); +SSdbRow* mndCompactDetailActionDecode(SSdbRaw *pRaw); + +int32_t mndCompactDetailActionInsert(SSdb *pSdb, SCompactDetailObj *pCompact); +int32_t mndCompactDetailActionDelete(SSdb *pSdb, SCompactDetailObj *pCompact); +int32_t mndCompactDetailActionUpdate(SSdb *pSdb, SCompactDetailObj *pOldCompact, SCompactDetailObj *pNewCompact); + +int32_t mndAddCompactDetailToTran(SMnode *pMnode, STrans *pTrans, SCompactObj* pCompact, SVgObj *pVgroup, + SVnodeGid *pVgid, int32_t index); + +int32_t mndRetrieveCompactDetail(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows); + +#ifdef __cplusplus +} +#endif + +#endif /*_TD_MND_COMPACT_DETAIL_H_*/ diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index 08c0aec46a..8dfd03622f 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -741,6 +741,25 @@ int32_t tEncodeSViewObj(SEncoder* pEncoder, const SViewObj* pObj); int32_t tDecodeSViewObj(SDecoder* pDecoder, SViewObj* pObj, int32_t sver); void tFreeSViewObj(SViewObj* pObj); +typedef struct { + int32_t compactDetailId; + int32_t compactId; + int32_t vgId; + int32_t dnodeId; + int32_t numberFileset; + int32_t finished; + int64_t startTime; + int32_t newNumberFileset; + int32_t newFinished; +} SCompactDetailObj; + +typedef struct { + int32_t compactId; + char dbname[TSDB_TABLE_FNAME_LEN]; + int64_t startTime; + SArray* compactDetail; +} SCompactObj; + #ifdef __cplusplus } #endif diff --git a/source/dnode/mnode/impl/src/mndCompact.c b/source/dnode/mnode/impl/src/mndCompact.c new file mode 100644 index 0000000000..44b0d1c0d2 --- /dev/null +++ b/source/dnode/mnode/impl/src/mndCompact.c @@ -0,0 +1,741 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +#include "mndCompact.h" +#include "mndTrans.h" +#include "mndShow.h" +#include "mndDb.h" +#include "mndCompactDetail.h" +#include "mndVgroup.h" +#include "tmsgcb.h" +#include "mndDnode.h" +#include "tmisce.h" +#include "audit.h" +#include "mndPrivilege.h" +#include "mndTrans.h" + +#define MND_COMPACT_VER_NUMBER 1 + +static int32_t mndProcessCompactTimer(SRpcMsg *pReq); + +int32_t mndInitCompact(SMnode *pMnode) { + mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_COMPACT, mndRetrieveCompact); + mndSetMsgHandle(pMnode, TDMT_MND_KILL_COMPACT, mndProcessKillCompactReq); + mndSetMsgHandle(pMnode, TDMT_VND_QUERY_COMPACT_PROGRESS_RSP, mndProcessQueryCompactRsp); + mndSetMsgHandle(pMnode, TDMT_MND_COMPACT_TIMER, mndProcessCompactTimer); + mndSetMsgHandle(pMnode, TDMT_VND_KILL_COMPACT_RSP, mndTransProcessRsp); + + SSdbTable table = { + .sdbType = SDB_COMPACT, + .keyType = SDB_KEY_INT32, + .encodeFp = (SdbEncodeFp)mndCompactActionEncode, + .decodeFp = (SdbDecodeFp)mndCompactActionDecode, + .insertFp = (SdbInsertFp)mndCompactActionInsert, + .updateFp = (SdbUpdateFp)mndCompactActionUpdate, + .deleteFp = (SdbDeleteFp)mndCompactActionDelete, + }; + + return sdbSetTable(pMnode->pSdb, table); +} + +void mndCleanupCompact(SMnode *pMnode) { + mDebug("mnd compact cleanup"); +} + +void tFreeCompactObj(SCompactObj *pCompact) { +} + +int32_t tSerializeSCompactObj(void *buf, int32_t bufLen, const SCompactObj *pObj) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + + if (tEncodeI32(&encoder, pObj->compactId) < 0) return -1; + if (tEncodeCStr(&encoder, pObj->dbname) < 0) return -1; + if (tEncodeI64(&encoder, pObj->startTime) < 0) return -1; + + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSCompactObj(void *buf, int32_t bufLen, SCompactObj *pObj) { + int8_t ex = 0; + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + if (tStartDecode(&decoder) < 0) return -1; + + if (tDecodeI32(&decoder, &pObj->compactId) < 0) return -1; + if (tDecodeCStrTo(&decoder, pObj->dbname) < 0) return -1; + if (tDecodeI64(&decoder, &pObj->startTime) < 0) return -1; + + tEndDecode(&decoder); + + tDecoderClear(&decoder); + return 0; +} + +SSdbRaw *mndCompactActionEncode(SCompactObj *pCompact) { + terrno = TSDB_CODE_SUCCESS; + + void *buf = NULL; + SSdbRaw *pRaw = NULL; + + int32_t tlen = tSerializeSCompactObj(NULL, 0, pCompact); + if (tlen < 0) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto OVER; + } + + int32_t size = sizeof(int32_t) + tlen; + pRaw = sdbAllocRaw(SDB_COMPACT, MND_COMPACT_VER_NUMBER, size); + if (pRaw == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto OVER; + } + + buf = taosMemoryMalloc(tlen); + if (buf == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto OVER; + } + + tlen = tSerializeSCompactObj(buf, tlen, pCompact); + if (tlen < 0) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto OVER; + } + + int32_t dataPos = 0; + SDB_SET_INT32(pRaw, dataPos, tlen, OVER); + SDB_SET_BINARY(pRaw, dataPos, buf, tlen, OVER); + SDB_SET_DATALEN(pRaw, dataPos, OVER); + + +OVER: + taosMemoryFreeClear(buf); + if (terrno != TSDB_CODE_SUCCESS) { + mError("compact:%" PRId32 ", failed to encode to raw:%p since %s", pCompact->compactId, pRaw, terrstr()); + sdbFreeRaw(pRaw); + return NULL; + } + + mTrace("compact:%" PRId32 ", encode to raw:%p, row:%p", pCompact->compactId, pRaw, pCompact); + return pRaw; +} + +SSdbRow *mndCompactActionDecode(SSdbRaw *pRaw) { + SSdbRow *pRow = NULL; + SCompactObj *pCompact = NULL; + void *buf = NULL; + terrno = TSDB_CODE_SUCCESS; + + int8_t sver = 0; + if (sdbGetRawSoftVer(pRaw, &sver) != 0) { + goto OVER; + } + + if (sver != MND_COMPACT_VER_NUMBER) { + terrno = TSDB_CODE_SDB_INVALID_DATA_VER; + mError("compact read invalid ver, data ver: %d, curr ver: %d", sver, MND_COMPACT_VER_NUMBER); + goto OVER; + } + + pRow = sdbAllocRow(sizeof(SCompactObj)); + if (pRow == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto OVER; + } + + pCompact = sdbGetRowObj(pRow); + if (pCompact == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto OVER; + } + + int32_t tlen; + int32_t dataPos = 0; + SDB_GET_INT32(pRaw, dataPos, &tlen, OVER); + buf = taosMemoryMalloc(tlen + 1); + if (buf == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto OVER; + } + SDB_GET_BINARY(pRaw, dataPos, buf, tlen, OVER); + + if (tDeserializeSCompactObj(buf, tlen, pCompact) < 0) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto OVER; + } + + //taosInitRWLatch(&pView->lock); + +OVER: + taosMemoryFreeClear(buf); + if (terrno != TSDB_CODE_SUCCESS) { + mError("compact:%" PRId32 ", failed to decode from raw:%p since %s", pCompact->compactId, pRaw, terrstr()); + taosMemoryFreeClear(pRow); + return NULL; + } + + mTrace("compact:%" PRId32 ", decode from raw:%p, row:%p", pCompact->compactId, pRaw, pCompact); + return pRow; +} + +int32_t mndCompactActionInsert(SSdb *pSdb, SCompactObj *pCompact) { + mTrace("compact:%" PRId32 ", perform insert action", pCompact->compactId); + return 0; +} + +int32_t mndCompactActionDelete(SSdb *pSdb, SCompactObj *pCompact) { + mTrace("compact:%" PRId32 ", perform insert action", pCompact->compactId); + tFreeCompactObj(pCompact); + return 0; +} + +int32_t mndCompactActionUpdate(SSdb *pSdb, SCompactObj *pOldCompact, SCompactObj *pNewCompact) { + mTrace("compact:%" PRId32 ", perform update action, old row:%p new row:%p", + pOldCompact->compactId, pOldCompact, pNewCompact); + + return 0; +} + +SCompactObj *mndAcquireCompact(SMnode *pMnode, int64_t compactId) { + SSdb *pSdb = pMnode->pSdb; + SCompactObj *pCompact = sdbAcquire(pSdb, SDB_COMPACT, &compactId); + if (pCompact == NULL && terrno == TSDB_CODE_SDB_OBJ_NOT_THERE) { + terrno = TSDB_CODE_SUCCESS; + } + return pCompact; +} + +void mndReleaseCompact(SMnode *pMnode, SCompactObj *pCompact) { + SSdb *pSdb = pMnode->pSdb; + sdbRelease(pSdb, pCompact); +} + +//compact db +int32_t mndAddCompactToTran(SMnode *pMnode, STrans *pTrans, SCompactObj* pCompact, SDbObj *pDb, SCompactDbRsp *rsp){ + pCompact->compactId = tGenIdPI32(); + + strcpy(pCompact->dbname, pDb->name); + + pCompact->startTime = taosGetTimestampMs(); + + SSdbRaw *pVgRaw = mndCompactActionEncode(pCompact); + if (pVgRaw == NULL) return -1; + if (mndTransAppendRedolog(pTrans, pVgRaw) != 0) { + sdbFreeRaw(pVgRaw); + return -1; + } + (void)sdbSetRawStatus(pVgRaw, SDB_STATUS_READY); + + rsp->compactId = pCompact->compactId; + + return 0; +} + +//retrieve compact +int32_t mndRetrieveCompact(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows){ + SMnode *pMnode = pReq->info.node; + SSdb *pSdb = pMnode->pSdb; + int32_t numOfRows = 0; + SCompactObj *pCompact = NULL; + char *sep = NULL; + SDbObj *pDb = NULL; + + if (strlen(pShow->db) > 0) { + sep = strchr(pShow->db, '.'); + if (sep && ((0 == strcmp(sep + 1, TSDB_INFORMATION_SCHEMA_DB) || (0 == strcmp(sep + 1, TSDB_PERFORMANCE_SCHEMA_DB))))) { + sep++; + } else { + pDb = mndAcquireDb(pMnode, pShow->db); + if (pDb == NULL) return terrno; + } + } + + while (numOfRows < rows) { + pShow->pIter = sdbFetch(pSdb, SDB_COMPACT, pShow->pIter, (void **)&pCompact); + if (pShow->pIter == NULL) break; + + SColumnInfoData *pColInfo; + SName n; + int32_t cols = 0; + + char tmpBuf[TSDB_SHOW_SQL_LEN + VARSTR_HEADER_SIZE] = {0}; + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, (const char *)&pCompact->compactId, false); + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + if (pDb != NULL || !IS_SYS_DBNAME(pCompact->dbname)) { + SName name = {0}; + tNameFromString(&name, pCompact->dbname, T_NAME_ACCT | T_NAME_DB); + tNameGetDbName(&name, varDataVal(tmpBuf)); + } else { + strncpy(varDataVal(tmpBuf), pCompact->dbname, strlen(pCompact->dbname) + 1); + } + varDataSetLen(tmpBuf, strlen(varDataVal(tmpBuf))); + colDataSetVal(pColInfo, numOfRows, (const char *)tmpBuf, false); + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, (const char *)&pCompact->startTime, false); + + numOfRows++; + sdbRelease(pSdb, pCompact); + } + + pShow->numOfRows += numOfRows; + mndReleaseDb(pMnode, pDb); + return numOfRows; +} + +//kill compact +static void *mndBuildKillCompactReq(SMnode *pMnode, SVgObj *pVgroup, int32_t *pContLen, + int32_t compactId, int32_t dnodeid) { + SVKillCompactReq req = {0}; + req.compactId = compactId; + req.vgId = pVgroup->vgId; + req.dnodeId = dnodeid; + + mInfo("vgId:%d, build compact vnode config req", pVgroup->vgId); + int32_t contLen = tSerializeSVKillCompactReq(NULL, 0, &req); + if (contLen < 0) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return NULL; + } + contLen += sizeof(SMsgHead); + + void *pReq = taosMemoryMalloc(contLen); + if (pReq == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return NULL; + } + + SMsgHead *pHead = pReq; + pHead->contLen = htonl(contLen); + pHead->vgId = htonl(pVgroup->vgId); + + tSerializeSVKillCompactReq((char *)pReq + sizeof(SMsgHead), contLen, &req); + *pContLen = contLen; + return pReq; +} + +static int32_t mndAddKillCompactAction(SMnode *pMnode, STrans *pTrans, SVgObj *pVgroup, + int32_t compactId, int32_t dnodeid) { + STransAction action = {0}; + + SDnodeObj *pDnode = mndAcquireDnode(pMnode, dnodeid); + if (pDnode == NULL) return -1; + action.epSet = mndGetDnodeEpset(pDnode); + mndReleaseDnode(pMnode, pDnode); + + int32_t contLen = 0; + void *pReq = mndBuildKillCompactReq(pMnode, pVgroup, &contLen, compactId, dnodeid); + if (pReq == NULL) return -1; + + action.pCont = pReq; + action.contLen = contLen; + action.msgType = TDMT_VND_KILL_COMPACT; + + if (mndTransAppendRedoAction(pTrans, &action) != 0) { + taosMemoryFree(pReq); + return -1; + } + + return 0; +} + +static int32_t mndKillCompact(SMnode *pMnode, SRpcMsg *pReq, SCompactObj *pCompact) { + STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_NOTHING, pReq, "kill-compact"); + if (pTrans == NULL) { + mError("compact:%" PRId32 ", failed to drop since %s" , pCompact->compactId, terrstr()); + return -1; + } + mInfo("trans:%d, used to kill compact:%" PRId32, pTrans->id, pCompact->compactId); + + SSdbRaw *pCommitRaw = mndCompactActionEncode(pCompact); + if (pCommitRaw == NULL || mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) { + mError("trans:%d, failed to append commit log since %s", pTrans->id, terrstr()); + mndTransDrop(pTrans); + return -1; + } + (void)sdbSetRawStatus(pCommitRaw, SDB_STATUS_READY); + + void *pIter = NULL; + while (1) { + SCompactDetailObj *pDetail = NULL; + pIter = sdbFetch(pMnode->pSdb, SDB_COMPACT_DETAIL, pIter, (void **)&pDetail); + if (pIter == NULL) break; + + if (pDetail->compactId == pCompact->compactId) { + SVgObj *pVgroup = mndAcquireVgroup(pMnode, pDetail->vgId); + if(pVgroup == NULL){ + mError("trans:%d, failed to append redo action since %s", pTrans->id, terrstr()); + mndTransDrop(pTrans); + return -1; + } + + if(mndAddKillCompactAction(pMnode, pTrans, pVgroup, pCompact->compactId, pDetail->dnodeId) != 0){ + mError("trans:%d, failed to append redo action since %s", pTrans->id, terrstr()); + mndTransDrop(pTrans); + return -1; + } + + mndReleaseVgroup(pMnode, pVgroup); + + /* + SSdbRaw *pCommitRaw = mndCompactDetailActionEncode(pDetail); + if (pCommitRaw == NULL || mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) { + mError("trans:%d, failed to append commit log since %s", pTrans->id, terrstr()); + mndTransDrop(pTrans); + return -1; + } + (void)sdbSetRawStatus(pCommitRaw, SDB_STATUS_DROPPED); + */ + } + + sdbRelease(pMnode->pSdb, pDetail); + } + + if (mndTransPrepare(pMnode, pTrans) != 0) { + mError("trans:%d, failed to prepare since %s", pTrans->id, terrstr()); + mndTransDrop(pTrans); + return -1; + } + + mndTransDrop(pTrans); + return 0; +} + +int32_t mndProcessKillCompactReq(SRpcMsg *pReq){ + SKillCompactReq killCompactReq = {0}; + if (tDeserializeSKillCompactReq(pReq->pCont, pReq->contLen, &killCompactReq) != 0) { + terrno = TSDB_CODE_INVALID_MSG; + return -1; + } + + mInfo("start to kill compact:%" PRId32, killCompactReq.compactId); + + SMnode *pMnode = pReq->info.node; + int32_t code = -1; + SCompactObj *pCompact = mndAcquireCompact(pMnode, killCompactReq.compactId); + if(pCompact == NULL){ + tFreeSKillCompactReq(&killCompactReq); + return -1; + } + + if (0 != mndCheckOperPrivilege(pMnode, pReq->info.conn.user, MND_OPER_COMPACT_DB)) { + goto _OVER; + } + + if (mndKillCompact(pMnode, pReq, pCompact) < 0) { + goto _OVER; + } + + code = TSDB_CODE_ACTION_IN_PROGRESS; + + char obj[10] = {0}; + sprintf(obj, "%d", pCompact->compactId); + + auditRecord(pReq, pMnode->clusterId, "killCompact", pCompact->dbname, obj, killCompactReq.sql, killCompactReq.sqlLen); + +_OVER: + if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) { + mError("failed to kill compact %" PRId32 " since %s", killCompactReq.compactId, terrstr()); + } + + tFreeSKillCompactReq(&killCompactReq); + sdbRelease(pMnode->pSdb, pCompact); + + return code; +} + +//update progress +static int32_t mndUpdateCompactProgress(SMnode *pMnode, SRpcMsg *pReq, int32_t compactId, SQueryCompactProgressRsp* rsp) { + void* pIter = NULL; + while (1) { + SCompactDetailObj *pDetail = NULL; + pIter = sdbFetch(pMnode->pSdb, SDB_COMPACT_DETAIL, pIter, (void **)&pDetail); + if (pIter == NULL) break; + + if (pDetail->compactId == compactId && pDetail->vgId == rsp->vgId && pDetail->dnodeId == rsp->dnodeId) { + pDetail->newNumberFileset = rsp->numberFileset; + pDetail->newFinished = rsp->finished; + + sdbRelease(pMnode->pSdb, pDetail); + + return 0; + } + + sdbRelease(pMnode->pSdb, pDetail); + } + + return -1; +} + +int32_t mndProcessQueryCompactRsp(SRpcMsg *pReq){ + SQueryCompactProgressRsp req = {0}; + if (tDeserializeSQueryCompactProgressRsp(pReq->pCont, pReq->contLen, &req) != 0) { + terrno = TSDB_CODE_INVALID_MSG; + return -1; + } + + mDebug("compact:%d, receive query response, vgId:%d, dnodeId:%d, numberFileset:%d, finished:%d", + req.compactId, req.vgId, req.dnodeId, req.numberFileset, req.finished); + + SMnode *pMnode = pReq->info.node; + int32_t code = -1; + + + if(mndUpdateCompactProgress(pMnode, pReq, req.compactId, &req) != 0){ + mError("compact:%d, failed to update progress, vgId:%d, dnodeId:%d, numberFileset:%d, finished:%d", + req.compactId, req.vgId, req.dnodeId, req.numberFileset, req.finished); + return -1; + } + + return 0; +} + +//timer +void mndCompactSendProgressReq(SMnode *pMnode, SCompactObj *pCompact){ + void *pIter = NULL; + + while (1) { + SCompactDetailObj *pDetail = NULL; + pIter = sdbFetch(pMnode->pSdb, SDB_COMPACT_DETAIL, pIter, (void **)&pDetail); + if (pIter == NULL) break; + + if (pDetail->compactId == pCompact->compactId) { + SEpSet epSet = {0}; + + SDnodeObj *pDnode = mndAcquireDnode(pMnode, pDetail->dnodeId); + if(pDnode == NULL) break; + addEpIntoEpSet(&epSet, pDnode->fqdn, pDnode->port); + mndReleaseDnode(pMnode, pDnode); + + SQueryCompactProgressReq req; + req.compactId = pDetail->compactId; + req.vgId = pDetail->vgId; + req.dnodeId = pDetail->dnodeId; + + int32_t contLen = tSerializeSQueryCompactProgressReq(NULL, 0, &req); + if (contLen < 0) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + continue; + } + + contLen += sizeof(SMsgHead); + + SMsgHead *pHead = rpcMallocCont(contLen); + if (pHead == NULL) { + sdbCancelFetch(pMnode->pSdb, pDetail); + sdbRelease(pMnode->pSdb, pDetail); + continue; + } + + pHead->contLen = htonl(contLen); + pHead->vgId = htonl(pDetail->vgId); + + tSerializeSQueryCompactProgressReq((char *)pHead + sizeof(SMsgHead), contLen - sizeof(SMsgHead), &req); + + SRpcMsg rpcMsg = {.msgType = TDMT_VND_QUERY_COMPACT_PROGRESS, + .contLen = contLen}; + + //rpcMsg.pCont = rpcMallocCont(contLen); + //if (rpcMsg.pCont == NULL) { + // return; + //} + + //memcpy(rpcMsg.pCont, pHead, contLen); + + rpcMsg.pCont = pHead; + + char detail[1024] = {0}; + int32_t len = snprintf(detail, sizeof(detail), "msgType:%s numOfEps:%d inUse:%d", TMSG_INFO(TDMT_VND_QUERY_COMPACT_PROGRESS), + epSet.numOfEps, epSet.inUse); + for (int32_t i = 0; i < epSet.numOfEps; ++i) { + len += snprintf(detail + len, sizeof(detail) - len, " ep:%d-%s:%u", i, epSet.eps[i].fqdn, + epSet.eps[i].port); + } + + mDebug("compact:%d, send update progress msg to %s", pDetail->compactId, detail); + + tmsgSendReq(&epSet, &rpcMsg); + } + + sdbRelease(pMnode->pSdb, pDetail); + } +} + +static int32_t mndSaveCompactProgress(SMnode *pMnode, int32_t compactId) { + bool needSave = false; + void* pIter = NULL; + while (1) { + SCompactDetailObj *pDetail = NULL; + pIter = sdbFetch(pMnode->pSdb, SDB_COMPACT_DETAIL, pIter, (void **)&pDetail); + if (pIter == NULL) break; + + mDebug("compact:%d, check save progress, vgId:%d, dnodeId:%d, numberFileset:%d, finished:%d, " + "newNumberFileset:%d, newFinished:%d", + pDetail->compactId, pDetail->vgId, pDetail->dnodeId, pDetail->numberFileset, pDetail->finished, + pDetail->newNumberFileset, pDetail->newFinished); + + if (pDetail->compactId == compactId) { + if(pDetail->numberFileset < pDetail->newNumberFileset || pDetail->finished < pDetail->newFinished) + needSave = true; + } + + sdbRelease(pMnode->pSdb, pDetail); + } + if(!needSave) { + mDebug("compact:%" PRId32 ", no need to save" , compactId); + return 0; + } + + STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_NOTHING, NULL, "update-compact-progress"); + if (pTrans == NULL) { + mError("trans:%" PRId32 ", failed to create since %s" , pTrans->id, terrstr()); + return -1; + } + mInfo("trans:%d, used to update compact progress:%" PRId32, pTrans->id, compactId); + + SCompactObj *pCompact = mndAcquireCompact(pMnode, compactId); + + pIter = NULL; + while (1) { + SCompactDetailObj *pDetail = NULL; + pIter = sdbFetch(pMnode->pSdb, SDB_COMPACT_DETAIL, pIter, (void **)&pDetail); + if (pIter == NULL) break; + + if (pDetail->compactId == compactId) { + mInfo("trans:%d, check compact progress:%d, vgId:%d, dnodeId:%d, numberFileset:%d, finished:%d, " + "newNumberFileset:%d, newFinished:%d", + pTrans->id, pDetail->compactId, pDetail->vgId, pDetail->dnodeId, pDetail->numberFileset, pDetail->finished, + pDetail->newNumberFileset, pDetail->newFinished); + + pDetail->numberFileset = pDetail->newNumberFileset; + pDetail->finished = pDetail->newFinished; + + SSdbRaw *pCommitRaw = mndCompactDetailActionEncode(pDetail); + if (pCommitRaw == NULL || mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) { + mError("trans:%d, failed to append commit log since %s", pTrans->id, terrstr()); + mndTransDrop(pTrans); + return -1; + } + (void)sdbSetRawStatus(pCommitRaw, SDB_STATUS_READY); + } + + sdbRelease(pMnode->pSdb, pDetail); + } + + bool allFinished = true; + while (1) { + SCompactDetailObj *pDetail = NULL; + pIter = sdbFetch(pMnode->pSdb, SDB_COMPACT_DETAIL, pIter, (void **)&pDetail); + if (pIter == NULL) break; + + mInfo("trans:%d, check compact finished:%d, vgId:%d, dnodeId:%d, numberFileset:%d, finished:%d", + pTrans->id, pDetail->compactId, pDetail->vgId, pDetail->dnodeId, pDetail->numberFileset, pDetail->finished); + + if(pDetail->numberFileset == -1 && pDetail->finished == -1){ + allFinished = false; + sdbRelease(pMnode->pSdb, pDetail); + break; + } + if (pDetail->numberFileset != -1 && pDetail->finished != -1 && + pDetail->numberFileset != pDetail->finished) { + allFinished = false; + sdbRelease(pMnode->pSdb, pDetail); + break; + } + + sdbRelease(pMnode->pSdb, pDetail); + } + + if(allFinished){ + while (1) { + SCompactDetailObj *pDetail = NULL; + pIter = sdbFetch(pMnode->pSdb, SDB_COMPACT_DETAIL, pIter, (void **)&pDetail); + if (pIter == NULL) break; + + if (pDetail->compactId == pCompact->compactId) { + SSdbRaw *pCommitRaw = mndCompactDetailActionEncode(pDetail); + if (pCommitRaw == NULL || mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) { + mError("trans:%d, failed to append commit log since %s", pTrans->id, terrstr()); + mndTransDrop(pTrans); + return -1; + } + (void)sdbSetRawStatus(pCommitRaw, SDB_STATUS_DROPPED); + } + + sdbRelease(pMnode->pSdb, pDetail); + } + + SSdbRaw *pCommitRaw = mndCompactActionEncode(pCompact); + if (pCommitRaw == NULL || mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) { + mError("trans:%d, failed to append commit log since %s", pTrans->id, terrstr()); + mndTransDrop(pTrans); + return -1; + } + (void)sdbSetRawStatus(pCommitRaw, SDB_STATUS_DROPPED); + } + + if (mndTransPrepare(pMnode, pTrans) != 0) { + mError("trans:%d, failed to prepare since %s", pTrans->id, terrstr()); + mndTransDrop(pTrans); + sdbRelease(pMnode->pSdb, pCompact); + return -1; + } + + sdbRelease(pMnode->pSdb, pCompact); + mndTransDrop(pTrans); + return 0; +} + +void mndCompactPullup(SMnode *pMnode) { + SSdb *pSdb = pMnode->pSdb; + SArray *pArray = taosArrayInit(sdbGetSize(pSdb, SDB_COMPACT), sizeof(int32_t)); + if (pArray == NULL) return; + + void *pIter = NULL; + while (1) { + SCompactObj *pCompact = NULL; + pIter = sdbFetch(pMnode->pSdb, SDB_COMPACT, pIter, (void **)&pCompact); + if (pIter == NULL) break; + taosArrayPush(pArray, &pCompact->compactId); + sdbRelease(pSdb, pCompact); + } + + for (int32_t i = 0; i < taosArrayGetSize(pArray); ++i) { + int32_t *pCompactId = taosArrayGet(pArray, i); + SCompactObj *pCompact = mndAcquireCompact(pMnode, *pCompactId); + if (pCompact != NULL) { + mndCompactSendProgressReq(pMnode, pCompact); + mndSaveCompactProgress(pMnode, pCompact->compactId); + } + mndReleaseCompact(pMnode, pCompact); + } + taosArrayDestroy(pArray); +} + +static int32_t mndProcessCompactTimer(SRpcMsg *pReq) { + mTrace("start to process compact timer"); + mndCompactPullup(pReq->info.node); + return 0; +} diff --git a/source/dnode/mnode/impl/src/mndCompactDetail.c b/source/dnode/mnode/impl/src/mndCompactDetail.c new file mode 100644 index 0000000000..ea3296de7c --- /dev/null +++ b/source/dnode/mnode/impl/src/mndCompactDetail.c @@ -0,0 +1,300 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +#include "mndCompactDetail.h" +#include "mndTrans.h" +#include "mndShow.h" +#include "mndDb.h" + +#define MND_COMPACT_VER_NUMBER 1 + +int32_t mndInitCompactDetail(SMnode *pMnode) { + mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_COMPACT_DETAIL, mndRetrieveCompactDetail); + + SSdbTable table = { + .sdbType = SDB_COMPACT_DETAIL, + .keyType = SDB_KEY_INT32, + .encodeFp = (SdbEncodeFp)mndCompactDetailActionEncode, + .decodeFp = (SdbDecodeFp)mndCompactDetailActionDecode, + .insertFp = (SdbInsertFp)mndCompactDetailActionInsert, + .updateFp = (SdbUpdateFp)mndCompactDetailActionUpdate, + .deleteFp = (SdbDeleteFp)mndCompactDetailActionDelete, + }; + + return sdbSetTable(pMnode->pSdb, table); +} + +void mndCleanupCompactDetail(SMnode *pMnode) { + mDebug("mnd compact detail cleanup"); +} + +int32_t mndRetrieveCompactDetail(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows){ + SMnode *pMnode = pReq->info.node; + SSdb *pSdb = pMnode->pSdb; + int32_t numOfRows = 0; + SCompactDetailObj *pCompactDetail = NULL; + char *sep = NULL; + SDbObj *pDb = NULL; + + if (strlen(pShow->db) > 0) { + sep = strchr(pShow->db, '.'); + if (sep && ((0 == strcmp(sep + 1, TSDB_INFORMATION_SCHEMA_DB) || (0 == strcmp(sep + 1, TSDB_PERFORMANCE_SCHEMA_DB))))) { + sep++; + } else { + pDb = mndAcquireDb(pMnode, pShow->db); + if (pDb == NULL) return terrno; + } + } + + while(numOfRows < rows){ + pShow->pIter = sdbFetch(pSdb, SDB_COMPACT_DETAIL, pShow->pIter, (void **)&pCompactDetail); + if (pShow->pIter == NULL) break; + + SColumnInfoData *pColInfo; + SName n; + int32_t cols = 0; + + char tmpBuf[TSDB_SHOW_SQL_LEN + VARSTR_HEADER_SIZE] = {0}; + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, (const char *)&pCompactDetail->compactId, false); + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, (const char *)&pCompactDetail->vgId, false); + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, (const char *)&pCompactDetail->dnodeId, false); + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, (const char *)&pCompactDetail->numberFileset, false); + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, (const char *)&pCompactDetail->finished, false); + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, (const char *)&pCompactDetail->startTime, false); + + numOfRows++; + sdbRelease(pSdb, pCompactDetail); + } + + pShow->numOfRows += numOfRows; + mndReleaseDb(pMnode, pDb); + return numOfRows; +} + +void tFreeCompactDetailObj(SCompactDetailObj *pCompact) { +} + +int32_t tSerializeSCompactDetailObj(void *buf, int32_t bufLen, const SCompactDetailObj *pObj) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + + if (tEncodeI32(&encoder, pObj->compactDetailId) < 0) return -1; + if (tEncodeI32(&encoder, pObj->compactId) < 0) return -1; + if (tEncodeI32(&encoder, pObj->vgId) < 0) return -1; + if (tEncodeI32(&encoder, pObj->dnodeId) < 0) return -1; + if (tEncodeI32(&encoder, pObj->numberFileset) < 0) return -1; + if (tEncodeI32(&encoder, pObj->finished) < 0) return -1; + if (tEncodeI64(&encoder, pObj->startTime) < 0) return -1; + if (tEncodeI32(&encoder, pObj->newNumberFileset) < 0) return -1; + if (tEncodeI32(&encoder, pObj->newFinished) < 0) return -1; + + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSCompactDetailObj(void *buf, int32_t bufLen, SCompactDetailObj *pObj) { + int8_t ex = 0; + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + if (tStartDecode(&decoder) < 0) return -1; + + if (tDecodeI32(&decoder, &pObj->compactDetailId) < 0) return -1; + if (tDecodeI32(&decoder, &pObj->compactId) < 0) return -1; + if (tDecodeI32(&decoder, &pObj->vgId) < 0) return -1; + if (tDecodeI32(&decoder, &pObj->dnodeId) < 0) return -1; + if (tDecodeI32(&decoder, &pObj->numberFileset) < 0) return -1; + if (tDecodeI32(&decoder, &pObj->finished) < 0) return -1; + if (tDecodeI64(&decoder, &pObj->startTime) < 0) return -1; + if (tDecodeI32(&decoder, &pObj->newNumberFileset) < 0) return -1; + if (tDecodeI32(&decoder, &pObj->newFinished) < 0) return -1; + + tEndDecode(&decoder); + + tDecoderClear(&decoder); + return 0; +} + +SSdbRaw *mndCompactDetailActionEncode(SCompactDetailObj *pCompact) { + terrno = TSDB_CODE_SUCCESS; + + void *buf = NULL; + SSdbRaw *pRaw = NULL; + + int32_t tlen = tSerializeSCompactDetailObj(NULL, 0, pCompact); + if (tlen < 0) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto OVER; + } + + int32_t size = sizeof(int32_t) + tlen; + pRaw = sdbAllocRaw(SDB_COMPACT_DETAIL, MND_COMPACT_VER_NUMBER, size); + if (pRaw == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto OVER; + } + + buf = taosMemoryMalloc(tlen); + if (buf == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto OVER; + } + + tlen = tSerializeSCompactDetailObj(buf, tlen, pCompact); + if (tlen < 0) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto OVER; + } + + int32_t dataPos = 0; + SDB_SET_INT32(pRaw, dataPos, tlen, OVER); + SDB_SET_BINARY(pRaw, dataPos, buf, tlen, OVER); + SDB_SET_DATALEN(pRaw, dataPos, OVER); + + +OVER: + taosMemoryFreeClear(buf); + if (terrno != TSDB_CODE_SUCCESS) { + mError("compact detail:%" PRId32 ", failed to encode to raw:%p since %s", pCompact->compactId, pRaw, terrstr()); + sdbFreeRaw(pRaw); + return NULL; + } + + mTrace("compact detail:%" PRId32 ", encode to raw:%p, row:%p", pCompact->compactId, pRaw, pCompact); + return pRaw; +} + +SSdbRow *mndCompactDetailActionDecode(SSdbRaw *pRaw) { + SSdbRow *pRow = NULL; + SCompactDetailObj *pCompact = NULL; + void *buf = NULL; + terrno = TSDB_CODE_SUCCESS; + + int8_t sver = 0; + if (sdbGetRawSoftVer(pRaw, &sver) != 0) { + goto OVER; + } + + if (sver != MND_COMPACT_VER_NUMBER) { + terrno = TSDB_CODE_SDB_INVALID_DATA_VER; + mError("compact detail read invalid ver, data ver: %d, curr ver: %d", sver, MND_COMPACT_VER_NUMBER); + goto OVER; + } + + pRow = sdbAllocRow(sizeof(SCompactObj)); + if (pRow == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto OVER; + } + + pCompact = sdbGetRowObj(pRow); + if (pCompact == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto OVER; + } + + int32_t tlen; + int32_t dataPos = 0; + SDB_GET_INT32(pRaw, dataPos, &tlen, OVER); + buf = taosMemoryMalloc(tlen + 1); + if (buf == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto OVER; + } + SDB_GET_BINARY(pRaw, dataPos, buf, tlen, OVER); + + if (tDeserializeSCompactDetailObj(buf, tlen, pCompact) < 0) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto OVER; + } + + //taosInitRWLatch(&pView->lock); + +OVER: + taosMemoryFreeClear(buf); + if (terrno != TSDB_CODE_SUCCESS) { + mError("compact detail:%" PRId32 ", failed to decode from raw:%p since %s", pCompact->compactId, pRaw, terrstr()); + taosMemoryFreeClear(pRow); + return NULL; + } + + mTrace("compact detail:%" PRId32 ", decode from raw:%p, row:%p", pCompact->compactId, pRaw, pCompact); + return pRow; +} + +int32_t mndCompactDetailActionInsert(SSdb *pSdb, SCompactDetailObj *pCompact) { + mTrace("compact detail:%" PRId32 ", perform insert action", pCompact->compactId); + return 0; +} + +int32_t mndCompactDetailActionDelete(SSdb *pSdb, SCompactDetailObj *pCompact) { + mTrace("compact detail:%" PRId32 ", perform insert action", pCompact->compactId); + tFreeCompactDetailObj(pCompact); + return 0; +} + +int32_t mndCompactDetailActionUpdate(SSdb *pSdb, SCompactDetailObj *pOldCompact, SCompactDetailObj *pNewCompact) { + mTrace("compact detail:%" PRId32 ", perform update action, old row:%p new row:%p", + pOldCompact->compactId, pOldCompact, pNewCompact); + + + pOldCompact->numberFileset = pNewCompact->numberFileset; + pOldCompact->finished = pNewCompact->finished; + + return 0; +} + +int32_t mndAddCompactDetailToTran(SMnode *pMnode, STrans *pTrans, SCompactObj* pCompact, SVgObj *pVgroup, + SVnodeGid *pVgid, int32_t index){ + SCompactDetailObj compactDetail = {0}; + compactDetail.compactDetailId = index; + compactDetail.compactId = pCompact->compactId; + compactDetail.vgId = pVgroup->vgId; + compactDetail.dnodeId = pVgid->dnodeId; + compactDetail.startTime = taosGetTimestampMs(); + compactDetail.numberFileset = -1; + compactDetail.finished = -1; + compactDetail.newNumberFileset = -1; + compactDetail.newFinished = -1; + + mInfo("compact:%d, add compact detail to trans, vgId:%d, dnodeId:%d", + pCompact->compactId, pVgroup->vgId, pVgid->dnodeId); + + SSdbRaw *pVgRaw = mndCompactDetailActionEncode(&compactDetail); + if (pVgRaw == NULL) return -1; + if (mndTransAppendRedolog(pTrans, pVgRaw) != 0) { + sdbFreeRaw(pVgRaw); + return -1; + } + (void)sdbSetRawStatus(pVgRaw, SDB_STATUS_READY); + + return 0; +} \ No newline at end of file diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c index fdfec610d9..38a92b43e7 100644 --- a/source/dnode/mnode/impl/src/mndMain.c +++ b/source/dnode/mnode/impl/src/mndMain.c @@ -42,6 +42,8 @@ #include "mndUser.h" #include "mndVgroup.h" #include "mndView.h" +#include "mndCompact.h" +#include "mndCompactDetail.h" static inline int32_t mndAcquireRpc(SMnode *pMnode) { int32_t code = 0; @@ -112,6 +114,16 @@ static void mndPullupTrans(SMnode *pMnode) { } } +static void mndPullupCompacts(SMnode *pMnode) { + mTrace("pullup compact timer msg"); + int32_t contLen = 0; + void *pReq = mndBuildTimerMsg(&contLen); + if (pReq != NULL) { + SRpcMsg rpcMsg = {.msgType = TDMT_MND_COMPACT_TIMER, .pCont = pReq, .contLen = contLen}; + tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg); + } +} + static void mndPullupTtl(SMnode *pMnode) { mTrace("pullup ttl"); int32_t contLen = 0; @@ -287,6 +299,10 @@ static void *mndThreadFp(void *param) { mndPullupTrans(pMnode); } + if (sec % tsCompactPullupInterval == 0) { + mndPullupCompacts(pMnode); + } + if (sec % tsMqRebalanceInterval == 0) { mndCalMqRebalance(pMnode); } @@ -462,6 +478,8 @@ static int32_t mndInitSteps(SMnode *pMnode) { if (mndAllocStep(pMnode, "mnode-db", mndInitDb, mndCleanupDb) != 0) return -1; if (mndAllocStep(pMnode, "mnode-func", mndInitFunc, mndCleanupFunc) != 0) return -1; if (mndAllocStep(pMnode, "mnode-view", mndInitView, mndCleanupView) != 0) return -1; + if (mndAllocStep(pMnode, "mnode-compact", mndInitCompact, mndCleanupCompact) != 0) return -1; + if (mndAllocStep(pMnode, "mnode-compact-detail", mndInitCompactDetail, mndCleanupCompactDetail) != 0) return -1; if (mndAllocStep(pMnode, "mnode-sdb", mndOpenSdb, NULL) != 0) return -1; if (mndAllocStep(pMnode, "mnode-profile", mndInitProfile, mndCleanupProfile) != 0) return -1; if (mndAllocStep(pMnode, "mnode-show", mndInitShow, mndCleanupShow) != 0) return -1; @@ -693,7 +711,8 @@ static int32_t mndCheckMnodeState(SRpcMsg *pMsg) { _OVER: if (pMsg->msgType == TDMT_MND_TMQ_TIMER || pMsg->msgType == TDMT_MND_TELEM_TIMER || pMsg->msgType == TDMT_MND_TRANS_TIMER || pMsg->msgType == TDMT_MND_TTL_TIMER || - pMsg->msgType == TDMT_MND_TRIM_DB_TIMER || pMsg->msgType == TDMT_MND_UPTIME_TIMER) { + pMsg->msgType == TDMT_MND_TRIM_DB_TIMER || pMsg->msgType == TDMT_MND_UPTIME_TIMER || + pMsg->msgType == TDMT_MND_COMPACT_TIMER) { mTrace("timer not process since mnode restored:%d stopped:%d, sync restored:%d role:%s ", pMnode->restored, pMnode->stopped, state.restored, syncStr(state.state)); return -1; diff --git a/source/dnode/mnode/impl/src/mndShow.c b/source/dnode/mnode/impl/src/mndShow.c index bdf7df25e1..8e7e72aa0e 100644 --- a/source/dnode/mnode/impl/src/mndShow.c +++ b/source/dnode/mnode/impl/src/mndShow.c @@ -17,6 +17,7 @@ #include "mndShow.h" #include "mndPrivilege.h" #include "systable.h" +#include "mndUser.h" #define SHOW_STEP_SIZE 100 #define SHOW_COLS_STEP_SIZE 4096 @@ -118,6 +119,10 @@ static int32_t convertToRetrieveType(char *name, int32_t len) { type = TSDB_MGMT_TABLE_PRIVILEGES; } else if (strncasecmp(name, TSDB_INS_TABLE_VIEWS, len) == 0) { type = TSDB_MGMT_TABLE_VIEWS; + } else if (strncasecmp(name, TSDB_INS_TABLE_COMPACTS, len) == 0) { + type = TSDB_MGMT_TABLE_COMPACT; + } else if (strncasecmp(name, TSDB_INS_TABLE_COMPACT_DETAILS, len) == 0) { + type = TSDB_MGMT_TABLE_COMPACT_DETAIL; } else { mError("invalid show name:%s len:%d", name, len); } @@ -206,7 +211,7 @@ static int32_t mndProcessRetrieveSysTableReq(SRpcMsg *pReq) { return -1; } - mDebug("mndProcessRetrieveSysTableReq tb:%s", retrieveReq.tb); + mDebug("process to retrieve systable req db:%s, tb:%s", retrieveReq.db, retrieveReq.tb); if (retrieveReq.showId == 0) { STableMetaRsp *pMeta = taosHashGet(pMnode->infosMeta, retrieveReq.tb, strlen(retrieveReq.tb)); diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c index bd67af712a..a2f9c40c58 100644 --- a/source/dnode/mnode/impl/src/mndStream.c +++ b/source/dnode/mnode/impl/src/mndStream.c @@ -847,11 +847,12 @@ static int32_t mndProcessCreateStreamReq(SRpcMsg *pReq) { mInfo("trans:%d, used to create stream:%s", pTrans->id, createStreamReq.name); - mndTransSetDbName(pTrans, createStreamReq.sourceDB, streamObj.targetDb); + mndTransSetDbName(pTrans, createStreamReq.sourceDB, streamObj.targetSTbName); if (mndTransCheckConflict(pMnode, pTrans) != 0) { mndTransDrop(pTrans); goto _OVER; } + // create stb for stream if (createStreamReq.createStb == STREAM_CREATE_STABLE_TRUE && mndCreateStbForStream(pMnode, pTrans, &streamObj, pReq->info.conn.user) < 0) { @@ -938,7 +939,8 @@ int64_t mndStreamGenChkpId(SMnode *pMnode) { if (pIter == NULL) break; maxChkpId = TMAX(maxChkpId, pStream->checkpointId); - mDebug("stream %p checkpoint %" PRId64 "", pStream, pStream->checkpointId); + mDebug("stream:%p, %s id:%" PRIx64 "checkpoint %" PRId64 "", pStream, pStream->name, pStream->uid, + pStream->checkpointId); sdbRelease(pSdb, pStream); } @@ -1380,12 +1382,12 @@ static int32_t mndProcessDropStreamReq(SRpcMsg *pReq) { } // check if it is conflict with other trans in both sourceDb and targetDb. - bool conflict = streamTransConflictOtherTrans(pMnode, pStream->sourceDb, pStream->targetDb, true); - if (conflict) { - sdbRelease(pMnode->pSdb, pStream); - tFreeMDropStreamReq(&dropReq); - return -1; - } +// bool conflict = streamTransConflictOtherTrans(pMnode, pStream->sourceDb, pStream->targetDb, true); +// if (conflict) { +// sdbRelease(pMnode->pSdb, pStream); +// tFreeMDropStreamReq(&dropReq); +// return -1; +// } STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_DB_INSIDE, pReq, MND_STREAM_DROP_NAME); if (pTrans == NULL) { diff --git a/source/dnode/mnode/sdb/inc/sdb.h b/source/dnode/mnode/sdb/inc/sdb.h index 0a20dcfd09..e1beaaa910 100644 --- a/source/dnode/mnode/sdb/inc/sdb.h +++ b/source/dnode/mnode/sdb/inc/sdb.h @@ -150,7 +150,9 @@ typedef enum { SDB_IDX = 21, SDB_VIEW = 22, SDB_STREAM_SEQ = 23, - SDB_MAX = 24 + SDB_COMPACT = 24, + SDB_COMPACT_DETAIL = 25, + SDB_MAX = 26 } ESdbType; typedef struct SSdbRaw { @@ -170,11 +172,11 @@ typedef struct SSdbRow { } SSdbRow; typedef struct SSdb { - SMnode * pMnode; - SWal * pWal; + SMnode *pMnode; + SWal *pWal; int64_t sync; - char * currDir; - char * tmpDir; + char *currDir; + char *tmpDir; int64_t commitIndex; int64_t commitTerm; int64_t commitConfig; @@ -184,7 +186,7 @@ typedef struct SSdb { int64_t tableVer[SDB_MAX]; int64_t maxId[SDB_MAX]; EKeyType keyTypes[SDB_MAX]; - SHashObj * hashObjs[SDB_MAX]; + SHashObj *hashObjs[SDB_MAX]; TdThreadRwlock locks[SDB_MAX]; SdbInsertFp insertFps[SDB_MAX]; SdbUpdateFp updateFps[SDB_MAX]; @@ -199,7 +201,7 @@ typedef struct SSdb { typedef struct SSdbIter { TdFilePtr file; int64_t total; - char * name; + char *name; } SSdbIter; typedef struct { @@ -216,8 +218,8 @@ typedef struct { typedef struct SSdbOpt { const char *path; - SMnode * pMnode; - SWal * pWal; + SMnode *pMnode; + SWal *pWal; int64_t sync; } SSdbOpt; @@ -394,7 +396,7 @@ int32_t sdbGetRawSoftVer(SSdbRaw *pRaw, int8_t *sver); int32_t sdbGetRawTotalSize(SSdbRaw *pRaw); SSdbRow *sdbAllocRow(int32_t objSize); -void * sdbGetRowObj(SSdbRow *pRow); +void *sdbGetRowObj(SSdbRow *pRow); void sdbFreeRow(SSdb *pSdb, SSdbRow *pRow, bool callFunc); int32_t sdbStartRead(SSdb *pSdb, SSdbIter **ppIter, int64_t *index, int64_t *term, int64_t *config); diff --git a/source/dnode/mnode/sdb/src/sdbHash.c b/source/dnode/mnode/sdb/src/sdbHash.c index df5c399da8..109a3ca211 100644 --- a/source/dnode/mnode/sdb/src/sdbHash.c +++ b/source/dnode/mnode/sdb/src/sdbHash.c @@ -64,7 +64,11 @@ const char *sdbTableName(ESdbType type) { return "idx"; case SDB_VIEW: return "view"; - default: + case SDB_COMPACT: + return "compact"; + case SDB_COMPACT_DETAIL: + return "compact_detail"; + default: return "undefine"; } } diff --git a/source/dnode/vnode/CMakeLists.txt b/source/dnode/vnode/CMakeLists.txt index 114051f02b..2c57eb3cb5 100644 --- a/source/dnode/vnode/CMakeLists.txt +++ b/source/dnode/vnode/CMakeLists.txt @@ -93,6 +93,7 @@ IF (TD_VNODE_PLUGINS) vnode PRIVATE ${TD_ENTERPRISE_DIR}/src/plugins/vnode/src/tsdbCompact.c + ${TD_ENTERPRISE_DIR}/src/plugins/vnode/src/tsdbCompactMonitor.c ${TD_ENTERPRISE_DIR}/src/plugins/vnode/src/vnodeCompact.c ) ENDIF () diff --git a/source/dnode/vnode/src/inc/tsdb.h b/source/dnode/vnode/src/inc/tsdb.h index 4a98439375..d347ce30d8 100644 --- a/source/dnode/vnode/src/inc/tsdb.h +++ b/source/dnode/vnode/src/inc/tsdb.h @@ -74,6 +74,7 @@ typedef struct SDiskDataBuilder SDiskDataBuilder; typedef struct SBlkInfo SBlkInfo; typedef struct STsdbDataIter2 STsdbDataIter2; typedef struct STsdbFilterInfo STsdbFilterInfo; +typedef struct STFileSystem STFileSystem; #define TSDBROW_ROW_FMT ((int8_t)0x0) #define TSDBROW_COL_FMT ((int8_t)0x1) @@ -392,6 +393,8 @@ struct STsdb { TdThreadMutex pgMutex; struct STFileSystem *pFS; // new SRocksCache rCache; + // compact monitor + struct SCompMonitor *pCompMonitor; }; struct TSDBKEY { diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c index ee76a27414..138c58b45f 100644 --- a/source/dnode/vnode/src/tq/tq.c +++ b/source/dnode/vnode/src/tq/tq.c @@ -699,7 +699,23 @@ end: return ret; } -void freePtr(void* ptr) { taosMemoryFree(*(void**)ptr); } +static void freePtr(void* ptr) { taosMemoryFree(*(void**)ptr); } + +static STaskId replaceStreamTaskId(SStreamTask* pTask) { + ASSERT(pTask->info.fillHistory); + STaskId id = {.streamId = pTask->id.streamId, .taskId = pTask->id.taskId}; + + pTask->id.streamId = pTask->streamTaskId.streamId; + pTask->id.taskId = pTask->streamTaskId.taskId; + + return id; +} + +static void restoreStreamTaskId(SStreamTask* pTask, STaskId* pId) { + ASSERT(pTask->info.fillHistory); + pTask->id.taskId = pId->taskId; + pTask->id.streamId = pId->streamId; +} int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t nextProcessVer) { int32_t vgId = TD_VID(pTq->pVnode); @@ -713,15 +729,9 @@ int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t nextProcessVer) { streamTaskOpenAllUpstreamInput(pTask); if (pTask->info.taskLevel == TASK_LEVEL__SOURCE) { - SStreamTask* pStateTask = pTask; - - STaskId taskId = {.streamId = 0, .taskId = 0}; + STaskId taskId = {0}; if (pTask->info.fillHistory) { - taskId.streamId = pTask->id.streamId; - taskId.taskId = pTask->id.taskId; - - pTask->id.streamId = pTask->streamTaskId.streamId; - pTask->id.taskId = pTask->streamTaskId.taskId; + taskId = replaceStreamTaskId(pTask); } pTask->pState = streamStateOpen(pTq->pStreamMeta->path, pTask, false, -1, -1); @@ -731,9 +741,9 @@ int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t nextProcessVer) { } else { tqDebug("s-task:%s state:%p", pTask->id.idStr, pTask->pState); } + if (pTask->info.fillHistory) { - pTask->id.streamId = taskId.streamId; - pTask->id.taskId = taskId.taskId; + restoreStreamTaskId(pTask, &taskId); } SReadHandle handle = { @@ -754,15 +764,9 @@ int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t nextProcessVer) { qSetTaskId(pTask->exec.pExecutor, pTask->id.taskId, pTask->id.streamId); } else if (pTask->info.taskLevel == TASK_LEVEL__AGG) { - SStreamTask* pSateTask = pTask; - // SStreamTask task = {0}; - - STaskId taskId = {.streamId = 0, .taskId = 0}; + STaskId taskId = {0}; if (pTask->info.fillHistory) { - taskId.streamId = pTask->id.streamId; - taskId.taskId = pTask->id.taskId; - pTask->id.streamId = pTask->streamTaskId.streamId; - pTask->id.taskId = pTask->streamTaskId.taskId; + taskId = replaceStreamTaskId(pTask); } pTask->pState = streamStateOpen(pTq->pStreamMeta->path, pTask, false, -1, -1); @@ -774,15 +778,13 @@ int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t nextProcessVer) { } if (pTask->info.fillHistory) { - pTask->id.streamId = taskId.streamId; - pTask->id.taskId = taskId.taskId; + restoreStreamTaskId(pTask, &taskId); } - int32_t numOfVgroups = (int32_t)taosArrayGetSize(pTask->upstreamInfo.pList); SReadHandle handle = { .checkpointId = pTask->chkInfo.checkpointId, .vnode = NULL, - .numOfVgroups = numOfVgroups, + .numOfVgroups = (int32_t)taosArrayGetSize(pTask->upstreamInfo.pList), .pStateBackend = pTask->pState, .fillHistory = pTask->info.fillHistory, .winRange = pTask->dataRange.window, @@ -828,12 +830,6 @@ int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t nextProcessVer) { pTask->exec.pWalReader = walOpenReader(pTq->pVnode->pWal, &cond, pTask->id.taskId); } - // // reset the task status from unfinished transaction - // if (pTask->status.taskStatus == TASK_STATUS__PAUSE) { - // tqWarn("s-task:%s reset task status to be normal, status kept in taskMeta: Paused", pTask->id.idStr); - // pTask->status.taskStatus = TASK_STATUS__READY; - // } - streamTaskResetUpstreamStageInfo(pTask); streamSetupScheduleTrigger(pTask); SCheckpointInfo* pChkInfo = &pTask->chkInfo; diff --git a/source/dnode/vnode/src/tq/tqOffset.c b/source/dnode/vnode/src/tq/tqOffset.c index 5e67f3c3ac..f8bf61d4e7 100644 --- a/source/dnode/vnode/src/tq/tqOffset.c +++ b/source/dnode/vnode/src/tq/tqOffset.c @@ -47,6 +47,7 @@ int32_t tqOffsetRestoreFromFile(STqOffsetStore* pStore, const char* fname) { } } + size = htonl(size); void* pMemBuf = taosMemoryCalloc(1, size); if (pMemBuf == NULL) { tqError("vgId:%d failed to restore offset from file, since out of memory, malloc size:%d", vgId, size); @@ -119,6 +120,7 @@ STqOffsetStore* tqOffsetOpen(STQ* pTq) { } void tqOffsetClose(STqOffsetStore* pStore) { + if(pStore == NULL) return; tqOffsetCommitFile(pStore); taosHashCleanup(pStore->pHash); taosMemoryFree(pStore); @@ -176,7 +178,7 @@ int32_t tqOffsetCommitFile(STqOffsetStore* pStore) { void* buf = taosMemoryCalloc(1, totLen); void* abuf = POINTER_SHIFT(buf, INT_BYTES); - *(int32_t*)buf = bodyLen; + *(int32_t*)buf = htonl(bodyLen); SEncoder encoder; tEncoderInit(&encoder, abuf, bodyLen); tEncodeSTqOffset(&encoder, pOffset); diff --git a/source/dnode/vnode/src/tq/tqStreamStateSnap.c b/source/dnode/vnode/src/tq/tqStreamStateSnap.c index 2ab710176d..50f413bcc9 100644 --- a/source/dnode/vnode/src/tq/tqStreamStateSnap.c +++ b/source/dnode/vnode/src/tq/tqStreamStateSnap.c @@ -181,5 +181,5 @@ int32_t streamStateRebuildFromSnap(SStreamStateWriter* pWriter, int64_t chkpId) } int32_t streamStateLoadTasks(SStreamStateWriter* pWriter) { - return streamMetaReloadAllTasks(pWriter->pTq->pStreamMeta); + return streamMetaLoadAllTasks(pWriter->pTq->pStreamMeta); } diff --git a/source/dnode/vnode/src/tqCommon/tqCommon.c b/source/dnode/vnode/src/tqCommon/tqCommon.c index b1d49bf31b..a106fe148b 100644 --- a/source/dnode/vnode/src/tqCommon/tqCommon.c +++ b/source/dnode/vnode/src/tqCommon/tqCommon.c @@ -712,9 +712,9 @@ int32_t resetStreamTaskStatus(SStreamMeta* pMeta) { } static int32_t restartStreamTasks(SStreamMeta* pMeta, bool isLeader) { - int32_t vgId = pMeta->vgId; - int32_t code = 0; - int64_t st = taosGetTimestampMs(); + int32_t vgId = pMeta->vgId; + int32_t code = 0; + int64_t st = taosGetTimestampMs(); while(1) { int32_t startVal = atomic_val_compare_exchange_32(&pMeta->startInfo.taskStarting, 0, 1); @@ -736,17 +736,9 @@ static int32_t restartStreamTasks(SStreamMeta* pMeta, bool isLeader) { } streamMetaWLock(pMeta); - code = streamMetaReopen(pMeta); - if (code != TSDB_CODE_SUCCESS) { - tqError("vgId:%d failed to reopen stream meta", vgId); - streamMetaWUnLock(pMeta); - code = terrno; - return code; - } + streamMetaClear(pMeta); - streamMetaInitBackend(pMeta); int64_t el = taosGetTimestampMs() - st; - tqInfo("vgId:%d close&reload state elapsed time:%.3fs", vgId, el/1000.); code = streamMetaLoadAllTasks(pMeta); @@ -758,10 +750,10 @@ static int32_t restartStreamTasks(SStreamMeta* pMeta, bool isLeader) { } if (isLeader && !tsDisableStream) { - tqInfo("vgId:%d restart all stream tasks after all tasks being updated", vgId); resetStreamTaskStatus(pMeta); - streamMetaWUnLock(pMeta); + tqInfo("vgId:%d restart all stream tasks after all tasks being updated", vgId); + startStreamTasks(pMeta); } else { streamMetaResetStartInfo(&pMeta->startInfo); diff --git a/source/dnode/vnode/src/tsdb/tsdbFS2.c b/source/dnode/vnode/src/tsdb/tsdbFS2.c index 2511fa443b..b2ccc3e859 100644 --- a/source/dnode/vnode/src/tsdb/tsdbFS2.c +++ b/source/dnode/vnode/src/tsdb/tsdbFS2.c @@ -747,6 +747,7 @@ _exit: } static int32_t tsdbFSSetBlockCommit(STFileSet *fset, bool block); +extern int32_t tsdbStopAllCompTask(STsdb *tsdb); int32_t tsdbDisableAndCancelAllBgTask(STsdb *pTsdb) { STFileSystem *fs = pTsdb->pFS; @@ -774,6 +775,10 @@ int32_t tsdbDisableAndCancelAllBgTask(STsdb *pTsdb) { int64_t channel; TARRAY2_FOREACH(&channelArr, channel) { vnodeAChannelDestroy(vnodeAsyncHandle[1], channel, true); } TARRAY2_DESTROY(&channelArr, NULL); + +#ifdef TD_ENTERPRISE + tsdbStopAllCompTask(pTsdb); +#endif return 0; } diff --git a/source/dnode/vnode/src/tsdb/tsdbFSet2.h b/source/dnode/vnode/src/tsdb/tsdbFSet2.h index 0951a28f4e..86db3b01c7 100644 --- a/source/dnode/vnode/src/tsdb/tsdbFSet2.h +++ b/source/dnode/vnode/src/tsdb/tsdbFSet2.h @@ -27,7 +27,6 @@ typedef struct SSttLvl SSttLvl; typedef TARRAY2(STFileObj *) TFileObjArray; typedef TARRAY2(SSttLvl *) TSttLvlArray; typedef TARRAY2(STFileOp) TFileOpArray; -typedef struct STFileSystem STFileSystem; typedef enum { TSDB_FOP_NONE = 0, diff --git a/source/dnode/vnode/src/tsdb/tsdbOpen.c b/source/dnode/vnode/src/tsdb/tsdbOpen.c index a1f864814f..ea3d285880 100644 --- a/source/dnode/vnode/src/tsdb/tsdbOpen.c +++ b/source/dnode/vnode/src/tsdb/tsdbOpen.c @@ -16,6 +16,9 @@ #include "tsdb.h" #include "tsdbFS2.h" +extern int32_t tsdbOpenCompMonitor(STsdb *tsdb); +extern int32_t tsdbCloseCompMonitor(STsdb *tsdb); + int32_t tsdbSetKeepCfg(STsdb *pTsdb, STsdbCfg *pCfg) { STsdbKeepCfg *pKeepCfg = &pTsdb->keepCfg; pKeepCfg->precision = pCfg->precision; @@ -81,6 +84,12 @@ int tsdbOpen(SVnode *pVnode, STsdb **ppTsdb, const char *dir, STsdbKeepCfg *pKee goto _err; } +#ifdef TD_ENTERPRISE + if (tsdbOpenCompMonitor(pTsdb) < 0) { + goto _err; + } +#endif + tsdbDebug("vgId:%d, tsdb is opened at %s, days:%d, keep:%d,%d,%d, keepTimeoffset:%d", TD_VID(pVnode), pTsdb->path, pTsdb->keepCfg.days, pTsdb->keepCfg.keep0, pTsdb->keepCfg.keep1, pTsdb->keepCfg.keep2, pTsdb->keepCfg.keepTimeOffset); @@ -108,6 +117,9 @@ int tsdbClose(STsdb **pTsdb) { tsdbCloseFS(&(*pTsdb)->pFS); tsdbCloseCache(*pTsdb); +#ifdef TD_ENTERPRISE + tsdbCloseCompMonitor(*pTsdb); +#endif taosThreadMutexDestroy(&(*pTsdb)->mutex); taosMemoryFreeClear(*pTsdb); } diff --git a/source/dnode/vnode/src/tsdb/tsdbRead2.c b/source/dnode/vnode/src/tsdb/tsdbRead2.c index 6f9f81773a..f6fcfc6be1 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead2.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead2.c @@ -4816,14 +4816,13 @@ static int32_t getBucketIndex(int32_t startRow, int32_t bucketRange, int32_t num } int32_t tsdbGetFileBlocksDistInfo2(STsdbReader* pReader, STableBlockDistInfo* pTableBlockInfo) { - int32_t code = TSDB_CODE_SUCCESS; + int32_t code = TSDB_CODE_SUCCESS; + const int32_t numOfBuckets = 20.0; + pTableBlockInfo->totalSize = 0; pTableBlockInfo->totalRows = 0; pTableBlockInfo->numOfVgroups = 1; - const int32_t numOfBuckets = 20.0; - const int32_t defaultRows = 4096; - // find the start data block in file tsdbAcquireReader(pReader); if (pReader->flag == READER_STATUS_SUSPEND) { diff --git a/source/dnode/vnode/src/vnd/vnodeAsync.c b/source/dnode/vnode/src/vnd/vnodeAsync.c index c6bf60fa76..66668b60df 100644 --- a/source/dnode/vnode/src/vnd/vnodeAsync.c +++ b/source/dnode/vnode/src/vnd/vnodeAsync.c @@ -591,7 +591,7 @@ int32_t vnodeACancel(SVAsync *async, int64_t taskId) { task->prev->next = task->next; vnodeAsyncTaskDone(async, task); } else { - ret = 0; // task is running, should return code TSDB_CODE_BUSY ?? + ret = TSDB_CODE_FAILED; } } diff --git a/source/dnode/vnode/src/vnd/vnodeHash.c b/source/dnode/vnode/src/vnd/vnodeHash.c index 33602f6581..093b5056ed 100644 --- a/source/dnode/vnode/src/vnd/vnodeHash.c +++ b/source/dnode/vnode/src/vnd/vnodeHash.c @@ -24,14 +24,6 @@ struct SVHashEntry { void* obj; }; -struct SVHashTable { - uint32_t (*hash)(const void*); - int32_t (*compare)(const void*, const void*); - int32_t numEntries; - uint32_t numBuckets; - SVHashEntry** buckets; -}; - static int32_t vHashRehash(SVHashTable* ht, uint32_t newNumBuckets) { SVHashEntry** newBuckets = (SVHashEntry**)taosMemoryCalloc(newNumBuckets, sizeof(SVHashEntry*)); if (newBuckets == NULL) { diff --git a/source/dnode/vnode/src/vnd/vnodeHash.h b/source/dnode/vnode/src/vnd/vnodeHash.h index 86f6f9ac87..0181ca748d 100644 --- a/source/dnode/vnode/src/vnd/vnodeHash.h +++ b/source/dnode/vnode/src/vnd/vnodeHash.h @@ -24,6 +24,15 @@ extern "C" { typedef struct SVHashTable SVHashTable; +struct SVHashTable { + uint32_t (*hash)(const void*); + int32_t (*compare)(const void*, const void*); + int32_t numEntries; + uint32_t numBuckets; + struct SVHashEntry** buckets; +}; + +#define vHashNumEntries(ht) ((ht)->numEntries) int32_t vHashInit(SVHashTable** ht, uint32_t (*hash)(const void*), int32_t (*compare)(const void*, const void*)); int32_t vHashDestroy(SVHashTable** ht); int32_t vHashPut(SVHashTable* ht, void* obj); diff --git a/source/dnode/vnode/src/vnd/vnodeQuery.c b/source/dnode/vnode/src/vnd/vnodeQuery.c index e9dbc5e659..b6a9360afd 100644 --- a/source/dnode/vnode/src/vnd/vnodeQuery.c +++ b/source/dnode/vnode/src/vnd/vnodeQuery.c @@ -423,9 +423,9 @@ void vnodeResetLoad(SVnode *pVnode, SVnodeLoad *pLoad) { "nBatchInsertSuccess"); } -void vnodeGetInfo(void *pVnode, const char **dbname, int32_t *vgId, int64_t* numOfTables, int64_t* numOfNormalTables) { - SVnode* pVnodeObj = pVnode; - SVnodeCfg* pConf = &pVnodeObj->config; +void vnodeGetInfo(void *pVnode, const char **dbname, int32_t *vgId, int64_t *numOfTables, int64_t *numOfNormalTables) { + SVnode *pVnodeObj = pVnode; + SVnodeCfg *pConf = &pVnodeObj->config; if (dbname) { *dbname = pConf->dbname; @@ -444,7 +444,7 @@ void vnodeGetInfo(void *pVnode, const char **dbname, int32_t *vgId, int64_t* num } } -int32_t vnodeGetTableList(void* pVnode, int8_t type, SArray* pList) { +int32_t vnodeGetTableList(void *pVnode, int8_t type, SArray *pList) { if (type == TSDB_SUPER_TABLE) { return vnodeGetStbIdList(pVnode, 0, pList); } else { @@ -694,12 +694,12 @@ void *vnodeGetIdx(void *pVnode) { return NULL; } - return metaGetIdx(((SVnode*)pVnode)->pMeta); + return metaGetIdx(((SVnode *)pVnode)->pMeta); } void *vnodeGetIvtIdx(void *pVnode) { if (pVnode == NULL) { return NULL; } - return metaGetIvtIdx(((SVnode*)pVnode)->pMeta); + return metaGetIvtIdx(((SVnode *)pVnode)->pMeta); } diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index 1f951097a4..afb8f962b3 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -14,24 +14,22 @@ */ #include "audit.h" +#include "cos.h" #include "tencode.h" #include "tmsg.h" #include "tstrbuild.h" #include "vnd.h" -#include "cos.h" #include "vnode.h" #include "vnodeInt.h" -#include "audit.h" -#include "tstrbuild.h" static int32_t vnodeProcessCreateStbReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessAlterStbReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessDropStbReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); -static int32_t vnodeProcessCreateTbReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, - SRpcMsg *pOriginRpc); +static int32_t vnodeProcessCreateTbReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, + SRpcMsg *pOriginRpc); static int32_t vnodeProcessAlterTbReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); -static int32_t vnodeProcessDropTbReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, - SRpcMsg *pOriginRpc); +static int32_t vnodeProcessDropTbReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, + SRpcMsg *pOriginRpc); static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessCreateTSmaReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessAlterConfirmReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); @@ -45,6 +43,9 @@ static int32_t vnodeProcessDropIndexReq(SVnode *pVnode, int64_t ver, void *pReq, static int32_t vnodeProcessCompactVnodeReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessConfigChangeReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); +extern int32_t vnodeProcessKillCompactReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); +extern int32_t vnodeQueryCompactProgress(SVnode *pVnode, SRpcMsg *pMsg); + static int32_t vnodePreprocessCreateTableReq(SVnode *pVnode, SDecoder *pCoder, int64_t btime, int64_t *pUid) { int32_t code = 0; int32_t lino = 0; @@ -629,6 +630,11 @@ int32_t vnodeProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg, int64_t ver, SRpcMsg case TDMT_SYNC_CONFIG_CHANGE: vnodeProcessConfigChangeReq(pVnode, ver, pReq, len, pRsp); break; +#ifdef TD_ENTERPRISE + case TDMT_VND_KILL_COMPACT: + vnodeProcessKillCompactReq(pVnode, ver, pReq, len, pRsp); + break; +#endif default: vError("vgId:%d, unprocessed msg, %d", TD_VID(pVnode), pMsg->msgType); return -1; @@ -738,6 +744,10 @@ int32_t vnodeProcessFetchMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo) { return vnodeGetTableCfg(pVnode, pMsg, true); case TDMT_VND_BATCH_META: return vnodeGetBatchMeta(pVnode, pMsg); +#ifdef TD_ENTERPRISE + case TDMT_VND_QUERY_COMPACT_PROGRESS: + return vnodeQueryCompactProgress(pVnode, pMsg); +#endif // case TDMT_VND_TMQ_CONSUME: // return tqProcessPollReq(pVnode->pTq, pMsg); case TDMT_VND_TMQ_VG_WALINFO: @@ -886,8 +896,8 @@ _err: return -1; } -static int32_t vnodeProcessCreateTbReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, - SRpcMsg *pOriginRpc) { +static int32_t vnodeProcessCreateTbReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, + SRpcMsg *pOriginRpc) { SDecoder decoder = {0}; SEncoder encoder = {0}; int32_t rcode = 0; @@ -937,8 +947,8 @@ static int32_t vnodeProcessCreateTbReq(SVnode *pVnode, int64_t ver, void *pReq, goto _exit; } - if(tsEnableAudit && tsEnableAuditCreateTable){ - char* str = taosMemoryCalloc(1, TSDB_TABLE_FNAME_LEN); + if (tsEnableAudit && tsEnableAuditCreateTable) { + char *str = taosMemoryCalloc(1, TSDB_TABLE_FNAME_LEN); if (str == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; rcode = -1; @@ -992,27 +1002,27 @@ static int32_t vnodeProcessCreateTbReq(SVnode *pVnode, int64_t ver, void *pReq, tEncoderInit(&encoder, pRsp->pCont, pRsp->contLen); tEncodeSVCreateTbBatchRsp(&encoder, &rsp); - if(tsEnableAudit && tsEnableAuditCreateTable){ + if (tsEnableAudit && tsEnableAuditCreateTable) { int64_t clusterId = pVnode->config.syncCfg.nodeInfo[0].clusterId; SName name = {0}; tNameFromString(&name, pVnode->config.dbname, T_NAME_ACCT | T_NAME_DB); SStringBuilder sb = {0}; - for(int32_t i = 0; i < tbNames->size; i++){ - char** key = (char**)taosArrayGet(tbNames, i); + for (int32_t i = 0; i < tbNames->size; i++) { + char **key = (char **)taosArrayGet(tbNames, i); taosStringBuilderAppendStringLen(&sb, *key, strlen(*key)); - if(i < tbNames->size - 1){ + if (i < tbNames->size - 1) { taosStringBuilderAppendChar(&sb, ','); } taosMemoryFreeClear(*key); } - size_t len = 0; - char* keyJoined = taosStringBuilderGetResult(&sb, &len); + size_t len = 0; + char *keyJoined = taosStringBuilderGetResult(&sb, &len); - if(pOriginRpc->info.conn.user != NULL && strlen(pOriginRpc->info.conn.user) > 0){ - auditRecord(pOriginRpc, clusterId, "createTable", name.dbname, "", keyJoined, len); + if (pOriginRpc->info.conn.user != NULL && strlen(pOriginRpc->info.conn.user) > 0) { + auditAddRecord(pOriginRpc, clusterId, "createTable", name.dbname, "", keyJoined, len); } taosStringBuilderDestroy(&sb); @@ -1023,7 +1033,7 @@ _exit: pCreateReq = req.pReqs + iReq; taosMemoryFree(pCreateReq->sql); taosMemoryFree(pCreateReq->comment); - taosArrayDestroy(pCreateReq->ctb.tagName); + taosArrayDestroy(pCreateReq->ctb.tagName); } taosArrayDestroyEx(rsp.pArray, tFreeSVCreateTbRsp); taosArrayDestroy(tbUids); @@ -1156,7 +1166,7 @@ _exit: } static int32_t vnodeProcessDropTbReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, - SRpcMsg *pOriginRpc) { + SRpcMsg *pOriginRpc) { SVDropTbBatchReq req = {0}; SVDropTbBatchRsp rsp = {0}; SDecoder decoder = {0}; @@ -1235,13 +1245,13 @@ static int32_t vnodeProcessDropTbReq(SVnode *pVnode, int64_t ver, void *pReq, in size_t len = 0; char *keyJoined = taosStringBuilderGetResult(&sb, &len); - if(pOriginRpc->info.conn.user != NULL && strlen(pOriginRpc->info.conn.user) > 0){ - auditRecord(pOriginRpc, clusterId, "dropTable", name.dbname, "", keyJoined, len); + if (pOriginRpc->info.conn.user != NULL && strlen(pOriginRpc->info.conn.user) > 0) { + auditAddRecord(pOriginRpc, clusterId, "dropTable", name.dbname, "", keyJoined, len); } taosStringBuilderDestroy(&sb); } - + _exit: taosArrayDestroy(tbUids); tdUidStoreFree(pStore); diff --git a/source/libs/audit/src/auditMain.c b/source/libs/audit/src/auditMain.c index 7616617ff0..19dc771c56 100644 --- a/source/libs/audit/src/auditMain.c +++ b/source/libs/audit/src/auditMain.c @@ -24,6 +24,7 @@ #include "tglobal.h" #include "mnode.h" #include "audit.h" +#include "osMemory.h" SAudit tsAudit = {0}; char* tsAuditUri = "/audit"; @@ -36,9 +37,18 @@ int32_t auditInit(const SAuditCfg *pCfg) { return 0; } +static FORCE_INLINE void auditDeleteRecord(SAuditRecord * record) { + if (record) { + taosMemoryFree(record->detail); + taosMemoryFree(record); + } +} + void auditCleanup() { tsLogFp = NULL; - taosArrayDestroy(tsAudit.records); + taosThreadMutexLock(&tsAudit.lock); + taosArrayDestroyP(tsAudit.records, (FDelete)auditDeleteRecord); + taosThreadMutexUnlock(&tsAudit.lock); tsAudit.records = NULL; taosThreadMutexDestroy(&tsAudit.lock); } diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 3e8574f49f..ef2a99d1d1 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -3751,8 +3751,11 @@ SOperatorInfo* createTableMergeScanOperatorInfo(STableScanPhysiNode* pTableScanN int32_t rowSize = pInfo->pResBlock->info.rowSize; uint32_t nCols = taosArrayGetSize(pInfo->pResBlock->pDataBlock); pInfo->bufPageSize = getProperSortPageSize(rowSize, nCols); - - pInfo->filesetDelimited = pTableScanNode->filesetDelimited; + if (!tsExperimental) { + pInfo->filesetDelimited = false; + } else { + pInfo->filesetDelimited = pTableScanNode->filesetDelimited; + } setOperatorInfo(pOperator, "TableMergeScanOperator", QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN, false, OP_NOT_OPENED, pInfo, pTaskInfo); pOperator->exprSupp.numOfExprs = numOfCols; diff --git a/source/libs/executor/src/sysscanoperator.c b/source/libs/executor/src/sysscanoperator.c index ac4b8e88c7..76de204cab 100644 --- a/source/libs/executor/src/sysscanoperator.c +++ b/source/libs/executor/src/sysscanoperator.c @@ -1610,7 +1610,10 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator) { const char* name = tNameGetTableName(&pInfo->name); if (pInfo->showRewrite) { getDBNameFromCondition(pInfo->pCondition, dbName); - sprintf(pInfo->req.db, "%d.%s", pInfo->accountId, dbName); + if (strncasecmp(name, TSDB_INS_TABLE_COMPACTS, TSDB_TABLE_FNAME_LEN) != 0 && + strncasecmp(name, TSDB_INS_TABLE_COMPACT_DETAILS, TSDB_TABLE_FNAME_LEN) != 0) { + sprintf(pInfo->req.db, "%d.%s", pInfo->accountId, dbName); + } } else if (strncasecmp(name, TSDB_INS_TABLE_COLS, TSDB_TABLE_FNAME_LEN) == 0) { getDBNameFromCondition(pInfo->pCondition, dbName); if (dbName[0]) sprintf(pInfo->req.db, "%d.%s", pInfo->accountId, dbName); diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index 25a3c509a7..8a2e118fe7 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -5466,13 +5466,12 @@ bool blockDistSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInfo) { } int32_t blockDistFunction(SqlFunctionCtx* pCtx) { - const int32_t BLOCK_DIST_RESULT_ROWS = 24; + const int32_t BLOCK_DIST_RESULT_ROWS = 25; SInputColumnInfoData* pInput = &pCtx->input; SColumnInfoData* pInputCol = pInput->pData[0]; - - SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); - STableBlockDistInfo* pDistInfo = GET_ROWCELL_INTERBUF(pResInfo); + SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); + STableBlockDistInfo* pDistInfo = GET_ROWCELL_INTERBUF(pResInfo); STableBlockDistInfo p1 = {0}; tDeserializeBlockDistInfo(varDataVal(pInputCol->pData), varDataLen(pInputCol->pData), &p1); @@ -5635,7 +5634,7 @@ int32_t blockDistFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { double factor = pData->numOfBlocks / 80.0; int32_t numOfBuckets = sizeof(pData->blockRowsHisto) / sizeof(pData->blockRowsHisto[0]); - int32_t bucketRange = (pData->defMaxRows - pData->defMinRows) / numOfBuckets; + int32_t bucketRange = ceil(((double) (pData->defMaxRows - pData->defMinRows)) / numOfBuckets); for (int32_t i = 0; i < tListLen(pData->blockRowsHisto); ++i) { len = sprintf(st + VARSTR_HEADER_SIZE, "%04d |", pData->defMinRows + bucketRange * (i + 1)); @@ -5650,7 +5649,7 @@ int32_t blockDistFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { len += x; } - if (num > 0) { + if (pData->blockRowsHisto[i] > 0) { double v = pData->blockRowsHisto[i] * 100.0 / pData->numOfBlocks; len += sprintf(st + VARSTR_HEADER_SIZE + len, " %d (%.2f%c)", pData->blockRowsHisto[i], v, '%'); } diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index d26cdcf401..c445af61cc 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -259,6 +259,10 @@ const char* nodesNodeName(ENodeType type) { return "ShowLocalVariablesStmt"; case QUERY_NODE_SHOW_TABLE_TAGS_STMT: return "ShowTableTagsStmt"; + case QUERY_NODE_SHOW_COMPACTS_STMT: + return "ShowCompactsStmt"; + case QUERY_NODE_SHOW_COMPACT_DETAILS_STMT: + return "ShowCompactDetailsStmt"; case QUERY_NODE_DELETE_STMT: return "DeleteStmt"; case QUERY_NODE_INSERT_STMT: diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index e730ccf21b..8f2e82385b 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -456,10 +456,15 @@ SNode* nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(SShowCreateViewStmt)); case QUERY_NODE_SHOW_TABLE_DISTRIBUTED_STMT: return makeNode(type, sizeof(SShowTableDistributedStmt)); + case QUERY_NODE_SHOW_COMPACTS_STMT: + return makeNode(type, sizeof(SShowCompactsStmt)); + case QUERY_NODE_SHOW_COMPACT_DETAILS_STMT: + return makeNode(type, sizeof(SShowCompactDetailsStmt)); case QUERY_NODE_KILL_QUERY_STMT: return makeNode(type, sizeof(SKillQueryStmt)); case QUERY_NODE_KILL_TRANSACTION_STMT: case QUERY_NODE_KILL_CONNECTION_STMT: + case QUERY_NODE_KILL_COMPACT_STMT: return makeNode(type, sizeof(SKillStmt)); case QUERY_NODE_DELETE_STMT: return makeNode(type, sizeof(SDeleteStmt)); @@ -1085,6 +1090,13 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyNode(((SShowDnodeVariablesStmt*)pNode)->pDnodeId); nodesDestroyNode(((SShowDnodeVariablesStmt*)pNode)->pLikePattern); break; + case QUERY_NODE_SHOW_COMPACTS_STMT: + break; + case QUERY_NODE_SHOW_COMPACT_DETAILS_STMT: { + SShowCompactDetailsStmt* pStmt = (SShowCompactDetailsStmt*)pNode; + nodesDestroyNode(pStmt->pCompactId); + break; + } case QUERY_NODE_SHOW_CREATE_DATABASE_STMT: taosMemoryFreeClear(((SShowCreateDatabaseStmt*)pNode)->pCfg); break; @@ -1098,6 +1110,7 @@ void nodesDestroyNode(SNode* pNode) { 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 + case QUERY_NODE_KILL_COMPACT_STMT: // no pointer field break; case QUERY_NODE_DELETE_STMT: { SDeleteStmt* pStmt = (SDeleteStmt*)pNode; diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index c863c1e0ee..c3f2a53f7b 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -260,7 +260,8 @@ SNode* createDeleteStmt(SAstCreateContext* pCxt, SNode* pTable, SNode* pWhere); SNode* createInsertStmt(SAstCreateContext* pCxt, SNode* pTable, SNodeList* pCols, SNode* pQuery); SNode* createCreateViewStmt(SAstCreateContext* pCxt, bool orReplace, SNode* pView, const SToken* pAs, SNode* pQuery); SNode* createDropViewStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SNode* pView); - +SNode* createShowCompactDetailsStmt(SAstCreateContext* pCxt, SNode* pCompactIdNode); +SNode* createShowCompactsStmt(SAstCreateContext* pCxt, ENodeType type); #ifdef __cplusplus } #endif diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 9bcf65dbbe..0479fce255 100755 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -511,6 +511,8 @@ cmd ::= SHOW db_name_cond_opt(A) ALIVE. cmd ::= SHOW CLUSTER ALIVE. { pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); } cmd ::= SHOW db_name_cond_opt(A) VIEWS. { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, A, NULL, OP_TYPE_LIKE); } cmd ::= SHOW CREATE VIEW full_table_name(A). { pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, A); } +cmd ::= SHOW COMPACTS. { pCxt->pRootNode = createShowCompactsStmt(pCxt, QUERY_NODE_SHOW_COMPACTS_STMT); } +cmd ::= SHOW COMPACT NK_INTEGER(A). { pCxt->pRootNode = createShowCompactDetailsStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &A)); } %type table_kind_db_name_cond_opt { SShowTablesOption } %destructor table_kind_db_name_cond_opt { } @@ -700,6 +702,7 @@ ignore_opt(A) ::= IGNORE UNTREATED. cmd ::= KILL CONNECTION NK_INTEGER(A). { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &A); } cmd ::= KILL QUERY NK_STRING(A). { pCxt->pRootNode = createKillQueryStmt(pCxt, &A); } cmd ::= KILL TRANSACTION NK_INTEGER(A). { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &A); } +cmd ::= KILL COMPACT NK_INTEGER(A). { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_COMPACT_STMT, &A); } /************************************************ merge/redistribute/ vgroup ******************************************/ cmd ::= BALANCE VGROUP. { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 3ae82c3615..eb866c99aa 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -1638,6 +1638,13 @@ SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type) { return (SNode*)pStmt; } +SNode* createShowCompactsStmt(SAstCreateContext* pCxt, ENodeType type) { + CHECK_PARSER_STATUS(pCxt); + SShowCompactsStmt* pStmt = (SShowCompactsStmt*)nodesMakeNode(type); + CHECK_OUT_OF_MEM(pStmt); + return (SNode*)pStmt; +} + SNode* setShowKind(SAstCreateContext* pCxt, SNode* pStmt, EShowKind showKind) { if (pStmt == NULL) { return NULL; @@ -1783,6 +1790,13 @@ SNode* createShowTableTagsStmt(SAstCreateContext* pCxt, SNode* pTbName, SNode* p return (SNode*)pStmt; } +SNode* createShowCompactDetailsStmt(SAstCreateContext* pCxt, SNode* pCompactId) { + CHECK_PARSER_STATUS(pCxt); + SShowCompactDetailsStmt* pStmt = (SShowCompactDetailsStmt*)nodesMakeNode(QUERY_NODE_SHOW_COMPACT_DETAILS_STMT); + pStmt->pCompactId = pCompactId; + return (SNode*)pStmt; +} + static int32_t getIpV4RangeFromWhitelistItem(char* ipRange, SIpV4Range* pIpRange) { int32_t code = TSDB_CODE_SUCCESS; char* ipCopy = taosStrdup(ipRange); diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c index 91625defd0..be272228fe 100644 --- a/source/libs/parser/src/parAstParser.c +++ b/source/libs/parser/src/parAstParser.c @@ -607,6 +607,17 @@ static int32_t collectMetaKeyFromShowViews(SCollectMetaKeyCxt* pCxt, SShowStmt* return code; } +static int32_t collectMetaKeyFromShowCompacts(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { + int32_t code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_COMPACTS, + pCxt->pMetaCache); + return code; +} + +static int32_t collectMetaKeyFromShowCompactDetails(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { + int32_t code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_COMPACT_DETAILS, + pCxt->pMetaCache); + return code; +} static int32_t collectMetaKeyFromShowCreateDatabase(SCollectMetaKeyCxt* pCxt, SShowCreateDatabaseStmt* pStmt) { return reserveDbCfgInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pCxt->pMetaCache); @@ -824,6 +835,10 @@ static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) { return collectMetaKeyFromShowUserPrivileges(pCxt, (SShowStmt*)pStmt); case QUERY_NODE_SHOW_VIEWS_STMT: return collectMetaKeyFromShowViews(pCxt, (SShowStmt*)pStmt); + case QUERY_NODE_SHOW_COMPACTS_STMT: + return collectMetaKeyFromShowCompacts(pCxt, (SShowStmt*)pStmt); + case QUERY_NODE_SHOW_COMPACT_DETAILS_STMT: + return collectMetaKeyFromShowCompactDetails(pCxt, (SShowStmt*)pStmt); case QUERY_NODE_SHOW_CREATE_DATABASE_STMT: return collectMetaKeyFromShowCreateDatabase(pCxt, (SShowCreateDatabaseStmt*)pStmt); case QUERY_NODE_SHOW_CREATE_TABLE_STMT: diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index 5988c68e17..03a5317cd3 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -64,6 +64,7 @@ static SKeyword keywordTable[] = { {"COMMENT", TK_COMMENT}, {"COMP", TK_COMP}, {"COMPACT", TK_COMPACT}, + {"COMPACTS", TK_COMPACTS}, {"CONNECTION", TK_CONNECTION}, {"CONNECTIONS", TK_CONNECTIONS}, {"CONNS", TK_CONNS}, diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index c5ac8a3dd6..3bb24566c2 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -257,6 +257,18 @@ static const SSysTableShowAdapter sysTableShowAdapter[] = { .numOfShowCols = 1, .pShowCols = {"*"} }, + { .showType = QUERY_NODE_SHOW_COMPACTS_STMT, + .pDbName = TSDB_INFORMATION_SCHEMA_DB, + .pTableName = TSDB_INS_TABLE_COMPACTS, + .numOfShowCols = 1, + .pShowCols = {"*"} + }, + { .showType = QUERY_NODE_SHOW_COMPACT_DETAILS_STMT, + .pDbName = TSDB_INFORMATION_SCHEMA_DB, + .pTableName = TSDB_INS_TABLE_COMPACT_DETAILS, + .numOfShowCols = 1, + .pShowCols = {"*"} + }, }; // clang-format on @@ -7118,6 +7130,12 @@ static int32_t translateKillConnection(STranslateContext* pCxt, SKillStmt* pStmt return buildCmdMsg(pCxt, TDMT_MND_KILL_CONN, (FSerializeFunc)tSerializeSKillConnReq, &killReq); } +static int32_t translateKillCompact(STranslateContext* pCxt, SKillStmt* pStmt) { + SKillCompactReq killReq = {0}; + killReq.compactId = pStmt->targetId; + return buildCmdMsg(pCxt, TDMT_MND_KILL_COMPACT, (FSerializeFunc)tSerializeSKillCompactReq, &killReq); +} + static int32_t translateKillQuery(STranslateContext* pCxt, SKillQueryStmt* pStmt) { SKillQueryReq killReq = {0}; strcpy(killReq.queryStrId, pStmt->queryId); @@ -8511,6 +8529,9 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) { case QUERY_NODE_KILL_CONNECTION_STMT: code = translateKillConnection(pCxt, (SKillStmt*)pNode); break; + case QUERY_NODE_KILL_COMPACT_STMT: + code = translateKillCompact(pCxt, (SKillStmt*)pNode); + break; case QUERY_NODE_KILL_QUERY_STMT: code = translateKillQuery(pCxt, (SKillQueryStmt*)pNode); break; @@ -8761,6 +8782,28 @@ static int32_t extractShowVariablesResultSchema(int32_t* numOfCols, SSchema** pS return TSDB_CODE_SUCCESS; } +static int32_t extractCompactDbResultSchema(int32_t* numOfCols, SSchema** pSchema) { + *numOfCols = COMPACT_DB_RESULT_COLS; + *pSchema = taosMemoryCalloc((*numOfCols), sizeof(SSchema)); + if (NULL == (*pSchema)) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + (*pSchema)[0].type = TSDB_DATA_TYPE_BINARY; + (*pSchema)[0].bytes = COMPACT_DB_RESULT_FIELD1_LEN; + strcpy((*pSchema)[0].name, "name"); + + (*pSchema)[1].type = TSDB_DATA_TYPE_INT; + (*pSchema)[1].bytes = tDataTypes[TSDB_DATA_TYPE_INT].bytes; + strcpy((*pSchema)[1].name, "id"); + + (*pSchema)[2].type = TSDB_DATA_TYPE_BINARY; + (*pSchema)[2].bytes = COMPACT_DB_RESULT_FIELD3_LEN; + strcpy((*pSchema)[2].name, "reason"); + + return TSDB_CODE_SUCCESS; +} + int32_t extractResultSchema(const SNode* pRoot, int32_t* numOfCols, SSchema** pSchema) { if (NULL == pRoot) { return TSDB_CODE_SUCCESS; @@ -8787,6 +8830,8 @@ int32_t extractResultSchema(const SNode* pRoot, int32_t* numOfCols, SSchema** pS case QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT: case QUERY_NODE_SHOW_VARIABLES_STMT: return extractShowVariablesResultSchema(numOfCols, pSchema); + case QUERY_NODE_COMPACT_DATABASE_STMT: + return extractCompactDbResultSchema(numOfCols, pSchema); default: break; } @@ -10268,6 +10313,37 @@ static int32_t rewriteFlushDatabase(STranslateContext* pCxt, SQuery* pQuery) { return code; } +static int32_t rewriteShowCompacts(STranslateContext* pCxt, SQuery* pQuery) { + SShowCompactsStmt* pShow = (SShowCompactsStmt*)(pQuery->pRoot); + SSelectStmt* pStmt = NULL; + int32_t code = createSelectStmtForShow(QUERY_NODE_SHOW_COMPACTS_STMT, &pStmt); + if (TSDB_CODE_SUCCESS == code) { + pCxt->showRewrite = true; + pQuery->showRewrite = true; + nodesDestroyNode(pQuery->pRoot); + pQuery->pRoot = (SNode*)pStmt; + } + return code; +} + +static int32_t rewriteShowCompactDetailsStmt(STranslateContext* pCxt, SQuery* pQuery) { + SShowCompactDetailsStmt* pShow = (SShowCompactDetailsStmt*)(pQuery->pRoot); + SSelectStmt* pStmt = NULL; + int32_t code = createSelectStmtForShow(QUERY_NODE_SHOW_COMPACT_DETAILS_STMT, &pStmt); + if (TSDB_CODE_SUCCESS == code) { + if (NULL != pShow->pCompactId) { + code = createOperatorNode(OP_TYPE_EQUAL, "compact_id", pShow->pCompactId, &pStmt->pWhere); + } + } + if (TSDB_CODE_SUCCESS == code) { + pCxt->showRewrite = true; + pQuery->showRewrite = true; + nodesDestroyNode(pQuery->pRoot); + pQuery->pRoot = (SNode*)pStmt; + } + return code; +} + static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) { int32_t code = TSDB_CODE_SUCCESS; switch (nodeType(pQuery->pRoot)) { @@ -10330,6 +10406,12 @@ static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) { case QUERY_NODE_FLUSH_DATABASE_STMT: code = rewriteFlushDatabase(pCxt, pQuery); break; + case QUERY_NODE_SHOW_COMPACTS_STMT: + code = rewriteShowCompacts(pCxt, pQuery); + break; + case QUERY_NODE_SHOW_COMPACT_DETAILS_STMT: + code = rewriteShowCompactDetailsStmt(pCxt, pQuery); + break; default: break; } @@ -10435,6 +10517,7 @@ static int32_t setQuery(STranslateContext* pCxt, SQuery* pQuery) { pQuery->execMode = QUERY_EXEC_MODE_LOCAL; break; case QUERY_NODE_SHOW_VARIABLES_STMT: + case QUERY_NODE_COMPACT_DATABASE_STMT: pQuery->haveResultSet = true; pQuery->execMode = QUERY_EXEC_MODE_RPC; if (NULL != pCxt->pCmdMsg) { diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index f012b90941..66258ba3a9 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -1,3 +1,5 @@ +/* This file is automatically generated by Lemon from input grammar +** source file "sql.y". */ /* ** 2000-05-29 ** @@ -22,9 +24,8 @@ ** The following is the concatenation of all %include directives from the ** input grammar file: */ -#include -#include /************ Begin %include sections from the grammar ************************/ +#line 11 "sql.y" #include #include @@ -41,12 +42,359 @@ #include "parAst.h" #define YYSTACKDEPTH 0 +#line 46 "sql.c" /**************** End of %include directives **********************************/ -/* These constants specify the various numeric values for terminal symbols -** in a format understandable to "makeheaders". This section is blank unless -** "lemon" is run with the "-m" command-line option. -***************** Begin makeheaders token definitions *************************/ -/**************** End makeheaders token definitions ***************************/ +/* These constants specify the various numeric values for terminal symbols. +***************** Begin token definitions *************************************/ +#ifndef TK_OR +#define TK_OR 1 +#define TK_AND 2 +#define TK_UNION 3 +#define TK_ALL 4 +#define TK_MINUS 5 +#define TK_EXCEPT 6 +#define TK_INTERSECT 7 +#define TK_NK_BITAND 8 +#define TK_NK_BITOR 9 +#define TK_NK_LSHIFT 10 +#define TK_NK_RSHIFT 11 +#define TK_NK_PLUS 12 +#define TK_NK_MINUS 13 +#define TK_NK_STAR 14 +#define TK_NK_SLASH 15 +#define TK_NK_REM 16 +#define TK_NK_CONCAT 17 +#define TK_CREATE 18 +#define TK_ACCOUNT 19 +#define TK_NK_ID 20 +#define TK_PASS 21 +#define TK_NK_STRING 22 +#define TK_ALTER 23 +#define TK_PPS 24 +#define TK_TSERIES 25 +#define TK_STORAGE 26 +#define TK_STREAMS 27 +#define TK_QTIME 28 +#define TK_DBS 29 +#define TK_USERS 30 +#define TK_CONNS 31 +#define TK_STATE 32 +#define TK_NK_COMMA 33 +#define TK_HOST 34 +#define TK_USER 35 +#define TK_ENABLE 36 +#define TK_NK_INTEGER 37 +#define TK_SYSINFO 38 +#define TK_ADD 39 +#define TK_DROP 40 +#define TK_GRANT 41 +#define TK_ON 42 +#define TK_TO 43 +#define TK_REVOKE 44 +#define TK_FROM 45 +#define TK_SUBSCRIBE 46 +#define TK_READ 47 +#define TK_WRITE 48 +#define TK_NK_DOT 49 +#define TK_WITH 50 +#define TK_DNODE 51 +#define TK_PORT 52 +#define TK_DNODES 53 +#define TK_RESTORE 54 +#define TK_NK_IPTOKEN 55 +#define TK_FORCE 56 +#define TK_UNSAFE 57 +#define TK_LOCAL 58 +#define TK_QNODE 59 +#define TK_BNODE 60 +#define TK_SNODE 61 +#define TK_MNODE 62 +#define TK_VNODE 63 +#define TK_DATABASE 64 +#define TK_USE 65 +#define TK_FLUSH 66 +#define TK_TRIM 67 +#define TK_COMPACT 68 +#define TK_IF 69 +#define TK_NOT 70 +#define TK_EXISTS 71 +#define TK_BUFFER 72 +#define TK_CACHEMODEL 73 +#define TK_CACHESIZE 74 +#define TK_COMP 75 +#define TK_DURATION 76 +#define TK_NK_VARIABLE 77 +#define TK_MAXROWS 78 +#define TK_MINROWS 79 +#define TK_KEEP 80 +#define TK_PAGES 81 +#define TK_PAGESIZE 82 +#define TK_TSDB_PAGESIZE 83 +#define TK_PRECISION 84 +#define TK_REPLICA 85 +#define TK_VGROUPS 86 +#define TK_SINGLE_STABLE 87 +#define TK_RETENTIONS 88 +#define TK_SCHEMALESS 89 +#define TK_WAL_LEVEL 90 +#define TK_WAL_FSYNC_PERIOD 91 +#define TK_WAL_RETENTION_PERIOD 92 +#define TK_WAL_RETENTION_SIZE 93 +#define TK_WAL_ROLL_PERIOD 94 +#define TK_WAL_SEGMENT_SIZE 95 +#define TK_STT_TRIGGER 96 +#define TK_TABLE_PREFIX 97 +#define TK_TABLE_SUFFIX 98 +#define TK_KEEP_TIME_OFFSET 99 +#define TK_NK_COLON 100 +#define TK_BWLIMIT 101 +#define TK_START 102 +#define TK_TIMESTAMP 103 +#define TK_END 104 +#define TK_TABLE 105 +#define TK_NK_LP 106 +#define TK_NK_RP 107 +#define TK_STABLE 108 +#define TK_COLUMN 109 +#define TK_MODIFY 110 +#define TK_RENAME 111 +#define TK_TAG 112 +#define TK_SET 113 +#define TK_NK_EQ 114 +#define TK_USING 115 +#define TK_TAGS 116 +#define TK_BOOL 117 +#define TK_TINYINT 118 +#define TK_SMALLINT 119 +#define TK_INT 120 +#define TK_INTEGER 121 +#define TK_BIGINT 122 +#define TK_FLOAT 123 +#define TK_DOUBLE 124 +#define TK_BINARY 125 +#define TK_NCHAR 126 +#define TK_UNSIGNED 127 +#define TK_JSON 128 +#define TK_VARCHAR 129 +#define TK_MEDIUMBLOB 130 +#define TK_BLOB 131 +#define TK_VARBINARY 132 +#define TK_GEOMETRY 133 +#define TK_DECIMAL 134 +#define TK_COMMENT 135 +#define TK_MAX_DELAY 136 +#define TK_WATERMARK 137 +#define TK_ROLLUP 138 +#define TK_TTL 139 +#define TK_SMA 140 +#define TK_DELETE_MARK 141 +#define TK_FIRST 142 +#define TK_LAST 143 +#define TK_SHOW 144 +#define TK_PRIVILEGES 145 +#define TK_DATABASES 146 +#define TK_TABLES 147 +#define TK_STABLES 148 +#define TK_MNODES 149 +#define TK_QNODES 150 +#define TK_FUNCTIONS 151 +#define TK_INDEXES 152 +#define TK_ACCOUNTS 153 +#define TK_APPS 154 +#define TK_CONNECTIONS 155 +#define TK_LICENCES 156 +#define TK_GRANTS 157 +#define TK_QUERIES 158 +#define TK_SCORES 159 +#define TK_TOPICS 160 +#define TK_VARIABLES 161 +#define TK_CLUSTER 162 +#define TK_BNODES 163 +#define TK_SNODES 164 +#define TK_TRANSACTIONS 165 +#define TK_DISTRIBUTED 166 +#define TK_CONSUMERS 167 +#define TK_SUBSCRIPTIONS 168 +#define TK_VNODES 169 +#define TK_ALIVE 170 +#define TK_VIEWS 171 +#define TK_VIEW 172 +#define TK_COMPACTS 173 +#define TK_NORMAL 174 +#define TK_CHILD 175 +#define TK_LIKE 176 +#define TK_TBNAME 177 +#define TK_QTAGS 178 +#define TK_AS 179 +#define TK_SYSTEM 180 +#define TK_INDEX 181 +#define TK_FUNCTION 182 +#define TK_INTERVAL 183 +#define TK_COUNT 184 +#define TK_LAST_ROW 185 +#define TK_META 186 +#define TK_ONLY 187 +#define TK_TOPIC 188 +#define TK_CONSUMER 189 +#define TK_GROUP 190 +#define TK_DESC 191 +#define TK_DESCRIBE 192 +#define TK_RESET 193 +#define TK_QUERY 194 +#define TK_CACHE 195 +#define TK_EXPLAIN 196 +#define TK_ANALYZE 197 +#define TK_VERBOSE 198 +#define TK_NK_BOOL 199 +#define TK_RATIO 200 +#define TK_NK_FLOAT 201 +#define TK_OUTPUTTYPE 202 +#define TK_AGGREGATE 203 +#define TK_BUFSIZE 204 +#define TK_LANGUAGE 205 +#define TK_REPLACE 206 +#define TK_STREAM 207 +#define TK_INTO 208 +#define TK_PAUSE 209 +#define TK_RESUME 210 +#define TK_TRIGGER 211 +#define TK_AT_ONCE 212 +#define TK_WINDOW_CLOSE 213 +#define TK_IGNORE 214 +#define TK_EXPIRED 215 +#define TK_FILL_HISTORY 216 +#define TK_UPDATE 217 +#define TK_SUBTABLE 218 +#define TK_UNTREATED 219 +#define TK_KILL 220 +#define TK_CONNECTION 221 +#define TK_TRANSACTION 222 +#define TK_BALANCE 223 +#define TK_VGROUP 224 +#define TK_LEADER 225 +#define TK_MERGE 226 +#define TK_REDISTRIBUTE 227 +#define TK_SPLIT 228 +#define TK_DELETE 229 +#define TK_INSERT 230 +#define TK_NULL 231 +#define TK_NK_QUESTION 232 +#define TK_NK_ALIAS 233 +#define TK_NK_ARROW 234 +#define TK_ROWTS 235 +#define TK_QSTART 236 +#define TK_QEND 237 +#define TK_QDURATION 238 +#define TK_WSTART 239 +#define TK_WEND 240 +#define TK_WDURATION 241 +#define TK_IROWTS 242 +#define TK_ISFILLED 243 +#define TK_CAST 244 +#define TK_NOW 245 +#define TK_TODAY 246 +#define TK_TIMEZONE 247 +#define TK_CLIENT_VERSION 248 +#define TK_SERVER_VERSION 249 +#define TK_SERVER_STATUS 250 +#define TK_CURRENT_USER 251 +#define TK_CASE 252 +#define TK_WHEN 253 +#define TK_THEN 254 +#define TK_ELSE 255 +#define TK_BETWEEN 256 +#define TK_IS 257 +#define TK_NK_LT 258 +#define TK_NK_GT 259 +#define TK_NK_LE 260 +#define TK_NK_GE 261 +#define TK_NK_NE 262 +#define TK_MATCH 263 +#define TK_NMATCH 264 +#define TK_CONTAINS 265 +#define TK_IN 266 +#define TK_JOIN 267 +#define TK_INNER 268 +#define TK_SELECT 269 +#define TK_NK_HINT 270 +#define TK_DISTINCT 271 +#define TK_WHERE 272 +#define TK_PARTITION 273 +#define TK_BY 274 +#define TK_SESSION 275 +#define TK_STATE_WINDOW 276 +#define TK_EVENT_WINDOW 277 +#define TK_SLIDING 278 +#define TK_FILL 279 +#define TK_VALUE 280 +#define TK_VALUE_F 281 +#define TK_NONE 282 +#define TK_PREV 283 +#define TK_NULL_F 284 +#define TK_LINEAR 285 +#define TK_NEXT 286 +#define TK_HAVING 287 +#define TK_RANGE 288 +#define TK_EVERY 289 +#define TK_ORDER 290 +#define TK_SLIMIT 291 +#define TK_SOFFSET 292 +#define TK_LIMIT 293 +#define TK_OFFSET 294 +#define TK_ASC 295 +#define TK_NULLS 296 +#define TK_ABORT 297 +#define TK_AFTER 298 +#define TK_ATTACH 299 +#define TK_BEFORE 300 +#define TK_BEGIN 301 +#define TK_BITAND 302 +#define TK_BITNOT 303 +#define TK_BITOR 304 +#define TK_BLOCKS 305 +#define TK_CHANGE 306 +#define TK_COMMA 307 +#define TK_CONCAT 308 +#define TK_CONFLICT 309 +#define TK_COPY 310 +#define TK_DEFERRED 311 +#define TK_DELIMITERS 312 +#define TK_DETACH 313 +#define TK_DIVIDE 314 +#define TK_DOT 315 +#define TK_EACH 316 +#define TK_FAIL 317 +#define TK_FILE 318 +#define TK_FOR 319 +#define TK_GLOB 320 +#define TK_ID 321 +#define TK_IMMEDIATE 322 +#define TK_IMPORT 323 +#define TK_INITIALLY 324 +#define TK_INSTEAD 325 +#define TK_ISNULL 326 +#define TK_KEY 327 +#define TK_MODULES 328 +#define TK_NK_BITNOT 329 +#define TK_NK_SEMI 330 +#define TK_NOTNULL 331 +#define TK_OF 332 +#define TK_PLUS 333 +#define TK_PRIVILEGE 334 +#define TK_RAISE 335 +#define TK_RESTRICT 336 +#define TK_ROW 337 +#define TK_SEMI 338 +#define TK_STAR 339 +#define TK_STATEMENT 340 +#define TK_STRICT 341 +#define TK_STRING 342 +#define TK_TIMES 343 +#define TK_VALUES 344 +#define TK_VARIABLE 345 +#define TK_WAL 346 +#endif +/**************** End token definitions ***************************************/ /* The next sections is a series of control #defines. ** various aspects of the generated parser. @@ -104,29 +452,29 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 507 +#define YYNOCODE 508 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - EFillMode yy36; - SNode* yy80; - SNodeList* yy106; - SDataType yy292; - EOperatorType yy428; - int8_t yy431; - SAlterOption yy455; - EShowKind yy459; - STokenPair yy573; - SShowTablesOption yy709; - ENullOrder yy763; - SToken yy785; - EOrder yy812; - EJoinType yy828; - bool yy923; - int32_t yy982; - int64_t yy987; + SNodeList* yy88; + int32_t yy92; + SAlterOption yy117; + SShowTablesOption yy133; + ENullOrder yy153; + int64_t yy221; + SNode* yy232; + STokenPair yy241; + EFillMode yy246; + int8_t yy279; + EShowKind yy281; + SDataType yy400; + EJoinType yy436; + EOperatorType yy708; + EOrder yy834; + bool yy985; + SToken yy993; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -142,18 +490,18 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 835 -#define YYNRULE 639 -#define YYNRULE_WITH_ACTION 639 -#define YYNTOKEN 346 -#define YY_MAX_SHIFT 834 -#define YY_MIN_SHIFTREDUCE 1237 -#define YY_MAX_SHIFTREDUCE 1875 -#define YY_ERROR_ACTION 1876 -#define YY_ACCEPT_ACTION 1877 -#define YY_NO_ACTION 1878 -#define YY_MIN_REDUCE 1879 -#define YY_MAX_REDUCE 2517 +#define YYNSTATE 840 +#define YYNRULE 642 +#define YYNRULE_WITH_ACTION 642 +#define YYNTOKEN 347 +#define YY_MAX_SHIFT 839 +#define YY_MIN_SHIFTREDUCE 1242 +#define YY_MAX_SHIFTREDUCE 1883 +#define YY_ERROR_ACTION 1884 +#define YY_ACCEPT_ACTION 1885 +#define YY_NO_ACTION 1886 +#define YY_MIN_REDUCE 1887 +#define YY_MAX_REDUCE 2528 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -220,895 +568,874 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (3178) +#define YY_ACTTAB_COUNT (3071) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 173, 409, 462, 418, 2278, 720, 2067, 461, 2006, 171, - /* 10 */ 2007, 168, 48, 46, 1799, 424, 423, 2069, 397, 2069, - /* 20 */ 415, 1669, 1640, 41, 40, 137, 2118, 47, 45, 44, - /* 30 */ 43, 42, 599, 475, 2176, 1725, 1963, 1638, 41, 40, - /* 40 */ 1647, 694, 47, 45, 44, 43, 42, 2319, 1665, 720, - /* 50 */ 2067, 2120, 662, 469, 662, 2488, 681, 2488, 381, 789, - /* 60 */ 702, 184, 2028, 30, 1720, 1880, 2118, 719, 556, 208, - /* 70 */ 19, 557, 1922, 2494, 203, 2494, 203, 1646, 2489, 688, - /* 80 */ 2489, 688, 219, 383, 2337, 2180, 127, 719, 2337, 126, - /* 90 */ 125, 124, 123, 122, 121, 120, 119, 118, 523, 521, - /* 100 */ 2285, 364, 736, 831, 786, 217, 15, 1665, 806, 805, - /* 110 */ 804, 803, 427, 719, 802, 801, 151, 796, 795, 794, - /* 120 */ 793, 792, 791, 790, 150, 784, 783, 782, 426, 425, - /* 130 */ 779, 778, 777, 183, 182, 776, 687, 1842, 573, 2488, - /* 140 */ 561, 2318, 1727, 1728, 2356, 680, 558, 114, 2320, 740, - /* 150 */ 2322, 2323, 735, 51, 730, 2424, 2200, 686, 203, 186, - /* 160 */ 2200, 2409, 2489, 688, 687, 411, 2405, 2488, 788, 720, - /* 170 */ 2067, 408, 699, 146, 2197, 707, 1700, 1710, 2198, 707, - /* 180 */ 205, 2421, 1665, 1726, 1729, 686, 203, 1382, 2439, 137, - /* 190 */ 2489, 688, 1439, 682, 574, 2193, 604, 1877, 1641, 51, - /* 200 */ 1639, 677, 2295, 1650, 2306, 1872, 1430, 765, 764, 763, - /* 210 */ 1434, 762, 1436, 1437, 761, 758, 2303, 1445, 755, 1447, - /* 220 */ 1448, 752, 749, 746, 481, 2176, 2299, 1384, 389, 388, - /* 230 */ 1644, 1645, 1697, 1670, 1699, 1702, 1703, 1704, 1705, 1706, - /* 240 */ 1707, 1708, 1709, 732, 728, 1718, 1719, 1721, 1722, 1723, - /* 250 */ 1724, 2, 48, 46, 509, 2176, 576, 363, 63, 1663, - /* 260 */ 415, 2308, 1640, 1540, 1541, 2319, 507, 184, 63, 526, - /* 270 */ 2301, 412, 95, 221, 525, 1725, 430, 1638, 734, 95, - /* 280 */ 730, 429, 300, 2417, 698, 68, 138, 697, 1668, 2488, - /* 290 */ 489, 2181, 527, 683, 678, 671, 385, 491, 2063, 387, - /* 300 */ 386, 695, 601, 226, 1720, 2062, 2337, 686, 203, 1871, - /* 310 */ 19, 1666, 2489, 688, 618, 617, 616, 1646, 2285, 2424, - /* 320 */ 736, 608, 143, 612, 603, 1822, 662, 611, 602, 2488, - /* 330 */ 720, 2067, 610, 615, 391, 390, 1803, 645, 609, 634, - /* 340 */ 1823, 605, 1665, 831, 384, 2420, 15, 2494, 203, 460, - /* 350 */ 56, 459, 2489, 688, 632, 477, 630, 269, 268, 2318, - /* 360 */ 564, 304, 2356, 557, 1922, 356, 2320, 740, 2322, 2323, - /* 370 */ 735, 733, 730, 721, 2374, 47, 45, 44, 43, 42, - /* 380 */ 1821, 458, 1727, 1728, 63, 2187, 2166, 63, 514, 513, - /* 390 */ 512, 511, 506, 505, 504, 503, 502, 497, 496, 495, - /* 400 */ 494, 367, 486, 485, 484, 1697, 479, 478, 382, 172, - /* 410 */ 38, 320, 1528, 1529, 341, 34, 1700, 1710, 1547, 223, - /* 420 */ 304, 41, 40, 1726, 1729, 47, 45, 44, 43, 42, - /* 430 */ 304, 338, 74, 1474, 1475, 73, 646, 775, 1641, 420, - /* 440 */ 1639, 1966, 2113, 2115, 517, 365, 302, 41, 40, 52, - /* 450 */ 691, 47, 45, 44, 43, 42, 235, 538, 536, 533, - /* 460 */ 90, 41, 40, 89, 1902, 47, 45, 44, 43, 42, - /* 470 */ 1644, 1645, 1697, 1669, 1699, 1702, 1703, 1704, 1705, 1706, - /* 480 */ 1707, 1708, 1709, 732, 728, 1718, 1719, 1721, 1722, 1723, - /* 490 */ 1724, 2, 12, 48, 46, 159, 553, 63, 1701, 720, - /* 500 */ 2067, 415, 2248, 1640, 551, 644, 227, 547, 543, 375, - /* 510 */ 566, 2239, 572, 618, 617, 616, 1725, 2285, 1638, 466, - /* 520 */ 608, 143, 612, 834, 699, 146, 611, 88, 516, 515, - /* 530 */ 1735, 610, 615, 391, 390, 64, 1665, 609, 237, 327, - /* 540 */ 605, 284, 559, 1830, 1930, 1720, 304, 1669, 2319, 304, - /* 550 */ 196, 19, 661, 1754, 1698, 193, 274, 1756, 1646, 720, - /* 560 */ 2067, 702, 2107, 822, 818, 814, 810, 127, 324, 55, - /* 570 */ 126, 125, 124, 123, 122, 121, 120, 119, 118, 467, - /* 580 */ 9, 84, 83, 465, 831, 100, 216, 15, 12, 2337, - /* 590 */ 10, 1640, 674, 673, 1828, 1829, 1831, 1832, 1833, 457, - /* 600 */ 455, 2285, 643, 736, 112, 2493, 1638, 720, 2067, 113, - /* 610 */ 366, 304, 318, 446, 1755, 1666, 443, 439, 435, 432, - /* 620 */ 458, 147, 1668, 1727, 1728, 2044, 1303, 483, 1302, 2059, - /* 630 */ 174, 199, 1891, 701, 201, 2417, 2418, 35, 144, 2422, - /* 640 */ 699, 146, 2318, 142, 716, 2356, 1646, 1761, 114, 2320, - /* 650 */ 740, 2322, 2323, 735, 1901, 730, 2120, 1700, 1710, 304, - /* 660 */ 186, 1304, 2409, 36, 1726, 1729, 411, 2405, 106, 41, - /* 670 */ 40, 706, 831, 47, 45, 44, 43, 42, 2043, 1641, - /* 680 */ 61, 1639, 699, 146, 307, 1670, 720, 2067, 659, 2440, - /* 690 */ 606, 306, 1701, 2060, 37, 413, 1749, 1750, 1751, 1752, - /* 700 */ 1753, 1757, 1758, 1759, 1760, 194, 498, 2285, 692, 1865, - /* 710 */ 277, 1644, 1645, 1697, 1379, 1699, 1702, 1703, 1704, 1705, - /* 720 */ 1706, 1707, 1708, 1709, 732, 728, 1718, 1719, 1721, 1722, - /* 730 */ 1723, 1724, 2, 48, 46, 1730, 2319, 1560, 1561, 1286, - /* 740 */ 239, 415, 1900, 1640, 559, 1664, 1930, 775, 1698, 737, - /* 750 */ 202, 2417, 2418, 603, 144, 2422, 1725, 602, 1638, 1670, - /* 760 */ 773, 161, 160, 770, 769, 768, 158, 1641, 2319, 1639, - /* 770 */ 773, 161, 160, 770, 769, 768, 158, 2337, 1559, 1562, - /* 780 */ 302, 737, 1899, 1932, 727, 1720, 1879, 720, 2067, 2285, - /* 790 */ 1669, 736, 204, 2417, 2418, 2285, 144, 2422, 1646, 1644, - /* 800 */ 1645, 2114, 2115, 1898, 646, 1788, 2319, 499, 2424, 2337, - /* 810 */ 136, 135, 134, 133, 132, 131, 130, 129, 128, 737, - /* 820 */ 1665, 2285, 99, 736, 831, 720, 2067, 49, 1665, 623, - /* 830 */ 2318, 720, 2067, 2356, 2419, 2285, 114, 2320, 740, 2322, - /* 840 */ 2323, 735, 1897, 730, 635, 500, 149, 2337, 156, 2380, - /* 850 */ 2409, 575, 1588, 272, 411, 2405, 2285, 271, 418, 2285, - /* 860 */ 270, 736, 2318, 1727, 1728, 2356, 171, 2151, 114, 2320, - /* 870 */ 740, 2322, 2323, 735, 2069, 730, 626, 2042, 648, 2239, - /* 880 */ 2508, 2120, 2409, 620, 2120, 12, 411, 2405, 396, 267, - /* 890 */ 1646, 405, 720, 2067, 1896, 2285, 2118, 1700, 1710, 2118, - /* 900 */ 2318, 595, 594, 2356, 1726, 1729, 114, 2320, 740, 2322, - /* 910 */ 2323, 735, 2064, 730, 2295, 722, 255, 2381, 2384, 1641, - /* 920 */ 2409, 1639, 1895, 98, 411, 2405, 370, 1894, 2058, 395, - /* 930 */ 72, 636, 178, 71, 2120, 1277, 614, 613, 2299, 766, - /* 940 */ 593, 589, 585, 581, 1746, 254, 1893, 2285, 198, 715, - /* 950 */ 2279, 1644, 1645, 1697, 1284, 1699, 1702, 1703, 1704, 1705, - /* 960 */ 1706, 1707, 1708, 1709, 732, 728, 1718, 1719, 1721, 1722, - /* 970 */ 1723, 1724, 2, 48, 46, 2285, 1701, 1279, 1282, 1283, - /* 980 */ 2285, 415, 2301, 1640, 720, 2067, 96, 720, 2067, 252, - /* 990 */ 2120, 2492, 730, 325, 2120, 2319, 1725, 410, 1638, 2285, - /* 1000 */ 662, 419, 1670, 2488, 275, 2118, 1284, 283, 737, 2118, - /* 1010 */ 2447, 2056, 773, 161, 160, 770, 769, 768, 158, 720, - /* 1020 */ 2067, 2494, 203, 720, 2067, 1720, 2489, 688, 493, 2319, - /* 1030 */ 1282, 1283, 1698, 421, 720, 2067, 2337, 492, 1646, 705, - /* 1040 */ 1698, 171, 737, 315, 2460, 720, 2067, 2052, 2285, 2069, - /* 1050 */ 736, 41, 40, 242, 717, 47, 45, 44, 43, 42, - /* 1060 */ 1796, 251, 244, 450, 831, 718, 2161, 49, 249, 570, - /* 1070 */ 2337, 41, 40, 720, 2067, 47, 45, 44, 43, 42, - /* 1080 */ 1306, 1307, 2285, 1933, 736, 720, 2067, 241, 1337, 2318, - /* 1090 */ 452, 448, 2356, 321, 2054, 114, 2320, 740, 2322, 2323, - /* 1100 */ 735, 641, 730, 1727, 1728, 422, 2266, 2508, 473, 2409, - /* 1110 */ 647, 41, 40, 411, 2405, 47, 45, 44, 43, 42, - /* 1120 */ 1303, 1890, 1302, 2318, 800, 798, 2356, 1889, 1338, 114, - /* 1130 */ 2320, 740, 2322, 2323, 735, 824, 730, 1700, 1710, 597, - /* 1140 */ 596, 2508, 273, 2409, 1726, 1729, 2050, 411, 2405, 2493, - /* 1150 */ 1841, 662, 2488, 148, 2488, 1304, 2380, 311, 312, 1641, - /* 1160 */ 662, 1639, 310, 2488, 724, 2295, 2381, 1888, 1394, 703, - /* 1170 */ 1815, 2492, 2494, 203, 2285, 2489, 2491, 2489, 688, 2304, - /* 1180 */ 2285, 2494, 203, 1393, 14, 13, 2489, 688, 638, 2299, - /* 1190 */ 637, 1644, 1645, 1697, 1887, 1699, 1702, 1703, 1704, 1705, - /* 1200 */ 1706, 1707, 1708, 1709, 732, 728, 1718, 1719, 1721, 1722, - /* 1210 */ 1723, 1724, 2, 48, 46, 2319, 197, 1609, 1610, 662, - /* 1220 */ 2285, 415, 2488, 1640, 1398, 44, 43, 42, 737, 1886, - /* 1230 */ 669, 2493, 767, 2301, 2488, 2111, 1725, 2120, 1638, 1397, - /* 1240 */ 2494, 203, 1885, 730, 1884, 2489, 688, 2285, 2319, 528, - /* 1250 */ 1649, 171, 2119, 2492, 2071, 1883, 2337, 2489, 2490, 2070, - /* 1260 */ 1882, 737, 1648, 2481, 771, 1720, 334, 2111, 2285, 2097, - /* 1270 */ 736, 772, 1907, 826, 2111, 2429, 1788, 690, 1646, 41, - /* 1280 */ 40, 170, 2285, 47, 45, 44, 43, 42, 2269, 2337, - /* 1290 */ 1768, 2045, 1950, 280, 3, 2285, 76, 2285, 139, 260, - /* 1300 */ 159, 2285, 258, 736, 831, 530, 54, 15, 2285, 2318, - /* 1310 */ 86, 2453, 2356, 2285, 619, 114, 2320, 740, 2322, 2323, - /* 1320 */ 735, 731, 730, 607, 152, 262, 1795, 2508, 261, 2409, - /* 1330 */ 210, 424, 423, 411, 2405, 264, 1941, 266, 263, 437, - /* 1340 */ 265, 1654, 2318, 1727, 1728, 2356, 87, 1377, 114, 2320, - /* 1350 */ 740, 2322, 2323, 735, 1725, 730, 1647, 1939, 621, 297, - /* 1360 */ 2508, 1892, 2409, 1874, 1875, 675, 411, 2405, 14, 13, - /* 1370 */ 141, 291, 2338, 2004, 1604, 2319, 780, 1700, 1710, 624, - /* 1380 */ 159, 50, 50, 1720, 1726, 1729, 187, 159, 737, 50, - /* 1390 */ 2428, 309, 75, 111, 157, 781, 1646, 159, 2003, 1641, - /* 1400 */ 1356, 1639, 108, 672, 2185, 1923, 2443, 401, 679, 398, - /* 1410 */ 709, 66, 50, 1652, 50, 428, 2337, 744, 157, 1354, - /* 1420 */ 1929, 159, 726, 140, 157, 1651, 2108, 2186, 2285, 655, - /* 1430 */ 736, 1644, 1645, 1697, 2444, 1699, 1702, 1703, 1704, 1705, - /* 1440 */ 1706, 1707, 1708, 1709, 732, 728, 1718, 1719, 1721, 1722, - /* 1450 */ 1723, 1724, 2, 2454, 1607, 1827, 1826, 700, 299, 296, - /* 1460 */ 289, 704, 2029, 1557, 303, 313, 712, 5, 317, 2318, - /* 1470 */ 431, 1424, 2356, 436, 379, 114, 2320, 740, 2322, 2323, - /* 1480 */ 735, 444, 730, 2319, 445, 1762, 1711, 2508, 333, 2409, - /* 1490 */ 1673, 1452, 1456, 411, 2405, 1463, 737, 1461, 162, 454, - /* 1500 */ 212, 211, 453, 214, 456, 1581, 328, 1663, 470, 1664, - /* 1510 */ 474, 225, 476, 480, 519, 482, 487, 1655, 501, 1650, - /* 1520 */ 508, 2178, 510, 518, 2337, 520, 532, 531, 529, 229, - /* 1530 */ 230, 534, 232, 535, 537, 539, 2285, 1671, 736, 554, - /* 1540 */ 4, 2319, 555, 562, 563, 240, 565, 92, 1666, 1658, - /* 1550 */ 1660, 243, 1672, 567, 737, 1674, 568, 246, 569, 1675, - /* 1560 */ 571, 248, 2194, 728, 1718, 1719, 1721, 1722, 1723, 1724, - /* 1570 */ 93, 577, 598, 94, 253, 97, 642, 2318, 2319, 627, - /* 1580 */ 2356, 2257, 2337, 114, 2320, 740, 2322, 2323, 735, 600, - /* 1590 */ 730, 737, 116, 628, 2285, 2382, 736, 2409, 2057, 257, - /* 1600 */ 360, 411, 2405, 640, 2053, 259, 153, 164, 2254, 165, - /* 1610 */ 2055, 2319, 2051, 166, 167, 329, 276, 1667, 2240, 2337, - /* 1620 */ 650, 649, 651, 281, 737, 657, 2459, 279, 676, 710, - /* 1630 */ 8, 2285, 2253, 736, 2431, 2318, 654, 685, 2356, 666, - /* 1640 */ 2458, 114, 2320, 740, 2322, 2323, 735, 290, 730, 179, - /* 1650 */ 667, 292, 2337, 723, 2319, 2409, 286, 665, 288, 411, - /* 1660 */ 2405, 656, 2487, 402, 2285, 664, 736, 737, 295, 696, - /* 1670 */ 2511, 298, 2318, 693, 1788, 2356, 145, 1668, 115, 2320, - /* 1680 */ 740, 2322, 2323, 735, 1793, 730, 190, 2425, 1791, 293, - /* 1690 */ 294, 2319, 2409, 1, 305, 2337, 2408, 2405, 154, 330, - /* 1700 */ 708, 2208, 2207, 2206, 737, 2318, 331, 2285, 2356, 736, - /* 1710 */ 407, 115, 2320, 740, 2322, 2323, 735, 713, 730, 206, - /* 1720 */ 714, 332, 62, 155, 2390, 2409, 107, 2068, 105, 725, - /* 1730 */ 2405, 742, 2337, 2112, 335, 1261, 825, 323, 828, 371, - /* 1740 */ 53, 359, 372, 830, 2285, 339, 736, 163, 738, 2319, - /* 1750 */ 344, 2356, 2277, 2276, 115, 2320, 740, 2322, 2323, 735, - /* 1760 */ 358, 730, 737, 337, 348, 2275, 2319, 81, 2409, 2270, - /* 1770 */ 433, 434, 374, 2405, 1631, 1632, 209, 438, 2268, 737, - /* 1780 */ 440, 441, 442, 1630, 2267, 2318, 380, 2319, 2356, 2265, - /* 1790 */ 2337, 175, 2320, 740, 2322, 2323, 735, 447, 730, 2264, - /* 1800 */ 737, 449, 2285, 451, 736, 2263, 1620, 2337, 2244, 213, - /* 1810 */ 2243, 215, 1584, 82, 2221, 1583, 2220, 2219, 463, 2285, - /* 1820 */ 464, 736, 2218, 2217, 2168, 468, 1527, 2160, 2337, 471, - /* 1830 */ 2157, 472, 218, 663, 2450, 2156, 85, 2155, 2154, 2159, - /* 1840 */ 2285, 2158, 736, 2318, 220, 2153, 2356, 2152, 2150, 176, - /* 1850 */ 2320, 740, 2322, 2323, 735, 2149, 730, 2148, 222, 2147, - /* 1860 */ 2318, 488, 490, 2356, 2163, 2146, 115, 2320, 740, 2322, - /* 1870 */ 2323, 735, 2145, 730, 2144, 2143, 2142, 2165, 2141, 2140, - /* 1880 */ 2409, 2318, 2139, 2138, 2356, 2406, 2319, 175, 2320, 740, - /* 1890 */ 2322, 2323, 735, 2137, 730, 2136, 2135, 2134, 2133, 737, - /* 1900 */ 2132, 224, 2131, 689, 2509, 91, 2130, 2129, 2128, 2164, - /* 1910 */ 2162, 2127, 2126, 2319, 1533, 2125, 2124, 228, 522, 2123, - /* 1920 */ 524, 2122, 2121, 1395, 1969, 1399, 737, 2337, 1391, 1968, - /* 1930 */ 2451, 368, 399, 231, 369, 233, 1967, 234, 1965, 2285, - /* 1940 */ 1962, 736, 540, 1961, 2319, 541, 542, 1954, 1943, 1918, - /* 1950 */ 544, 1285, 1917, 2242, 2337, 2238, 185, 737, 2228, 400, - /* 1960 */ 546, 2216, 548, 552, 2215, 545, 2285, 2192, 736, 550, - /* 1970 */ 247, 549, 78, 236, 238, 2046, 79, 1964, 1960, 578, - /* 1980 */ 2318, 2319, 2305, 2356, 195, 2337, 357, 2320, 740, 2322, - /* 1990 */ 2323, 735, 245, 730, 737, 560, 579, 2285, 580, 736, - /* 2000 */ 250, 1958, 582, 1330, 584, 583, 1956, 2318, 586, 1953, - /* 2010 */ 2356, 587, 588, 357, 2320, 740, 2322, 2323, 735, 590, - /* 2020 */ 730, 592, 2337, 591, 1938, 1936, 1937, 1935, 1914, 2048, - /* 2030 */ 1468, 65, 1467, 2047, 2285, 1951, 736, 1381, 2318, 1380, - /* 2040 */ 1378, 2356, 1376, 1942, 350, 2320, 740, 2322, 2323, 735, - /* 2050 */ 1375, 730, 1374, 256, 2319, 1373, 1372, 1369, 1368, 1367, - /* 2060 */ 1366, 392, 393, 797, 799, 622, 1940, 737, 394, 625, - /* 2070 */ 1913, 1912, 1911, 629, 1910, 2318, 1909, 633, 2356, 2319, - /* 2080 */ 117, 176, 2320, 740, 2322, 2323, 735, 631, 730, 1614, - /* 2090 */ 684, 1616, 734, 1613, 1618, 2337, 29, 2241, 69, 2237, - /* 2100 */ 406, 1590, 278, 1592, 1594, 2227, 652, 2285, 2214, 736, - /* 2110 */ 2493, 20, 6, 17, 31, 668, 21, 57, 2213, 7, - /* 2120 */ 2337, 22, 2319, 1844, 287, 189, 200, 33, 285, 2306, - /* 2130 */ 67, 23, 2285, 24, 736, 737, 2510, 2319, 282, 18, - /* 2140 */ 670, 58, 301, 1859, 653, 169, 1569, 1568, 2318, 1825, - /* 2150 */ 737, 2356, 2319, 177, 357, 2320, 740, 2322, 2323, 735, - /* 2160 */ 1858, 730, 403, 2337, 188, 737, 1814, 32, 414, 658, - /* 2170 */ 660, 80, 1863, 2318, 1864, 2285, 2356, 736, 2337, 356, - /* 2180 */ 2320, 740, 2322, 2323, 735, 1862, 730, 404, 2375, 1865, - /* 2190 */ 2285, 60, 736, 2337, 1785, 180, 1784, 2212, 416, 2191, - /* 2200 */ 2190, 101, 102, 308, 25, 2285, 103, 736, 1820, 191, - /* 2210 */ 314, 319, 26, 13, 316, 70, 2318, 2319, 104, 2356, - /* 2220 */ 1737, 1736, 357, 2320, 740, 2322, 2323, 735, 108, 730, - /* 2230 */ 737, 639, 1656, 711, 2356, 2319, 11, 352, 2320, 740, - /* 2240 */ 2322, 2323, 735, 2359, 730, 1715, 2318, 729, 737, 2356, - /* 2250 */ 1713, 39, 357, 2320, 740, 2322, 2323, 735, 2337, 730, - /* 2260 */ 59, 1712, 181, 16, 192, 27, 1690, 741, 1682, 28, - /* 2270 */ 2285, 1747, 736, 1453, 743, 417, 2337, 739, 745, 747, - /* 2280 */ 1450, 748, 750, 1449, 751, 753, 756, 1446, 2285, 754, - /* 2290 */ 736, 1440, 757, 759, 1438, 760, 1444, 1443, 1442, 109, - /* 2300 */ 322, 1441, 110, 1462, 77, 1458, 1363, 1328, 1360, 774, - /* 2310 */ 1389, 2318, 1359, 1358, 2356, 1357, 1355, 342, 2320, 740, - /* 2320 */ 2322, 2323, 735, 1353, 730, 1352, 1351, 785, 1388, 2318, - /* 2330 */ 2319, 787, 2356, 207, 1349, 340, 2320, 740, 2322, 2323, - /* 2340 */ 735, 1348, 730, 737, 1347, 1346, 1345, 2319, 1344, 1343, - /* 2350 */ 1383, 1385, 1340, 1339, 1336, 1335, 1334, 1333, 1959, 807, - /* 2360 */ 737, 808, 1957, 2319, 811, 812, 809, 813, 1955, 815, - /* 2370 */ 816, 2337, 1952, 817, 819, 821, 737, 820, 1934, 823, - /* 2380 */ 1274, 1908, 1262, 2285, 827, 736, 326, 829, 2337, 1642, - /* 2390 */ 833, 336, 832, 1878, 1878, 1878, 1878, 1878, 1878, 1878, - /* 2400 */ 2285, 1878, 736, 1878, 2337, 1878, 1878, 1878, 1878, 1878, - /* 2410 */ 1878, 1878, 1878, 1878, 1878, 1878, 2285, 1878, 736, 1878, - /* 2420 */ 1878, 1878, 1878, 1878, 2318, 1878, 1878, 2356, 1878, 1878, - /* 2430 */ 343, 2320, 740, 2322, 2323, 735, 1878, 730, 1878, 1878, - /* 2440 */ 2319, 2318, 1878, 1878, 2356, 1878, 1878, 349, 2320, 740, - /* 2450 */ 2322, 2323, 735, 737, 730, 1878, 1878, 2318, 1878, 2319, - /* 2460 */ 2356, 1878, 1878, 353, 2320, 740, 2322, 2323, 735, 1878, - /* 2470 */ 730, 1878, 737, 1878, 1878, 1878, 1878, 1878, 1878, 1878, - /* 2480 */ 1878, 2337, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, - /* 2490 */ 1878, 1878, 1878, 2285, 1878, 736, 1878, 1878, 1878, 1878, - /* 2500 */ 2337, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, - /* 2510 */ 1878, 1878, 2285, 1878, 736, 1878, 1878, 1878, 1878, 1878, - /* 2520 */ 1878, 1878, 1878, 1878, 1878, 1878, 2319, 1878, 1878, 1878, - /* 2530 */ 1878, 1878, 1878, 1878, 2318, 1878, 1878, 2356, 1878, 737, - /* 2540 */ 345, 2320, 740, 2322, 2323, 735, 1878, 730, 1878, 1878, - /* 2550 */ 1878, 1878, 1878, 2318, 1878, 2319, 2356, 1878, 1878, 354, - /* 2560 */ 2320, 740, 2322, 2323, 735, 1878, 730, 2337, 737, 1878, - /* 2570 */ 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 2285, - /* 2580 */ 1878, 736, 1878, 1878, 2319, 1878, 1878, 1878, 1878, 1878, - /* 2590 */ 1878, 1878, 1878, 1878, 1878, 1878, 2337, 737, 1878, 1878, - /* 2600 */ 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 2285, 1878, - /* 2610 */ 736, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, - /* 2620 */ 2318, 1878, 2319, 2356, 1878, 2337, 346, 2320, 740, 2322, - /* 2630 */ 2323, 735, 1878, 730, 1878, 737, 1878, 2285, 1878, 736, - /* 2640 */ 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 2318, - /* 2650 */ 1878, 1878, 2356, 1878, 1878, 355, 2320, 740, 2322, 2323, - /* 2660 */ 735, 1878, 730, 2337, 1878, 1878, 1878, 1878, 1878, 1878, - /* 2670 */ 1878, 1878, 1878, 1878, 1878, 2285, 1878, 736, 2318, 2319, - /* 2680 */ 1878, 2356, 1878, 1878, 347, 2320, 740, 2322, 2323, 735, - /* 2690 */ 1878, 730, 737, 1878, 1878, 1878, 1878, 2319, 1878, 1878, - /* 2700 */ 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, - /* 2710 */ 737, 1878, 1878, 1878, 1878, 1878, 2318, 1878, 1878, 2356, - /* 2720 */ 2337, 1878, 361, 2320, 740, 2322, 2323, 735, 1878, 730, - /* 2730 */ 1878, 1878, 2285, 1878, 736, 1878, 1878, 1878, 2337, 1878, - /* 2740 */ 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, - /* 2750 */ 2285, 1878, 736, 1878, 2319, 1878, 1878, 1878, 1878, 1878, - /* 2760 */ 1878, 1878, 1878, 1878, 1878, 1878, 1878, 737, 1878, 1878, - /* 2770 */ 1878, 1878, 1878, 2318, 2319, 1878, 2356, 1878, 1878, 362, - /* 2780 */ 2320, 740, 2322, 2323, 735, 1878, 730, 737, 1878, 1878, - /* 2790 */ 2319, 2318, 1878, 1878, 2356, 2337, 1878, 2331, 2320, 740, - /* 2800 */ 2322, 2323, 735, 737, 730, 1878, 1878, 2285, 1878, 736, - /* 2810 */ 1878, 1878, 1878, 1878, 1878, 2337, 1878, 1878, 1878, 1878, - /* 2820 */ 1878, 1878, 1878, 1878, 1878, 1878, 1878, 2285, 1878, 736, - /* 2830 */ 1878, 2337, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, - /* 2840 */ 1878, 1878, 1878, 2285, 1878, 736, 1878, 1878, 2318, 1878, - /* 2850 */ 1878, 2356, 1878, 1878, 2330, 2320, 740, 2322, 2323, 735, - /* 2860 */ 1878, 730, 1878, 1878, 1878, 1878, 1878, 1878, 2318, 1878, - /* 2870 */ 1878, 2356, 1878, 1878, 2329, 2320, 740, 2322, 2323, 735, - /* 2880 */ 1878, 730, 1878, 1878, 2318, 1878, 1878, 2356, 1878, 2319, - /* 2890 */ 376, 2320, 740, 2322, 2323, 735, 1878, 730, 1878, 1878, - /* 2900 */ 1878, 1878, 737, 1878, 1878, 2319, 1878, 1878, 1878, 1878, - /* 2910 */ 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 737, 1878, - /* 2920 */ 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, - /* 2930 */ 2337, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, - /* 2940 */ 1878, 1878, 2285, 1878, 736, 1878, 2337, 1878, 1878, 1878, - /* 2950 */ 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 2285, 1878, - /* 2960 */ 736, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, - /* 2970 */ 1878, 1878, 2319, 1878, 1878, 1878, 1878, 1878, 1878, 1878, - /* 2980 */ 1878, 1878, 1878, 2318, 1878, 737, 2356, 2319, 1878, 377, - /* 2990 */ 2320, 740, 2322, 2323, 735, 1878, 730, 1878, 1878, 2318, - /* 3000 */ 737, 1878, 2356, 1878, 1878, 373, 2320, 740, 2322, 2323, - /* 3010 */ 735, 1878, 730, 2337, 1878, 1878, 1878, 1878, 1878, 1878, - /* 3020 */ 1878, 1878, 1878, 1878, 1878, 2285, 1878, 736, 2337, 1878, - /* 3030 */ 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, - /* 3040 */ 2285, 1878, 736, 1878, 1878, 1878, 1878, 1878, 1878, 1878, - /* 3050 */ 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, - /* 3060 */ 1878, 1878, 1878, 1878, 1878, 1878, 2318, 1878, 1878, 2356, - /* 3070 */ 2319, 1878, 378, 2320, 740, 2322, 2323, 735, 1878, 730, - /* 3080 */ 1878, 738, 1878, 737, 2356, 1878, 1878, 352, 2320, 740, - /* 3090 */ 2322, 2323, 735, 1878, 730, 1878, 1878, 1878, 1878, 1878, - /* 3100 */ 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, - /* 3110 */ 1878, 2337, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, - /* 3120 */ 1878, 1878, 1878, 2285, 1878, 736, 1878, 1878, 1878, 1878, - /* 3130 */ 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, - /* 3140 */ 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, - /* 3150 */ 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, 1878, - /* 3160 */ 1878, 1878, 1878, 1878, 2318, 1878, 1878, 2356, 1878, 1878, - /* 3170 */ 351, 2320, 740, 2322, 2323, 735, 1878, 730, + /* 0 */ 409, 561, 197, 418, 562, 1930, 569, 2064, 171, 562, + /* 10 */ 1930, 168, 48, 46, 1807, 2210, 2077, 34, 397, 2077, + /* 20 */ 415, 471, 1648, 41, 40, 1673, 2126, 47, 45, 44, + /* 30 */ 43, 42, 36, 2208, 712, 1733, 1971, 1646, 41, 40, + /* 40 */ 38, 320, 47, 45, 44, 43, 42, 2330, 41, 40, + /* 50 */ 480, 2186, 47, 45, 44, 43, 42, 704, 146, 1674, + /* 60 */ 707, 184, 2122, 2123, 1728, 1888, 528, 526, 420, 365, + /* 70 */ 19, 2121, 2123, 217, 41, 40, 173, 1654, 47, 45, + /* 80 */ 44, 43, 42, 383, 2014, 2190, 127, 95, 2348, 126, + /* 90 */ 125, 124, 123, 122, 121, 120, 119, 118, 1673, 219, + /* 100 */ 2296, 237, 741, 836, 385, 564, 15, 1938, 811, 810, + /* 110 */ 809, 808, 427, 2070, 807, 806, 151, 801, 800, 799, + /* 120 */ 798, 797, 796, 795, 150, 789, 788, 787, 426, 425, + /* 130 */ 784, 783, 782, 183, 182, 781, 692, 486, 2186, 2499, + /* 140 */ 1648, 2329, 1735, 1736, 2367, 686, 184, 114, 2331, 745, + /* 150 */ 2333, 2334, 740, 148, 735, 1646, 2391, 691, 203, 186, + /* 160 */ 581, 2420, 2500, 693, 1282, 411, 2416, 300, 2428, 703, + /* 170 */ 2191, 138, 702, 2348, 2499, 704, 146, 1708, 1718, 2435, + /* 180 */ 205, 1479, 1480, 1289, 1734, 1737, 221, 724, 2450, 2128, + /* 190 */ 1674, 724, 691, 203, 2210, 1654, 381, 2500, 693, 1649, + /* 200 */ 174, 1647, 1899, 2504, 2126, 2432, 1284, 1287, 1288, 408, + /* 210 */ 41, 40, 2207, 712, 47, 45, 44, 43, 42, 127, + /* 220 */ 1676, 836, 126, 125, 124, 123, 122, 121, 120, 119, + /* 230 */ 118, 1652, 1653, 1705, 685, 1707, 1710, 1711, 1712, 1713, + /* 240 */ 1714, 1715, 1716, 1717, 737, 733, 1726, 1727, 1729, 1730, + /* 250 */ 1731, 1732, 2, 48, 46, 1547, 1548, 1880, 364, 682, + /* 260 */ 1671, 415, 1308, 1648, 1307, 514, 2186, 512, 1830, 2330, + /* 270 */ 531, 724, 375, 51, 692, 530, 1733, 2499, 1646, 142, + /* 280 */ 2306, 650, 742, 1831, 706, 201, 2428, 2429, 272, 144, + /* 290 */ 2433, 494, 271, 532, 2066, 691, 203, 1309, 496, 2504, + /* 300 */ 2500, 693, 2499, 112, 2310, 1728, 1887, 1873, 474, 566, + /* 310 */ 2348, 19, 1567, 1568, 226, 563, 1762, 1649, 1654, 1647, + /* 320 */ 147, 2503, 2296, 1829, 741, 2500, 2502, 2330, 2067, 196, + /* 330 */ 136, 135, 134, 133, 132, 131, 130, 129, 128, 608, + /* 340 */ 742, 2115, 1940, 607, 836, 384, 687, 15, 2312, 1652, + /* 350 */ 1653, 688, 683, 676, 1566, 1569, 482, 51, 735, 98, + /* 360 */ 578, 1879, 370, 2329, 2051, 395, 2367, 641, 2348, 175, + /* 370 */ 2331, 745, 2333, 2334, 740, 577, 735, 666, 1763, 302, + /* 380 */ 2296, 106, 741, 1735, 1736, 1910, 2197, 2176, 1958, 519, + /* 390 */ 518, 517, 516, 511, 510, 509, 508, 507, 502, 501, + /* 400 */ 500, 499, 367, 491, 490, 489, 2068, 484, 483, 382, + /* 410 */ 624, 668, 2461, 475, 1535, 1536, 579, 2203, 1708, 1718, + /* 420 */ 1554, 2329, 1673, 648, 2367, 1734, 1737, 114, 2331, 745, + /* 430 */ 2333, 2334, 740, 780, 735, 1676, 304, 639, 2296, 2519, + /* 440 */ 1649, 2420, 1647, 41, 40, 411, 2416, 47, 45, 44, + /* 450 */ 43, 42, 637, 1654, 635, 269, 268, 2289, 37, 413, + /* 460 */ 1757, 1758, 1759, 1760, 1761, 1765, 1766, 1767, 1768, 780, + /* 470 */ 311, 312, 1652, 1653, 1705, 310, 1707, 1710, 1711, 1712, + /* 480 */ 1713, 1714, 1715, 1716, 1717, 737, 733, 1726, 1727, 1729, + /* 490 */ 1730, 1731, 1732, 2, 12, 48, 46, 255, 239, 2330, + /* 500 */ 1673, 1399, 564, 415, 1938, 1648, 61, 667, 63, 1909, + /* 510 */ 2499, 63, 742, 178, 664, 12, 1398, 68, 1733, 558, + /* 520 */ 1646, 598, 594, 590, 586, 223, 254, 556, 2505, 203, + /* 530 */ 552, 548, 1908, 2500, 693, 2330, 159, 623, 622, 621, + /* 540 */ 2348, 651, 1849, 522, 613, 143, 617, 1728, 707, 651, + /* 550 */ 616, 2052, 2296, 19, 741, 615, 620, 391, 390, 1705, + /* 560 */ 1654, 614, 2296, 3, 610, 2504, 90, 96, 2499, 89, + /* 570 */ 252, 1311, 1312, 41, 40, 54, 2348, 47, 45, 44, + /* 580 */ 43, 42, 533, 424, 423, 2296, 836, 2503, 2296, 15, + /* 590 */ 741, 2500, 2501, 2329, 302, 1308, 2367, 1307, 30, 114, + /* 600 */ 2331, 745, 2333, 2334, 740, 227, 735, 2306, 1655, 149, + /* 610 */ 55, 156, 2391, 2420, 1811, 571, 2249, 411, 2416, 63, + /* 620 */ 1673, 2315, 771, 653, 2249, 1735, 1736, 521, 520, 2329, + /* 630 */ 1309, 2310, 2367, 88, 242, 114, 2331, 745, 2333, 2334, + /* 640 */ 740, 2128, 735, 251, 244, 600, 599, 186, 396, 2420, + /* 650 */ 249, 575, 325, 411, 2416, 2435, 2126, 1709, 41, 40, + /* 660 */ 1708, 1718, 47, 45, 44, 43, 42, 1734, 1737, 241, + /* 670 */ 699, 304, 1850, 1743, 304, 2312, 2451, 1974, 2159, 1673, + /* 680 */ 1444, 2431, 1649, 2060, 1647, 735, 778, 161, 160, 775, + /* 690 */ 774, 773, 158, 52, 1435, 770, 769, 768, 1439, 767, + /* 700 */ 1441, 1442, 766, 763, 171, 1450, 760, 1452, 1453, 757, + /* 710 */ 754, 751, 2078, 1706, 1652, 1653, 1705, 99, 1707, 1710, + /* 720 */ 1711, 1712, 1713, 1714, 1715, 1716, 1717, 737, 733, 1726, + /* 730 */ 1727, 1729, 1730, 1731, 1732, 2, 48, 46, 1738, 2062, + /* 740 */ 2330, 44, 43, 42, 415, 2128, 1648, 1907, 1595, 623, + /* 750 */ 622, 621, 405, 742, 1838, 2458, 613, 143, 617, 1733, + /* 760 */ 2126, 1646, 616, 725, 2075, 725, 2075, 615, 620, 391, + /* 770 */ 390, 2330, 1658, 614, 725, 2075, 610, 1709, 1885, 2050, + /* 780 */ 9, 2348, 304, 137, 742, 137, 2471, 2058, 1728, 12, + /* 790 */ 604, 10, 609, 2296, 208, 741, 602, 601, 448, 2435, + /* 800 */ 2296, 1654, 1906, 679, 678, 1836, 1837, 1839, 1840, 1841, + /* 810 */ 464, 2079, 2348, 41, 40, 463, 2128, 47, 45, 44, + /* 820 */ 43, 42, 1291, 410, 2296, 2430, 741, 836, 1672, 170, + /* 830 */ 49, 2126, 280, 1706, 2329, 1905, 1709, 2367, 2330, 498, + /* 840 */ 114, 2331, 745, 2333, 2334, 740, 2128, 735, 497, 725, + /* 850 */ 2075, 739, 2519, 419, 2420, 2296, 304, 430, 411, 2416, + /* 860 */ 667, 2126, 429, 2499, 2503, 2329, 1735, 1736, 2367, 56, + /* 870 */ 736, 114, 2331, 745, 2333, 2334, 740, 2290, 735, 2348, + /* 880 */ 95, 2505, 203, 2519, 1904, 2420, 2500, 693, 2296, 411, + /* 890 */ 2416, 2296, 1706, 741, 778, 161, 160, 775, 774, 773, + /* 900 */ 158, 1708, 1718, 704, 146, 418, 2071, 667, 1734, 1737, + /* 910 */ 2499, 2128, 1823, 171, 778, 161, 160, 775, 774, 773, + /* 920 */ 158, 2077, 2317, 1649, 452, 1647, 711, 667, 2505, 203, + /* 930 */ 2499, 700, 2329, 2500, 693, 2367, 1949, 2296, 356, 2331, + /* 940 */ 745, 2333, 2334, 740, 738, 735, 726, 2385, 2505, 203, + /* 950 */ 1764, 454, 450, 2500, 693, 1652, 1653, 1705, 626, 1707, + /* 960 */ 1710, 1711, 1712, 1713, 1714, 1715, 1716, 1717, 737, 733, + /* 970 */ 1726, 1727, 1729, 1730, 1731, 1732, 2, 48, 46, 2319, + /* 980 */ 2330, 725, 2075, 1403, 646, 415, 1387, 1648, 1903, 649, + /* 990 */ 725, 2075, 727, 742, 2392, 674, 725, 2075, 1402, 273, + /* 1000 */ 1733, 468, 1646, 421, 725, 2075, 1796, 839, 619, 618, + /* 1010 */ 469, 171, 2330, 202, 2428, 2429, 488, 144, 2433, 2077, + /* 1020 */ 2169, 2348, 2306, 327, 275, 742, 1389, 2492, 1657, 1728, + /* 1030 */ 35, 725, 2075, 2296, 667, 741, 2314, 2499, 1804, 193, + /* 1040 */ 1769, 2296, 1654, 725, 2075, 284, 2310, 827, 823, 819, + /* 1050 */ 815, 503, 324, 2348, 791, 2505, 203, 2258, 725, 2075, + /* 1060 */ 2500, 693, 478, 504, 535, 2296, 2015, 741, 836, 704, + /* 1070 */ 146, 49, 1902, 628, 2329, 1616, 1617, 2367, 505, 1677, + /* 1080 */ 114, 2331, 745, 2333, 2334, 740, 652, 735, 640, 100, + /* 1090 */ 2312, 412, 2519, 113, 2420, 1677, 318, 1673, 411, 2416, + /* 1100 */ 735, 725, 2075, 2277, 270, 1900, 2329, 1735, 1736, 2367, + /* 1110 */ 1289, 274, 114, 2331, 745, 2333, 2334, 740, 793, 735, + /* 1120 */ 631, 580, 1677, 696, 2519, 2296, 2420, 625, 721, 794, + /* 1130 */ 411, 2416, 2036, 267, 1287, 1288, 667, 805, 803, 2499, + /* 1140 */ 41, 40, 1708, 1718, 47, 45, 44, 43, 42, 1734, + /* 1150 */ 1737, 695, 1677, 389, 388, 725, 2075, 2505, 203, 729, + /* 1160 */ 159, 2392, 2500, 693, 1649, 772, 1647, 2128, 2119, 307, + /* 1170 */ 1901, 725, 2075, 2128, 72, 2072, 306, 71, 111, 204, + /* 1180 */ 2428, 2429, 720, 144, 2433, 14, 13, 108, 2127, 708, + /* 1190 */ 63, 283, 1660, 1898, 1897, 277, 1652, 1653, 1705, 1896, + /* 1200 */ 1707, 1710, 1711, 1712, 1713, 1714, 1715, 1716, 1717, 737, + /* 1210 */ 733, 1726, 1727, 1729, 1730, 1731, 1732, 2, 48, 46, + /* 1220 */ 725, 2075, 2330, 2296, 387, 386, 415, 606, 1648, 47, + /* 1230 */ 45, 44, 43, 42, 1611, 742, 1895, 2439, 194, 667, + /* 1240 */ 710, 1733, 2499, 1646, 725, 2075, 2296, 2296, 1894, 608, + /* 1250 */ 1893, 1892, 2296, 607, 725, 2075, 725, 2075, 725, 2075, + /* 1260 */ 2505, 203, 2280, 2348, 315, 2500, 693, 725, 2075, 776, + /* 1270 */ 1728, 76, 2119, 732, 722, 2296, 723, 741, 321, 1891, + /* 1280 */ 1890, 198, 462, 1654, 461, 777, 2464, 422, 2119, 2296, + /* 1290 */ 334, 1776, 1678, 2105, 1915, 831, 260, 2440, 1796, 258, + /* 1300 */ 643, 2296, 642, 2296, 2296, 1803, 139, 50, 1678, 836, + /* 1310 */ 1706, 199, 15, 437, 460, 1656, 2329, 2330, 86, 2367, + /* 1320 */ 611, 87, 114, 2331, 745, 2333, 2334, 740, 210, 735, + /* 1330 */ 742, 2053, 2296, 2296, 2519, 1678, 2420, 424, 423, 262, + /* 1340 */ 411, 2416, 261, 264, 1384, 612, 263, 1662, 1735, 1736, + /* 1350 */ 680, 266, 1947, 304, 265, 785, 159, 1342, 2348, 50, + /* 1360 */ 1733, 786, 1655, 297, 152, 1678, 50, 1882, 1883, 1382, + /* 1370 */ 2296, 141, 741, 2349, 629, 291, 14, 13, 2012, 1361, + /* 1380 */ 1941, 1719, 697, 1708, 1718, 1359, 2011, 187, 159, 1728, + /* 1390 */ 1734, 1737, 50, 309, 75, 2195, 157, 1343, 159, 66, + /* 1400 */ 50, 749, 1654, 157, 159, 1649, 140, 1647, 1931, 2454, + /* 1410 */ 157, 2329, 677, 401, 2367, 684, 714, 114, 2331, 745, + /* 1420 */ 2333, 2334, 740, 398, 735, 2196, 428, 1937, 731, 2395, + /* 1430 */ 1614, 2420, 829, 1835, 1754, 411, 2416, 1652, 1653, 1705, + /* 1440 */ 1834, 1707, 1710, 1711, 1712, 1713, 1714, 1715, 1716, 1717, + /* 1450 */ 737, 733, 1726, 1727, 1729, 1730, 1731, 1732, 2, 2116, + /* 1460 */ 172, 289, 709, 705, 660, 341, 1564, 313, 717, 2455, + /* 1470 */ 317, 2465, 1429, 1770, 333, 1457, 299, 1461, 1468, 1659, + /* 1480 */ 1466, 296, 338, 74, 162, 303, 73, 2037, 5, 431, + /* 1490 */ 436, 379, 444, 445, 1681, 455, 366, 211, 1588, 456, + /* 1500 */ 2330, 212, 214, 458, 1671, 328, 472, 235, 543, 541, + /* 1510 */ 538, 1672, 479, 742, 225, 485, 481, 487, 492, 524, + /* 1520 */ 506, 523, 513, 2188, 1663, 515, 1658, 525, 536, 537, + /* 1530 */ 534, 229, 230, 539, 232, 540, 542, 544, 1679, 4, + /* 1540 */ 559, 2348, 560, 567, 240, 568, 570, 92, 63, 1674, + /* 1550 */ 572, 243, 1680, 2296, 573, 741, 1666, 1668, 1682, 576, + /* 1560 */ 246, 574, 248, 1683, 93, 2204, 582, 94, 253, 603, + /* 1570 */ 733, 1726, 1727, 1729, 1730, 1731, 1732, 632, 360, 633, + /* 1580 */ 116, 2267, 2264, 605, 2263, 2065, 64, 645, 97, 257, + /* 1590 */ 2061, 259, 164, 165, 2329, 647, 2063, 2367, 2059, 166, + /* 1600 */ 114, 2331, 745, 2333, 2334, 740, 167, 735, 153, 329, + /* 1610 */ 276, 1675, 2393, 655, 2420, 654, 659, 656, 411, 2416, + /* 1620 */ 281, 662, 671, 681, 2470, 715, 2330, 2469, 8, 2442, + /* 1630 */ 690, 290, 293, 84, 83, 467, 402, 292, 216, 742, + /* 1640 */ 661, 286, 288, 179, 279, 672, 2250, 669, 294, 295, + /* 1650 */ 670, 459, 457, 1796, 145, 2522, 1676, 701, 1801, 1, + /* 1660 */ 2330, 2498, 363, 698, 1799, 446, 298, 2348, 443, 439, + /* 1670 */ 435, 432, 460, 742, 305, 190, 2436, 154, 330, 2296, + /* 1680 */ 713, 741, 2218, 2217, 331, 2216, 407, 718, 719, 332, + /* 1690 */ 155, 105, 206, 2076, 62, 2401, 107, 2120, 747, 335, + /* 1700 */ 1266, 2348, 833, 323, 830, 163, 835, 359, 371, 372, + /* 1710 */ 2288, 304, 344, 2296, 53, 741, 337, 2287, 2286, 81, + /* 1720 */ 2329, 358, 2281, 2367, 348, 433, 114, 2331, 745, 2333, + /* 1730 */ 2334, 740, 434, 735, 2330, 339, 1639, 1640, 728, 209, + /* 1740 */ 2420, 438, 2279, 440, 411, 2416, 441, 742, 442, 1638, + /* 1750 */ 2278, 2276, 380, 447, 2329, 2275, 449, 2367, 2274, 451, + /* 1760 */ 115, 2331, 745, 2333, 2334, 740, 2273, 735, 2330, 453, + /* 1770 */ 1627, 2254, 213, 2253, 2420, 2348, 215, 1591, 2419, 2416, + /* 1780 */ 82, 742, 1590, 2231, 2230, 2229, 466, 2296, 465, 741, + /* 1790 */ 2228, 2227, 2178, 470, 1534, 2175, 473, 2174, 2168, 476, + /* 1800 */ 477, 2330, 2165, 218, 2164, 85, 2163, 2162, 2167, 2348, + /* 1810 */ 220, 2166, 2161, 2160, 742, 2158, 2157, 2156, 222, 493, + /* 1820 */ 2155, 2296, 495, 741, 2171, 2154, 2153, 2152, 2329, 224, + /* 1830 */ 2139, 2367, 2151, 2150, 115, 2331, 745, 2333, 2334, 740, + /* 1840 */ 2173, 735, 2348, 2149, 2148, 2147, 2146, 2145, 2420, 527, + /* 1850 */ 91, 2138, 730, 2416, 2296, 2144, 741, 2143, 2142, 2141, + /* 1860 */ 2140, 2137, 743, 2136, 2172, 2367, 2170, 2135, 115, 2331, + /* 1870 */ 745, 2333, 2334, 740, 2134, 735, 1540, 2330, 2133, 2132, + /* 1880 */ 228, 2131, 2420, 529, 2130, 2129, 374, 2416, 368, 369, + /* 1890 */ 742, 1400, 1404, 1977, 1976, 2329, 1975, 1973, 2367, 231, + /* 1900 */ 233, 176, 2331, 745, 2333, 2334, 740, 2330, 735, 1970, + /* 1910 */ 1396, 1969, 234, 545, 549, 1962, 546, 547, 2348, 550, + /* 1920 */ 742, 1951, 551, 553, 1926, 555, 557, 1290, 185, 1925, + /* 1930 */ 2296, 2252, 741, 554, 78, 236, 2248, 2316, 2238, 2226, + /* 1940 */ 195, 2225, 238, 79, 245, 2202, 247, 565, 2348, 250, + /* 1950 */ 2054, 1972, 1968, 583, 584, 694, 2520, 1966, 588, 585, + /* 1960 */ 2296, 589, 741, 587, 1964, 591, 1961, 593, 1946, 592, + /* 1970 */ 595, 2329, 597, 596, 2367, 1335, 1944, 115, 2331, 745, + /* 1980 */ 2333, 2334, 740, 1945, 735, 2330, 1943, 1922, 2056, 1472, + /* 1990 */ 1473, 2420, 2055, 1386, 802, 1385, 2417, 1383, 742, 1381, + /* 2000 */ 1380, 2329, 2330, 804, 2367, 1959, 1379, 175, 2331, 745, + /* 2010 */ 2333, 2334, 740, 1372, 735, 742, 1378, 256, 1377, 2330, + /* 2020 */ 392, 1374, 65, 1950, 393, 627, 2348, 1373, 1948, 394, + /* 2030 */ 1371, 399, 742, 630, 1921, 1920, 1919, 634, 2296, 1918, + /* 2040 */ 741, 636, 1917, 2348, 638, 117, 1621, 1623, 400, 1620, + /* 2050 */ 2462, 1625, 29, 2251, 69, 2296, 1601, 741, 2247, 1599, + /* 2060 */ 2348, 1597, 278, 2237, 169, 657, 2224, 2223, 2504, 6, + /* 2070 */ 17, 20, 2296, 21, 741, 23, 7, 31, 673, 2329, + /* 2080 */ 1852, 285, 2367, 22, 2330, 357, 2331, 745, 2333, 2334, + /* 2090 */ 740, 57, 735, 58, 189, 177, 2329, 742, 200, 2367, + /* 2100 */ 2317, 287, 357, 2331, 745, 2333, 2334, 740, 675, 735, + /* 2110 */ 1833, 658, 33, 2329, 2330, 1822, 2367, 282, 1872, 350, + /* 2120 */ 2331, 745, 2333, 2334, 740, 2348, 735, 742, 1576, 663, + /* 2130 */ 67, 24, 1867, 1575, 1873, 188, 32, 2296, 80, 741, + /* 2140 */ 1866, 665, 403, 1871, 1870, 18, 404, 60, 1793, 301, + /* 2150 */ 180, 1792, 2222, 2201, 101, 2348, 2200, 102, 25, 103, + /* 2160 */ 406, 308, 1828, 191, 26, 689, 314, 2296, 716, 741, + /* 2170 */ 70, 108, 319, 1745, 104, 1744, 316, 59, 2329, 2330, + /* 2180 */ 13, 2367, 1664, 2370, 176, 2331, 745, 2333, 2334, 740, + /* 2190 */ 1755, 735, 739, 1723, 11, 734, 181, 1721, 39, 2330, + /* 2200 */ 1720, 1690, 16, 192, 1698, 27, 748, 746, 2329, 1458, + /* 2210 */ 28, 2367, 742, 417, 357, 2331, 745, 2333, 2334, 740, + /* 2220 */ 2348, 735, 2330, 1455, 750, 752, 753, 755, 1454, 1451, + /* 2230 */ 756, 744, 2296, 758, 741, 742, 759, 2330, 761, 2521, + /* 2240 */ 2348, 1445, 762, 764, 1443, 414, 1449, 765, 109, 322, + /* 2250 */ 742, 110, 2296, 1448, 741, 1447, 2330, 1467, 1463, 1446, + /* 2260 */ 1333, 77, 779, 2348, 1368, 1365, 1364, 1363, 416, 742, + /* 2270 */ 1394, 1362, 1360, 2329, 1358, 2296, 2367, 741, 2348, 356, + /* 2280 */ 2331, 745, 2333, 2334, 740, 1357, 735, 1356, 2386, 1393, + /* 2290 */ 2296, 790, 741, 2329, 792, 207, 2367, 2348, 1354, 357, + /* 2300 */ 2331, 745, 2333, 2334, 740, 1353, 735, 1352, 1351, 2296, + /* 2310 */ 1350, 741, 1349, 1967, 1348, 1390, 2329, 1388, 1345, 2367, + /* 2320 */ 1344, 1341, 357, 2331, 745, 2333, 2334, 740, 1339, 735, + /* 2330 */ 2330, 644, 1340, 1338, 2367, 812, 813, 352, 2331, 745, + /* 2340 */ 2333, 2334, 740, 742, 735, 814, 1965, 816, 817, 2330, + /* 2350 */ 2329, 818, 1963, 2367, 820, 821, 342, 2331, 745, 2333, + /* 2360 */ 2334, 740, 742, 735, 822, 2330, 1960, 824, 826, 825, + /* 2370 */ 1942, 2348, 828, 1279, 1916, 1267, 832, 326, 742, 834, + /* 2380 */ 1886, 1650, 336, 2296, 837, 741, 1886, 838, 1886, 1886, + /* 2390 */ 2348, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, + /* 2400 */ 1886, 1886, 2296, 1886, 741, 1886, 2348, 1886, 1886, 1886, + /* 2410 */ 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 2296, 1886, + /* 2420 */ 741, 1886, 1886, 2330, 2329, 1886, 1886, 2367, 1886, 1886, + /* 2430 */ 340, 2331, 745, 2333, 2334, 740, 742, 735, 1886, 1886, + /* 2440 */ 1886, 1886, 1886, 2329, 1886, 1886, 2367, 2330, 1886, 343, + /* 2450 */ 2331, 745, 2333, 2334, 740, 1886, 735, 1886, 1886, 2329, + /* 2460 */ 742, 1886, 2367, 1886, 2348, 349, 2331, 745, 2333, 2334, + /* 2470 */ 740, 1886, 735, 1886, 1886, 1886, 2296, 1886, 741, 1886, + /* 2480 */ 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 2348, 1886, + /* 2490 */ 2330, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, + /* 2500 */ 2296, 1886, 741, 742, 1886, 1886, 1886, 1886, 1886, 1886, + /* 2510 */ 1886, 1886, 1886, 1886, 1886, 1886, 2330, 2329, 1886, 1886, + /* 2520 */ 2367, 1886, 1886, 353, 2331, 745, 2333, 2334, 740, 742, + /* 2530 */ 735, 2348, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, + /* 2540 */ 1886, 2329, 1886, 2296, 2367, 741, 1886, 345, 2331, 745, + /* 2550 */ 2333, 2334, 740, 1886, 735, 1886, 1886, 2348, 1886, 2330, + /* 2560 */ 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 2296, + /* 2570 */ 1886, 741, 742, 1886, 1886, 1886, 1886, 1886, 1886, 1886, + /* 2580 */ 1886, 1886, 1886, 2330, 2329, 1886, 1886, 2367, 1886, 1886, + /* 2590 */ 354, 2331, 745, 2333, 2334, 740, 742, 735, 1886, 1886, + /* 2600 */ 2348, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, + /* 2610 */ 2329, 1886, 2296, 2367, 741, 1886, 346, 2331, 745, 2333, + /* 2620 */ 2334, 740, 1886, 735, 2348, 1886, 2330, 1886, 1886, 1886, + /* 2630 */ 1886, 1886, 1886, 1886, 1886, 1886, 2296, 1886, 741, 742, + /* 2640 */ 1886, 2330, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, + /* 2650 */ 1886, 1886, 1886, 2329, 742, 1886, 2367, 2330, 1886, 355, + /* 2660 */ 2331, 745, 2333, 2334, 740, 1886, 735, 2348, 1886, 1886, + /* 2670 */ 742, 1886, 1886, 1886, 1886, 1886, 1886, 2329, 1886, 2296, + /* 2680 */ 2367, 741, 2348, 347, 2331, 745, 2333, 2334, 740, 1886, + /* 2690 */ 735, 1886, 1886, 1886, 2296, 1886, 741, 1886, 2348, 1886, + /* 2700 */ 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, + /* 2710 */ 2296, 1886, 741, 1886, 1886, 1886, 1886, 1886, 1886, 1886, + /* 2720 */ 2329, 1886, 1886, 2367, 1886, 1886, 361, 2331, 745, 2333, + /* 2730 */ 2334, 740, 1886, 735, 2330, 2329, 1886, 1886, 2367, 1886, + /* 2740 */ 1886, 362, 2331, 745, 2333, 2334, 740, 742, 735, 1886, + /* 2750 */ 1886, 2329, 1886, 2330, 2367, 1886, 1886, 2342, 2331, 745, + /* 2760 */ 2333, 2334, 740, 1886, 735, 1886, 742, 1886, 1886, 2330, + /* 2770 */ 1886, 1886, 1886, 1886, 1886, 2348, 1886, 1886, 1886, 1886, + /* 2780 */ 1886, 1886, 742, 1886, 1886, 1886, 1886, 2296, 1886, 741, + /* 2790 */ 1886, 1886, 1886, 1886, 2348, 1886, 1886, 1886, 1886, 1886, + /* 2800 */ 1886, 1886, 1886, 1886, 1886, 1886, 2296, 1886, 741, 1886, + /* 2810 */ 2348, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, + /* 2820 */ 1886, 1886, 2296, 1886, 741, 1886, 1886, 2330, 2329, 1886, + /* 2830 */ 1886, 2367, 1886, 1886, 2341, 2331, 745, 2333, 2334, 740, + /* 2840 */ 742, 735, 1886, 1886, 1886, 1886, 1886, 2329, 1886, 1886, + /* 2850 */ 2367, 2330, 1886, 2340, 2331, 745, 2333, 2334, 740, 1886, + /* 2860 */ 735, 1886, 1886, 2329, 742, 1886, 2367, 1886, 2348, 376, + /* 2870 */ 2331, 745, 2333, 2334, 740, 1886, 735, 1886, 1886, 1886, + /* 2880 */ 2296, 1886, 741, 1886, 1886, 1886, 1886, 1886, 1886, 1886, + /* 2890 */ 1886, 1886, 2348, 1886, 2330, 1886, 1886, 1886, 1886, 1886, + /* 2900 */ 1886, 1886, 1886, 1886, 2296, 1886, 741, 742, 1886, 1886, + /* 2910 */ 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, + /* 2920 */ 2330, 2329, 1886, 1886, 2367, 1886, 1886, 377, 2331, 745, + /* 2930 */ 2333, 2334, 740, 742, 735, 2348, 1886, 1886, 1886, 1886, + /* 2940 */ 1886, 1886, 1886, 1886, 1886, 2329, 1886, 2296, 2367, 741, + /* 2950 */ 1886, 373, 2331, 745, 2333, 2334, 740, 1886, 735, 1886, + /* 2960 */ 1886, 2348, 1886, 2330, 1886, 1886, 1886, 1886, 1886, 1886, + /* 2970 */ 1886, 1886, 1886, 2296, 1886, 741, 742, 1886, 1886, 1886, + /* 2980 */ 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 2329, 1886, + /* 2990 */ 1886, 2367, 1886, 1886, 378, 2331, 745, 2333, 2334, 740, + /* 3000 */ 1886, 735, 1886, 1886, 2348, 1886, 1886, 1886, 1886, 1886, + /* 3010 */ 1886, 1886, 1886, 1886, 743, 1886, 2296, 2367, 741, 1886, + /* 3020 */ 352, 2331, 745, 2333, 2334, 740, 1886, 735, 1886, 1886, + /* 3030 */ 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, + /* 3040 */ 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, 1886, + /* 3050 */ 1886, 1886, 1886, 1886, 1886, 1886, 1886, 2329, 1886, 1886, + /* 3060 */ 2367, 1886, 1886, 351, 2331, 745, 2333, 2334, 740, 1886, + /* 3070 */ 735, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 371, 382, 425, 382, 425, 361, 362, 430, 379, 390, - /* 10 */ 379, 390, 12, 13, 14, 12, 13, 398, 397, 398, - /* 20 */ 20, 20, 22, 8, 9, 381, 405, 12, 13, 14, - /* 30 */ 15, 16, 388, 361, 362, 35, 0, 37, 8, 9, - /* 40 */ 37, 33, 12, 13, 14, 15, 16, 349, 20, 361, - /* 50 */ 362, 390, 475, 361, 475, 478, 362, 478, 397, 377, - /* 60 */ 362, 390, 380, 33, 64, 0, 405, 20, 356, 381, - /* 70 */ 70, 359, 360, 496, 497, 496, 497, 77, 501, 502, - /* 80 */ 501, 502, 410, 412, 390, 414, 21, 20, 390, 24, - /* 90 */ 25, 26, 27, 28, 29, 30, 31, 32, 406, 407, - /* 100 */ 402, 409, 404, 103, 13, 413, 106, 20, 72, 73, - /* 110 */ 74, 75, 76, 20, 78, 79, 80, 81, 82, 83, + /* 0 */ 383, 357, 432, 383, 360, 361, 357, 392, 391, 360, + /* 10 */ 361, 391, 12, 13, 14, 405, 399, 2, 398, 399, + /* 20 */ 20, 362, 22, 8, 9, 20, 406, 12, 13, 14, + /* 30 */ 15, 16, 2, 423, 424, 35, 0, 37, 8, 9, + /* 40 */ 465, 466, 12, 13, 14, 15, 16, 350, 8, 9, + /* 50 */ 362, 363, 12, 13, 14, 15, 16, 362, 363, 20, + /* 60 */ 363, 391, 404, 405, 64, 0, 407, 408, 401, 410, + /* 70 */ 70, 404, 405, 414, 8, 9, 372, 77, 12, 13, + /* 80 */ 14, 15, 16, 413, 380, 415, 21, 371, 391, 24, + /* 90 */ 25, 26, 27, 28, 29, 30, 31, 32, 20, 411, + /* 100 */ 403, 358, 405, 103, 388, 362, 106, 364, 72, 73, + /* 110 */ 74, 75, 76, 397, 78, 79, 80, 81, 82, 83, /* 120 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - /* 130 */ 94, 95, 96, 97, 98, 99, 475, 107, 361, 478, - /* 140 */ 14, 443, 142, 143, 446, 451, 20, 449, 450, 451, - /* 150 */ 452, 453, 454, 106, 456, 448, 404, 496, 497, 461, - /* 160 */ 404, 463, 501, 502, 475, 467, 468, 478, 77, 361, - /* 170 */ 362, 419, 361, 362, 422, 423, 176, 177, 422, 423, - /* 180 */ 482, 474, 20, 183, 184, 496, 497, 37, 490, 381, - /* 190 */ 501, 502, 103, 20, 417, 418, 388, 346, 198, 106, - /* 200 */ 200, 182, 378, 200, 49, 190, 117, 118, 119, 120, - /* 210 */ 121, 122, 123, 124, 125, 126, 392, 128, 129, 130, - /* 220 */ 131, 132, 133, 134, 361, 362, 402, 77, 39, 40, - /* 230 */ 230, 231, 232, 232, 234, 235, 236, 237, 238, 239, + /* 130 */ 94, 95, 96, 97, 98, 99, 476, 362, 363, 479, + /* 140 */ 22, 444, 142, 143, 447, 363, 391, 450, 451, 452, + /* 150 */ 453, 454, 455, 460, 457, 37, 463, 497, 498, 462, + /* 160 */ 69, 464, 502, 503, 4, 468, 469, 472, 473, 474, + /* 170 */ 415, 476, 477, 391, 479, 362, 363, 177, 178, 449, + /* 180 */ 483, 142, 143, 23, 184, 185, 411, 20, 491, 391, + /* 190 */ 20, 20, 497, 498, 405, 77, 398, 502, 503, 199, + /* 200 */ 349, 201, 351, 3, 406, 475, 46, 47, 48, 420, + /* 210 */ 8, 9, 423, 424, 12, 13, 14, 15, 16, 21, + /* 220 */ 20, 103, 24, 25, 26, 27, 28, 29, 30, 31, + /* 230 */ 32, 231, 232, 233, 452, 235, 236, 237, 238, 239, /* 240 */ 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - /* 250 */ 250, 251, 12, 13, 361, 362, 69, 18, 106, 20, - /* 260 */ 20, 106, 22, 176, 177, 349, 27, 390, 106, 30, - /* 270 */ 446, 447, 370, 410, 35, 35, 425, 37, 362, 370, - /* 280 */ 456, 430, 471, 472, 473, 4, 475, 476, 20, 478, - /* 290 */ 51, 414, 53, 274, 275, 276, 387, 58, 396, 110, - /* 300 */ 111, 293, 113, 410, 64, 396, 390, 496, 497, 294, - /* 310 */ 70, 20, 501, 502, 72, 73, 74, 77, 402, 448, - /* 320 */ 404, 79, 80, 81, 135, 22, 475, 85, 139, 478, - /* 330 */ 361, 362, 90, 91, 92, 93, 14, 20, 96, 21, - /* 340 */ 37, 99, 20, 103, 105, 474, 106, 496, 497, 197, - /* 350 */ 381, 199, 501, 502, 36, 116, 38, 39, 40, 443, - /* 360 */ 356, 268, 446, 359, 360, 449, 450, 451, 452, 453, - /* 370 */ 454, 455, 456, 457, 458, 12, 13, 14, 15, 16, - /* 380 */ 77, 229, 142, 143, 106, 146, 147, 106, 149, 150, - /* 390 */ 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - /* 400 */ 161, 162, 163, 164, 165, 232, 167, 168, 169, 18, - /* 410 */ 464, 465, 173, 174, 23, 2, 176, 177, 179, 64, - /* 420 */ 268, 8, 9, 183, 184, 12, 13, 14, 15, 16, - /* 430 */ 268, 40, 41, 142, 143, 44, 361, 69, 198, 400, - /* 440 */ 200, 0, 403, 404, 86, 54, 178, 8, 9, 106, - /* 450 */ 33, 12, 13, 14, 15, 16, 65, 66, 67, 68, - /* 460 */ 105, 8, 9, 108, 349, 12, 13, 14, 15, 16, - /* 470 */ 230, 231, 232, 20, 234, 235, 236, 237, 238, 239, - /* 480 */ 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - /* 490 */ 250, 251, 252, 12, 13, 33, 51, 106, 176, 361, - /* 500 */ 362, 20, 386, 22, 59, 1, 148, 62, 63, 70, - /* 510 */ 435, 436, 20, 72, 73, 74, 35, 402, 37, 381, - /* 520 */ 79, 80, 81, 19, 361, 362, 85, 172, 170, 171, - /* 530 */ 14, 90, 91, 92, 93, 144, 20, 96, 357, 35, - /* 540 */ 99, 64, 361, 230, 363, 64, 268, 20, 349, 268, - /* 550 */ 389, 70, 50, 114, 232, 51, 440, 175, 77, 361, - /* 560 */ 362, 362, 401, 59, 60, 61, 62, 21, 64, 107, - /* 570 */ 24, 25, 26, 27, 28, 29, 30, 31, 32, 381, - /* 580 */ 42, 190, 191, 192, 103, 108, 195, 106, 252, 390, - /* 590 */ 254, 22, 279, 280, 281, 282, 283, 284, 285, 208, - /* 600 */ 209, 402, 116, 404, 368, 3, 37, 361, 362, 105, - /* 610 */ 219, 268, 108, 222, 175, 20, 225, 226, 227, 228, - /* 620 */ 229, 385, 20, 142, 143, 0, 20, 381, 22, 393, - /* 630 */ 348, 178, 350, 470, 471, 472, 473, 255, 475, 476, - /* 640 */ 361, 362, 443, 37, 140, 446, 77, 265, 449, 450, - /* 650 */ 451, 452, 453, 454, 349, 456, 390, 176, 177, 268, - /* 660 */ 461, 55, 463, 2, 183, 184, 467, 468, 368, 8, - /* 670 */ 9, 405, 103, 12, 13, 14, 15, 16, 0, 198, - /* 680 */ 178, 200, 361, 362, 180, 232, 361, 362, 186, 490, - /* 690 */ 13, 187, 176, 393, 255, 256, 257, 258, 259, 260, - /* 700 */ 261, 262, 263, 264, 265, 178, 381, 402, 291, 107, - /* 710 */ 206, 230, 231, 232, 37, 234, 235, 236, 237, 238, - /* 720 */ 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - /* 730 */ 249, 250, 251, 12, 13, 14, 349, 142, 143, 14, - /* 740 */ 357, 20, 349, 22, 361, 20, 363, 69, 232, 362, - /* 750 */ 471, 472, 473, 135, 475, 476, 35, 139, 37, 232, - /* 760 */ 135, 136, 137, 138, 139, 140, 141, 198, 349, 200, - /* 770 */ 135, 136, 137, 138, 139, 140, 141, 390, 183, 184, - /* 780 */ 178, 362, 349, 364, 70, 64, 0, 361, 362, 402, - /* 790 */ 20, 404, 471, 472, 473, 402, 475, 476, 77, 230, - /* 800 */ 231, 403, 404, 349, 361, 267, 349, 381, 448, 390, - /* 810 */ 24, 25, 26, 27, 28, 29, 30, 31, 32, 362, - /* 820 */ 20, 402, 172, 404, 103, 361, 362, 106, 20, 4, - /* 830 */ 443, 361, 362, 446, 474, 402, 449, 450, 451, 452, - /* 840 */ 453, 454, 349, 456, 19, 381, 459, 390, 461, 462, - /* 850 */ 463, 381, 202, 137, 467, 468, 402, 141, 382, 402, - /* 860 */ 35, 404, 443, 142, 143, 446, 390, 0, 449, 450, - /* 870 */ 451, 452, 453, 454, 398, 456, 51, 0, 435, 436, - /* 880 */ 461, 390, 463, 58, 390, 252, 467, 468, 397, 64, - /* 890 */ 77, 397, 361, 362, 349, 402, 405, 176, 177, 405, - /* 900 */ 443, 366, 367, 446, 183, 184, 449, 450, 451, 452, - /* 910 */ 453, 454, 381, 456, 378, 460, 35, 462, 461, 198, - /* 920 */ 463, 200, 349, 207, 467, 468, 210, 349, 392, 213, - /* 930 */ 105, 215, 51, 108, 390, 4, 375, 376, 402, 116, - /* 940 */ 59, 60, 61, 62, 230, 64, 349, 402, 178, 405, - /* 950 */ 425, 230, 231, 232, 23, 234, 235, 236, 237, 238, - /* 960 */ 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - /* 970 */ 249, 250, 251, 12, 13, 402, 176, 46, 47, 48, - /* 980 */ 402, 20, 446, 22, 361, 362, 105, 361, 362, 108, - /* 990 */ 390, 3, 456, 34, 390, 349, 35, 397, 37, 402, - /* 1000 */ 475, 397, 232, 478, 381, 405, 23, 381, 362, 405, - /* 1010 */ 364, 391, 135, 136, 137, 138, 139, 140, 141, 361, - /* 1020 */ 362, 496, 497, 361, 362, 64, 501, 502, 161, 349, - /* 1030 */ 47, 48, 232, 382, 361, 362, 390, 170, 77, 381, - /* 1040 */ 232, 390, 362, 381, 364, 361, 362, 391, 402, 398, - /* 1050 */ 404, 8, 9, 172, 381, 12, 13, 14, 15, 16, - /* 1060 */ 4, 180, 181, 193, 103, 381, 0, 106, 187, 188, - /* 1070 */ 390, 8, 9, 361, 362, 12, 13, 14, 15, 16, - /* 1080 */ 56, 57, 402, 0, 404, 361, 362, 206, 37, 443, - /* 1090 */ 220, 221, 446, 381, 391, 449, 450, 451, 452, 453, - /* 1100 */ 454, 425, 456, 142, 143, 381, 0, 461, 42, 463, - /* 1110 */ 425, 8, 9, 467, 468, 12, 13, 14, 15, 16, - /* 1120 */ 20, 349, 22, 443, 375, 376, 446, 349, 77, 449, - /* 1130 */ 450, 451, 452, 453, 454, 52, 456, 176, 177, 366, - /* 1140 */ 367, 461, 136, 463, 183, 184, 391, 467, 468, 475, - /* 1150 */ 107, 475, 478, 459, 478, 55, 462, 136, 137, 198, - /* 1160 */ 475, 200, 141, 478, 460, 378, 462, 349, 22, 425, - /* 1170 */ 107, 497, 496, 497, 402, 501, 502, 501, 502, 392, - /* 1180 */ 402, 496, 497, 37, 1, 2, 501, 502, 214, 402, - /* 1190 */ 216, 230, 231, 232, 349, 234, 235, 236, 237, 238, - /* 1200 */ 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - /* 1210 */ 249, 250, 251, 12, 13, 349, 431, 211, 212, 475, - /* 1220 */ 402, 20, 478, 22, 22, 14, 15, 16, 362, 349, - /* 1230 */ 364, 475, 399, 446, 478, 402, 35, 390, 37, 37, - /* 1240 */ 496, 497, 349, 456, 349, 501, 502, 402, 349, 103, - /* 1250 */ 37, 390, 405, 497, 391, 349, 390, 501, 502, 398, - /* 1260 */ 349, 362, 37, 364, 399, 64, 383, 402, 402, 386, - /* 1270 */ 404, 399, 352, 353, 402, 266, 267, 289, 77, 8, - /* 1280 */ 9, 178, 402, 12, 13, 14, 15, 16, 0, 390, - /* 1290 */ 107, 0, 0, 391, 33, 402, 116, 402, 33, 109, - /* 1300 */ 33, 402, 112, 404, 103, 103, 45, 106, 402, 443, - /* 1310 */ 45, 415, 446, 402, 22, 449, 450, 451, 452, 453, - /* 1320 */ 454, 391, 456, 13, 33, 109, 270, 461, 112, 463, - /* 1330 */ 224, 12, 13, 467, 468, 109, 0, 109, 112, 51, - /* 1340 */ 112, 22, 443, 142, 143, 446, 166, 37, 449, 450, - /* 1350 */ 451, 452, 453, 454, 35, 456, 37, 0, 22, 505, - /* 1360 */ 461, 350, 463, 142, 143, 494, 467, 468, 1, 2, - /* 1370 */ 365, 487, 390, 378, 107, 349, 13, 176, 177, 22, - /* 1380 */ 33, 33, 33, 64, 183, 184, 33, 33, 362, 33, - /* 1390 */ 364, 33, 33, 106, 33, 13, 77, 33, 378, 198, - /* 1400 */ 37, 200, 115, 493, 415, 360, 415, 493, 493, 424, - /* 1410 */ 493, 33, 33, 200, 33, 365, 390, 33, 33, 37, - /* 1420 */ 362, 33, 103, 33, 33, 200, 401, 415, 402, 432, - /* 1430 */ 404, 230, 231, 232, 415, 234, 235, 236, 237, 238, - /* 1440 */ 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - /* 1450 */ 249, 250, 251, 415, 107, 107, 107, 477, 498, 469, - /* 1460 */ 107, 107, 380, 107, 480, 107, 107, 271, 107, 443, - /* 1470 */ 426, 107, 446, 51, 445, 449, 450, 451, 452, 453, - /* 1480 */ 454, 42, 456, 349, 444, 107, 107, 461, 107, 463, - /* 1490 */ 20, 107, 107, 467, 468, 107, 362, 107, 107, 437, - /* 1500 */ 370, 442, 213, 370, 437, 196, 428, 20, 361, 20, - /* 1510 */ 362, 45, 411, 362, 175, 411, 408, 198, 361, 200, - /* 1520 */ 362, 361, 411, 408, 390, 408, 374, 104, 102, 373, - /* 1530 */ 361, 101, 361, 372, 361, 361, 402, 20, 404, 354, - /* 1540 */ 50, 349, 358, 354, 358, 370, 437, 370, 20, 230, - /* 1550 */ 231, 370, 20, 404, 362, 20, 363, 370, 427, 20, - /* 1560 */ 363, 370, 418, 244, 245, 246, 247, 248, 249, 250, - /* 1570 */ 370, 361, 354, 370, 370, 106, 441, 443, 349, 352, - /* 1580 */ 446, 402, 390, 449, 450, 451, 452, 453, 454, 390, - /* 1590 */ 456, 362, 361, 352, 402, 461, 404, 463, 390, 390, - /* 1600 */ 354, 467, 468, 217, 390, 390, 439, 390, 402, 390, - /* 1610 */ 390, 349, 390, 390, 390, 437, 368, 20, 436, 390, - /* 1620 */ 204, 203, 434, 368, 362, 361, 486, 433, 278, 277, - /* 1630 */ 286, 402, 402, 404, 489, 443, 404, 189, 446, 402, - /* 1640 */ 486, 449, 450, 451, 452, 453, 454, 488, 456, 486, - /* 1650 */ 288, 485, 390, 461, 349, 463, 420, 287, 420, 467, - /* 1660 */ 468, 426, 500, 295, 402, 272, 404, 362, 426, 292, - /* 1670 */ 506, 499, 443, 290, 267, 446, 362, 20, 449, 450, - /* 1680 */ 451, 452, 453, 454, 116, 456, 363, 448, 269, 484, - /* 1690 */ 483, 349, 463, 481, 368, 390, 467, 468, 368, 420, - /* 1700 */ 402, 402, 402, 402, 362, 443, 420, 402, 446, 404, - /* 1710 */ 402, 449, 450, 451, 452, 453, 454, 181, 456, 479, - /* 1720 */ 416, 386, 106, 368, 466, 463, 106, 362, 368, 467, - /* 1730 */ 468, 394, 390, 402, 361, 22, 38, 368, 351, 421, - /* 1740 */ 429, 438, 421, 354, 402, 347, 404, 355, 443, 349, - /* 1750 */ 384, 446, 0, 0, 449, 450, 451, 452, 453, 454, - /* 1760 */ 384, 456, 362, 369, 384, 0, 349, 45, 463, 0, - /* 1770 */ 37, 223, 467, 468, 37, 37, 37, 223, 0, 362, - /* 1780 */ 37, 37, 223, 37, 0, 443, 223, 349, 446, 0, - /* 1790 */ 390, 449, 450, 451, 452, 453, 454, 37, 456, 0, - /* 1800 */ 362, 22, 402, 37, 404, 0, 218, 390, 0, 206, - /* 1810 */ 0, 206, 200, 207, 0, 198, 0, 0, 194, 402, - /* 1820 */ 193, 404, 0, 0, 147, 49, 49, 0, 390, 37, - /* 1830 */ 0, 51, 49, 491, 492, 0, 45, 0, 0, 0, - /* 1840 */ 402, 0, 404, 443, 49, 0, 446, 0, 0, 449, - /* 1850 */ 450, 451, 452, 453, 454, 0, 456, 0, 161, 0, - /* 1860 */ 443, 37, 161, 446, 0, 0, 449, 450, 451, 452, - /* 1870 */ 453, 454, 0, 456, 0, 0, 0, 0, 0, 0, - /* 1880 */ 463, 443, 0, 0, 446, 468, 349, 449, 450, 451, - /* 1890 */ 452, 453, 454, 0, 456, 0, 0, 0, 0, 362, - /* 1900 */ 0, 49, 0, 503, 504, 45, 0, 0, 0, 0, - /* 1910 */ 0, 0, 0, 349, 22, 0, 0, 147, 146, 0, - /* 1920 */ 145, 0, 0, 22, 0, 22, 362, 390, 37, 0, - /* 1930 */ 492, 50, 395, 64, 50, 64, 0, 64, 0, 402, - /* 1940 */ 0, 404, 37, 0, 349, 51, 42, 0, 0, 0, - /* 1950 */ 37, 14, 0, 0, 390, 0, 33, 362, 0, 395, - /* 1960 */ 42, 0, 37, 37, 0, 51, 402, 0, 404, 42, - /* 1970 */ 189, 51, 42, 45, 43, 0, 42, 0, 0, 37, - /* 1980 */ 443, 349, 49, 446, 49, 390, 449, 450, 451, 452, - /* 1990 */ 453, 454, 42, 456, 362, 49, 51, 402, 42, 404, - /* 2000 */ 49, 0, 37, 71, 42, 51, 0, 443, 37, 0, - /* 2010 */ 446, 51, 42, 449, 450, 451, 452, 453, 454, 37, - /* 2020 */ 456, 42, 390, 51, 0, 0, 0, 0, 0, 0, - /* 2030 */ 37, 114, 22, 0, 402, 0, 404, 37, 443, 37, - /* 2040 */ 37, 446, 37, 0, 449, 450, 451, 452, 453, 454, - /* 2050 */ 37, 456, 37, 112, 349, 37, 37, 37, 37, 22, - /* 2060 */ 37, 22, 22, 33, 33, 53, 0, 362, 22, 37, - /* 2070 */ 0, 0, 0, 37, 0, 443, 0, 22, 446, 349, - /* 2080 */ 20, 449, 450, 451, 452, 453, 454, 37, 456, 37, - /* 2090 */ 495, 37, 362, 37, 107, 390, 106, 0, 106, 0, - /* 2100 */ 395, 37, 49, 22, 205, 0, 22, 402, 0, 404, - /* 2110 */ 3, 33, 50, 273, 106, 104, 33, 178, 0, 50, - /* 2120 */ 390, 33, 349, 107, 107, 33, 49, 33, 106, 49, - /* 2130 */ 3, 273, 402, 33, 404, 362, 504, 349, 181, 273, - /* 2140 */ 102, 178, 49, 37, 178, 201, 178, 178, 443, 107, - /* 2150 */ 362, 446, 349, 106, 449, 450, 451, 452, 453, 454, - /* 2160 */ 37, 456, 37, 390, 106, 362, 107, 106, 395, 185, - /* 2170 */ 185, 106, 37, 443, 107, 402, 446, 404, 390, 449, - /* 2180 */ 450, 451, 452, 453, 454, 37, 456, 37, 458, 107, - /* 2190 */ 402, 33, 404, 390, 107, 49, 107, 0, 395, 0, - /* 2200 */ 0, 106, 42, 107, 106, 402, 42, 404, 107, 106, - /* 2210 */ 106, 49, 33, 2, 180, 106, 443, 349, 106, 446, - /* 2220 */ 104, 104, 449, 450, 451, 452, 453, 454, 115, 456, - /* 2230 */ 362, 443, 22, 182, 446, 349, 253, 449, 450, 451, - /* 2240 */ 452, 453, 454, 106, 456, 107, 443, 106, 362, 446, - /* 2250 */ 107, 106, 449, 450, 451, 452, 453, 454, 390, 456, - /* 2260 */ 266, 107, 49, 106, 49, 106, 22, 116, 107, 106, - /* 2270 */ 402, 230, 404, 107, 37, 37, 390, 233, 106, 37, - /* 2280 */ 107, 106, 37, 107, 106, 37, 37, 107, 402, 106, - /* 2290 */ 404, 107, 106, 37, 107, 106, 127, 127, 127, 106, - /* 2300 */ 33, 127, 106, 37, 106, 22, 37, 71, 37, 70, - /* 2310 */ 77, 443, 37, 37, 446, 37, 37, 449, 450, 451, - /* 2320 */ 452, 453, 454, 37, 456, 37, 37, 100, 77, 443, - /* 2330 */ 349, 100, 446, 33, 37, 449, 450, 451, 452, 453, - /* 2340 */ 454, 37, 456, 362, 37, 22, 37, 349, 37, 37, - /* 2350 */ 37, 77, 37, 37, 37, 37, 22, 37, 0, 37, - /* 2360 */ 362, 51, 0, 349, 37, 51, 42, 42, 0, 37, - /* 2370 */ 51, 390, 0, 42, 37, 42, 362, 51, 0, 37, - /* 2380 */ 37, 0, 22, 402, 33, 404, 22, 21, 390, 22, - /* 2390 */ 20, 22, 21, 507, 507, 507, 507, 507, 507, 507, - /* 2400 */ 402, 507, 404, 507, 390, 507, 507, 507, 507, 507, - /* 2410 */ 507, 507, 507, 507, 507, 507, 402, 507, 404, 507, - /* 2420 */ 507, 507, 507, 507, 443, 507, 507, 446, 507, 507, - /* 2430 */ 449, 450, 451, 452, 453, 454, 507, 456, 507, 507, - /* 2440 */ 349, 443, 507, 507, 446, 507, 507, 449, 450, 451, - /* 2450 */ 452, 453, 454, 362, 456, 507, 507, 443, 507, 349, - /* 2460 */ 446, 507, 507, 449, 450, 451, 452, 453, 454, 507, - /* 2470 */ 456, 507, 362, 507, 507, 507, 507, 507, 507, 507, - /* 2480 */ 507, 390, 507, 507, 507, 507, 507, 507, 507, 507, - /* 2490 */ 507, 507, 507, 402, 507, 404, 507, 507, 507, 507, - /* 2500 */ 390, 507, 507, 507, 507, 507, 507, 507, 507, 507, - /* 2510 */ 507, 507, 402, 507, 404, 507, 507, 507, 507, 507, - /* 2520 */ 507, 507, 507, 507, 507, 507, 349, 507, 507, 507, - /* 2530 */ 507, 507, 507, 507, 443, 507, 507, 446, 507, 362, - /* 2540 */ 449, 450, 451, 452, 453, 454, 507, 456, 507, 507, - /* 2550 */ 507, 507, 507, 443, 507, 349, 446, 507, 507, 449, - /* 2560 */ 450, 451, 452, 453, 454, 507, 456, 390, 362, 507, - /* 2570 */ 507, 507, 507, 507, 507, 507, 507, 507, 507, 402, - /* 2580 */ 507, 404, 507, 507, 349, 507, 507, 507, 507, 507, - /* 2590 */ 507, 507, 507, 507, 507, 507, 390, 362, 507, 507, - /* 2600 */ 507, 507, 507, 507, 507, 507, 507, 507, 402, 507, - /* 2610 */ 404, 507, 507, 507, 507, 507, 507, 507, 507, 507, - /* 2620 */ 443, 507, 349, 446, 507, 390, 449, 450, 451, 452, - /* 2630 */ 453, 454, 507, 456, 507, 362, 507, 402, 507, 404, - /* 2640 */ 507, 507, 507, 507, 507, 507, 507, 507, 507, 443, - /* 2650 */ 507, 507, 446, 507, 507, 449, 450, 451, 452, 453, - /* 2660 */ 454, 507, 456, 390, 507, 507, 507, 507, 507, 507, - /* 2670 */ 507, 507, 507, 507, 507, 402, 507, 404, 443, 349, - /* 2680 */ 507, 446, 507, 507, 449, 450, 451, 452, 453, 454, - /* 2690 */ 507, 456, 362, 507, 507, 507, 507, 349, 507, 507, - /* 2700 */ 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - /* 2710 */ 362, 507, 507, 507, 507, 507, 443, 507, 507, 446, - /* 2720 */ 390, 507, 449, 450, 451, 452, 453, 454, 507, 456, - /* 2730 */ 507, 507, 402, 507, 404, 507, 507, 507, 390, 507, - /* 2740 */ 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - /* 2750 */ 402, 507, 404, 507, 349, 507, 507, 507, 507, 507, - /* 2760 */ 507, 507, 507, 507, 507, 507, 507, 362, 507, 507, - /* 2770 */ 507, 507, 507, 443, 349, 507, 446, 507, 507, 449, - /* 2780 */ 450, 451, 452, 453, 454, 507, 456, 362, 507, 507, - /* 2790 */ 349, 443, 507, 507, 446, 390, 507, 449, 450, 451, - /* 2800 */ 452, 453, 454, 362, 456, 507, 507, 402, 507, 404, - /* 2810 */ 507, 507, 507, 507, 507, 390, 507, 507, 507, 507, - /* 2820 */ 507, 507, 507, 507, 507, 507, 507, 402, 507, 404, - /* 2830 */ 507, 390, 507, 507, 507, 507, 507, 507, 507, 507, - /* 2840 */ 507, 507, 507, 402, 507, 404, 507, 507, 443, 507, - /* 2850 */ 507, 446, 507, 507, 449, 450, 451, 452, 453, 454, - /* 2860 */ 507, 456, 507, 507, 507, 507, 507, 507, 443, 507, - /* 2870 */ 507, 446, 507, 507, 449, 450, 451, 452, 453, 454, - /* 2880 */ 507, 456, 507, 507, 443, 507, 507, 446, 507, 349, - /* 2890 */ 449, 450, 451, 452, 453, 454, 507, 456, 507, 507, - /* 2900 */ 507, 507, 362, 507, 507, 349, 507, 507, 507, 507, - /* 2910 */ 507, 507, 507, 507, 507, 507, 507, 507, 362, 507, - /* 2920 */ 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - /* 2930 */ 390, 507, 507, 507, 507, 507, 507, 507, 507, 507, - /* 2940 */ 507, 507, 402, 507, 404, 507, 390, 507, 507, 507, - /* 2950 */ 507, 507, 507, 507, 507, 507, 507, 507, 402, 507, - /* 2960 */ 404, 507, 507, 507, 507, 507, 507, 507, 507, 507, - /* 2970 */ 507, 507, 349, 507, 507, 507, 507, 507, 507, 507, - /* 2980 */ 507, 507, 507, 443, 507, 362, 446, 349, 507, 449, - /* 2990 */ 450, 451, 452, 453, 454, 507, 456, 507, 507, 443, - /* 3000 */ 362, 507, 446, 507, 507, 449, 450, 451, 452, 453, - /* 3010 */ 454, 507, 456, 390, 507, 507, 507, 507, 507, 507, - /* 3020 */ 507, 507, 507, 507, 507, 402, 507, 404, 390, 507, - /* 3030 */ 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - /* 3040 */ 402, 507, 404, 507, 507, 507, 507, 507, 507, 507, - /* 3050 */ 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - /* 3060 */ 507, 507, 507, 507, 507, 507, 443, 507, 507, 446, - /* 3070 */ 349, 507, 449, 450, 451, 452, 453, 454, 507, 456, - /* 3080 */ 507, 443, 507, 362, 446, 507, 507, 449, 450, 451, - /* 3090 */ 452, 453, 454, 507, 456, 507, 507, 507, 507, 507, - /* 3100 */ 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - /* 3110 */ 507, 390, 507, 507, 507, 507, 507, 507, 507, 507, - /* 3120 */ 507, 507, 507, 402, 507, 404, 507, 507, 507, 507, - /* 3130 */ 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - /* 3140 */ 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - /* 3150 */ 507, 507, 507, 507, 507, 507, 507, 507, 507, 507, - /* 3160 */ 507, 507, 507, 507, 443, 507, 507, 446, 507, 507, - /* 3170 */ 449, 450, 451, 452, 453, 454, 507, 456, 346, 346, - /* 3180 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3190 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3200 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3210 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3220 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3230 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3240 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3250 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3260 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3270 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3280 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3290 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3300 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3310 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3320 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3330 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3340 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3350 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3360 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3370 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3380 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3390 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3400 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3410 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3420 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3430 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3440 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3450 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3460 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3470 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3480 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3490 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3500 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3510 */ 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, - /* 3520 */ 346, 346, 346, 346, + /* 250 */ 250, 251, 252, 12, 13, 177, 178, 191, 18, 183, + /* 260 */ 20, 20, 20, 22, 22, 362, 363, 27, 22, 350, + /* 270 */ 30, 20, 70, 106, 476, 35, 35, 479, 37, 37, + /* 280 */ 379, 20, 363, 37, 471, 472, 473, 474, 137, 476, + /* 290 */ 477, 51, 141, 53, 393, 497, 498, 55, 58, 476, + /* 300 */ 502, 503, 479, 369, 403, 64, 0, 107, 68, 14, + /* 310 */ 391, 70, 142, 143, 411, 20, 114, 199, 77, 201, + /* 320 */ 386, 498, 403, 77, 405, 502, 503, 350, 394, 390, + /* 330 */ 24, 25, 26, 27, 28, 29, 30, 31, 32, 135, + /* 340 */ 363, 402, 365, 139, 103, 105, 20, 106, 447, 231, + /* 350 */ 232, 275, 276, 277, 184, 185, 116, 106, 457, 208, + /* 360 */ 362, 295, 211, 444, 0, 214, 447, 216, 391, 450, + /* 370 */ 451, 452, 453, 454, 455, 20, 457, 50, 176, 179, + /* 380 */ 403, 369, 405, 142, 143, 350, 146, 147, 0, 149, + /* 390 */ 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + /* 400 */ 160, 161, 162, 163, 164, 165, 394, 167, 168, 169, + /* 410 */ 22, 492, 493, 173, 174, 175, 418, 419, 177, 178, + /* 420 */ 180, 444, 20, 116, 447, 184, 185, 450, 451, 452, + /* 430 */ 453, 454, 455, 69, 457, 20, 269, 21, 403, 462, + /* 440 */ 199, 464, 201, 8, 9, 468, 469, 12, 13, 14, + /* 450 */ 15, 16, 36, 77, 38, 39, 40, 426, 256, 257, + /* 460 */ 258, 259, 260, 261, 262, 263, 264, 265, 266, 69, + /* 470 */ 136, 137, 231, 232, 233, 141, 235, 236, 237, 238, + /* 480 */ 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + /* 490 */ 249, 250, 251, 252, 253, 12, 13, 35, 358, 350, + /* 500 */ 20, 22, 362, 20, 364, 22, 179, 476, 106, 350, + /* 510 */ 479, 106, 363, 51, 187, 253, 37, 4, 35, 51, + /* 520 */ 37, 59, 60, 61, 62, 64, 64, 59, 497, 498, + /* 530 */ 62, 63, 350, 502, 503, 350, 33, 72, 73, 74, + /* 540 */ 391, 362, 107, 86, 79, 80, 81, 64, 363, 362, + /* 550 */ 85, 0, 403, 70, 405, 90, 91, 92, 93, 233, + /* 560 */ 77, 96, 403, 33, 99, 476, 105, 105, 479, 108, + /* 570 */ 108, 56, 57, 8, 9, 45, 391, 12, 13, 14, + /* 580 */ 15, 16, 103, 12, 13, 403, 103, 498, 403, 106, + /* 590 */ 405, 502, 503, 444, 179, 20, 447, 22, 33, 450, + /* 600 */ 451, 452, 453, 454, 455, 148, 457, 379, 37, 460, + /* 610 */ 107, 462, 463, 464, 14, 436, 437, 468, 469, 106, + /* 620 */ 20, 393, 116, 436, 437, 142, 143, 170, 171, 444, + /* 630 */ 55, 403, 447, 172, 172, 450, 451, 452, 453, 454, + /* 640 */ 455, 391, 457, 181, 182, 367, 368, 462, 398, 464, + /* 650 */ 188, 189, 34, 468, 469, 449, 406, 177, 8, 9, + /* 660 */ 177, 178, 12, 13, 14, 15, 16, 184, 185, 207, + /* 670 */ 33, 269, 107, 14, 269, 447, 491, 0, 0, 20, + /* 680 */ 103, 475, 199, 392, 201, 457, 135, 136, 137, 138, + /* 690 */ 139, 140, 141, 106, 117, 118, 119, 120, 121, 122, + /* 700 */ 123, 124, 125, 126, 391, 128, 129, 130, 131, 132, + /* 710 */ 133, 134, 399, 233, 231, 232, 233, 172, 235, 236, + /* 720 */ 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + /* 730 */ 247, 248, 249, 250, 251, 252, 12, 13, 14, 392, + /* 740 */ 350, 14, 15, 16, 20, 391, 22, 350, 203, 72, + /* 750 */ 73, 74, 398, 363, 231, 365, 79, 80, 81, 35, + /* 760 */ 406, 37, 85, 362, 363, 362, 363, 90, 91, 92, + /* 770 */ 93, 350, 201, 96, 362, 363, 99, 177, 347, 0, + /* 780 */ 42, 391, 269, 382, 363, 382, 365, 392, 64, 253, + /* 790 */ 389, 255, 389, 403, 382, 405, 367, 368, 68, 449, + /* 800 */ 403, 77, 350, 280, 281, 282, 283, 284, 285, 286, + /* 810 */ 426, 392, 391, 8, 9, 431, 391, 12, 13, 14, + /* 820 */ 15, 16, 14, 398, 403, 475, 405, 103, 20, 179, + /* 830 */ 106, 406, 392, 233, 444, 350, 177, 447, 350, 161, + /* 840 */ 450, 451, 452, 453, 454, 455, 391, 457, 170, 362, + /* 850 */ 363, 363, 462, 398, 464, 403, 269, 426, 468, 469, + /* 860 */ 476, 406, 431, 479, 3, 444, 142, 143, 447, 382, + /* 870 */ 392, 450, 451, 452, 453, 454, 455, 426, 457, 391, + /* 880 */ 371, 497, 498, 462, 350, 464, 502, 503, 403, 468, + /* 890 */ 469, 403, 233, 405, 135, 136, 137, 138, 139, 140, + /* 900 */ 141, 177, 178, 362, 363, 383, 397, 476, 184, 185, + /* 910 */ 479, 391, 107, 391, 135, 136, 137, 138, 139, 140, + /* 920 */ 141, 399, 49, 199, 194, 201, 406, 476, 497, 498, + /* 930 */ 479, 294, 444, 502, 503, 447, 0, 403, 450, 451, + /* 940 */ 452, 453, 454, 455, 456, 457, 458, 459, 497, 498, + /* 950 */ 176, 221, 222, 502, 503, 231, 232, 233, 22, 235, + /* 960 */ 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + /* 970 */ 246, 247, 248, 249, 250, 251, 252, 12, 13, 106, + /* 980 */ 350, 362, 363, 22, 426, 20, 37, 22, 350, 1, + /* 990 */ 362, 363, 461, 363, 463, 365, 362, 363, 37, 136, + /* 1000 */ 35, 382, 37, 383, 362, 363, 268, 19, 376, 377, + /* 1010 */ 382, 391, 350, 472, 473, 474, 382, 476, 477, 399, + /* 1020 */ 0, 391, 379, 35, 382, 363, 77, 365, 37, 64, + /* 1030 */ 256, 362, 363, 403, 476, 405, 393, 479, 4, 51, + /* 1040 */ 266, 403, 77, 362, 363, 64, 403, 59, 60, 61, + /* 1050 */ 62, 382, 64, 391, 13, 497, 498, 387, 362, 363, + /* 1060 */ 502, 503, 42, 382, 103, 403, 380, 405, 103, 362, + /* 1070 */ 363, 106, 350, 4, 444, 212, 213, 447, 382, 20, + /* 1080 */ 450, 451, 452, 453, 454, 455, 426, 457, 19, 108, + /* 1090 */ 447, 448, 462, 105, 464, 20, 108, 20, 468, 469, + /* 1100 */ 457, 362, 363, 0, 35, 351, 444, 142, 143, 447, + /* 1110 */ 23, 441, 450, 451, 452, 453, 454, 455, 77, 457, + /* 1120 */ 51, 382, 20, 33, 462, 403, 464, 58, 140, 378, + /* 1130 */ 468, 469, 381, 64, 47, 48, 476, 376, 377, 479, + /* 1140 */ 8, 9, 177, 178, 12, 13, 14, 15, 16, 184, + /* 1150 */ 185, 290, 20, 39, 40, 362, 363, 497, 498, 461, + /* 1160 */ 33, 463, 502, 503, 199, 400, 201, 391, 403, 181, + /* 1170 */ 350, 362, 363, 391, 105, 382, 188, 108, 106, 472, + /* 1180 */ 473, 474, 406, 476, 477, 1, 2, 115, 406, 426, + /* 1190 */ 106, 382, 201, 350, 350, 207, 231, 232, 233, 350, + /* 1200 */ 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + /* 1210 */ 245, 246, 247, 248, 249, 250, 251, 252, 12, 13, + /* 1220 */ 362, 363, 350, 403, 110, 111, 20, 113, 22, 12, + /* 1230 */ 13, 14, 15, 16, 107, 363, 350, 365, 179, 476, + /* 1240 */ 382, 35, 479, 37, 362, 363, 403, 403, 350, 135, + /* 1250 */ 350, 350, 403, 139, 362, 363, 362, 363, 362, 363, + /* 1260 */ 497, 498, 0, 391, 382, 502, 503, 362, 363, 400, + /* 1270 */ 64, 116, 403, 70, 382, 403, 382, 405, 382, 350, + /* 1280 */ 350, 179, 198, 77, 200, 400, 416, 382, 403, 403, + /* 1290 */ 384, 107, 233, 387, 353, 354, 109, 267, 268, 112, + /* 1300 */ 215, 403, 217, 403, 403, 271, 33, 33, 233, 103, + /* 1310 */ 233, 179, 106, 51, 230, 37, 444, 350, 45, 447, + /* 1320 */ 13, 166, 450, 451, 452, 453, 454, 455, 225, 457, + /* 1330 */ 363, 0, 403, 403, 462, 233, 464, 12, 13, 109, + /* 1340 */ 468, 469, 112, 109, 37, 13, 112, 22, 142, 143, + /* 1350 */ 495, 109, 0, 269, 112, 13, 33, 37, 391, 33, + /* 1360 */ 35, 13, 37, 506, 33, 233, 33, 142, 143, 37, + /* 1370 */ 403, 366, 405, 391, 22, 488, 1, 2, 379, 37, + /* 1380 */ 0, 107, 292, 177, 178, 37, 379, 33, 33, 64, + /* 1390 */ 184, 185, 33, 33, 33, 416, 33, 77, 33, 33, + /* 1400 */ 33, 33, 77, 33, 33, 199, 33, 201, 361, 416, + /* 1410 */ 33, 444, 494, 494, 447, 494, 494, 450, 451, 452, + /* 1420 */ 453, 454, 455, 425, 457, 416, 366, 363, 103, 462, + /* 1430 */ 107, 464, 52, 107, 231, 468, 469, 231, 232, 233, + /* 1440 */ 107, 235, 236, 237, 238, 239, 240, 241, 242, 243, + /* 1450 */ 244, 245, 246, 247, 248, 249, 250, 251, 252, 402, + /* 1460 */ 18, 107, 107, 478, 433, 23, 107, 107, 107, 416, + /* 1470 */ 107, 416, 107, 107, 107, 107, 499, 107, 107, 201, + /* 1480 */ 107, 470, 40, 41, 107, 481, 44, 381, 272, 427, + /* 1490 */ 51, 446, 42, 445, 20, 214, 54, 443, 197, 438, + /* 1500 */ 350, 371, 371, 438, 20, 429, 362, 65, 66, 67, + /* 1510 */ 68, 20, 363, 363, 45, 363, 412, 412, 409, 176, + /* 1520 */ 362, 409, 363, 362, 199, 412, 201, 409, 104, 375, + /* 1530 */ 102, 374, 362, 101, 362, 373, 362, 362, 20, 50, + /* 1540 */ 355, 391, 359, 355, 371, 359, 438, 371, 106, 20, + /* 1550 */ 405, 371, 20, 403, 364, 405, 231, 232, 20, 364, + /* 1560 */ 371, 428, 371, 20, 371, 419, 362, 371, 371, 355, + /* 1570 */ 245, 246, 247, 248, 249, 250, 251, 353, 355, 353, + /* 1580 */ 362, 403, 403, 391, 403, 391, 144, 218, 106, 391, + /* 1590 */ 391, 391, 391, 391, 444, 442, 391, 447, 391, 391, + /* 1600 */ 450, 451, 452, 453, 454, 455, 391, 457, 440, 438, + /* 1610 */ 369, 20, 462, 205, 464, 204, 405, 435, 468, 469, + /* 1620 */ 369, 362, 403, 279, 487, 278, 350, 487, 287, 490, + /* 1630 */ 190, 489, 485, 191, 192, 193, 296, 486, 196, 363, + /* 1640 */ 427, 421, 421, 487, 434, 289, 437, 273, 484, 427, + /* 1650 */ 288, 209, 210, 268, 363, 507, 20, 293, 116, 482, + /* 1660 */ 350, 501, 220, 291, 270, 223, 500, 391, 226, 227, + /* 1670 */ 228, 229, 230, 363, 369, 364, 449, 369, 421, 403, + /* 1680 */ 403, 405, 403, 403, 421, 403, 403, 182, 417, 387, + /* 1690 */ 369, 369, 480, 363, 106, 467, 106, 403, 395, 362, + /* 1700 */ 22, 391, 352, 369, 38, 356, 355, 439, 422, 422, + /* 1710 */ 0, 269, 385, 403, 430, 405, 370, 0, 0, 45, + /* 1720 */ 444, 385, 0, 447, 385, 37, 450, 451, 452, 453, + /* 1730 */ 454, 455, 224, 457, 350, 348, 37, 37, 462, 37, + /* 1740 */ 464, 224, 0, 37, 468, 469, 37, 363, 224, 37, + /* 1750 */ 0, 0, 224, 37, 444, 0, 37, 447, 0, 22, + /* 1760 */ 450, 451, 452, 453, 454, 455, 0, 457, 350, 37, + /* 1770 */ 219, 0, 207, 0, 464, 391, 207, 201, 468, 469, + /* 1780 */ 208, 363, 199, 0, 0, 0, 194, 403, 195, 405, + /* 1790 */ 0, 0, 147, 49, 49, 0, 37, 0, 0, 37, + /* 1800 */ 51, 350, 0, 49, 0, 45, 0, 0, 0, 391, + /* 1810 */ 49, 0, 0, 0, 363, 0, 0, 0, 161, 37, + /* 1820 */ 0, 403, 161, 405, 0, 0, 0, 0, 444, 49, + /* 1830 */ 0, 447, 0, 0, 450, 451, 452, 453, 454, 455, + /* 1840 */ 0, 457, 391, 0, 0, 0, 0, 0, 464, 146, + /* 1850 */ 45, 0, 468, 469, 403, 0, 405, 0, 0, 0, + /* 1860 */ 0, 0, 444, 0, 0, 447, 0, 0, 450, 451, + /* 1870 */ 452, 453, 454, 455, 0, 457, 22, 350, 0, 0, + /* 1880 */ 147, 0, 464, 145, 0, 0, 468, 469, 50, 50, + /* 1890 */ 363, 22, 22, 0, 0, 444, 0, 0, 447, 64, + /* 1900 */ 64, 450, 451, 452, 453, 454, 455, 350, 457, 0, + /* 1910 */ 37, 0, 64, 37, 37, 0, 51, 42, 391, 51, + /* 1920 */ 363, 0, 42, 37, 0, 42, 37, 14, 33, 0, + /* 1930 */ 403, 0, 405, 51, 42, 45, 0, 49, 0, 0, + /* 1940 */ 49, 0, 43, 42, 42, 0, 190, 49, 391, 49, + /* 1950 */ 0, 0, 0, 37, 51, 504, 505, 0, 51, 42, + /* 1960 */ 403, 42, 405, 37, 0, 37, 0, 42, 0, 51, + /* 1970 */ 37, 444, 42, 51, 447, 71, 0, 450, 451, 452, + /* 1980 */ 453, 454, 455, 0, 457, 350, 0, 0, 0, 22, + /* 1990 */ 37, 464, 0, 37, 33, 37, 469, 37, 363, 37, + /* 2000 */ 37, 444, 350, 33, 447, 0, 37, 450, 451, 452, + /* 2010 */ 453, 454, 455, 22, 457, 363, 37, 112, 37, 350, + /* 2020 */ 22, 37, 114, 0, 22, 53, 391, 37, 0, 22, + /* 2030 */ 37, 396, 363, 37, 0, 0, 0, 37, 403, 0, + /* 2040 */ 405, 37, 0, 391, 22, 20, 37, 37, 396, 37, + /* 2050 */ 493, 107, 106, 0, 106, 403, 206, 405, 0, 22, + /* 2060 */ 391, 37, 49, 0, 202, 22, 0, 0, 3, 50, + /* 2070 */ 274, 33, 403, 33, 405, 274, 50, 106, 104, 444, + /* 2080 */ 107, 106, 447, 33, 350, 450, 451, 452, 453, 454, + /* 2090 */ 455, 179, 457, 179, 33, 106, 444, 363, 49, 447, + /* 2100 */ 49, 107, 450, 451, 452, 453, 454, 455, 102, 457, + /* 2110 */ 107, 179, 33, 444, 350, 107, 447, 182, 107, 450, + /* 2120 */ 451, 452, 453, 454, 455, 391, 457, 363, 179, 186, + /* 2130 */ 3, 33, 37, 179, 107, 106, 106, 403, 106, 405, + /* 2140 */ 37, 186, 37, 37, 37, 274, 37, 33, 107, 49, + /* 2150 */ 49, 107, 0, 0, 106, 391, 0, 42, 106, 42, + /* 2160 */ 396, 107, 107, 106, 33, 496, 106, 403, 183, 405, + /* 2170 */ 106, 115, 49, 104, 106, 104, 181, 267, 444, 350, + /* 2180 */ 2, 447, 22, 106, 450, 451, 452, 453, 454, 455, + /* 2190 */ 231, 457, 363, 107, 254, 106, 49, 107, 106, 350, + /* 2200 */ 107, 107, 106, 49, 22, 106, 37, 116, 444, 107, + /* 2210 */ 106, 447, 363, 37, 450, 451, 452, 453, 454, 455, + /* 2220 */ 391, 457, 350, 107, 106, 37, 106, 37, 107, 107, + /* 2230 */ 106, 234, 403, 37, 405, 363, 106, 350, 37, 505, + /* 2240 */ 391, 107, 106, 37, 107, 396, 127, 106, 106, 33, + /* 2250 */ 363, 106, 403, 127, 405, 127, 350, 37, 22, 127, + /* 2260 */ 71, 106, 70, 391, 37, 37, 37, 37, 396, 363, + /* 2270 */ 77, 37, 37, 444, 37, 403, 447, 405, 391, 450, + /* 2280 */ 451, 452, 453, 454, 455, 37, 457, 37, 459, 77, + /* 2290 */ 403, 100, 405, 444, 100, 33, 447, 391, 37, 450, + /* 2300 */ 451, 452, 453, 454, 455, 37, 457, 37, 22, 403, + /* 2310 */ 37, 405, 37, 0, 37, 77, 444, 37, 37, 447, + /* 2320 */ 37, 37, 450, 451, 452, 453, 454, 455, 22, 457, + /* 2330 */ 350, 444, 37, 37, 447, 37, 51, 450, 451, 452, + /* 2340 */ 453, 454, 455, 363, 457, 42, 0, 37, 51, 350, + /* 2350 */ 444, 42, 0, 447, 37, 51, 450, 451, 452, 453, + /* 2360 */ 454, 455, 363, 457, 42, 350, 0, 37, 42, 51, + /* 2370 */ 0, 391, 37, 37, 0, 22, 33, 22, 363, 21, + /* 2380 */ 508, 22, 22, 403, 21, 405, 508, 20, 508, 508, + /* 2390 */ 391, 508, 508, 508, 508, 508, 508, 508, 508, 508, + /* 2400 */ 508, 508, 403, 508, 405, 508, 391, 508, 508, 508, + /* 2410 */ 508, 508, 508, 508, 508, 508, 508, 508, 403, 508, + /* 2420 */ 405, 508, 508, 350, 444, 508, 508, 447, 508, 508, + /* 2430 */ 450, 451, 452, 453, 454, 455, 363, 457, 508, 508, + /* 2440 */ 508, 508, 508, 444, 508, 508, 447, 350, 508, 450, + /* 2450 */ 451, 452, 453, 454, 455, 508, 457, 508, 508, 444, + /* 2460 */ 363, 508, 447, 508, 391, 450, 451, 452, 453, 454, + /* 2470 */ 455, 508, 457, 508, 508, 508, 403, 508, 405, 508, + /* 2480 */ 508, 508, 508, 508, 508, 508, 508, 508, 391, 508, + /* 2490 */ 350, 508, 508, 508, 508, 508, 508, 508, 508, 508, + /* 2500 */ 403, 508, 405, 363, 508, 508, 508, 508, 508, 508, + /* 2510 */ 508, 508, 508, 508, 508, 508, 350, 444, 508, 508, + /* 2520 */ 447, 508, 508, 450, 451, 452, 453, 454, 455, 363, + /* 2530 */ 457, 391, 508, 508, 508, 508, 508, 508, 508, 508, + /* 2540 */ 508, 444, 508, 403, 447, 405, 508, 450, 451, 452, + /* 2550 */ 453, 454, 455, 508, 457, 508, 508, 391, 508, 350, + /* 2560 */ 508, 508, 508, 508, 508, 508, 508, 508, 508, 403, + /* 2570 */ 508, 405, 363, 508, 508, 508, 508, 508, 508, 508, + /* 2580 */ 508, 508, 508, 350, 444, 508, 508, 447, 508, 508, + /* 2590 */ 450, 451, 452, 453, 454, 455, 363, 457, 508, 508, + /* 2600 */ 391, 508, 508, 508, 508, 508, 508, 508, 508, 508, + /* 2610 */ 444, 508, 403, 447, 405, 508, 450, 451, 452, 453, + /* 2620 */ 454, 455, 508, 457, 391, 508, 350, 508, 508, 508, + /* 2630 */ 508, 508, 508, 508, 508, 508, 403, 508, 405, 363, + /* 2640 */ 508, 350, 508, 508, 508, 508, 508, 508, 508, 508, + /* 2650 */ 508, 508, 508, 444, 363, 508, 447, 350, 508, 450, + /* 2660 */ 451, 452, 453, 454, 455, 508, 457, 391, 508, 508, + /* 2670 */ 363, 508, 508, 508, 508, 508, 508, 444, 508, 403, + /* 2680 */ 447, 405, 391, 450, 451, 452, 453, 454, 455, 508, + /* 2690 */ 457, 508, 508, 508, 403, 508, 405, 508, 391, 508, + /* 2700 */ 508, 508, 508, 508, 508, 508, 508, 508, 508, 508, + /* 2710 */ 403, 508, 405, 508, 508, 508, 508, 508, 508, 508, + /* 2720 */ 444, 508, 508, 447, 508, 508, 450, 451, 452, 453, + /* 2730 */ 454, 455, 508, 457, 350, 444, 508, 508, 447, 508, + /* 2740 */ 508, 450, 451, 452, 453, 454, 455, 363, 457, 508, + /* 2750 */ 508, 444, 508, 350, 447, 508, 508, 450, 451, 452, + /* 2760 */ 453, 454, 455, 508, 457, 508, 363, 508, 508, 350, + /* 2770 */ 508, 508, 508, 508, 508, 391, 508, 508, 508, 508, + /* 2780 */ 508, 508, 363, 508, 508, 508, 508, 403, 508, 405, + /* 2790 */ 508, 508, 508, 508, 391, 508, 508, 508, 508, 508, + /* 2800 */ 508, 508, 508, 508, 508, 508, 403, 508, 405, 508, + /* 2810 */ 391, 508, 508, 508, 508, 508, 508, 508, 508, 508, + /* 2820 */ 508, 508, 403, 508, 405, 508, 508, 350, 444, 508, + /* 2830 */ 508, 447, 508, 508, 450, 451, 452, 453, 454, 455, + /* 2840 */ 363, 457, 508, 508, 508, 508, 508, 444, 508, 508, + /* 2850 */ 447, 350, 508, 450, 451, 452, 453, 454, 455, 508, + /* 2860 */ 457, 508, 508, 444, 363, 508, 447, 508, 391, 450, + /* 2870 */ 451, 452, 453, 454, 455, 508, 457, 508, 508, 508, + /* 2880 */ 403, 508, 405, 508, 508, 508, 508, 508, 508, 508, + /* 2890 */ 508, 508, 391, 508, 350, 508, 508, 508, 508, 508, + /* 2900 */ 508, 508, 508, 508, 403, 508, 405, 363, 508, 508, + /* 2910 */ 508, 508, 508, 508, 508, 508, 508, 508, 508, 508, + /* 2920 */ 350, 444, 508, 508, 447, 508, 508, 450, 451, 452, + /* 2930 */ 453, 454, 455, 363, 457, 391, 508, 508, 508, 508, + /* 2940 */ 508, 508, 508, 508, 508, 444, 508, 403, 447, 405, + /* 2950 */ 508, 450, 451, 452, 453, 454, 455, 508, 457, 508, + /* 2960 */ 508, 391, 508, 350, 508, 508, 508, 508, 508, 508, + /* 2970 */ 508, 508, 508, 403, 508, 405, 363, 508, 508, 508, + /* 2980 */ 508, 508, 508, 508, 508, 508, 508, 508, 444, 508, + /* 2990 */ 508, 447, 508, 508, 450, 451, 452, 453, 454, 455, + /* 3000 */ 508, 457, 508, 508, 391, 508, 508, 508, 508, 508, + /* 3010 */ 508, 508, 508, 508, 444, 508, 403, 447, 405, 508, + /* 3020 */ 450, 451, 452, 453, 454, 455, 508, 457, 508, 508, + /* 3030 */ 508, 508, 508, 508, 508, 508, 508, 508, 508, 508, + /* 3040 */ 508, 508, 508, 508, 508, 508, 508, 508, 508, 508, + /* 3050 */ 508, 508, 508, 508, 508, 508, 508, 444, 508, 508, + /* 3060 */ 447, 508, 508, 450, 451, 452, 453, 454, 455, 508, + /* 3070 */ 457, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3080 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3090 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3100 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3110 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3120 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3130 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3140 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3150 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3160 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3170 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3180 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3190 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3200 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3210 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3220 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3230 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3240 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3250 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3260 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3270 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3280 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3290 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3300 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3310 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3320 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3330 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3340 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3350 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3360 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3370 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3380 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3390 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3400 */ 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + /* 3410 */ 347, 347, 347, 347, 347, 347, 347, 347, }; -#define YY_SHIFT_COUNT (834) +#define YY_SHIFT_COUNT (839) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2381) +#define YY_SHIFT_MAX (2374) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 391, 0, 240, 0, 481, 481, 481, 481, 481, 481, - /* 10 */ 481, 481, 481, 481, 481, 481, 721, 961, 961, 1201, - /* 20 */ 961, 961, 961, 961, 961, 961, 961, 961, 961, 961, - /* 30 */ 961, 961, 961, 961, 961, 961, 961, 961, 961, 961, - /* 40 */ 961, 961, 961, 961, 961, 961, 961, 961, 961, 961, - /* 50 */ 961, 93, 162, 152, 47, 278, 343, 278, 278, 47, - /* 60 */ 47, 278, 1319, 278, 239, 1319, 1319, 281, 278, 28, - /* 70 */ 595, 67, 67, 931, 931, 595, 87, 291, 126, 126, - /* 80 */ 173, 67, 67, 67, 67, 67, 67, 67, 67, 67, - /* 90 */ 67, 67, 317, 492, 67, 67, 187, 28, 67, 317, - /* 100 */ 67, 28, 67, 67, 28, 67, 67, 28, 67, 28, - /* 110 */ 28, 28, 67, 368, 439, 439, 242, 546, 569, 569, - /* 120 */ 569, 569, 569, 569, 569, 569, 569, 569, 569, 569, - /* 130 */ 569, 569, 569, 569, 569, 569, 569, 189, 602, 87, - /* 140 */ 291, 1024, 1024, 150, 268, 268, 268, 678, 336, 336, - /* 150 */ 91, 150, 187, 486, 28, 28, 633, 28, 813, 28, - /* 160 */ 813, 813, 823, 959, 89, 89, 89, 89, 89, 89, - /* 170 */ 89, 89, 504, 441, 65, 453, 15, 313, 606, 19, - /* 180 */ 322, 516, 3, 3, 527, 983, 770, 303, 303, 303, - /* 190 */ 502, 303, 800, 1100, 1, 725, 618, 650, 1, 1, - /* 200 */ 808, 1009, 538, 988, 1009, 1261, 1056, 91, 1196, 1422, - /* 210 */ 1439, 1470, 1289, 187, 1470, 187, 1309, 1487, 1489, 1466, - /* 220 */ 1489, 1466, 1339, 1487, 1489, 1487, 1466, 1339, 1339, 1423, - /* 230 */ 1426, 1487, 1430, 1487, 1487, 1487, 1517, 1490, 1517, 1490, - /* 240 */ 1470, 187, 187, 1528, 187, 1532, 1535, 187, 1532, 187, - /* 250 */ 1539, 187, 187, 1487, 187, 1517, 28, 28, 28, 28, - /* 260 */ 28, 28, 28, 28, 28, 28, 28, 1487, 959, 959, - /* 270 */ 1517, 813, 813, 813, 1386, 1469, 1470, 368, 1597, 1416, - /* 280 */ 1418, 1528, 368, 1196, 1487, 813, 1350, 1352, 1350, 1352, - /* 290 */ 1344, 1448, 1350, 1362, 1370, 1393, 1196, 1368, 1377, 1383, - /* 300 */ 1407, 1489, 1657, 1568, 1419, 1532, 368, 368, 1352, 813, - /* 310 */ 813, 813, 813, 1352, 813, 1536, 368, 823, 368, 1489, - /* 320 */ 1616, 1620, 813, 1487, 368, 1713, 1698, 1517, 3178, 3178, - /* 330 */ 3178, 3178, 3178, 3178, 3178, 3178, 3178, 36, 881, 786, - /* 340 */ 30, 825, 1043, 1063, 625, 413, 661, 1103, 877, 1271, - /* 350 */ 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 635, 716, - /* 360 */ 318, 363, 363, 355, 358, 445, 870, 867, 1146, 1202, - /* 370 */ 1006, 1021, 1021, 1211, 1183, 382, 1211, 1211, 1211, 1288, - /* 380 */ 1106, 462, 1066, 1265, 1180, 1291, 1190, 1216, 1226, 1228, - /* 390 */ 677, 1310, 1292, 1336, 1357, 974, 1267, 1347, 477, 1348, - /* 400 */ 1349, 1353, 1221, 417, 8, 1354, 1356, 1358, 1359, 1361, - /* 410 */ 1364, 1367, 1378, 714, 1379, 155, 1381, 1384, 1385, 1388, - /* 420 */ 1390, 1391, 1287, 1213, 1225, 1363, 1382, 1051, 1083, 1752, - /* 430 */ 1753, 1765, 1722, 1769, 1733, 1548, 1737, 1738, 1739, 1554, - /* 440 */ 1778, 1743, 1744, 1559, 1746, 1784, 1563, 1789, 1760, 1799, - /* 450 */ 1779, 1805, 1766, 1588, 1808, 1603, 1810, 1605, 1606, 1612, - /* 460 */ 1617, 1814, 1816, 1817, 1624, 1627, 1822, 1823, 1677, 1776, - /* 470 */ 1777, 1827, 1792, 1780, 1830, 1783, 1835, 1791, 1837, 1838, - /* 480 */ 1839, 1795, 1841, 1845, 1847, 1848, 1855, 1857, 1697, 1824, - /* 490 */ 1859, 1701, 1864, 1865, 1872, 1874, 1875, 1876, 1877, 1878, - /* 500 */ 1879, 1882, 1883, 1893, 1895, 1896, 1897, 1898, 1900, 1852, - /* 510 */ 1902, 1860, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1892, - /* 520 */ 1915, 1770, 1916, 1772, 1919, 1775, 1921, 1922, 1901, 1881, - /* 530 */ 1903, 1884, 1924, 1869, 1891, 1929, 1871, 1936, 1873, 1938, - /* 540 */ 1940, 1905, 1894, 1904, 1943, 1913, 1914, 1918, 1947, 1925, - /* 550 */ 1920, 1927, 1948, 1926, 1949, 1928, 1930, 1923, 1933, 1935, - /* 560 */ 1937, 1946, 1952, 1931, 1934, 1953, 1955, 1958, 1961, 1950, - /* 570 */ 1781, 1964, 1933, 1951, 1967, 1975, 1932, 1977, 1978, 1942, - /* 580 */ 1945, 1956, 2001, 1965, 1954, 1962, 2006, 1971, 1960, 1970, - /* 590 */ 2009, 1982, 1972, 1979, 2024, 2025, 2026, 2027, 2028, 2029, - /* 600 */ 1917, 1941, 1993, 2010, 2033, 2000, 2002, 2003, 2005, 2013, - /* 610 */ 2015, 2018, 2019, 2030, 2031, 2020, 2021, 2037, 2023, 2035, - /* 620 */ 2039, 2043, 2040, 2012, 2066, 2046, 2032, 2070, 2071, 2072, - /* 630 */ 2036, 2074, 2050, 2076, 2055, 2060, 2052, 2054, 2056, 1987, - /* 640 */ 1990, 2097, 1939, 1992, 1899, 1933, 2053, 2099, 1963, 2064, - /* 650 */ 2081, 2105, 1944, 2084, 1966, 1957, 2108, 2118, 1968, 1984, - /* 660 */ 1969, 1985, 2107, 2078, 1840, 2008, 2016, 2022, 2062, 2011, - /* 670 */ 2069, 2038, 2017, 2083, 2088, 2042, 2047, 2058, 2061, 2059, - /* 680 */ 2092, 2077, 2080, 2065, 2094, 1858, 2067, 2082, 2127, 2100, - /* 690 */ 1866, 2106, 2123, 2125, 2135, 2148, 2150, 2087, 2089, 2093, - /* 700 */ 1994, 2158, 2146, 2197, 2199, 2095, 2160, 2098, 2096, 2101, - /* 710 */ 2103, 2104, 2051, 2109, 2200, 2164, 2034, 2112, 2113, 1933, - /* 720 */ 2162, 2179, 2116, 1983, 2117, 2211, 2210, 2041, 2137, 2138, - /* 730 */ 2141, 2143, 2145, 2154, 2213, 2157, 2159, 2215, 2161, 2244, - /* 740 */ 2044, 2163, 2151, 2166, 2237, 2238, 2172, 2173, 2242, 2175, - /* 750 */ 2176, 2245, 2178, 2180, 2248, 2183, 2184, 2249, 2186, 2187, - /* 760 */ 2256, 2189, 2169, 2170, 2171, 2174, 2193, 2267, 2196, 2266, - /* 770 */ 2198, 2267, 2267, 2283, 2236, 2239, 2269, 2271, 2275, 2276, - /* 780 */ 2278, 2279, 2286, 2288, 2289, 2233, 2227, 2251, 2231, 2300, - /* 790 */ 2297, 2304, 2307, 2323, 2309, 2311, 2312, 2274, 2030, 2313, - /* 800 */ 2031, 2315, 2316, 2317, 2318, 2334, 2320, 2358, 2322, 2310, - /* 810 */ 2324, 2362, 2327, 2314, 2325, 2368, 2332, 2319, 2331, 2372, - /* 820 */ 2337, 2326, 2333, 2378, 2342, 2343, 2381, 2360, 2351, 2364, - /* 830 */ 2366, 2367, 2369, 2371, 2370, + /* 0 */ 1442, 0, 241, 0, 483, 483, 483, 483, 483, 483, + /* 10 */ 483, 483, 483, 483, 483, 483, 724, 965, 965, 1206, + /* 20 */ 965, 965, 965, 965, 965, 965, 965, 965, 965, 965, + /* 30 */ 965, 965, 965, 965, 965, 965, 965, 965, 965, 965, + /* 40 */ 965, 965, 965, 965, 965, 965, 965, 965, 965, 965, + /* 50 */ 965, 167, 402, 1084, 251, 405, 587, 405, 405, 251, + /* 60 */ 251, 405, 1325, 405, 240, 1325, 1325, 513, 405, 5, + /* 70 */ 170, 171, 171, 160, 160, 170, 78, 39, 295, 295, + /* 80 */ 326, 171, 171, 171, 171, 171, 171, 171, 171, 171, + /* 90 */ 171, 171, 261, 355, 171, 171, 91, 5, 171, 261, + /* 100 */ 171, 5, 171, 171, 5, 171, 171, 5, 171, 5, + /* 110 */ 5, 5, 171, 400, 202, 202, 465, 198, 118, 118, + /* 120 */ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, + /* 130 */ 118, 118, 118, 118, 118, 118, 118, 1114, 200, 78, + /* 140 */ 39, 515, 515, 949, 415, 415, 415, 364, 536, 536, + /* 150 */ 1041, 949, 91, 307, 5, 5, 262, 5, 376, 5, + /* 160 */ 376, 376, 506, 618, 577, 577, 577, 577, 577, 577, + /* 170 */ 577, 577, 988, 677, 65, 1132, 66, 523, 242, 76, + /* 180 */ 600, 659, 571, 571, 1059, 1087, 1102, 246, 246, 246, + /* 190 */ 327, 246, 480, 575, 1075, 808, 204, 545, 1075, 1075, + /* 200 */ 1077, 1030, 738, 861, 1030, 530, 1034, 1041, 1216, 1439, + /* 210 */ 1450, 1474, 1281, 91, 1474, 91, 1301, 1484, 1491, 1469, + /* 220 */ 1491, 1469, 1343, 1484, 1491, 1484, 1469, 1343, 1343, 1424, + /* 230 */ 1428, 1484, 1432, 1484, 1484, 1484, 1518, 1489, 1518, 1489, + /* 240 */ 1474, 91, 91, 1529, 91, 1532, 1538, 91, 1532, 91, + /* 250 */ 1543, 91, 91, 1484, 91, 1518, 5, 5, 5, 5, + /* 260 */ 5, 5, 5, 5, 5, 5, 5, 1484, 618, 618, + /* 270 */ 1518, 376, 376, 376, 1369, 1482, 1474, 400, 1591, 1408, + /* 280 */ 1411, 1529, 400, 1216, 1484, 376, 1344, 1347, 1344, 1347, + /* 290 */ 1341, 1440, 1344, 1356, 1362, 1374, 1216, 1340, 1364, 1372, + /* 300 */ 1385, 1491, 1636, 1542, 1394, 1532, 400, 400, 1347, 376, + /* 310 */ 376, 376, 376, 1347, 376, 1505, 400, 506, 400, 1491, + /* 320 */ 1588, 1590, 376, 1484, 400, 1678, 1666, 1518, 3071, 3071, + /* 330 */ 3071, 3071, 3071, 3071, 3071, 3071, 3071, 36, 462, 306, + /* 340 */ 565, 1069, 435, 805, 551, 15, 30, 650, 779, 40, + /* 350 */ 40, 40, 40, 40, 40, 40, 40, 40, 759, 151, + /* 360 */ 416, 1217, 1217, 730, 461, 457, 468, 678, 479, 961, + /* 370 */ 863, 334, 334, 727, 1184, 774, 727, 727, 727, 1262, + /* 380 */ 1103, 503, 1020, 1273, 1155, 1331, 1187, 1230, 1234, 1242, + /* 390 */ 1307, 1332, 388, 936, 1352, 1085, 1127, 1323, 981, 1326, + /* 400 */ 1333, 1354, 1225, 1090, 637, 1355, 1359, 1360, 1361, 1363, + /* 410 */ 1365, 1375, 1366, 1203, 1274, 873, 1367, 1368, 1370, 1371, + /* 420 */ 1373, 1377, 1072, 991, 1278, 1342, 1348, 1320, 1380, 1710, + /* 430 */ 1717, 1718, 1674, 1722, 1688, 1508, 1699, 1700, 1702, 1517, + /* 440 */ 1742, 1706, 1709, 1524, 1712, 1750, 1528, 1751, 1716, 1755, + /* 450 */ 1719, 1758, 1737, 1766, 1732, 1551, 1771, 1565, 1773, 1569, + /* 460 */ 1572, 1576, 1583, 1783, 1784, 1785, 1593, 1592, 1790, 1791, + /* 470 */ 1645, 1744, 1745, 1795, 1759, 1797, 1798, 1762, 1749, 1802, + /* 480 */ 1754, 1804, 1760, 1806, 1807, 1808, 1761, 1811, 1812, 1813, + /* 490 */ 1815, 1816, 1817, 1657, 1782, 1820, 1661, 1824, 1825, 1826, + /* 500 */ 1827, 1832, 1833, 1840, 1843, 1844, 1845, 1846, 1847, 1855, + /* 510 */ 1857, 1858, 1859, 1860, 1780, 1830, 1805, 1851, 1861, 1863, + /* 520 */ 1864, 1866, 1867, 1874, 1854, 1878, 1733, 1879, 1703, 1881, + /* 530 */ 1738, 1884, 1885, 1869, 1838, 1870, 1839, 1893, 1835, 1873, + /* 540 */ 1894, 1836, 1896, 1848, 1897, 1909, 1876, 1865, 1875, 1911, + /* 550 */ 1877, 1868, 1880, 1915, 1886, 1882, 1883, 1921, 1889, 1924, + /* 560 */ 1890, 1892, 1895, 1888, 1891, 1913, 1898, 1929, 1899, 1901, + /* 570 */ 1931, 1936, 1938, 1939, 1902, 1756, 1941, 1888, 1900, 1945, + /* 580 */ 1950, 1904, 1951, 1952, 1916, 1903, 1917, 1957, 1926, 1907, + /* 590 */ 1919, 1964, 1928, 1918, 1925, 1966, 1933, 1922, 1930, 1968, + /* 600 */ 1976, 1983, 1986, 1987, 1988, 1908, 1905, 1953, 1967, 1992, + /* 610 */ 1956, 1958, 1960, 1962, 1963, 1969, 1979, 1981, 1961, 1970, + /* 620 */ 1984, 1990, 1991, 1993, 2005, 1998, 2023, 2002, 1972, 2028, + /* 630 */ 2007, 1996, 2034, 2035, 2036, 2000, 2039, 2004, 2042, 2022, + /* 640 */ 2025, 2009, 2010, 2012, 1944, 1946, 2053, 1912, 1948, 1850, + /* 650 */ 1888, 2013, 2058, 1914, 2024, 2037, 2063, 1862, 2043, 1932, + /* 660 */ 1935, 2066, 2067, 1949, 1943, 1954, 1955, 2065, 2038, 1796, + /* 670 */ 1971, 1973, 1975, 2019, 1974, 2026, 2006, 1994, 2040, 2050, + /* 680 */ 2003, 1989, 2029, 2030, 2008, 2061, 2049, 2051, 2032, 2079, + /* 690 */ 1801, 2011, 2027, 2127, 2098, 1871, 2095, 2103, 2105, 2106, + /* 700 */ 2107, 2109, 2041, 2044, 2100, 1910, 2114, 2101, 2152, 2153, + /* 710 */ 2048, 2115, 2052, 2054, 2055, 2057, 2060, 1985, 2064, 2156, + /* 720 */ 2117, 1995, 2068, 2056, 1888, 2123, 2131, 2069, 1940, 2071, + /* 730 */ 2178, 2160, 1959, 2077, 2086, 2089, 2090, 2092, 2093, 2147, + /* 740 */ 2096, 2099, 2154, 2094, 2182, 1997, 2104, 2091, 2102, 2169, + /* 750 */ 2176, 2118, 2116, 2188, 2120, 2121, 2190, 2124, 2122, 2196, + /* 760 */ 2130, 2134, 2201, 2136, 2137, 2206, 2141, 2119, 2126, 2128, + /* 770 */ 2132, 2142, 2216, 2145, 2220, 2155, 2216, 2216, 2236, 2189, + /* 780 */ 2192, 2227, 2228, 2229, 2230, 2234, 2235, 2237, 2248, 2250, + /* 790 */ 2193, 2191, 2212, 2194, 2262, 2261, 2268, 2270, 2286, 2273, + /* 800 */ 2275, 2277, 2238, 1961, 2280, 1970, 2281, 2283, 2284, 2295, + /* 810 */ 2306, 2296, 2313, 2298, 2285, 2303, 2346, 2310, 2297, 2309, + /* 820 */ 2352, 2317, 2304, 2322, 2366, 2330, 2318, 2326, 2370, 2335, + /* 830 */ 2336, 2374, 2353, 2343, 2355, 2358, 2359, 2360, 2363, 2367, }; #define YY_REDUCE_COUNT (336) -#define YY_REDUCE_MIN (-423) -#define YY_REDUCE_MAX (2721) +#define YY_REDUCE_MIN (-430) +#define YY_REDUCE_MAX (2613) static const short yy_reduce_ofst[] = { - /* 0 */ -149, -302, 387, 199, 419, 646, 680, 866, 899, 1026, - /* 10 */ 457, 1134, 1192, 1229, 1262, 1305, -84, 1342, 1400, 1417, - /* 20 */ 1438, 1537, 1564, 1595, 1632, 1705, 1730, 1773, 1803, 1788, - /* 30 */ 1868, 1886, 1981, 1998, 2014, 2091, 2110, 2177, 2206, 2235, - /* 40 */ 2273, 2330, 2348, 2405, 2425, 2441, 2540, 2556, 2623, 2638, - /* 50 */ 2721, -189, -339, -423, 163, -421, 525, 676, 685, 279, - /* 60 */ 321, 744, -176, -311, -308, 536, 787, 674, 756, -379, - /* 70 */ -248, -356, -192, -288, 4, -244, -329, 39, 181, 383, - /* 80 */ -306, -312, -31, 138, 198, -328, -137, 246, 325, 426, - /* 90 */ 464, -107, 75, -223, 470, 531, -91, 491, 623, 443, - /* 100 */ 626, 494, 658, 662, -381, 673, 684, 600, 712, 476, - /* 110 */ 604, 651, 724, 236, -54, -54, -371, 282, 115, 305, - /* 120 */ 393, 433, 454, 493, 545, 573, 578, 597, 772, 778, - /* 130 */ 818, 845, 880, 893, 895, 906, 911, 161, -293, -123, - /* 140 */ 398, 535, 773, 561, -293, -129, 360, 300, 455, 704, - /* 150 */ -318, 749, -98, 116, 266, 544, 694, 861, 833, 847, - /* 160 */ 865, 872, 883, 920, 620, 656, 703, 755, 863, 902, - /* 170 */ 930, 863, 785, -369, 1011, 896, 854, 871, 1005, 884, - /* 180 */ 982, 982, 995, 1020, 989, 1045, 991, 910, 914, 915, - /* 190 */ 985, 917, 982, 1050, 1012, 1058, 1025, 997, 1019, 1038, - /* 200 */ 982, 980, 980, 960, 980, 990, 984, 1082, 1044, 1029, - /* 210 */ 1040, 1062, 1059, 1130, 1067, 1133, 1078, 1147, 1148, 1101, - /* 220 */ 1151, 1104, 1108, 1157, 1158, 1160, 1111, 1115, 1117, 1152, - /* 230 */ 1156, 1169, 1161, 1171, 1173, 1174, 1185, 1184, 1189, 1186, - /* 240 */ 1109, 1175, 1177, 1149, 1181, 1193, 1131, 1187, 1197, 1191, - /* 250 */ 1144, 1200, 1203, 1210, 1204, 1218, 1199, 1208, 1209, 1214, - /* 260 */ 1215, 1217, 1219, 1220, 1222, 1223, 1224, 1231, 1227, 1241, - /* 270 */ 1246, 1179, 1206, 1230, 1135, 1167, 1178, 1248, 1182, 1188, - /* 280 */ 1194, 1232, 1255, 1235, 1264, 1237, 1140, 1236, 1154, 1238, - /* 290 */ 1145, 1159, 1163, 1166, 1205, 1207, 1242, 1164, 1162, 1172, - /* 300 */ 980, 1314, 1239, 1212, 1240, 1323, 1326, 1330, 1279, 1298, - /* 310 */ 1299, 1300, 1301, 1286, 1308, 1304, 1355, 1335, 1360, 1365, - /* 320 */ 1258, 1337, 1331, 1373, 1369, 1387, 1392, 1389, 1311, 1303, - /* 330 */ 1318, 1321, 1366, 1376, 1380, 1394, 1398, + /* 0 */ 431, -303, 149, 185, -23, 390, 421, 630, 662, 872, + /* 10 */ 967, 1150, 1276, 1310, 1384, 1418, 488, -81, 1451, 1527, + /* 20 */ 1557, 1635, 1652, 1669, 1734, 1764, 1829, 1849, 1872, 1887, + /* 30 */ 1906, 1980, 1999, 2015, 2073, 2097, 2140, 2166, 2209, 2233, + /* 40 */ 2276, 2291, 2307, 2384, 2403, 2419, 2477, 2501, 2544, 2570, + /* 50 */ 2613, -305, -202, 384, -187, 31, 451, 558, 660, 541, + /* 60 */ 707, 763, 643, -340, -341, -99, 228, -177, 89, -380, + /* 70 */ -211, 401, 403, -356, -351, -390, -330, -333, -257, 140, + /* 80 */ -218, 412, 487, 619, 628, -312, -225, 634, 669, 681, + /* 90 */ 696, -97, 179, -2, 739, 793, -284, 250, 642, 187, + /* 100 */ 809, 354, 858, 882, -383, 892, 894, 425, 896, 522, + /* 110 */ 455, 620, 905, -66, -425, -425, -296, -149, 35, 159, + /* 120 */ 182, 397, 452, 485, 534, 638, 722, 820, 843, 844, + /* 130 */ 849, 886, 898, 900, 901, 929, 930, -61, -270, -245, + /* 140 */ -342, 278, 429, 632, -270, 206, 350, 12, 531, 698, + /* 150 */ 751, 761, 509, 670, 520, 776, -307, 313, 765, 782, + /* 160 */ 869, 885, 906, 941, -385, 291, 347, 395, 419, 440, + /* 170 */ 478, 419, -430, 686, 754, 870, 857, 855, 1005, 887, + /* 180 */ 982, 982, 999, 1007, 979, 1047, 993, 918, 919, 921, + /* 190 */ 998, 922, 982, 1060, 1009, 1064, 1057, 1031, 1053, 1055, + /* 200 */ 982, 985, 985, 977, 985, 1011, 1004, 1106, 1062, 1045, + /* 210 */ 1048, 1061, 1054, 1130, 1065, 1131, 1076, 1144, 1149, 1104, + /* 220 */ 1152, 1105, 1109, 1158, 1159, 1161, 1113, 1112, 1118, 1154, + /* 230 */ 1157, 1170, 1162, 1172, 1174, 1175, 1185, 1183, 1188, 1186, + /* 240 */ 1108, 1173, 1176, 1145, 1180, 1190, 1133, 1189, 1195, 1191, + /* 250 */ 1146, 1193, 1196, 1204, 1197, 1214, 1192, 1194, 1198, 1199, + /* 260 */ 1200, 1201, 1202, 1205, 1207, 1208, 1215, 1218, 1224, 1226, + /* 270 */ 1223, 1178, 1179, 1181, 1153, 1168, 1171, 1241, 1209, 1182, + /* 280 */ 1210, 1211, 1251, 1213, 1259, 1219, 1137, 1220, 1140, 1221, + /* 290 */ 1139, 1142, 1156, 1151, 1147, 1164, 1222, 1148, 1160, 1166, + /* 300 */ 985, 1291, 1227, 1177, 1212, 1311, 1305, 1308, 1257, 1277, + /* 310 */ 1279, 1280, 1282, 1263, 1283, 1271, 1321, 1302, 1322, 1330, + /* 320 */ 1228, 1303, 1294, 1337, 1334, 1350, 1349, 1351, 1284, 1268, + /* 330 */ 1286, 1287, 1327, 1336, 1339, 1346, 1387, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 10 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 20 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 30 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 40 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 50 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 60 */ 1876, 2209, 1876, 1876, 2172, 1876, 1876, 1876, 1876, 1876, - /* 70 */ 1876, 1876, 1876, 1876, 1876, 1876, 2179, 1876, 1876, 1876, - /* 80 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 90 */ 1876, 1876, 1876, 1876, 1876, 1876, 1973, 1876, 1876, 1876, - /* 100 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 110 */ 1876, 1876, 1876, 1971, 2411, 1876, 1876, 1876, 1876, 1876, - /* 120 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 130 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 2423, 1876, - /* 140 */ 1876, 1947, 1947, 1876, 2423, 2423, 2423, 1971, 2383, 2383, - /* 150 */ 1876, 1876, 1973, 2247, 1876, 1876, 1876, 1876, 1876, 1876, - /* 160 */ 1876, 1876, 2096, 1906, 1876, 1876, 1876, 1876, 2120, 1876, - /* 170 */ 1876, 1876, 2235, 1876, 1876, 2452, 2512, 1876, 1876, 2455, - /* 180 */ 1876, 1876, 1876, 1876, 2184, 1876, 2442, 1876, 1876, 1876, - /* 190 */ 1876, 1876, 1876, 1876, 1876, 1876, 2049, 2229, 1876, 1876, - /* 200 */ 1876, 2415, 2429, 2496, 2416, 2413, 2436, 1876, 2446, 1876, - /* 210 */ 2271, 1876, 2261, 1973, 1876, 1973, 2222, 2167, 1876, 2177, - /* 220 */ 1876, 2177, 2174, 1876, 1876, 1876, 2177, 2174, 2174, 2038, - /* 230 */ 2034, 1876, 2032, 1876, 1876, 1876, 1876, 1931, 1876, 1931, - /* 240 */ 1876, 1973, 1973, 1876, 1973, 1876, 1876, 1973, 1876, 1973, - /* 250 */ 1876, 1973, 1973, 1876, 1973, 1876, 1876, 1876, 1876, 1876, - /* 260 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 270 */ 1876, 1876, 1876, 1876, 2259, 2245, 1876, 1971, 1876, 2233, - /* 280 */ 2231, 1876, 1971, 2446, 1876, 1876, 2466, 2461, 2466, 2461, - /* 290 */ 2480, 2476, 2466, 2485, 2482, 2448, 2446, 2515, 2502, 2498, - /* 300 */ 2429, 1876, 1876, 2434, 2432, 1876, 1971, 1971, 2461, 1876, - /* 310 */ 1876, 1876, 1876, 2461, 1876, 1876, 1971, 1876, 1971, 1876, - /* 320 */ 1876, 2065, 1876, 1876, 1971, 1876, 1915, 1876, 2224, 2250, - /* 330 */ 2205, 2205, 2099, 2099, 2099, 1974, 1881, 1876, 1876, 1876, - /* 340 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 2479, - /* 350 */ 2478, 2336, 1876, 2387, 2386, 2385, 2376, 2335, 2061, 1876, - /* 360 */ 1876, 2334, 2333, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 370 */ 1876, 2196, 2195, 2327, 1876, 1876, 2328, 2326, 2325, 1876, - /* 380 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 390 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 400 */ 1876, 1876, 1876, 2499, 2503, 1876, 1876, 1876, 1876, 1876, - /* 410 */ 1876, 2412, 1876, 1876, 1876, 2307, 1876, 1876, 1876, 1876, - /* 420 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 430 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 440 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 450 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 460 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 2173, 1876, - /* 470 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 480 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 490 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 500 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 510 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 520 */ 1876, 1876, 1876, 1876, 1876, 2188, 1876, 1876, 1876, 1876, - /* 530 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 540 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 550 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1920, 2314, 1876, - /* 560 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 570 */ 1876, 1876, 2317, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 580 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 590 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 600 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 610 */ 1876, 1876, 1876, 2013, 2012, 1876, 1876, 1876, 1876, 1876, - /* 620 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 630 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 2318, - /* 640 */ 1876, 1876, 1876, 1876, 1876, 2309, 1876, 1876, 1876, 1876, - /* 650 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 660 */ 1876, 1876, 2495, 2449, 1876, 1876, 1876, 1876, 1876, 1876, - /* 670 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 680 */ 1876, 1876, 2307, 1876, 2477, 1876, 1876, 2493, 1876, 2497, - /* 690 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 2422, 2418, 1876, - /* 700 */ 1876, 2414, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 710 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 2306, - /* 720 */ 1876, 2373, 1876, 1876, 1876, 2407, 1876, 1876, 2358, 1876, - /* 730 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 2318, 1876, - /* 740 */ 2321, 1876, 1876, 1876, 1876, 1876, 2093, 1876, 1876, 1876, - /* 750 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 760 */ 1876, 1876, 2077, 2075, 2074, 2073, 1876, 2106, 1876, 1876, - /* 770 */ 1876, 2102, 2101, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 780 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1992, - /* 790 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1984, 1876, - /* 800 */ 1983, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 810 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, - /* 820 */ 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1876, 1905, 1876, - /* 830 */ 1876, 1876, 1876, 1876, 1876, + /* 0 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 10 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 20 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 30 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 40 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 50 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 60 */ 1884, 2219, 1884, 1884, 2182, 1884, 1884, 1884, 1884, 1884, + /* 70 */ 1884, 1884, 1884, 1884, 1884, 1884, 2189, 1884, 1884, 1884, + /* 80 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 90 */ 1884, 1884, 1884, 1884, 1884, 1884, 1981, 1884, 1884, 1884, + /* 100 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 110 */ 1884, 1884, 1884, 1979, 2422, 1884, 1884, 1884, 1884, 1884, + /* 120 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 130 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 2434, 1884, + /* 140 */ 1884, 1955, 1955, 1884, 2434, 2434, 2434, 1979, 2394, 2394, + /* 150 */ 1884, 1884, 1981, 2257, 1884, 1884, 1884, 1884, 1884, 1884, + /* 160 */ 1884, 1884, 2104, 1914, 1884, 1884, 1884, 1884, 2128, 1884, + /* 170 */ 1884, 1884, 2245, 1884, 1884, 2463, 2523, 1884, 1884, 2466, + /* 180 */ 1884, 1884, 1884, 1884, 2194, 1884, 2453, 1884, 1884, 1884, + /* 190 */ 1884, 1884, 1884, 1884, 1884, 1884, 2057, 2239, 1884, 1884, + /* 200 */ 1884, 2426, 2440, 2507, 2427, 2424, 2447, 1884, 2457, 1884, + /* 210 */ 2282, 1884, 2271, 1981, 1884, 1981, 2232, 2177, 1884, 2187, + /* 220 */ 1884, 2187, 2184, 1884, 1884, 1884, 2187, 2184, 2184, 2046, + /* 230 */ 2042, 1884, 2040, 1884, 1884, 1884, 1884, 1939, 1884, 1939, + /* 240 */ 1884, 1981, 1981, 1884, 1981, 1884, 1884, 1981, 1884, 1981, + /* 250 */ 1884, 1981, 1981, 1884, 1981, 1884, 1884, 1884, 1884, 1884, + /* 260 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 270 */ 1884, 1884, 1884, 1884, 2269, 2255, 1884, 1979, 1884, 2243, + /* 280 */ 2241, 1884, 1979, 2457, 1884, 1884, 2477, 2472, 2477, 2472, + /* 290 */ 2491, 2487, 2477, 2496, 2493, 2459, 2457, 2526, 2513, 2509, + /* 300 */ 2440, 1884, 1884, 2445, 2443, 1884, 1979, 1979, 2472, 1884, + /* 310 */ 1884, 1884, 1884, 2472, 1884, 1884, 1979, 1884, 1979, 1884, + /* 320 */ 1884, 2073, 1884, 1884, 1979, 1884, 1923, 1884, 2234, 2260, + /* 330 */ 2215, 2215, 2107, 2107, 2107, 1982, 1889, 1884, 1884, 1884, + /* 340 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 2490, + /* 350 */ 2489, 2347, 1884, 2398, 2397, 2396, 2387, 2346, 2069, 1884, + /* 360 */ 1884, 2345, 2344, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 370 */ 1884, 2206, 2205, 2338, 1884, 1884, 2339, 2337, 2336, 1884, + /* 380 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 390 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 400 */ 1884, 1884, 1884, 2510, 2514, 1884, 1884, 1884, 1884, 1884, + /* 410 */ 1884, 2423, 1884, 1884, 1884, 2318, 1884, 1884, 1884, 1884, + /* 420 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 430 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 440 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 450 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 460 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 470 */ 2183, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 480 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 490 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 500 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 510 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 520 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 530 */ 2198, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 540 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 550 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 560 */ 1884, 1884, 1928, 2325, 1884, 1884, 1884, 1884, 1884, 1884, + /* 570 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 2328, 1884, 1884, + /* 580 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 590 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 600 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 610 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 2021, 2020, + /* 620 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 630 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 640 */ 1884, 1884, 1884, 1884, 2329, 1884, 1884, 1884, 1884, 1884, + /* 650 */ 2320, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 660 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 2506, 2460, 1884, + /* 670 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 680 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 2318, 1884, 2488, + /* 690 */ 1884, 1884, 2504, 1884, 2508, 1884, 1884, 1884, 1884, 1884, + /* 700 */ 1884, 1884, 2433, 2429, 1884, 1884, 2425, 1884, 1884, 1884, + /* 710 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 720 */ 1884, 1884, 1884, 1884, 2317, 1884, 2384, 1884, 1884, 1884, + /* 730 */ 2418, 1884, 1884, 2369, 1884, 1884, 1884, 1884, 1884, 1884, + /* 740 */ 1884, 1884, 1884, 2329, 1884, 2332, 1884, 1884, 1884, 1884, + /* 750 */ 1884, 2101, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 760 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 2085, 2083, 2082, + /* 770 */ 2081, 1884, 2114, 1884, 1884, 1884, 2110, 2109, 1884, 1884, + /* 780 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 790 */ 1884, 1884, 1884, 1884, 2000, 1884, 1884, 1884, 1884, 1884, + /* 800 */ 1884, 1884, 1884, 1992, 1884, 1991, 1884, 1884, 1884, 1884, + /* 810 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 820 */ 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, 1884, + /* 830 */ 1884, 1884, 1884, 1913, 1884, 1884, 1884, 1884, 1884, 1884, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1232,7 +1559,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* BWLIMIT => nothing */ 0, /* START => nothing */ 0, /* TIMESTAMP => nothing */ - 296, /* END => ABORT */ + 297, /* END => ABORT */ 0, /* TABLE => nothing */ 0, /* NK_LP => nothing */ 0, /* NK_RP => nothing */ @@ -1300,7 +1627,8 @@ static const YYCODETYPE yyFallback[] = { 0, /* VNODES => nothing */ 0, /* ALIVE => nothing */ 0, /* VIEWS => nothing */ - 296, /* VIEW => ABORT */ + 297, /* VIEW => ABORT */ + 0, /* COMPACTS => nothing */ 0, /* NORMAL => nothing */ 0, /* CHILD => nothing */ 0, /* LIKE => nothing */ @@ -1425,55 +1753,55 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ABORT => nothing */ - 296, /* AFTER => ABORT */ - 296, /* ATTACH => ABORT */ - 296, /* BEFORE => ABORT */ - 296, /* BEGIN => ABORT */ - 296, /* BITAND => ABORT */ - 296, /* BITNOT => ABORT */ - 296, /* BITOR => ABORT */ - 296, /* BLOCKS => ABORT */ - 296, /* CHANGE => ABORT */ - 296, /* COMMA => ABORT */ - 296, /* CONCAT => ABORT */ - 296, /* CONFLICT => ABORT */ - 296, /* COPY => ABORT */ - 296, /* DEFERRED => ABORT */ - 296, /* DELIMITERS => ABORT */ - 296, /* DETACH => ABORT */ - 296, /* DIVIDE => ABORT */ - 296, /* DOT => ABORT */ - 296, /* EACH => ABORT */ - 296, /* FAIL => ABORT */ - 296, /* FILE => ABORT */ - 296, /* FOR => ABORT */ - 296, /* GLOB => ABORT */ - 296, /* ID => ABORT */ - 296, /* IMMEDIATE => ABORT */ - 296, /* IMPORT => ABORT */ - 296, /* INITIALLY => ABORT */ - 296, /* INSTEAD => ABORT */ - 296, /* ISNULL => ABORT */ - 296, /* KEY => ABORT */ - 296, /* MODULES => ABORT */ - 296, /* NK_BITNOT => ABORT */ - 296, /* NK_SEMI => ABORT */ - 296, /* NOTNULL => ABORT */ - 296, /* OF => ABORT */ - 296, /* PLUS => ABORT */ - 296, /* PRIVILEGE => ABORT */ - 296, /* RAISE => ABORT */ - 296, /* RESTRICT => ABORT */ - 296, /* ROW => ABORT */ - 296, /* SEMI => ABORT */ - 296, /* STAR => ABORT */ - 296, /* STATEMENT => ABORT */ - 296, /* STRICT => ABORT */ - 296, /* STRING => ABORT */ - 296, /* TIMES => ABORT */ - 296, /* VALUES => ABORT */ - 296, /* VARIABLE => ABORT */ - 296, /* WAL => ABORT */ + 297, /* AFTER => ABORT */ + 297, /* ATTACH => ABORT */ + 297, /* BEFORE => ABORT */ + 297, /* BEGIN => ABORT */ + 297, /* BITAND => ABORT */ + 297, /* BITNOT => ABORT */ + 297, /* BITOR => ABORT */ + 297, /* BLOCKS => ABORT */ + 297, /* CHANGE => ABORT */ + 297, /* COMMA => ABORT */ + 297, /* CONCAT => ABORT */ + 297, /* CONFLICT => ABORT */ + 297, /* COPY => ABORT */ + 297, /* DEFERRED => ABORT */ + 297, /* DELIMITERS => ABORT */ + 297, /* DETACH => ABORT */ + 297, /* DIVIDE => ABORT */ + 297, /* DOT => ABORT */ + 297, /* EACH => ABORT */ + 297, /* FAIL => ABORT */ + 297, /* FILE => ABORT */ + 297, /* FOR => ABORT */ + 297, /* GLOB => ABORT */ + 297, /* ID => ABORT */ + 297, /* IMMEDIATE => ABORT */ + 297, /* IMPORT => ABORT */ + 297, /* INITIALLY => ABORT */ + 297, /* INSTEAD => ABORT */ + 297, /* ISNULL => ABORT */ + 297, /* KEY => ABORT */ + 297, /* MODULES => ABORT */ + 297, /* NK_BITNOT => ABORT */ + 297, /* NK_SEMI => ABORT */ + 297, /* NOTNULL => ABORT */ + 297, /* OF => ABORT */ + 297, /* PLUS => ABORT */ + 297, /* PRIVILEGE => ABORT */ + 297, /* RAISE => ABORT */ + 297, /* RESTRICT => ABORT */ + 297, /* ROW => ABORT */ + 297, /* SEMI => ABORT */ + 297, /* STAR => ABORT */ + 297, /* STATEMENT => ABORT */ + 297, /* STRICT => ABORT */ + 297, /* STRING => ABORT */ + 297, /* TIMES => ABORT */ + 297, /* VALUES => ABORT */ + 297, /* VARIABLE => ABORT */ + 297, /* WAL => ABORT */ }; #endif /* YYFALLBACK */ @@ -1525,6 +1853,7 @@ struct yyParser { }; typedef struct yyParser yyParser; +#include #ifndef NDEBUG #include static FILE *yyTraceFILE = 0; @@ -1734,340 +2063,341 @@ static const char *const yyTokenName[] = { /* 170 */ "ALIVE", /* 171 */ "VIEWS", /* 172 */ "VIEW", - /* 173 */ "NORMAL", - /* 174 */ "CHILD", - /* 175 */ "LIKE", - /* 176 */ "TBNAME", - /* 177 */ "QTAGS", - /* 178 */ "AS", - /* 179 */ "SYSTEM", - /* 180 */ "INDEX", - /* 181 */ "FUNCTION", - /* 182 */ "INTERVAL", - /* 183 */ "COUNT", - /* 184 */ "LAST_ROW", - /* 185 */ "META", - /* 186 */ "ONLY", - /* 187 */ "TOPIC", - /* 188 */ "CONSUMER", - /* 189 */ "GROUP", - /* 190 */ "DESC", - /* 191 */ "DESCRIBE", - /* 192 */ "RESET", - /* 193 */ "QUERY", - /* 194 */ "CACHE", - /* 195 */ "EXPLAIN", - /* 196 */ "ANALYZE", - /* 197 */ "VERBOSE", - /* 198 */ "NK_BOOL", - /* 199 */ "RATIO", - /* 200 */ "NK_FLOAT", - /* 201 */ "OUTPUTTYPE", - /* 202 */ "AGGREGATE", - /* 203 */ "BUFSIZE", - /* 204 */ "LANGUAGE", - /* 205 */ "REPLACE", - /* 206 */ "STREAM", - /* 207 */ "INTO", - /* 208 */ "PAUSE", - /* 209 */ "RESUME", - /* 210 */ "TRIGGER", - /* 211 */ "AT_ONCE", - /* 212 */ "WINDOW_CLOSE", - /* 213 */ "IGNORE", - /* 214 */ "EXPIRED", - /* 215 */ "FILL_HISTORY", - /* 216 */ "UPDATE", - /* 217 */ "SUBTABLE", - /* 218 */ "UNTREATED", - /* 219 */ "KILL", - /* 220 */ "CONNECTION", - /* 221 */ "TRANSACTION", - /* 222 */ "BALANCE", - /* 223 */ "VGROUP", - /* 224 */ "LEADER", - /* 225 */ "MERGE", - /* 226 */ "REDISTRIBUTE", - /* 227 */ "SPLIT", - /* 228 */ "DELETE", - /* 229 */ "INSERT", - /* 230 */ "NULL", - /* 231 */ "NK_QUESTION", - /* 232 */ "NK_ALIAS", - /* 233 */ "NK_ARROW", - /* 234 */ "ROWTS", - /* 235 */ "QSTART", - /* 236 */ "QEND", - /* 237 */ "QDURATION", - /* 238 */ "WSTART", - /* 239 */ "WEND", - /* 240 */ "WDURATION", - /* 241 */ "IROWTS", - /* 242 */ "ISFILLED", - /* 243 */ "CAST", - /* 244 */ "NOW", - /* 245 */ "TODAY", - /* 246 */ "TIMEZONE", - /* 247 */ "CLIENT_VERSION", - /* 248 */ "SERVER_VERSION", - /* 249 */ "SERVER_STATUS", - /* 250 */ "CURRENT_USER", - /* 251 */ "CASE", - /* 252 */ "WHEN", - /* 253 */ "THEN", - /* 254 */ "ELSE", - /* 255 */ "BETWEEN", - /* 256 */ "IS", - /* 257 */ "NK_LT", - /* 258 */ "NK_GT", - /* 259 */ "NK_LE", - /* 260 */ "NK_GE", - /* 261 */ "NK_NE", - /* 262 */ "MATCH", - /* 263 */ "NMATCH", - /* 264 */ "CONTAINS", - /* 265 */ "IN", - /* 266 */ "JOIN", - /* 267 */ "INNER", - /* 268 */ "SELECT", - /* 269 */ "NK_HINT", - /* 270 */ "DISTINCT", - /* 271 */ "WHERE", - /* 272 */ "PARTITION", - /* 273 */ "BY", - /* 274 */ "SESSION", - /* 275 */ "STATE_WINDOW", - /* 276 */ "EVENT_WINDOW", - /* 277 */ "SLIDING", - /* 278 */ "FILL", - /* 279 */ "VALUE", - /* 280 */ "VALUE_F", - /* 281 */ "NONE", - /* 282 */ "PREV", - /* 283 */ "NULL_F", - /* 284 */ "LINEAR", - /* 285 */ "NEXT", - /* 286 */ "HAVING", - /* 287 */ "RANGE", - /* 288 */ "EVERY", - /* 289 */ "ORDER", - /* 290 */ "SLIMIT", - /* 291 */ "SOFFSET", - /* 292 */ "LIMIT", - /* 293 */ "OFFSET", - /* 294 */ "ASC", - /* 295 */ "NULLS", - /* 296 */ "ABORT", - /* 297 */ "AFTER", - /* 298 */ "ATTACH", - /* 299 */ "BEFORE", - /* 300 */ "BEGIN", - /* 301 */ "BITAND", - /* 302 */ "BITNOT", - /* 303 */ "BITOR", - /* 304 */ "BLOCKS", - /* 305 */ "CHANGE", - /* 306 */ "COMMA", - /* 307 */ "CONCAT", - /* 308 */ "CONFLICT", - /* 309 */ "COPY", - /* 310 */ "DEFERRED", - /* 311 */ "DELIMITERS", - /* 312 */ "DETACH", - /* 313 */ "DIVIDE", - /* 314 */ "DOT", - /* 315 */ "EACH", - /* 316 */ "FAIL", - /* 317 */ "FILE", - /* 318 */ "FOR", - /* 319 */ "GLOB", - /* 320 */ "ID", - /* 321 */ "IMMEDIATE", - /* 322 */ "IMPORT", - /* 323 */ "INITIALLY", - /* 324 */ "INSTEAD", - /* 325 */ "ISNULL", - /* 326 */ "KEY", - /* 327 */ "MODULES", - /* 328 */ "NK_BITNOT", - /* 329 */ "NK_SEMI", - /* 330 */ "NOTNULL", - /* 331 */ "OF", - /* 332 */ "PLUS", - /* 333 */ "PRIVILEGE", - /* 334 */ "RAISE", - /* 335 */ "RESTRICT", - /* 336 */ "ROW", - /* 337 */ "SEMI", - /* 338 */ "STAR", - /* 339 */ "STATEMENT", - /* 340 */ "STRICT", - /* 341 */ "STRING", - /* 342 */ "TIMES", - /* 343 */ "VALUES", - /* 344 */ "VARIABLE", - /* 345 */ "WAL", - /* 346 */ "cmd", - /* 347 */ "account_options", - /* 348 */ "alter_account_options", - /* 349 */ "literal", - /* 350 */ "alter_account_option", - /* 351 */ "ip_range_list", - /* 352 */ "white_list", - /* 353 */ "white_list_opt", - /* 354 */ "user_name", - /* 355 */ "sysinfo_opt", - /* 356 */ "privileges", - /* 357 */ "priv_level", - /* 358 */ "with_opt", - /* 359 */ "priv_type_list", - /* 360 */ "priv_type", - /* 361 */ "db_name", - /* 362 */ "table_name", - /* 363 */ "topic_name", - /* 364 */ "search_condition", - /* 365 */ "dnode_endpoint", - /* 366 */ "force_opt", - /* 367 */ "unsafe_opt", - /* 368 */ "not_exists_opt", - /* 369 */ "db_options", - /* 370 */ "exists_opt", - /* 371 */ "alter_db_options", - /* 372 */ "speed_opt", - /* 373 */ "start_opt", - /* 374 */ "end_opt", - /* 375 */ "integer_list", - /* 376 */ "variable_list", - /* 377 */ "retention_list", - /* 378 */ "signed", - /* 379 */ "alter_db_option", - /* 380 */ "retention", - /* 381 */ "full_table_name", - /* 382 */ "column_def_list", - /* 383 */ "tags_def_opt", - /* 384 */ "table_options", - /* 385 */ "multi_create_clause", - /* 386 */ "tags_def", - /* 387 */ "multi_drop_clause", - /* 388 */ "alter_table_clause", - /* 389 */ "alter_table_options", - /* 390 */ "column_name", - /* 391 */ "type_name", - /* 392 */ "signed_literal", - /* 393 */ "create_subtable_clause", - /* 394 */ "specific_cols_opt", - /* 395 */ "expression_list", - /* 396 */ "drop_table_clause", - /* 397 */ "col_name_list", - /* 398 */ "column_def", - /* 399 */ "duration_list", - /* 400 */ "rollup_func_list", - /* 401 */ "alter_table_option", - /* 402 */ "duration_literal", - /* 403 */ "rollup_func_name", - /* 404 */ "function_name", - /* 405 */ "col_name", - /* 406 */ "db_kind_opt", - /* 407 */ "table_kind_db_name_cond_opt", - /* 408 */ "like_pattern_opt", - /* 409 */ "db_name_cond_opt", - /* 410 */ "table_name_cond", - /* 411 */ "from_db_opt", - /* 412 */ "tag_list_opt", - /* 413 */ "table_kind", - /* 414 */ "tag_item", - /* 415 */ "column_alias", - /* 416 */ "index_options", - /* 417 */ "full_index_name", - /* 418 */ "index_name", - /* 419 */ "func_list", - /* 420 */ "sliding_opt", - /* 421 */ "sma_stream_opt", - /* 422 */ "func", - /* 423 */ "sma_func_name", - /* 424 */ "with_meta", - /* 425 */ "query_or_subquery", - /* 426 */ "where_clause_opt", - /* 427 */ "cgroup_name", - /* 428 */ "analyze_opt", - /* 429 */ "explain_options", - /* 430 */ "insert_query", - /* 431 */ "or_replace_opt", - /* 432 */ "agg_func_opt", - /* 433 */ "bufsize_opt", - /* 434 */ "language_opt", - /* 435 */ "full_view_name", - /* 436 */ "view_name", - /* 437 */ "stream_name", - /* 438 */ "stream_options", - /* 439 */ "col_list_opt", - /* 440 */ "tag_def_or_ref_opt", - /* 441 */ "subtable_opt", - /* 442 */ "ignore_opt", - /* 443 */ "expression", - /* 444 */ "on_vgroup_id", - /* 445 */ "dnode_list", - /* 446 */ "literal_func", - /* 447 */ "literal_list", - /* 448 */ "table_alias", - /* 449 */ "expr_or_subquery", - /* 450 */ "pseudo_column", - /* 451 */ "column_reference", - /* 452 */ "function_expression", - /* 453 */ "case_when_expression", - /* 454 */ "star_func", - /* 455 */ "star_func_para_list", - /* 456 */ "noarg_func", - /* 457 */ "other_para_list", - /* 458 */ "star_func_para", - /* 459 */ "when_then_list", - /* 460 */ "case_when_else_opt", - /* 461 */ "common_expression", - /* 462 */ "when_then_expr", - /* 463 */ "predicate", - /* 464 */ "compare_op", - /* 465 */ "in_op", - /* 466 */ "in_predicate_value", - /* 467 */ "boolean_value_expression", - /* 468 */ "boolean_primary", - /* 469 */ "from_clause_opt", - /* 470 */ "table_reference_list", - /* 471 */ "table_reference", - /* 472 */ "table_primary", - /* 473 */ "joined_table", - /* 474 */ "alias_opt", - /* 475 */ "subquery", - /* 476 */ "parenthesized_joined_table", - /* 477 */ "join_type", - /* 478 */ "query_specification", - /* 479 */ "hint_list", - /* 480 */ "set_quantifier_opt", - /* 481 */ "tag_mode_opt", - /* 482 */ "select_list", - /* 483 */ "partition_by_clause_opt", - /* 484 */ "range_opt", - /* 485 */ "every_opt", - /* 486 */ "fill_opt", - /* 487 */ "twindow_clause_opt", - /* 488 */ "group_by_clause_opt", - /* 489 */ "having_clause_opt", - /* 490 */ "select_item", - /* 491 */ "partition_list", - /* 492 */ "partition_item", - /* 493 */ "interval_sliding_duration_literal", - /* 494 */ "fill_mode", - /* 495 */ "group_by_list", - /* 496 */ "query_expression", - /* 497 */ "query_simple", - /* 498 */ "order_by_clause_opt", - /* 499 */ "slimit_clause_opt", - /* 500 */ "limit_clause_opt", - /* 501 */ "union_query_expression", - /* 502 */ "query_simple_or_subquery", - /* 503 */ "sort_specification_list", - /* 504 */ "sort_specification", - /* 505 */ "ordering_specification_opt", - /* 506 */ "null_ordering_opt", + /* 173 */ "COMPACTS", + /* 174 */ "NORMAL", + /* 175 */ "CHILD", + /* 176 */ "LIKE", + /* 177 */ "TBNAME", + /* 178 */ "QTAGS", + /* 179 */ "AS", + /* 180 */ "SYSTEM", + /* 181 */ "INDEX", + /* 182 */ "FUNCTION", + /* 183 */ "INTERVAL", + /* 184 */ "COUNT", + /* 185 */ "LAST_ROW", + /* 186 */ "META", + /* 187 */ "ONLY", + /* 188 */ "TOPIC", + /* 189 */ "CONSUMER", + /* 190 */ "GROUP", + /* 191 */ "DESC", + /* 192 */ "DESCRIBE", + /* 193 */ "RESET", + /* 194 */ "QUERY", + /* 195 */ "CACHE", + /* 196 */ "EXPLAIN", + /* 197 */ "ANALYZE", + /* 198 */ "VERBOSE", + /* 199 */ "NK_BOOL", + /* 200 */ "RATIO", + /* 201 */ "NK_FLOAT", + /* 202 */ "OUTPUTTYPE", + /* 203 */ "AGGREGATE", + /* 204 */ "BUFSIZE", + /* 205 */ "LANGUAGE", + /* 206 */ "REPLACE", + /* 207 */ "STREAM", + /* 208 */ "INTO", + /* 209 */ "PAUSE", + /* 210 */ "RESUME", + /* 211 */ "TRIGGER", + /* 212 */ "AT_ONCE", + /* 213 */ "WINDOW_CLOSE", + /* 214 */ "IGNORE", + /* 215 */ "EXPIRED", + /* 216 */ "FILL_HISTORY", + /* 217 */ "UPDATE", + /* 218 */ "SUBTABLE", + /* 219 */ "UNTREATED", + /* 220 */ "KILL", + /* 221 */ "CONNECTION", + /* 222 */ "TRANSACTION", + /* 223 */ "BALANCE", + /* 224 */ "VGROUP", + /* 225 */ "LEADER", + /* 226 */ "MERGE", + /* 227 */ "REDISTRIBUTE", + /* 228 */ "SPLIT", + /* 229 */ "DELETE", + /* 230 */ "INSERT", + /* 231 */ "NULL", + /* 232 */ "NK_QUESTION", + /* 233 */ "NK_ALIAS", + /* 234 */ "NK_ARROW", + /* 235 */ "ROWTS", + /* 236 */ "QSTART", + /* 237 */ "QEND", + /* 238 */ "QDURATION", + /* 239 */ "WSTART", + /* 240 */ "WEND", + /* 241 */ "WDURATION", + /* 242 */ "IROWTS", + /* 243 */ "ISFILLED", + /* 244 */ "CAST", + /* 245 */ "NOW", + /* 246 */ "TODAY", + /* 247 */ "TIMEZONE", + /* 248 */ "CLIENT_VERSION", + /* 249 */ "SERVER_VERSION", + /* 250 */ "SERVER_STATUS", + /* 251 */ "CURRENT_USER", + /* 252 */ "CASE", + /* 253 */ "WHEN", + /* 254 */ "THEN", + /* 255 */ "ELSE", + /* 256 */ "BETWEEN", + /* 257 */ "IS", + /* 258 */ "NK_LT", + /* 259 */ "NK_GT", + /* 260 */ "NK_LE", + /* 261 */ "NK_GE", + /* 262 */ "NK_NE", + /* 263 */ "MATCH", + /* 264 */ "NMATCH", + /* 265 */ "CONTAINS", + /* 266 */ "IN", + /* 267 */ "JOIN", + /* 268 */ "INNER", + /* 269 */ "SELECT", + /* 270 */ "NK_HINT", + /* 271 */ "DISTINCT", + /* 272 */ "WHERE", + /* 273 */ "PARTITION", + /* 274 */ "BY", + /* 275 */ "SESSION", + /* 276 */ "STATE_WINDOW", + /* 277 */ "EVENT_WINDOW", + /* 278 */ "SLIDING", + /* 279 */ "FILL", + /* 280 */ "VALUE", + /* 281 */ "VALUE_F", + /* 282 */ "NONE", + /* 283 */ "PREV", + /* 284 */ "NULL_F", + /* 285 */ "LINEAR", + /* 286 */ "NEXT", + /* 287 */ "HAVING", + /* 288 */ "RANGE", + /* 289 */ "EVERY", + /* 290 */ "ORDER", + /* 291 */ "SLIMIT", + /* 292 */ "SOFFSET", + /* 293 */ "LIMIT", + /* 294 */ "OFFSET", + /* 295 */ "ASC", + /* 296 */ "NULLS", + /* 297 */ "ABORT", + /* 298 */ "AFTER", + /* 299 */ "ATTACH", + /* 300 */ "BEFORE", + /* 301 */ "BEGIN", + /* 302 */ "BITAND", + /* 303 */ "BITNOT", + /* 304 */ "BITOR", + /* 305 */ "BLOCKS", + /* 306 */ "CHANGE", + /* 307 */ "COMMA", + /* 308 */ "CONCAT", + /* 309 */ "CONFLICT", + /* 310 */ "COPY", + /* 311 */ "DEFERRED", + /* 312 */ "DELIMITERS", + /* 313 */ "DETACH", + /* 314 */ "DIVIDE", + /* 315 */ "DOT", + /* 316 */ "EACH", + /* 317 */ "FAIL", + /* 318 */ "FILE", + /* 319 */ "FOR", + /* 320 */ "GLOB", + /* 321 */ "ID", + /* 322 */ "IMMEDIATE", + /* 323 */ "IMPORT", + /* 324 */ "INITIALLY", + /* 325 */ "INSTEAD", + /* 326 */ "ISNULL", + /* 327 */ "KEY", + /* 328 */ "MODULES", + /* 329 */ "NK_BITNOT", + /* 330 */ "NK_SEMI", + /* 331 */ "NOTNULL", + /* 332 */ "OF", + /* 333 */ "PLUS", + /* 334 */ "PRIVILEGE", + /* 335 */ "RAISE", + /* 336 */ "RESTRICT", + /* 337 */ "ROW", + /* 338 */ "SEMI", + /* 339 */ "STAR", + /* 340 */ "STATEMENT", + /* 341 */ "STRICT", + /* 342 */ "STRING", + /* 343 */ "TIMES", + /* 344 */ "VALUES", + /* 345 */ "VARIABLE", + /* 346 */ "WAL", + /* 347 */ "cmd", + /* 348 */ "account_options", + /* 349 */ "alter_account_options", + /* 350 */ "literal", + /* 351 */ "alter_account_option", + /* 352 */ "ip_range_list", + /* 353 */ "white_list", + /* 354 */ "white_list_opt", + /* 355 */ "user_name", + /* 356 */ "sysinfo_opt", + /* 357 */ "privileges", + /* 358 */ "priv_level", + /* 359 */ "with_opt", + /* 360 */ "priv_type_list", + /* 361 */ "priv_type", + /* 362 */ "db_name", + /* 363 */ "table_name", + /* 364 */ "topic_name", + /* 365 */ "search_condition", + /* 366 */ "dnode_endpoint", + /* 367 */ "force_opt", + /* 368 */ "unsafe_opt", + /* 369 */ "not_exists_opt", + /* 370 */ "db_options", + /* 371 */ "exists_opt", + /* 372 */ "alter_db_options", + /* 373 */ "speed_opt", + /* 374 */ "start_opt", + /* 375 */ "end_opt", + /* 376 */ "integer_list", + /* 377 */ "variable_list", + /* 378 */ "retention_list", + /* 379 */ "signed", + /* 380 */ "alter_db_option", + /* 381 */ "retention", + /* 382 */ "full_table_name", + /* 383 */ "column_def_list", + /* 384 */ "tags_def_opt", + /* 385 */ "table_options", + /* 386 */ "multi_create_clause", + /* 387 */ "tags_def", + /* 388 */ "multi_drop_clause", + /* 389 */ "alter_table_clause", + /* 390 */ "alter_table_options", + /* 391 */ "column_name", + /* 392 */ "type_name", + /* 393 */ "signed_literal", + /* 394 */ "create_subtable_clause", + /* 395 */ "specific_cols_opt", + /* 396 */ "expression_list", + /* 397 */ "drop_table_clause", + /* 398 */ "col_name_list", + /* 399 */ "column_def", + /* 400 */ "duration_list", + /* 401 */ "rollup_func_list", + /* 402 */ "alter_table_option", + /* 403 */ "duration_literal", + /* 404 */ "rollup_func_name", + /* 405 */ "function_name", + /* 406 */ "col_name", + /* 407 */ "db_kind_opt", + /* 408 */ "table_kind_db_name_cond_opt", + /* 409 */ "like_pattern_opt", + /* 410 */ "db_name_cond_opt", + /* 411 */ "table_name_cond", + /* 412 */ "from_db_opt", + /* 413 */ "tag_list_opt", + /* 414 */ "table_kind", + /* 415 */ "tag_item", + /* 416 */ "column_alias", + /* 417 */ "index_options", + /* 418 */ "full_index_name", + /* 419 */ "index_name", + /* 420 */ "func_list", + /* 421 */ "sliding_opt", + /* 422 */ "sma_stream_opt", + /* 423 */ "func", + /* 424 */ "sma_func_name", + /* 425 */ "with_meta", + /* 426 */ "query_or_subquery", + /* 427 */ "where_clause_opt", + /* 428 */ "cgroup_name", + /* 429 */ "analyze_opt", + /* 430 */ "explain_options", + /* 431 */ "insert_query", + /* 432 */ "or_replace_opt", + /* 433 */ "agg_func_opt", + /* 434 */ "bufsize_opt", + /* 435 */ "language_opt", + /* 436 */ "full_view_name", + /* 437 */ "view_name", + /* 438 */ "stream_name", + /* 439 */ "stream_options", + /* 440 */ "col_list_opt", + /* 441 */ "tag_def_or_ref_opt", + /* 442 */ "subtable_opt", + /* 443 */ "ignore_opt", + /* 444 */ "expression", + /* 445 */ "on_vgroup_id", + /* 446 */ "dnode_list", + /* 447 */ "literal_func", + /* 448 */ "literal_list", + /* 449 */ "table_alias", + /* 450 */ "expr_or_subquery", + /* 451 */ "pseudo_column", + /* 452 */ "column_reference", + /* 453 */ "function_expression", + /* 454 */ "case_when_expression", + /* 455 */ "star_func", + /* 456 */ "star_func_para_list", + /* 457 */ "noarg_func", + /* 458 */ "other_para_list", + /* 459 */ "star_func_para", + /* 460 */ "when_then_list", + /* 461 */ "case_when_else_opt", + /* 462 */ "common_expression", + /* 463 */ "when_then_expr", + /* 464 */ "predicate", + /* 465 */ "compare_op", + /* 466 */ "in_op", + /* 467 */ "in_predicate_value", + /* 468 */ "boolean_value_expression", + /* 469 */ "boolean_primary", + /* 470 */ "from_clause_opt", + /* 471 */ "table_reference_list", + /* 472 */ "table_reference", + /* 473 */ "table_primary", + /* 474 */ "joined_table", + /* 475 */ "alias_opt", + /* 476 */ "subquery", + /* 477 */ "parenthesized_joined_table", + /* 478 */ "join_type", + /* 479 */ "query_specification", + /* 480 */ "hint_list", + /* 481 */ "set_quantifier_opt", + /* 482 */ "tag_mode_opt", + /* 483 */ "select_list", + /* 484 */ "partition_by_clause_opt", + /* 485 */ "range_opt", + /* 486 */ "every_opt", + /* 487 */ "fill_opt", + /* 488 */ "twindow_clause_opt", + /* 489 */ "group_by_clause_opt", + /* 490 */ "having_clause_opt", + /* 491 */ "select_item", + /* 492 */ "partition_list", + /* 493 */ "partition_item", + /* 494 */ "interval_sliding_duration_literal", + /* 495 */ "fill_mode", + /* 496 */ "group_by_list", + /* 497 */ "query_expression", + /* 498 */ "query_simple", + /* 499 */ "order_by_clause_opt", + /* 500 */ "slimit_clause_opt", + /* 501 */ "limit_clause_opt", + /* 502 */ "union_query_expression", + /* 503 */ "query_simple_or_subquery", + /* 504 */ "sort_specification_list", + /* 505 */ "sort_specification", + /* 506 */ "ordering_specification_opt", + /* 507 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -2362,358 +2692,361 @@ static const char *const yyRuleName[] = { /* 284 */ "cmd ::= SHOW CLUSTER ALIVE", /* 285 */ "cmd ::= SHOW db_name_cond_opt VIEWS", /* 286 */ "cmd ::= SHOW CREATE VIEW full_table_name", - /* 287 */ "table_kind_db_name_cond_opt ::=", - /* 288 */ "table_kind_db_name_cond_opt ::= table_kind", - /* 289 */ "table_kind_db_name_cond_opt ::= db_name NK_DOT", - /* 290 */ "table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT", - /* 291 */ "table_kind ::= NORMAL", - /* 292 */ "table_kind ::= CHILD", - /* 293 */ "db_name_cond_opt ::=", - /* 294 */ "db_name_cond_opt ::= db_name NK_DOT", - /* 295 */ "like_pattern_opt ::=", - /* 296 */ "like_pattern_opt ::= LIKE NK_STRING", - /* 297 */ "table_name_cond ::= table_name", - /* 298 */ "from_db_opt ::=", - /* 299 */ "from_db_opt ::= FROM db_name", - /* 300 */ "tag_list_opt ::=", - /* 301 */ "tag_list_opt ::= tag_item", - /* 302 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", - /* 303 */ "tag_item ::= TBNAME", - /* 304 */ "tag_item ::= QTAGS", - /* 305 */ "tag_item ::= column_name", - /* 306 */ "tag_item ::= column_name column_alias", - /* 307 */ "tag_item ::= column_name AS column_alias", - /* 308 */ "db_kind_opt ::=", - /* 309 */ "db_kind_opt ::= USER", - /* 310 */ "db_kind_opt ::= SYSTEM", - /* 311 */ "cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options", - /* 312 */ "cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP", - /* 313 */ "cmd ::= DROP INDEX exists_opt full_index_name", - /* 314 */ "full_index_name ::= index_name", - /* 315 */ "full_index_name ::= db_name NK_DOT index_name", - /* 316 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", - /* 317 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt", - /* 318 */ "func_list ::= func", - /* 319 */ "func_list ::= func_list NK_COMMA func", - /* 320 */ "func ::= sma_func_name NK_LP expression_list NK_RP", - /* 321 */ "sma_func_name ::= function_name", - /* 322 */ "sma_func_name ::= COUNT", - /* 323 */ "sma_func_name ::= FIRST", - /* 324 */ "sma_func_name ::= LAST", - /* 325 */ "sma_func_name ::= LAST_ROW", - /* 326 */ "sma_stream_opt ::=", - /* 327 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", - /* 328 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", - /* 329 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", - /* 330 */ "with_meta ::= AS", - /* 331 */ "with_meta ::= WITH META AS", - /* 332 */ "with_meta ::= ONLY META AS", - /* 333 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", - /* 334 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name", - /* 335 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt", - /* 336 */ "cmd ::= DROP TOPIC exists_opt topic_name", - /* 337 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", - /* 338 */ "cmd ::= DESC full_table_name", - /* 339 */ "cmd ::= DESCRIBE full_table_name", - /* 340 */ "cmd ::= RESET QUERY CACHE", - /* 341 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", - /* 342 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query", - /* 343 */ "analyze_opt ::=", - /* 344 */ "analyze_opt ::= ANALYZE", - /* 345 */ "explain_options ::=", - /* 346 */ "explain_options ::= explain_options VERBOSE NK_BOOL", - /* 347 */ "explain_options ::= explain_options RATIO NK_FLOAT", - /* 348 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt", - /* 349 */ "cmd ::= DROP FUNCTION exists_opt function_name", - /* 350 */ "agg_func_opt ::=", - /* 351 */ "agg_func_opt ::= AGGREGATE", - /* 352 */ "bufsize_opt ::=", - /* 353 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 354 */ "language_opt ::=", - /* 355 */ "language_opt ::= LANGUAGE NK_STRING", - /* 356 */ "or_replace_opt ::=", - /* 357 */ "or_replace_opt ::= OR REPLACE", - /* 358 */ "cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery", - /* 359 */ "cmd ::= DROP VIEW exists_opt full_view_name", - /* 360 */ "full_view_name ::= view_name", - /* 361 */ "full_view_name ::= db_name NK_DOT view_name", - /* 362 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery", - /* 363 */ "cmd ::= DROP STREAM exists_opt stream_name", - /* 364 */ "cmd ::= PAUSE STREAM exists_opt stream_name", - /* 365 */ "cmd ::= RESUME STREAM exists_opt ignore_opt stream_name", - /* 366 */ "col_list_opt ::=", - /* 367 */ "col_list_opt ::= NK_LP col_name_list NK_RP", - /* 368 */ "tag_def_or_ref_opt ::=", - /* 369 */ "tag_def_or_ref_opt ::= tags_def", - /* 370 */ "tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP", - /* 371 */ "stream_options ::=", - /* 372 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 373 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 374 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 375 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 376 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", - /* 377 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", - /* 378 */ "stream_options ::= stream_options DELETE_MARK duration_literal", - /* 379 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER", - /* 380 */ "subtable_opt ::=", - /* 381 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", - /* 382 */ "ignore_opt ::=", - /* 383 */ "ignore_opt ::= IGNORE UNTREATED", - /* 384 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 385 */ "cmd ::= KILL QUERY NK_STRING", - /* 386 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 387 */ "cmd ::= BALANCE VGROUP", - /* 388 */ "cmd ::= BALANCE VGROUP LEADER on_vgroup_id", - /* 389 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 390 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 391 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 392 */ "on_vgroup_id ::=", - /* 393 */ "on_vgroup_id ::= ON NK_INTEGER", - /* 394 */ "dnode_list ::= DNODE NK_INTEGER", - /* 395 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 396 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 397 */ "cmd ::= query_or_subquery", - /* 398 */ "cmd ::= insert_query", - /* 399 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", - /* 400 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", - /* 401 */ "literal ::= NK_INTEGER", - /* 402 */ "literal ::= NK_FLOAT", - /* 403 */ "literal ::= NK_STRING", - /* 404 */ "literal ::= NK_BOOL", - /* 405 */ "literal ::= TIMESTAMP NK_STRING", - /* 406 */ "literal ::= duration_literal", - /* 407 */ "literal ::= NULL", - /* 408 */ "literal ::= NK_QUESTION", - /* 409 */ "duration_literal ::= NK_VARIABLE", - /* 410 */ "signed ::= NK_INTEGER", - /* 411 */ "signed ::= NK_PLUS NK_INTEGER", - /* 412 */ "signed ::= NK_MINUS NK_INTEGER", - /* 413 */ "signed ::= NK_FLOAT", - /* 414 */ "signed ::= NK_PLUS NK_FLOAT", - /* 415 */ "signed ::= NK_MINUS NK_FLOAT", - /* 416 */ "signed_literal ::= signed", - /* 417 */ "signed_literal ::= NK_STRING", - /* 418 */ "signed_literal ::= NK_BOOL", - /* 419 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 420 */ "signed_literal ::= duration_literal", - /* 421 */ "signed_literal ::= NULL", - /* 422 */ "signed_literal ::= literal_func", - /* 423 */ "signed_literal ::= NK_QUESTION", - /* 424 */ "literal_list ::= signed_literal", - /* 425 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 426 */ "db_name ::= NK_ID", - /* 427 */ "table_name ::= NK_ID", - /* 428 */ "column_name ::= NK_ID", - /* 429 */ "function_name ::= NK_ID", - /* 430 */ "view_name ::= NK_ID", - /* 431 */ "table_alias ::= NK_ID", - /* 432 */ "column_alias ::= NK_ID", - /* 433 */ "column_alias ::= NK_ALIAS", - /* 434 */ "user_name ::= NK_ID", - /* 435 */ "topic_name ::= NK_ID", - /* 436 */ "stream_name ::= NK_ID", - /* 437 */ "cgroup_name ::= NK_ID", - /* 438 */ "index_name ::= NK_ID", - /* 439 */ "expr_or_subquery ::= expression", - /* 440 */ "expression ::= literal", - /* 441 */ "expression ::= pseudo_column", - /* 442 */ "expression ::= column_reference", - /* 443 */ "expression ::= function_expression", - /* 444 */ "expression ::= case_when_expression", - /* 445 */ "expression ::= NK_LP expression NK_RP", - /* 446 */ "expression ::= NK_PLUS expr_or_subquery", - /* 447 */ "expression ::= NK_MINUS expr_or_subquery", - /* 448 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 449 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 450 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 451 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 452 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 453 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 454 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 455 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 456 */ "expression_list ::= expr_or_subquery", - /* 457 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 458 */ "column_reference ::= column_name", - /* 459 */ "column_reference ::= table_name NK_DOT column_name", - /* 460 */ "column_reference ::= NK_ALIAS", - /* 461 */ "column_reference ::= table_name NK_DOT NK_ALIAS", - /* 462 */ "pseudo_column ::= ROWTS", - /* 463 */ "pseudo_column ::= TBNAME", - /* 464 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 465 */ "pseudo_column ::= QSTART", - /* 466 */ "pseudo_column ::= QEND", - /* 467 */ "pseudo_column ::= QDURATION", - /* 468 */ "pseudo_column ::= WSTART", - /* 469 */ "pseudo_column ::= WEND", - /* 470 */ "pseudo_column ::= WDURATION", - /* 471 */ "pseudo_column ::= IROWTS", - /* 472 */ "pseudo_column ::= ISFILLED", - /* 473 */ "pseudo_column ::= QTAGS", - /* 474 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 475 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 476 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 477 */ "function_expression ::= literal_func", - /* 478 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 479 */ "literal_func ::= NOW", - /* 480 */ "noarg_func ::= NOW", - /* 481 */ "noarg_func ::= TODAY", - /* 482 */ "noarg_func ::= TIMEZONE", - /* 483 */ "noarg_func ::= DATABASE", - /* 484 */ "noarg_func ::= CLIENT_VERSION", - /* 485 */ "noarg_func ::= SERVER_VERSION", - /* 486 */ "noarg_func ::= SERVER_STATUS", - /* 487 */ "noarg_func ::= CURRENT_USER", - /* 488 */ "noarg_func ::= USER", - /* 489 */ "star_func ::= COUNT", - /* 490 */ "star_func ::= FIRST", - /* 491 */ "star_func ::= LAST", - /* 492 */ "star_func ::= LAST_ROW", - /* 493 */ "star_func_para_list ::= NK_STAR", - /* 494 */ "star_func_para_list ::= other_para_list", - /* 495 */ "other_para_list ::= star_func_para", - /* 496 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 497 */ "star_func_para ::= expr_or_subquery", - /* 498 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 499 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 500 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 501 */ "when_then_list ::= when_then_expr", - /* 502 */ "when_then_list ::= when_then_list when_then_expr", - /* 503 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 504 */ "case_when_else_opt ::=", - /* 505 */ "case_when_else_opt ::= ELSE common_expression", - /* 506 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 507 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 508 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 509 */ "predicate ::= expr_or_subquery IS NULL", - /* 510 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 511 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 512 */ "compare_op ::= NK_LT", - /* 513 */ "compare_op ::= NK_GT", - /* 514 */ "compare_op ::= NK_LE", - /* 515 */ "compare_op ::= NK_GE", - /* 516 */ "compare_op ::= NK_NE", - /* 517 */ "compare_op ::= NK_EQ", - /* 518 */ "compare_op ::= LIKE", - /* 519 */ "compare_op ::= NOT LIKE", - /* 520 */ "compare_op ::= MATCH", - /* 521 */ "compare_op ::= NMATCH", - /* 522 */ "compare_op ::= CONTAINS", - /* 523 */ "in_op ::= IN", - /* 524 */ "in_op ::= NOT IN", - /* 525 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 526 */ "boolean_value_expression ::= boolean_primary", - /* 527 */ "boolean_value_expression ::= NOT boolean_primary", - /* 528 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 529 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 530 */ "boolean_primary ::= predicate", - /* 531 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 532 */ "common_expression ::= expr_or_subquery", - /* 533 */ "common_expression ::= boolean_value_expression", - /* 534 */ "from_clause_opt ::=", - /* 535 */ "from_clause_opt ::= FROM table_reference_list", - /* 536 */ "table_reference_list ::= table_reference", - /* 537 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 538 */ "table_reference ::= table_primary", - /* 539 */ "table_reference ::= joined_table", - /* 540 */ "table_primary ::= table_name alias_opt", - /* 541 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 542 */ "table_primary ::= subquery alias_opt", - /* 543 */ "table_primary ::= parenthesized_joined_table", - /* 544 */ "alias_opt ::=", - /* 545 */ "alias_opt ::= table_alias", - /* 546 */ "alias_opt ::= AS table_alias", - /* 547 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 548 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 549 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 550 */ "join_type ::=", - /* 551 */ "join_type ::= INNER", - /* 552 */ "query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", - /* 553 */ "hint_list ::=", - /* 554 */ "hint_list ::= NK_HINT", - /* 555 */ "tag_mode_opt ::=", - /* 556 */ "tag_mode_opt ::= TAGS", - /* 557 */ "set_quantifier_opt ::=", - /* 558 */ "set_quantifier_opt ::= DISTINCT", - /* 559 */ "set_quantifier_opt ::= ALL", - /* 560 */ "select_list ::= select_item", - /* 561 */ "select_list ::= select_list NK_COMMA select_item", - /* 562 */ "select_item ::= NK_STAR", - /* 563 */ "select_item ::= common_expression", - /* 564 */ "select_item ::= common_expression column_alias", - /* 565 */ "select_item ::= common_expression AS column_alias", - /* 566 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 567 */ "where_clause_opt ::=", - /* 568 */ "where_clause_opt ::= WHERE search_condition", - /* 569 */ "partition_by_clause_opt ::=", - /* 570 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 571 */ "partition_list ::= partition_item", - /* 572 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 573 */ "partition_item ::= expr_or_subquery", - /* 574 */ "partition_item ::= expr_or_subquery column_alias", - /* 575 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 576 */ "twindow_clause_opt ::=", - /* 577 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP", - /* 578 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 579 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt", - /* 580 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt", - /* 581 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", - /* 582 */ "sliding_opt ::=", - /* 583 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP", - /* 584 */ "interval_sliding_duration_literal ::= NK_VARIABLE", - /* 585 */ "interval_sliding_duration_literal ::= NK_STRING", - /* 586 */ "interval_sliding_duration_literal ::= NK_INTEGER", - /* 587 */ "fill_opt ::=", - /* 588 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 589 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", - /* 590 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", - /* 591 */ "fill_mode ::= NONE", - /* 592 */ "fill_mode ::= PREV", - /* 593 */ "fill_mode ::= NULL", - /* 594 */ "fill_mode ::= NULL_F", - /* 595 */ "fill_mode ::= LINEAR", - /* 596 */ "fill_mode ::= NEXT", - /* 597 */ "group_by_clause_opt ::=", - /* 598 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 599 */ "group_by_list ::= expr_or_subquery", - /* 600 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 601 */ "having_clause_opt ::=", - /* 602 */ "having_clause_opt ::= HAVING search_condition", - /* 603 */ "range_opt ::=", - /* 604 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 605 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", - /* 606 */ "every_opt ::=", - /* 607 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 608 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 609 */ "query_simple ::= query_specification", - /* 610 */ "query_simple ::= union_query_expression", - /* 611 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 612 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 613 */ "query_simple_or_subquery ::= query_simple", - /* 614 */ "query_simple_or_subquery ::= subquery", - /* 615 */ "query_or_subquery ::= query_expression", - /* 616 */ "query_or_subquery ::= subquery", - /* 617 */ "order_by_clause_opt ::=", - /* 618 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 619 */ "slimit_clause_opt ::=", - /* 620 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 621 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 622 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 623 */ "limit_clause_opt ::=", - /* 624 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 625 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 626 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 627 */ "subquery ::= NK_LP query_expression NK_RP", - /* 628 */ "subquery ::= NK_LP subquery NK_RP", - /* 629 */ "search_condition ::= common_expression", - /* 630 */ "sort_specification_list ::= sort_specification", - /* 631 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 632 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 633 */ "ordering_specification_opt ::=", - /* 634 */ "ordering_specification_opt ::= ASC", - /* 635 */ "ordering_specification_opt ::= DESC", - /* 636 */ "null_ordering_opt ::=", - /* 637 */ "null_ordering_opt ::= NULLS FIRST", - /* 638 */ "null_ordering_opt ::= NULLS LAST", + /* 287 */ "cmd ::= SHOW COMPACTS", + /* 288 */ "cmd ::= SHOW COMPACT NK_INTEGER", + /* 289 */ "table_kind_db_name_cond_opt ::=", + /* 290 */ "table_kind_db_name_cond_opt ::= table_kind", + /* 291 */ "table_kind_db_name_cond_opt ::= db_name NK_DOT", + /* 292 */ "table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT", + /* 293 */ "table_kind ::= NORMAL", + /* 294 */ "table_kind ::= CHILD", + /* 295 */ "db_name_cond_opt ::=", + /* 296 */ "db_name_cond_opt ::= db_name NK_DOT", + /* 297 */ "like_pattern_opt ::=", + /* 298 */ "like_pattern_opt ::= LIKE NK_STRING", + /* 299 */ "table_name_cond ::= table_name", + /* 300 */ "from_db_opt ::=", + /* 301 */ "from_db_opt ::= FROM db_name", + /* 302 */ "tag_list_opt ::=", + /* 303 */ "tag_list_opt ::= tag_item", + /* 304 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", + /* 305 */ "tag_item ::= TBNAME", + /* 306 */ "tag_item ::= QTAGS", + /* 307 */ "tag_item ::= column_name", + /* 308 */ "tag_item ::= column_name column_alias", + /* 309 */ "tag_item ::= column_name AS column_alias", + /* 310 */ "db_kind_opt ::=", + /* 311 */ "db_kind_opt ::= USER", + /* 312 */ "db_kind_opt ::= SYSTEM", + /* 313 */ "cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options", + /* 314 */ "cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP", + /* 315 */ "cmd ::= DROP INDEX exists_opt full_index_name", + /* 316 */ "full_index_name ::= index_name", + /* 317 */ "full_index_name ::= db_name NK_DOT index_name", + /* 318 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", + /* 319 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt", + /* 320 */ "func_list ::= func", + /* 321 */ "func_list ::= func_list NK_COMMA func", + /* 322 */ "func ::= sma_func_name NK_LP expression_list NK_RP", + /* 323 */ "sma_func_name ::= function_name", + /* 324 */ "sma_func_name ::= COUNT", + /* 325 */ "sma_func_name ::= FIRST", + /* 326 */ "sma_func_name ::= LAST", + /* 327 */ "sma_func_name ::= LAST_ROW", + /* 328 */ "sma_stream_opt ::=", + /* 329 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", + /* 330 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", + /* 331 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", + /* 332 */ "with_meta ::= AS", + /* 333 */ "with_meta ::= WITH META AS", + /* 334 */ "with_meta ::= ONLY META AS", + /* 335 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", + /* 336 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name", + /* 337 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt", + /* 338 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 339 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", + /* 340 */ "cmd ::= DESC full_table_name", + /* 341 */ "cmd ::= DESCRIBE full_table_name", + /* 342 */ "cmd ::= RESET QUERY CACHE", + /* 343 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", + /* 344 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query", + /* 345 */ "analyze_opt ::=", + /* 346 */ "analyze_opt ::= ANALYZE", + /* 347 */ "explain_options ::=", + /* 348 */ "explain_options ::= explain_options VERBOSE NK_BOOL", + /* 349 */ "explain_options ::= explain_options RATIO NK_FLOAT", + /* 350 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt", + /* 351 */ "cmd ::= DROP FUNCTION exists_opt function_name", + /* 352 */ "agg_func_opt ::=", + /* 353 */ "agg_func_opt ::= AGGREGATE", + /* 354 */ "bufsize_opt ::=", + /* 355 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", + /* 356 */ "language_opt ::=", + /* 357 */ "language_opt ::= LANGUAGE NK_STRING", + /* 358 */ "or_replace_opt ::=", + /* 359 */ "or_replace_opt ::= OR REPLACE", + /* 360 */ "cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery", + /* 361 */ "cmd ::= DROP VIEW exists_opt full_view_name", + /* 362 */ "full_view_name ::= view_name", + /* 363 */ "full_view_name ::= db_name NK_DOT view_name", + /* 364 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery", + /* 365 */ "cmd ::= DROP STREAM exists_opt stream_name", + /* 366 */ "cmd ::= PAUSE STREAM exists_opt stream_name", + /* 367 */ "cmd ::= RESUME STREAM exists_opt ignore_opt stream_name", + /* 368 */ "col_list_opt ::=", + /* 369 */ "col_list_opt ::= NK_LP col_name_list NK_RP", + /* 370 */ "tag_def_or_ref_opt ::=", + /* 371 */ "tag_def_or_ref_opt ::= tags_def", + /* 372 */ "tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP", + /* 373 */ "stream_options ::=", + /* 374 */ "stream_options ::= stream_options TRIGGER AT_ONCE", + /* 375 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", + /* 376 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 377 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 378 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", + /* 379 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", + /* 380 */ "stream_options ::= stream_options DELETE_MARK duration_literal", + /* 381 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER", + /* 382 */ "subtable_opt ::=", + /* 383 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", + /* 384 */ "ignore_opt ::=", + /* 385 */ "ignore_opt ::= IGNORE UNTREATED", + /* 386 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 387 */ "cmd ::= KILL QUERY NK_STRING", + /* 388 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 389 */ "cmd ::= KILL COMPACT NK_INTEGER", + /* 390 */ "cmd ::= BALANCE VGROUP", + /* 391 */ "cmd ::= BALANCE VGROUP LEADER on_vgroup_id", + /* 392 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 393 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 394 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 395 */ "on_vgroup_id ::=", + /* 396 */ "on_vgroup_id ::= ON NK_INTEGER", + /* 397 */ "dnode_list ::= DNODE NK_INTEGER", + /* 398 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 399 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 400 */ "cmd ::= query_or_subquery", + /* 401 */ "cmd ::= insert_query", + /* 402 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", + /* 403 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", + /* 404 */ "literal ::= NK_INTEGER", + /* 405 */ "literal ::= NK_FLOAT", + /* 406 */ "literal ::= NK_STRING", + /* 407 */ "literal ::= NK_BOOL", + /* 408 */ "literal ::= TIMESTAMP NK_STRING", + /* 409 */ "literal ::= duration_literal", + /* 410 */ "literal ::= NULL", + /* 411 */ "literal ::= NK_QUESTION", + /* 412 */ "duration_literal ::= NK_VARIABLE", + /* 413 */ "signed ::= NK_INTEGER", + /* 414 */ "signed ::= NK_PLUS NK_INTEGER", + /* 415 */ "signed ::= NK_MINUS NK_INTEGER", + /* 416 */ "signed ::= NK_FLOAT", + /* 417 */ "signed ::= NK_PLUS NK_FLOAT", + /* 418 */ "signed ::= NK_MINUS NK_FLOAT", + /* 419 */ "signed_literal ::= signed", + /* 420 */ "signed_literal ::= NK_STRING", + /* 421 */ "signed_literal ::= NK_BOOL", + /* 422 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 423 */ "signed_literal ::= duration_literal", + /* 424 */ "signed_literal ::= NULL", + /* 425 */ "signed_literal ::= literal_func", + /* 426 */ "signed_literal ::= NK_QUESTION", + /* 427 */ "literal_list ::= signed_literal", + /* 428 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 429 */ "db_name ::= NK_ID", + /* 430 */ "table_name ::= NK_ID", + /* 431 */ "column_name ::= NK_ID", + /* 432 */ "function_name ::= NK_ID", + /* 433 */ "view_name ::= NK_ID", + /* 434 */ "table_alias ::= NK_ID", + /* 435 */ "column_alias ::= NK_ID", + /* 436 */ "column_alias ::= NK_ALIAS", + /* 437 */ "user_name ::= NK_ID", + /* 438 */ "topic_name ::= NK_ID", + /* 439 */ "stream_name ::= NK_ID", + /* 440 */ "cgroup_name ::= NK_ID", + /* 441 */ "index_name ::= NK_ID", + /* 442 */ "expr_or_subquery ::= expression", + /* 443 */ "expression ::= literal", + /* 444 */ "expression ::= pseudo_column", + /* 445 */ "expression ::= column_reference", + /* 446 */ "expression ::= function_expression", + /* 447 */ "expression ::= case_when_expression", + /* 448 */ "expression ::= NK_LP expression NK_RP", + /* 449 */ "expression ::= NK_PLUS expr_or_subquery", + /* 450 */ "expression ::= NK_MINUS expr_or_subquery", + /* 451 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 452 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 453 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 454 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 455 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 456 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 457 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 458 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 459 */ "expression_list ::= expr_or_subquery", + /* 460 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 461 */ "column_reference ::= column_name", + /* 462 */ "column_reference ::= table_name NK_DOT column_name", + /* 463 */ "column_reference ::= NK_ALIAS", + /* 464 */ "column_reference ::= table_name NK_DOT NK_ALIAS", + /* 465 */ "pseudo_column ::= ROWTS", + /* 466 */ "pseudo_column ::= TBNAME", + /* 467 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 468 */ "pseudo_column ::= QSTART", + /* 469 */ "pseudo_column ::= QEND", + /* 470 */ "pseudo_column ::= QDURATION", + /* 471 */ "pseudo_column ::= WSTART", + /* 472 */ "pseudo_column ::= WEND", + /* 473 */ "pseudo_column ::= WDURATION", + /* 474 */ "pseudo_column ::= IROWTS", + /* 475 */ "pseudo_column ::= ISFILLED", + /* 476 */ "pseudo_column ::= QTAGS", + /* 477 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 478 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 479 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 480 */ "function_expression ::= literal_func", + /* 481 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 482 */ "literal_func ::= NOW", + /* 483 */ "noarg_func ::= NOW", + /* 484 */ "noarg_func ::= TODAY", + /* 485 */ "noarg_func ::= TIMEZONE", + /* 486 */ "noarg_func ::= DATABASE", + /* 487 */ "noarg_func ::= CLIENT_VERSION", + /* 488 */ "noarg_func ::= SERVER_VERSION", + /* 489 */ "noarg_func ::= SERVER_STATUS", + /* 490 */ "noarg_func ::= CURRENT_USER", + /* 491 */ "noarg_func ::= USER", + /* 492 */ "star_func ::= COUNT", + /* 493 */ "star_func ::= FIRST", + /* 494 */ "star_func ::= LAST", + /* 495 */ "star_func ::= LAST_ROW", + /* 496 */ "star_func_para_list ::= NK_STAR", + /* 497 */ "star_func_para_list ::= other_para_list", + /* 498 */ "other_para_list ::= star_func_para", + /* 499 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 500 */ "star_func_para ::= expr_or_subquery", + /* 501 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 502 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 503 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 504 */ "when_then_list ::= when_then_expr", + /* 505 */ "when_then_list ::= when_then_list when_then_expr", + /* 506 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 507 */ "case_when_else_opt ::=", + /* 508 */ "case_when_else_opt ::= ELSE common_expression", + /* 509 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 510 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 511 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 512 */ "predicate ::= expr_or_subquery IS NULL", + /* 513 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 514 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 515 */ "compare_op ::= NK_LT", + /* 516 */ "compare_op ::= NK_GT", + /* 517 */ "compare_op ::= NK_LE", + /* 518 */ "compare_op ::= NK_GE", + /* 519 */ "compare_op ::= NK_NE", + /* 520 */ "compare_op ::= NK_EQ", + /* 521 */ "compare_op ::= LIKE", + /* 522 */ "compare_op ::= NOT LIKE", + /* 523 */ "compare_op ::= MATCH", + /* 524 */ "compare_op ::= NMATCH", + /* 525 */ "compare_op ::= CONTAINS", + /* 526 */ "in_op ::= IN", + /* 527 */ "in_op ::= NOT IN", + /* 528 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 529 */ "boolean_value_expression ::= boolean_primary", + /* 530 */ "boolean_value_expression ::= NOT boolean_primary", + /* 531 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 532 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 533 */ "boolean_primary ::= predicate", + /* 534 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 535 */ "common_expression ::= expr_or_subquery", + /* 536 */ "common_expression ::= boolean_value_expression", + /* 537 */ "from_clause_opt ::=", + /* 538 */ "from_clause_opt ::= FROM table_reference_list", + /* 539 */ "table_reference_list ::= table_reference", + /* 540 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 541 */ "table_reference ::= table_primary", + /* 542 */ "table_reference ::= joined_table", + /* 543 */ "table_primary ::= table_name alias_opt", + /* 544 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 545 */ "table_primary ::= subquery alias_opt", + /* 546 */ "table_primary ::= parenthesized_joined_table", + /* 547 */ "alias_opt ::=", + /* 548 */ "alias_opt ::= table_alias", + /* 549 */ "alias_opt ::= AS table_alias", + /* 550 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 551 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 552 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 553 */ "join_type ::=", + /* 554 */ "join_type ::= INNER", + /* 555 */ "query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", + /* 556 */ "hint_list ::=", + /* 557 */ "hint_list ::= NK_HINT", + /* 558 */ "tag_mode_opt ::=", + /* 559 */ "tag_mode_opt ::= TAGS", + /* 560 */ "set_quantifier_opt ::=", + /* 561 */ "set_quantifier_opt ::= DISTINCT", + /* 562 */ "set_quantifier_opt ::= ALL", + /* 563 */ "select_list ::= select_item", + /* 564 */ "select_list ::= select_list NK_COMMA select_item", + /* 565 */ "select_item ::= NK_STAR", + /* 566 */ "select_item ::= common_expression", + /* 567 */ "select_item ::= common_expression column_alias", + /* 568 */ "select_item ::= common_expression AS column_alias", + /* 569 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 570 */ "where_clause_opt ::=", + /* 571 */ "where_clause_opt ::= WHERE search_condition", + /* 572 */ "partition_by_clause_opt ::=", + /* 573 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 574 */ "partition_list ::= partition_item", + /* 575 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 576 */ "partition_item ::= expr_or_subquery", + /* 577 */ "partition_item ::= expr_or_subquery column_alias", + /* 578 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 579 */ "twindow_clause_opt ::=", + /* 580 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP", + /* 581 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 582 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt", + /* 583 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt", + /* 584 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", + /* 585 */ "sliding_opt ::=", + /* 586 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP", + /* 587 */ "interval_sliding_duration_literal ::= NK_VARIABLE", + /* 588 */ "interval_sliding_duration_literal ::= NK_STRING", + /* 589 */ "interval_sliding_duration_literal ::= NK_INTEGER", + /* 590 */ "fill_opt ::=", + /* 591 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 592 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", + /* 593 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", + /* 594 */ "fill_mode ::= NONE", + /* 595 */ "fill_mode ::= PREV", + /* 596 */ "fill_mode ::= NULL", + /* 597 */ "fill_mode ::= NULL_F", + /* 598 */ "fill_mode ::= LINEAR", + /* 599 */ "fill_mode ::= NEXT", + /* 600 */ "group_by_clause_opt ::=", + /* 601 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 602 */ "group_by_list ::= expr_or_subquery", + /* 603 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 604 */ "having_clause_opt ::=", + /* 605 */ "having_clause_opt ::= HAVING search_condition", + /* 606 */ "range_opt ::=", + /* 607 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 608 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", + /* 609 */ "every_opt ::=", + /* 610 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 611 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 612 */ "query_simple ::= query_specification", + /* 613 */ "query_simple ::= union_query_expression", + /* 614 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 615 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 616 */ "query_simple_or_subquery ::= query_simple", + /* 617 */ "query_simple_or_subquery ::= subquery", + /* 618 */ "query_or_subquery ::= query_expression", + /* 619 */ "query_or_subquery ::= subquery", + /* 620 */ "order_by_clause_opt ::=", + /* 621 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 622 */ "slimit_clause_opt ::=", + /* 623 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 624 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 625 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 626 */ "limit_clause_opt ::=", + /* 627 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 628 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 629 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 630 */ "subquery ::= NK_LP query_expression NK_RP", + /* 631 */ "subquery ::= NK_LP subquery NK_RP", + /* 632 */ "search_condition ::= common_expression", + /* 633 */ "sort_specification_list ::= sort_specification", + /* 634 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 635 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 636 */ "ordering_specification_opt ::=", + /* 637 */ "ordering_specification_opt ::= ASC", + /* 638 */ "ordering_specification_opt ::= DESC", + /* 639 */ "null_ordering_opt ::=", + /* 640 */ "null_ordering_opt ::= NULLS FIRST", + /* 641 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2840,233 +3173,267 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 346: /* cmd */ - case 349: /* literal */ - case 358: /* with_opt */ - case 364: /* search_condition */ - case 369: /* db_options */ - case 371: /* alter_db_options */ - case 373: /* start_opt */ - case 374: /* end_opt */ - case 378: /* signed */ - case 380: /* retention */ - case 381: /* full_table_name */ - case 384: /* table_options */ - case 388: /* alter_table_clause */ - case 389: /* alter_table_options */ - case 392: /* signed_literal */ - case 393: /* create_subtable_clause */ - case 396: /* drop_table_clause */ - case 398: /* column_def */ - case 402: /* duration_literal */ - case 403: /* rollup_func_name */ - case 405: /* col_name */ - case 408: /* like_pattern_opt */ - case 409: /* db_name_cond_opt */ - case 410: /* table_name_cond */ - case 411: /* from_db_opt */ - case 414: /* tag_item */ - case 416: /* index_options */ - case 417: /* full_index_name */ - case 420: /* sliding_opt */ - case 421: /* sma_stream_opt */ - case 422: /* func */ - case 425: /* query_or_subquery */ - case 426: /* where_clause_opt */ - case 429: /* explain_options */ - case 430: /* insert_query */ - case 435: /* full_view_name */ - case 438: /* stream_options */ - case 441: /* subtable_opt */ - case 443: /* expression */ - case 446: /* literal_func */ - case 449: /* expr_or_subquery */ - case 450: /* pseudo_column */ - case 451: /* column_reference */ - case 452: /* function_expression */ - case 453: /* case_when_expression */ - case 458: /* star_func_para */ - case 460: /* case_when_else_opt */ - case 461: /* common_expression */ - case 462: /* when_then_expr */ - case 463: /* predicate */ - case 466: /* in_predicate_value */ - case 467: /* boolean_value_expression */ - case 468: /* boolean_primary */ - case 469: /* from_clause_opt */ - case 470: /* table_reference_list */ - case 471: /* table_reference */ - case 472: /* table_primary */ - case 473: /* joined_table */ - case 475: /* subquery */ - case 476: /* parenthesized_joined_table */ - case 478: /* query_specification */ - case 484: /* range_opt */ - case 485: /* every_opt */ - case 486: /* fill_opt */ - case 487: /* twindow_clause_opt */ - case 489: /* having_clause_opt */ - case 490: /* select_item */ - case 492: /* partition_item */ - case 493: /* interval_sliding_duration_literal */ - case 496: /* query_expression */ - case 497: /* query_simple */ - case 499: /* slimit_clause_opt */ - case 500: /* limit_clause_opt */ - case 501: /* union_query_expression */ - case 502: /* query_simple_or_subquery */ - case 504: /* sort_specification */ + case 347: /* cmd */ + case 350: /* literal */ + case 359: /* with_opt */ + case 365: /* search_condition */ + case 370: /* db_options */ + case 372: /* alter_db_options */ + case 374: /* start_opt */ + case 375: /* end_opt */ + case 379: /* signed */ + case 381: /* retention */ + case 382: /* full_table_name */ + case 385: /* table_options */ + case 389: /* alter_table_clause */ + case 390: /* alter_table_options */ + case 393: /* signed_literal */ + case 394: /* create_subtable_clause */ + case 397: /* drop_table_clause */ + case 399: /* column_def */ + case 403: /* duration_literal */ + case 404: /* rollup_func_name */ + case 406: /* col_name */ + case 409: /* like_pattern_opt */ + case 410: /* db_name_cond_opt */ + case 411: /* table_name_cond */ + case 412: /* from_db_opt */ + case 415: /* tag_item */ + case 417: /* index_options */ + case 418: /* full_index_name */ + case 421: /* sliding_opt */ + case 422: /* sma_stream_opt */ + case 423: /* func */ + case 426: /* query_or_subquery */ + case 427: /* where_clause_opt */ + case 430: /* explain_options */ + case 431: /* insert_query */ + case 436: /* full_view_name */ + case 439: /* stream_options */ + case 442: /* subtable_opt */ + case 444: /* expression */ + case 447: /* literal_func */ + case 450: /* expr_or_subquery */ + case 451: /* pseudo_column */ + case 452: /* column_reference */ + case 453: /* function_expression */ + case 454: /* case_when_expression */ + case 459: /* star_func_para */ + case 461: /* case_when_else_opt */ + case 462: /* common_expression */ + case 463: /* when_then_expr */ + case 464: /* predicate */ + case 467: /* in_predicate_value */ + case 468: /* boolean_value_expression */ + case 469: /* boolean_primary */ + case 470: /* from_clause_opt */ + case 471: /* table_reference_list */ + case 472: /* table_reference */ + case 473: /* table_primary */ + case 474: /* joined_table */ + case 476: /* subquery */ + case 477: /* parenthesized_joined_table */ + case 479: /* query_specification */ + case 485: /* range_opt */ + case 486: /* every_opt */ + case 487: /* fill_opt */ + case 488: /* twindow_clause_opt */ + case 490: /* having_clause_opt */ + case 491: /* select_item */ + case 493: /* partition_item */ + case 494: /* interval_sliding_duration_literal */ + case 497: /* query_expression */ + case 498: /* query_simple */ + case 500: /* slimit_clause_opt */ + case 501: /* limit_clause_opt */ + case 502: /* union_query_expression */ + case 503: /* query_simple_or_subquery */ + case 505: /* sort_specification */ { - nodesDestroyNode((yypminor->yy80)); +#line 7 "sql.y" + nodesDestroyNode((yypminor->yy232)); +#line 3255 "sql.c" } break; - case 347: /* account_options */ - case 348: /* alter_account_options */ - case 350: /* alter_account_option */ - case 372: /* speed_opt */ - case 424: /* with_meta */ - case 433: /* bufsize_opt */ + case 348: /* account_options */ + case 349: /* alter_account_options */ + case 351: /* alter_account_option */ + case 373: /* speed_opt */ + case 425: /* with_meta */ + case 434: /* bufsize_opt */ { +#line 54 "sql.y" +#line 3267 "sql.c" } break; - case 351: /* ip_range_list */ - case 352: /* white_list */ - case 353: /* white_list_opt */ - case 375: /* integer_list */ - case 376: /* variable_list */ - case 377: /* retention_list */ - case 382: /* column_def_list */ - case 383: /* tags_def_opt */ - case 385: /* multi_create_clause */ - case 386: /* tags_def */ - case 387: /* multi_drop_clause */ - case 394: /* specific_cols_opt */ - case 395: /* expression_list */ - case 397: /* col_name_list */ - case 399: /* duration_list */ - case 400: /* rollup_func_list */ - case 412: /* tag_list_opt */ - case 419: /* func_list */ - case 439: /* col_list_opt */ - case 440: /* tag_def_or_ref_opt */ - case 445: /* dnode_list */ - case 447: /* literal_list */ - case 455: /* star_func_para_list */ - case 457: /* other_para_list */ - case 459: /* when_then_list */ - case 479: /* hint_list */ - case 482: /* select_list */ - case 483: /* partition_by_clause_opt */ - case 488: /* group_by_clause_opt */ - case 491: /* partition_list */ - case 495: /* group_by_list */ - case 498: /* order_by_clause_opt */ - case 503: /* sort_specification_list */ + case 352: /* ip_range_list */ + case 353: /* white_list */ + case 354: /* white_list_opt */ + case 376: /* integer_list */ + case 377: /* variable_list */ + case 378: /* retention_list */ + case 383: /* column_def_list */ + case 384: /* tags_def_opt */ + case 386: /* multi_create_clause */ + case 387: /* tags_def */ + case 388: /* multi_drop_clause */ + case 395: /* specific_cols_opt */ + case 396: /* expression_list */ + case 398: /* col_name_list */ + case 400: /* duration_list */ + case 401: /* rollup_func_list */ + case 413: /* tag_list_opt */ + case 420: /* func_list */ + case 440: /* col_list_opt */ + case 441: /* tag_def_or_ref_opt */ + case 446: /* dnode_list */ + case 448: /* literal_list */ + case 456: /* star_func_para_list */ + case 458: /* other_para_list */ + case 460: /* when_then_list */ + case 480: /* hint_list */ + case 483: /* select_list */ + case 484: /* partition_by_clause_opt */ + case 489: /* group_by_clause_opt */ + case 492: /* partition_list */ + case 496: /* group_by_list */ + case 499: /* order_by_clause_opt */ + case 504: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy106)); +#line 85 "sql.y" + nodesDestroyList((yypminor->yy88)); +#line 3306 "sql.c" } break; - case 354: /* user_name */ - case 361: /* db_name */ - case 362: /* table_name */ - case 363: /* topic_name */ - case 365: /* dnode_endpoint */ - case 390: /* column_name */ - case 404: /* function_name */ - case 415: /* column_alias */ - case 418: /* index_name */ - case 423: /* sma_func_name */ - case 427: /* cgroup_name */ - case 434: /* language_opt */ - case 436: /* view_name */ - case 437: /* stream_name */ - case 444: /* on_vgroup_id */ - case 448: /* table_alias */ - case 454: /* star_func */ - case 456: /* noarg_func */ - case 474: /* alias_opt */ + case 355: /* user_name */ + case 362: /* db_name */ + case 363: /* table_name */ + case 364: /* topic_name */ + case 366: /* dnode_endpoint */ + case 391: /* column_name */ + case 405: /* function_name */ + case 416: /* column_alias */ + case 419: /* index_name */ + case 424: /* sma_func_name */ + case 428: /* cgroup_name */ + case 435: /* language_opt */ + case 437: /* view_name */ + case 438: /* stream_name */ + case 445: /* on_vgroup_id */ + case 449: /* table_alias */ + case 455: /* star_func */ + case 457: /* noarg_func */ + case 475: /* alias_opt */ { +#line 812 "sql.y" +#line 3331 "sql.c" } break; - case 355: /* sysinfo_opt */ + case 356: /* sysinfo_opt */ { +#line 112 "sql.y" +#line 3338 "sql.c" } break; - case 356: /* privileges */ - case 359: /* priv_type_list */ - case 360: /* priv_type */ + case 357: /* privileges */ + case 360: /* priv_type_list */ + case 361: /* priv_type */ { +#line 121 "sql.y" +#line 3347 "sql.c" } break; - case 357: /* priv_level */ + case 358: /* priv_level */ { +#line 138 "sql.y" +#line 3354 "sql.c" } break; - case 366: /* force_opt */ - case 367: /* unsafe_opt */ - case 368: /* not_exists_opt */ - case 370: /* exists_opt */ - case 428: /* analyze_opt */ - case 431: /* or_replace_opt */ - case 432: /* agg_func_opt */ - case 442: /* ignore_opt */ - case 480: /* set_quantifier_opt */ - case 481: /* tag_mode_opt */ + case 367: /* force_opt */ + case 368: /* unsafe_opt */ + case 369: /* not_exists_opt */ + case 371: /* exists_opt */ + case 429: /* analyze_opt */ + case 432: /* or_replace_opt */ + case 433: /* agg_func_opt */ + case 443: /* ignore_opt */ + case 481: /* set_quantifier_opt */ + case 482: /* tag_mode_opt */ { +#line 167 "sql.y" +#line 3370 "sql.c" } break; - case 379: /* alter_db_option */ - case 401: /* alter_table_option */ + case 380: /* alter_db_option */ + case 402: /* alter_table_option */ { +#line 265 "sql.y" +#line 3378 "sql.c" } break; - case 391: /* type_name */ + case 392: /* type_name */ { +#line 388 "sql.y" +#line 3385 "sql.c" } break; - case 406: /* db_kind_opt */ - case 413: /* table_kind */ + case 407: /* db_kind_opt */ + case 414: /* table_kind */ { +#line 553 "sql.y" +#line 3393 "sql.c" } break; - case 407: /* table_kind_db_name_cond_opt */ + case 408: /* table_kind_db_name_cond_opt */ { +#line 518 "sql.y" +#line 3400 "sql.c" } break; - case 464: /* compare_op */ - case 465: /* in_op */ + case 465: /* compare_op */ + case 466: /* in_op */ { +#line 1002 "sql.y" +#line 3408 "sql.c" } break; - case 477: /* join_type */ + case 478: /* join_type */ { +#line 1078 "sql.y" +#line 3415 "sql.c" } break; - case 494: /* fill_mode */ + case 495: /* fill_mode */ { +#line 1169 "sql.y" +#line 3422 "sql.c" } break; - case 505: /* ordering_specification_opt */ + case 506: /* ordering_specification_opt */ { +#line 1254 "sql.y" +#line 3429 "sql.c" } break; - case 506: /* null_ordering_opt */ + case 507: /* null_ordering_opt */ { +#line 1260 "sql.y" +#line 3436 "sql.c" } break; /********* End destructor definitions *****************************************/ @@ -3233,7 +3600,7 @@ static YYACTIONTYPE yy_find_shift_action( #endif /* YYWILDCARD */ return yy_default[stateno]; }else{ - assert( i>=0 && i=0 && i<(int)(sizeof(yy_action)/sizeof(yy_action[0])) ); return yy_action[i]; } }while(1); @@ -3355,645 +3722,648 @@ static void yy_shift( /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side ** of that rule */ static const YYCODETYPE yyRuleInfoLhs[] = { - 346, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ - 346, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ - 347, /* (2) account_options ::= */ - 347, /* (3) account_options ::= account_options PPS literal */ - 347, /* (4) account_options ::= account_options TSERIES literal */ - 347, /* (5) account_options ::= account_options STORAGE literal */ - 347, /* (6) account_options ::= account_options STREAMS literal */ - 347, /* (7) account_options ::= account_options QTIME literal */ - 347, /* (8) account_options ::= account_options DBS literal */ - 347, /* (9) account_options ::= account_options USERS literal */ - 347, /* (10) account_options ::= account_options CONNS literal */ - 347, /* (11) account_options ::= account_options STATE literal */ - 348, /* (12) alter_account_options ::= alter_account_option */ - 348, /* (13) alter_account_options ::= alter_account_options alter_account_option */ - 350, /* (14) alter_account_option ::= PASS literal */ - 350, /* (15) alter_account_option ::= PPS literal */ - 350, /* (16) alter_account_option ::= TSERIES literal */ - 350, /* (17) alter_account_option ::= STORAGE literal */ - 350, /* (18) alter_account_option ::= STREAMS literal */ - 350, /* (19) alter_account_option ::= QTIME literal */ - 350, /* (20) alter_account_option ::= DBS literal */ - 350, /* (21) alter_account_option ::= USERS literal */ - 350, /* (22) alter_account_option ::= CONNS literal */ - 350, /* (23) alter_account_option ::= STATE literal */ - 351, /* (24) ip_range_list ::= NK_STRING */ - 351, /* (25) ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ - 352, /* (26) white_list ::= HOST ip_range_list */ - 353, /* (27) white_list_opt ::= */ - 353, /* (28) white_list_opt ::= white_list */ - 346, /* (29) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ - 346, /* (30) cmd ::= ALTER USER user_name PASS NK_STRING */ - 346, /* (31) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ - 346, /* (32) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ - 346, /* (33) cmd ::= ALTER USER user_name ADD white_list */ - 346, /* (34) cmd ::= ALTER USER user_name DROP white_list */ - 346, /* (35) cmd ::= DROP USER user_name */ - 355, /* (36) sysinfo_opt ::= */ - 355, /* (37) sysinfo_opt ::= SYSINFO NK_INTEGER */ - 346, /* (38) cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ - 346, /* (39) cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ - 356, /* (40) privileges ::= ALL */ - 356, /* (41) privileges ::= priv_type_list */ - 356, /* (42) privileges ::= SUBSCRIBE */ - 359, /* (43) priv_type_list ::= priv_type */ - 359, /* (44) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - 360, /* (45) priv_type ::= READ */ - 360, /* (46) priv_type ::= WRITE */ - 360, /* (47) priv_type ::= ALTER */ - 357, /* (48) priv_level ::= NK_STAR NK_DOT NK_STAR */ - 357, /* (49) priv_level ::= db_name NK_DOT NK_STAR */ - 357, /* (50) priv_level ::= db_name NK_DOT table_name */ - 357, /* (51) priv_level ::= topic_name */ - 358, /* (52) with_opt ::= */ - 358, /* (53) with_opt ::= WITH search_condition */ - 346, /* (54) cmd ::= CREATE DNODE dnode_endpoint */ - 346, /* (55) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - 346, /* (56) cmd ::= DROP DNODE NK_INTEGER force_opt */ - 346, /* (57) cmd ::= DROP DNODE dnode_endpoint force_opt */ - 346, /* (58) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ - 346, /* (59) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ - 346, /* (60) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - 346, /* (61) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - 346, /* (62) cmd ::= ALTER ALL DNODES NK_STRING */ - 346, /* (63) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - 346, /* (64) cmd ::= RESTORE DNODE NK_INTEGER */ - 365, /* (65) dnode_endpoint ::= NK_STRING */ - 365, /* (66) dnode_endpoint ::= NK_ID */ - 365, /* (67) dnode_endpoint ::= NK_IPTOKEN */ - 366, /* (68) force_opt ::= */ - 366, /* (69) force_opt ::= FORCE */ - 367, /* (70) unsafe_opt ::= UNSAFE */ - 346, /* (71) cmd ::= ALTER LOCAL NK_STRING */ - 346, /* (72) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - 346, /* (73) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - 346, /* (74) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - 346, /* (75) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ - 346, /* (76) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - 346, /* (77) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - 346, /* (78) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - 346, /* (79) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - 346, /* (80) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - 346, /* (81) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - 346, /* (82) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ - 346, /* (83) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ - 346, /* (84) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - 346, /* (85) cmd ::= DROP DATABASE exists_opt db_name */ - 346, /* (86) cmd ::= USE db_name */ - 346, /* (87) cmd ::= ALTER DATABASE db_name alter_db_options */ - 346, /* (88) cmd ::= FLUSH DATABASE db_name */ - 346, /* (89) cmd ::= TRIM DATABASE db_name speed_opt */ - 346, /* (90) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ - 368, /* (91) not_exists_opt ::= IF NOT EXISTS */ - 368, /* (92) not_exists_opt ::= */ - 370, /* (93) exists_opt ::= IF EXISTS */ - 370, /* (94) exists_opt ::= */ - 369, /* (95) db_options ::= */ - 369, /* (96) db_options ::= db_options BUFFER NK_INTEGER */ - 369, /* (97) db_options ::= db_options CACHEMODEL NK_STRING */ - 369, /* (98) db_options ::= db_options CACHESIZE NK_INTEGER */ - 369, /* (99) db_options ::= db_options COMP NK_INTEGER */ - 369, /* (100) db_options ::= db_options DURATION NK_INTEGER */ - 369, /* (101) db_options ::= db_options DURATION NK_VARIABLE */ - 369, /* (102) db_options ::= db_options MAXROWS NK_INTEGER */ - 369, /* (103) db_options ::= db_options MINROWS NK_INTEGER */ - 369, /* (104) db_options ::= db_options KEEP integer_list */ - 369, /* (105) db_options ::= db_options KEEP variable_list */ - 369, /* (106) db_options ::= db_options PAGES NK_INTEGER */ - 369, /* (107) db_options ::= db_options PAGESIZE NK_INTEGER */ - 369, /* (108) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ - 369, /* (109) db_options ::= db_options PRECISION NK_STRING */ - 369, /* (110) db_options ::= db_options REPLICA NK_INTEGER */ - 369, /* (111) db_options ::= db_options VGROUPS NK_INTEGER */ - 369, /* (112) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - 369, /* (113) db_options ::= db_options RETENTIONS retention_list */ - 369, /* (114) db_options ::= db_options SCHEMALESS NK_INTEGER */ - 369, /* (115) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - 369, /* (116) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - 369, /* (117) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - 369, /* (118) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - 369, /* (119) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - 369, /* (120) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - 369, /* (121) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - 369, /* (122) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - 369, /* (123) db_options ::= db_options STT_TRIGGER NK_INTEGER */ - 369, /* (124) db_options ::= db_options TABLE_PREFIX signed */ - 369, /* (125) db_options ::= db_options TABLE_SUFFIX signed */ - 369, /* (126) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ - 371, /* (127) alter_db_options ::= alter_db_option */ - 371, /* (128) alter_db_options ::= alter_db_options alter_db_option */ - 379, /* (129) alter_db_option ::= BUFFER NK_INTEGER */ - 379, /* (130) alter_db_option ::= CACHEMODEL NK_STRING */ - 379, /* (131) alter_db_option ::= CACHESIZE NK_INTEGER */ - 379, /* (132) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - 379, /* (133) alter_db_option ::= KEEP integer_list */ - 379, /* (134) alter_db_option ::= KEEP variable_list */ - 379, /* (135) alter_db_option ::= PAGES NK_INTEGER */ - 379, /* (136) alter_db_option ::= REPLICA NK_INTEGER */ - 379, /* (137) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - 379, /* (138) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - 379, /* (139) alter_db_option ::= MINROWS NK_INTEGER */ - 379, /* (140) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ - 379, /* (141) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - 379, /* (142) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ - 379, /* (143) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - 379, /* (144) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ - 375, /* (145) integer_list ::= NK_INTEGER */ - 375, /* (146) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - 376, /* (147) variable_list ::= NK_VARIABLE */ - 376, /* (148) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - 377, /* (149) retention_list ::= retention */ - 377, /* (150) retention_list ::= retention_list NK_COMMA retention */ - 380, /* (151) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - 380, /* (152) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ - 372, /* (153) speed_opt ::= */ - 372, /* (154) speed_opt ::= BWLIMIT NK_INTEGER */ - 373, /* (155) start_opt ::= */ - 373, /* (156) start_opt ::= START WITH NK_INTEGER */ - 373, /* (157) start_opt ::= START WITH NK_STRING */ - 373, /* (158) start_opt ::= START WITH TIMESTAMP NK_STRING */ - 374, /* (159) end_opt ::= */ - 374, /* (160) end_opt ::= END WITH NK_INTEGER */ - 374, /* (161) end_opt ::= END WITH NK_STRING */ - 374, /* (162) end_opt ::= END WITH TIMESTAMP NK_STRING */ - 346, /* (163) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - 346, /* (164) cmd ::= CREATE TABLE multi_create_clause */ - 346, /* (165) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - 346, /* (166) cmd ::= DROP TABLE multi_drop_clause */ - 346, /* (167) cmd ::= DROP STABLE exists_opt full_table_name */ - 346, /* (168) cmd ::= ALTER TABLE alter_table_clause */ - 346, /* (169) cmd ::= ALTER STABLE alter_table_clause */ - 388, /* (170) alter_table_clause ::= full_table_name alter_table_options */ - 388, /* (171) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ - 388, /* (172) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - 388, /* (173) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - 388, /* (174) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - 388, /* (175) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - 388, /* (176) alter_table_clause ::= full_table_name DROP TAG column_name */ - 388, /* (177) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - 388, /* (178) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - 388, /* (179) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ - 385, /* (180) multi_create_clause ::= create_subtable_clause */ - 385, /* (181) multi_create_clause ::= multi_create_clause create_subtable_clause */ - 393, /* (182) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ - 387, /* (183) multi_drop_clause ::= drop_table_clause */ - 387, /* (184) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ - 396, /* (185) drop_table_clause ::= exists_opt full_table_name */ - 394, /* (186) specific_cols_opt ::= */ - 394, /* (187) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - 381, /* (188) full_table_name ::= table_name */ - 381, /* (189) full_table_name ::= db_name NK_DOT table_name */ - 382, /* (190) column_def_list ::= column_def */ - 382, /* (191) column_def_list ::= column_def_list NK_COMMA column_def */ - 398, /* (192) column_def ::= column_name type_name */ - 391, /* (193) type_name ::= BOOL */ - 391, /* (194) type_name ::= TINYINT */ - 391, /* (195) type_name ::= SMALLINT */ - 391, /* (196) type_name ::= INT */ - 391, /* (197) type_name ::= INTEGER */ - 391, /* (198) type_name ::= BIGINT */ - 391, /* (199) type_name ::= FLOAT */ - 391, /* (200) type_name ::= DOUBLE */ - 391, /* (201) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - 391, /* (202) type_name ::= TIMESTAMP */ - 391, /* (203) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - 391, /* (204) type_name ::= TINYINT UNSIGNED */ - 391, /* (205) type_name ::= SMALLINT UNSIGNED */ - 391, /* (206) type_name ::= INT UNSIGNED */ - 391, /* (207) type_name ::= BIGINT UNSIGNED */ - 391, /* (208) type_name ::= JSON */ - 391, /* (209) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - 391, /* (210) type_name ::= MEDIUMBLOB */ - 391, /* (211) type_name ::= BLOB */ - 391, /* (212) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - 391, /* (213) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ - 391, /* (214) type_name ::= DECIMAL */ - 391, /* (215) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - 391, /* (216) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 383, /* (217) tags_def_opt ::= */ - 383, /* (218) tags_def_opt ::= tags_def */ - 386, /* (219) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - 384, /* (220) table_options ::= */ - 384, /* (221) table_options ::= table_options COMMENT NK_STRING */ - 384, /* (222) table_options ::= table_options MAX_DELAY duration_list */ - 384, /* (223) table_options ::= table_options WATERMARK duration_list */ - 384, /* (224) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - 384, /* (225) table_options ::= table_options TTL NK_INTEGER */ - 384, /* (226) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - 384, /* (227) table_options ::= table_options DELETE_MARK duration_list */ - 389, /* (228) alter_table_options ::= alter_table_option */ - 389, /* (229) alter_table_options ::= alter_table_options alter_table_option */ - 401, /* (230) alter_table_option ::= COMMENT NK_STRING */ - 401, /* (231) alter_table_option ::= TTL NK_INTEGER */ - 399, /* (232) duration_list ::= duration_literal */ - 399, /* (233) duration_list ::= duration_list NK_COMMA duration_literal */ - 400, /* (234) rollup_func_list ::= rollup_func_name */ - 400, /* (235) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - 403, /* (236) rollup_func_name ::= function_name */ - 403, /* (237) rollup_func_name ::= FIRST */ - 403, /* (238) rollup_func_name ::= LAST */ - 397, /* (239) col_name_list ::= col_name */ - 397, /* (240) col_name_list ::= col_name_list NK_COMMA col_name */ - 405, /* (241) col_name ::= column_name */ - 346, /* (242) cmd ::= SHOW DNODES */ - 346, /* (243) cmd ::= SHOW USERS */ - 346, /* (244) cmd ::= SHOW USER PRIVILEGES */ - 346, /* (245) cmd ::= SHOW db_kind_opt DATABASES */ - 346, /* (246) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ - 346, /* (247) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - 346, /* (248) cmd ::= SHOW db_name_cond_opt VGROUPS */ - 346, /* (249) cmd ::= SHOW MNODES */ - 346, /* (250) cmd ::= SHOW QNODES */ - 346, /* (251) cmd ::= SHOW FUNCTIONS */ - 346, /* (252) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - 346, /* (253) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ - 346, /* (254) cmd ::= SHOW STREAMS */ - 346, /* (255) cmd ::= SHOW ACCOUNTS */ - 346, /* (256) cmd ::= SHOW APPS */ - 346, /* (257) cmd ::= SHOW CONNECTIONS */ - 346, /* (258) cmd ::= SHOW LICENCES */ - 346, /* (259) cmd ::= SHOW GRANTS */ - 346, /* (260) cmd ::= SHOW CREATE DATABASE db_name */ - 346, /* (261) cmd ::= SHOW CREATE TABLE full_table_name */ - 346, /* (262) cmd ::= SHOW CREATE STABLE full_table_name */ - 346, /* (263) cmd ::= SHOW QUERIES */ - 346, /* (264) cmd ::= SHOW SCORES */ - 346, /* (265) cmd ::= SHOW TOPICS */ - 346, /* (266) cmd ::= SHOW VARIABLES */ - 346, /* (267) cmd ::= SHOW CLUSTER VARIABLES */ - 346, /* (268) cmd ::= SHOW LOCAL VARIABLES */ - 346, /* (269) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - 346, /* (270) cmd ::= SHOW BNODES */ - 346, /* (271) cmd ::= SHOW SNODES */ - 346, /* (272) cmd ::= SHOW CLUSTER */ - 346, /* (273) cmd ::= SHOW TRANSACTIONS */ - 346, /* (274) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - 346, /* (275) cmd ::= SHOW CONSUMERS */ - 346, /* (276) cmd ::= SHOW SUBSCRIPTIONS */ - 346, /* (277) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - 346, /* (278) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ - 346, /* (279) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - 346, /* (280) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ - 346, /* (281) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ - 346, /* (282) cmd ::= SHOW VNODES */ - 346, /* (283) cmd ::= SHOW db_name_cond_opt ALIVE */ - 346, /* (284) cmd ::= SHOW CLUSTER ALIVE */ - 346, /* (285) cmd ::= SHOW db_name_cond_opt VIEWS */ - 346, /* (286) cmd ::= SHOW CREATE VIEW full_table_name */ - 407, /* (287) table_kind_db_name_cond_opt ::= */ - 407, /* (288) table_kind_db_name_cond_opt ::= table_kind */ - 407, /* (289) table_kind_db_name_cond_opt ::= db_name NK_DOT */ - 407, /* (290) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ - 413, /* (291) table_kind ::= NORMAL */ - 413, /* (292) table_kind ::= CHILD */ - 409, /* (293) db_name_cond_opt ::= */ - 409, /* (294) db_name_cond_opt ::= db_name NK_DOT */ - 408, /* (295) like_pattern_opt ::= */ - 408, /* (296) like_pattern_opt ::= LIKE NK_STRING */ - 410, /* (297) table_name_cond ::= table_name */ - 411, /* (298) from_db_opt ::= */ - 411, /* (299) from_db_opt ::= FROM db_name */ - 412, /* (300) tag_list_opt ::= */ - 412, /* (301) tag_list_opt ::= tag_item */ - 412, /* (302) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - 414, /* (303) tag_item ::= TBNAME */ - 414, /* (304) tag_item ::= QTAGS */ - 414, /* (305) tag_item ::= column_name */ - 414, /* (306) tag_item ::= column_name column_alias */ - 414, /* (307) tag_item ::= column_name AS column_alias */ - 406, /* (308) db_kind_opt ::= */ - 406, /* (309) db_kind_opt ::= USER */ - 406, /* (310) db_kind_opt ::= SYSTEM */ - 346, /* (311) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ - 346, /* (312) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ - 346, /* (313) cmd ::= DROP INDEX exists_opt full_index_name */ - 417, /* (314) full_index_name ::= index_name */ - 417, /* (315) full_index_name ::= db_name NK_DOT index_name */ - 416, /* (316) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - 416, /* (317) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ - 419, /* (318) func_list ::= func */ - 419, /* (319) func_list ::= func_list NK_COMMA func */ - 422, /* (320) func ::= sma_func_name NK_LP expression_list NK_RP */ - 423, /* (321) sma_func_name ::= function_name */ - 423, /* (322) sma_func_name ::= COUNT */ - 423, /* (323) sma_func_name ::= FIRST */ - 423, /* (324) sma_func_name ::= LAST */ - 423, /* (325) sma_func_name ::= LAST_ROW */ - 421, /* (326) sma_stream_opt ::= */ - 421, /* (327) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - 421, /* (328) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - 421, /* (329) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - 424, /* (330) with_meta ::= AS */ - 424, /* (331) with_meta ::= WITH META AS */ - 424, /* (332) with_meta ::= ONLY META AS */ - 346, /* (333) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - 346, /* (334) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ - 346, /* (335) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ - 346, /* (336) cmd ::= DROP TOPIC exists_opt topic_name */ - 346, /* (337) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - 346, /* (338) cmd ::= DESC full_table_name */ - 346, /* (339) cmd ::= DESCRIBE full_table_name */ - 346, /* (340) cmd ::= RESET QUERY CACHE */ - 346, /* (341) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - 346, /* (342) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ - 428, /* (343) analyze_opt ::= */ - 428, /* (344) analyze_opt ::= ANALYZE */ - 429, /* (345) explain_options ::= */ - 429, /* (346) explain_options ::= explain_options VERBOSE NK_BOOL */ - 429, /* (347) explain_options ::= explain_options RATIO NK_FLOAT */ - 346, /* (348) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ - 346, /* (349) cmd ::= DROP FUNCTION exists_opt function_name */ - 432, /* (350) agg_func_opt ::= */ - 432, /* (351) agg_func_opt ::= AGGREGATE */ - 433, /* (352) bufsize_opt ::= */ - 433, /* (353) bufsize_opt ::= BUFSIZE NK_INTEGER */ - 434, /* (354) language_opt ::= */ - 434, /* (355) language_opt ::= LANGUAGE NK_STRING */ - 431, /* (356) or_replace_opt ::= */ - 431, /* (357) or_replace_opt ::= OR REPLACE */ - 346, /* (358) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ - 346, /* (359) cmd ::= DROP VIEW exists_opt full_view_name */ - 435, /* (360) full_view_name ::= view_name */ - 435, /* (361) full_view_name ::= db_name NK_DOT view_name */ - 346, /* (362) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ - 346, /* (363) cmd ::= DROP STREAM exists_opt stream_name */ - 346, /* (364) cmd ::= PAUSE STREAM exists_opt stream_name */ - 346, /* (365) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ - 439, /* (366) col_list_opt ::= */ - 439, /* (367) col_list_opt ::= NK_LP col_name_list NK_RP */ - 440, /* (368) tag_def_or_ref_opt ::= */ - 440, /* (369) tag_def_or_ref_opt ::= tags_def */ - 440, /* (370) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ - 438, /* (371) stream_options ::= */ - 438, /* (372) stream_options ::= stream_options TRIGGER AT_ONCE */ - 438, /* (373) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - 438, /* (374) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - 438, /* (375) stream_options ::= stream_options WATERMARK duration_literal */ - 438, /* (376) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - 438, /* (377) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - 438, /* (378) stream_options ::= stream_options DELETE_MARK duration_literal */ - 438, /* (379) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ - 441, /* (380) subtable_opt ::= */ - 441, /* (381) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - 442, /* (382) ignore_opt ::= */ - 442, /* (383) ignore_opt ::= IGNORE UNTREATED */ - 346, /* (384) cmd ::= KILL CONNECTION NK_INTEGER */ - 346, /* (385) cmd ::= KILL QUERY NK_STRING */ - 346, /* (386) cmd ::= KILL TRANSACTION NK_INTEGER */ - 346, /* (387) cmd ::= BALANCE VGROUP */ - 346, /* (388) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ - 346, /* (389) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - 346, /* (390) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - 346, /* (391) cmd ::= SPLIT VGROUP NK_INTEGER */ - 444, /* (392) on_vgroup_id ::= */ - 444, /* (393) on_vgroup_id ::= ON NK_INTEGER */ - 445, /* (394) dnode_list ::= DNODE NK_INTEGER */ - 445, /* (395) dnode_list ::= dnode_list DNODE NK_INTEGER */ - 346, /* (396) cmd ::= DELETE FROM full_table_name where_clause_opt */ - 346, /* (397) cmd ::= query_or_subquery */ - 346, /* (398) cmd ::= insert_query */ - 430, /* (399) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - 430, /* (400) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - 349, /* (401) literal ::= NK_INTEGER */ - 349, /* (402) literal ::= NK_FLOAT */ - 349, /* (403) literal ::= NK_STRING */ - 349, /* (404) literal ::= NK_BOOL */ - 349, /* (405) literal ::= TIMESTAMP NK_STRING */ - 349, /* (406) literal ::= duration_literal */ - 349, /* (407) literal ::= NULL */ - 349, /* (408) literal ::= NK_QUESTION */ - 402, /* (409) duration_literal ::= NK_VARIABLE */ - 378, /* (410) signed ::= NK_INTEGER */ - 378, /* (411) signed ::= NK_PLUS NK_INTEGER */ - 378, /* (412) signed ::= NK_MINUS NK_INTEGER */ - 378, /* (413) signed ::= NK_FLOAT */ - 378, /* (414) signed ::= NK_PLUS NK_FLOAT */ - 378, /* (415) signed ::= NK_MINUS NK_FLOAT */ - 392, /* (416) signed_literal ::= signed */ - 392, /* (417) signed_literal ::= NK_STRING */ - 392, /* (418) signed_literal ::= NK_BOOL */ - 392, /* (419) signed_literal ::= TIMESTAMP NK_STRING */ - 392, /* (420) signed_literal ::= duration_literal */ - 392, /* (421) signed_literal ::= NULL */ - 392, /* (422) signed_literal ::= literal_func */ - 392, /* (423) signed_literal ::= NK_QUESTION */ - 447, /* (424) literal_list ::= signed_literal */ - 447, /* (425) literal_list ::= literal_list NK_COMMA signed_literal */ - 361, /* (426) db_name ::= NK_ID */ - 362, /* (427) table_name ::= NK_ID */ - 390, /* (428) column_name ::= NK_ID */ - 404, /* (429) function_name ::= NK_ID */ - 436, /* (430) view_name ::= NK_ID */ - 448, /* (431) table_alias ::= NK_ID */ - 415, /* (432) column_alias ::= NK_ID */ - 415, /* (433) column_alias ::= NK_ALIAS */ - 354, /* (434) user_name ::= NK_ID */ - 363, /* (435) topic_name ::= NK_ID */ - 437, /* (436) stream_name ::= NK_ID */ - 427, /* (437) cgroup_name ::= NK_ID */ - 418, /* (438) index_name ::= NK_ID */ - 449, /* (439) expr_or_subquery ::= expression */ - 443, /* (440) expression ::= literal */ - 443, /* (441) expression ::= pseudo_column */ - 443, /* (442) expression ::= column_reference */ - 443, /* (443) expression ::= function_expression */ - 443, /* (444) expression ::= case_when_expression */ - 443, /* (445) expression ::= NK_LP expression NK_RP */ - 443, /* (446) expression ::= NK_PLUS expr_or_subquery */ - 443, /* (447) expression ::= NK_MINUS expr_or_subquery */ - 443, /* (448) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - 443, /* (449) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - 443, /* (450) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - 443, /* (451) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - 443, /* (452) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - 443, /* (453) expression ::= column_reference NK_ARROW NK_STRING */ - 443, /* (454) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - 443, /* (455) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - 395, /* (456) expression_list ::= expr_or_subquery */ - 395, /* (457) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - 451, /* (458) column_reference ::= column_name */ - 451, /* (459) column_reference ::= table_name NK_DOT column_name */ - 451, /* (460) column_reference ::= NK_ALIAS */ - 451, /* (461) column_reference ::= table_name NK_DOT NK_ALIAS */ - 450, /* (462) pseudo_column ::= ROWTS */ - 450, /* (463) pseudo_column ::= TBNAME */ - 450, /* (464) pseudo_column ::= table_name NK_DOT TBNAME */ - 450, /* (465) pseudo_column ::= QSTART */ - 450, /* (466) pseudo_column ::= QEND */ - 450, /* (467) pseudo_column ::= QDURATION */ - 450, /* (468) pseudo_column ::= WSTART */ - 450, /* (469) pseudo_column ::= WEND */ - 450, /* (470) pseudo_column ::= WDURATION */ - 450, /* (471) pseudo_column ::= IROWTS */ - 450, /* (472) pseudo_column ::= ISFILLED */ - 450, /* (473) pseudo_column ::= QTAGS */ - 452, /* (474) function_expression ::= function_name NK_LP expression_list NK_RP */ - 452, /* (475) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - 452, /* (476) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - 452, /* (477) function_expression ::= literal_func */ - 446, /* (478) literal_func ::= noarg_func NK_LP NK_RP */ - 446, /* (479) literal_func ::= NOW */ - 456, /* (480) noarg_func ::= NOW */ - 456, /* (481) noarg_func ::= TODAY */ - 456, /* (482) noarg_func ::= TIMEZONE */ - 456, /* (483) noarg_func ::= DATABASE */ - 456, /* (484) noarg_func ::= CLIENT_VERSION */ - 456, /* (485) noarg_func ::= SERVER_VERSION */ - 456, /* (486) noarg_func ::= SERVER_STATUS */ - 456, /* (487) noarg_func ::= CURRENT_USER */ - 456, /* (488) noarg_func ::= USER */ - 454, /* (489) star_func ::= COUNT */ - 454, /* (490) star_func ::= FIRST */ - 454, /* (491) star_func ::= LAST */ - 454, /* (492) star_func ::= LAST_ROW */ - 455, /* (493) star_func_para_list ::= NK_STAR */ - 455, /* (494) star_func_para_list ::= other_para_list */ - 457, /* (495) other_para_list ::= star_func_para */ - 457, /* (496) other_para_list ::= other_para_list NK_COMMA star_func_para */ - 458, /* (497) star_func_para ::= expr_or_subquery */ - 458, /* (498) star_func_para ::= table_name NK_DOT NK_STAR */ - 453, /* (499) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - 453, /* (500) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - 459, /* (501) when_then_list ::= when_then_expr */ - 459, /* (502) when_then_list ::= when_then_list when_then_expr */ - 462, /* (503) when_then_expr ::= WHEN common_expression THEN common_expression */ - 460, /* (504) case_when_else_opt ::= */ - 460, /* (505) case_when_else_opt ::= ELSE common_expression */ - 463, /* (506) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - 463, /* (507) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - 463, /* (508) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - 463, /* (509) predicate ::= expr_or_subquery IS NULL */ - 463, /* (510) predicate ::= expr_or_subquery IS NOT NULL */ - 463, /* (511) predicate ::= expr_or_subquery in_op in_predicate_value */ - 464, /* (512) compare_op ::= NK_LT */ - 464, /* (513) compare_op ::= NK_GT */ - 464, /* (514) compare_op ::= NK_LE */ - 464, /* (515) compare_op ::= NK_GE */ - 464, /* (516) compare_op ::= NK_NE */ - 464, /* (517) compare_op ::= NK_EQ */ - 464, /* (518) compare_op ::= LIKE */ - 464, /* (519) compare_op ::= NOT LIKE */ - 464, /* (520) compare_op ::= MATCH */ - 464, /* (521) compare_op ::= NMATCH */ - 464, /* (522) compare_op ::= CONTAINS */ - 465, /* (523) in_op ::= IN */ - 465, /* (524) in_op ::= NOT IN */ - 466, /* (525) in_predicate_value ::= NK_LP literal_list NK_RP */ - 467, /* (526) boolean_value_expression ::= boolean_primary */ - 467, /* (527) boolean_value_expression ::= NOT boolean_primary */ - 467, /* (528) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - 467, /* (529) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - 468, /* (530) boolean_primary ::= predicate */ - 468, /* (531) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - 461, /* (532) common_expression ::= expr_or_subquery */ - 461, /* (533) common_expression ::= boolean_value_expression */ - 469, /* (534) from_clause_opt ::= */ - 469, /* (535) from_clause_opt ::= FROM table_reference_list */ - 470, /* (536) table_reference_list ::= table_reference */ - 470, /* (537) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - 471, /* (538) table_reference ::= table_primary */ - 471, /* (539) table_reference ::= joined_table */ - 472, /* (540) table_primary ::= table_name alias_opt */ - 472, /* (541) table_primary ::= db_name NK_DOT table_name alias_opt */ - 472, /* (542) table_primary ::= subquery alias_opt */ - 472, /* (543) table_primary ::= parenthesized_joined_table */ - 474, /* (544) alias_opt ::= */ - 474, /* (545) alias_opt ::= table_alias */ - 474, /* (546) alias_opt ::= AS table_alias */ - 476, /* (547) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - 476, /* (548) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - 473, /* (549) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - 477, /* (550) join_type ::= */ - 477, /* (551) join_type ::= INNER */ - 478, /* (552) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - 479, /* (553) hint_list ::= */ - 479, /* (554) hint_list ::= NK_HINT */ - 481, /* (555) tag_mode_opt ::= */ - 481, /* (556) tag_mode_opt ::= TAGS */ - 480, /* (557) set_quantifier_opt ::= */ - 480, /* (558) set_quantifier_opt ::= DISTINCT */ - 480, /* (559) set_quantifier_opt ::= ALL */ - 482, /* (560) select_list ::= select_item */ - 482, /* (561) select_list ::= select_list NK_COMMA select_item */ - 490, /* (562) select_item ::= NK_STAR */ - 490, /* (563) select_item ::= common_expression */ - 490, /* (564) select_item ::= common_expression column_alias */ - 490, /* (565) select_item ::= common_expression AS column_alias */ - 490, /* (566) select_item ::= table_name NK_DOT NK_STAR */ - 426, /* (567) where_clause_opt ::= */ - 426, /* (568) where_clause_opt ::= WHERE search_condition */ - 483, /* (569) partition_by_clause_opt ::= */ - 483, /* (570) partition_by_clause_opt ::= PARTITION BY partition_list */ - 491, /* (571) partition_list ::= partition_item */ - 491, /* (572) partition_list ::= partition_list NK_COMMA partition_item */ - 492, /* (573) partition_item ::= expr_or_subquery */ - 492, /* (574) partition_item ::= expr_or_subquery column_alias */ - 492, /* (575) partition_item ::= expr_or_subquery AS column_alias */ - 487, /* (576) twindow_clause_opt ::= */ - 487, /* (577) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ - 487, /* (578) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - 487, /* (579) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - 487, /* (580) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - 487, /* (581) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - 420, /* (582) sliding_opt ::= */ - 420, /* (583) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ - 493, /* (584) interval_sliding_duration_literal ::= NK_VARIABLE */ - 493, /* (585) interval_sliding_duration_literal ::= NK_STRING */ - 493, /* (586) interval_sliding_duration_literal ::= NK_INTEGER */ - 486, /* (587) fill_opt ::= */ - 486, /* (588) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - 486, /* (589) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - 486, /* (590) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - 494, /* (591) fill_mode ::= NONE */ - 494, /* (592) fill_mode ::= PREV */ - 494, /* (593) fill_mode ::= NULL */ - 494, /* (594) fill_mode ::= NULL_F */ - 494, /* (595) fill_mode ::= LINEAR */ - 494, /* (596) fill_mode ::= NEXT */ - 488, /* (597) group_by_clause_opt ::= */ - 488, /* (598) group_by_clause_opt ::= GROUP BY group_by_list */ - 495, /* (599) group_by_list ::= expr_or_subquery */ - 495, /* (600) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 489, /* (601) having_clause_opt ::= */ - 489, /* (602) having_clause_opt ::= HAVING search_condition */ - 484, /* (603) range_opt ::= */ - 484, /* (604) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - 484, /* (605) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 485, /* (606) every_opt ::= */ - 485, /* (607) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - 496, /* (608) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - 497, /* (609) query_simple ::= query_specification */ - 497, /* (610) query_simple ::= union_query_expression */ - 501, /* (611) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - 501, /* (612) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - 502, /* (613) query_simple_or_subquery ::= query_simple */ - 502, /* (614) query_simple_or_subquery ::= subquery */ - 425, /* (615) query_or_subquery ::= query_expression */ - 425, /* (616) query_or_subquery ::= subquery */ - 498, /* (617) order_by_clause_opt ::= */ - 498, /* (618) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 499, /* (619) slimit_clause_opt ::= */ - 499, /* (620) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - 499, /* (621) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - 499, /* (622) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 500, /* (623) limit_clause_opt ::= */ - 500, /* (624) limit_clause_opt ::= LIMIT NK_INTEGER */ - 500, /* (625) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - 500, /* (626) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 475, /* (627) subquery ::= NK_LP query_expression NK_RP */ - 475, /* (628) subquery ::= NK_LP subquery NK_RP */ - 364, /* (629) search_condition ::= common_expression */ - 503, /* (630) sort_specification_list ::= sort_specification */ - 503, /* (631) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - 504, /* (632) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 505, /* (633) ordering_specification_opt ::= */ - 505, /* (634) ordering_specification_opt ::= ASC */ - 505, /* (635) ordering_specification_opt ::= DESC */ - 506, /* (636) null_ordering_opt ::= */ - 506, /* (637) null_ordering_opt ::= NULLS FIRST */ - 506, /* (638) null_ordering_opt ::= NULLS LAST */ + 347, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ + 347, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ + 348, /* (2) account_options ::= */ + 348, /* (3) account_options ::= account_options PPS literal */ + 348, /* (4) account_options ::= account_options TSERIES literal */ + 348, /* (5) account_options ::= account_options STORAGE literal */ + 348, /* (6) account_options ::= account_options STREAMS literal */ + 348, /* (7) account_options ::= account_options QTIME literal */ + 348, /* (8) account_options ::= account_options DBS literal */ + 348, /* (9) account_options ::= account_options USERS literal */ + 348, /* (10) account_options ::= account_options CONNS literal */ + 348, /* (11) account_options ::= account_options STATE literal */ + 349, /* (12) alter_account_options ::= alter_account_option */ + 349, /* (13) alter_account_options ::= alter_account_options alter_account_option */ + 351, /* (14) alter_account_option ::= PASS literal */ + 351, /* (15) alter_account_option ::= PPS literal */ + 351, /* (16) alter_account_option ::= TSERIES literal */ + 351, /* (17) alter_account_option ::= STORAGE literal */ + 351, /* (18) alter_account_option ::= STREAMS literal */ + 351, /* (19) alter_account_option ::= QTIME literal */ + 351, /* (20) alter_account_option ::= DBS literal */ + 351, /* (21) alter_account_option ::= USERS literal */ + 351, /* (22) alter_account_option ::= CONNS literal */ + 351, /* (23) alter_account_option ::= STATE literal */ + 352, /* (24) ip_range_list ::= NK_STRING */ + 352, /* (25) ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ + 353, /* (26) white_list ::= HOST ip_range_list */ + 354, /* (27) white_list_opt ::= */ + 354, /* (28) white_list_opt ::= white_list */ + 347, /* (29) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ + 347, /* (30) cmd ::= ALTER USER user_name PASS NK_STRING */ + 347, /* (31) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ + 347, /* (32) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ + 347, /* (33) cmd ::= ALTER USER user_name ADD white_list */ + 347, /* (34) cmd ::= ALTER USER user_name DROP white_list */ + 347, /* (35) cmd ::= DROP USER user_name */ + 356, /* (36) sysinfo_opt ::= */ + 356, /* (37) sysinfo_opt ::= SYSINFO NK_INTEGER */ + 347, /* (38) cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ + 347, /* (39) cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ + 357, /* (40) privileges ::= ALL */ + 357, /* (41) privileges ::= priv_type_list */ + 357, /* (42) privileges ::= SUBSCRIBE */ + 360, /* (43) priv_type_list ::= priv_type */ + 360, /* (44) priv_type_list ::= priv_type_list NK_COMMA priv_type */ + 361, /* (45) priv_type ::= READ */ + 361, /* (46) priv_type ::= WRITE */ + 361, /* (47) priv_type ::= ALTER */ + 358, /* (48) priv_level ::= NK_STAR NK_DOT NK_STAR */ + 358, /* (49) priv_level ::= db_name NK_DOT NK_STAR */ + 358, /* (50) priv_level ::= db_name NK_DOT table_name */ + 358, /* (51) priv_level ::= topic_name */ + 359, /* (52) with_opt ::= */ + 359, /* (53) with_opt ::= WITH search_condition */ + 347, /* (54) cmd ::= CREATE DNODE dnode_endpoint */ + 347, /* (55) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ + 347, /* (56) cmd ::= DROP DNODE NK_INTEGER force_opt */ + 347, /* (57) cmd ::= DROP DNODE dnode_endpoint force_opt */ + 347, /* (58) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ + 347, /* (59) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ + 347, /* (60) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + 347, /* (61) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + 347, /* (62) cmd ::= ALTER ALL DNODES NK_STRING */ + 347, /* (63) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + 347, /* (64) cmd ::= RESTORE DNODE NK_INTEGER */ + 366, /* (65) dnode_endpoint ::= NK_STRING */ + 366, /* (66) dnode_endpoint ::= NK_ID */ + 366, /* (67) dnode_endpoint ::= NK_IPTOKEN */ + 367, /* (68) force_opt ::= */ + 367, /* (69) force_opt ::= FORCE */ + 368, /* (70) unsafe_opt ::= UNSAFE */ + 347, /* (71) cmd ::= ALTER LOCAL NK_STRING */ + 347, /* (72) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + 347, /* (73) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + 347, /* (74) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + 347, /* (75) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ + 347, /* (76) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + 347, /* (77) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + 347, /* (78) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + 347, /* (79) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + 347, /* (80) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + 347, /* (81) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + 347, /* (82) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ + 347, /* (83) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ + 347, /* (84) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + 347, /* (85) cmd ::= DROP DATABASE exists_opt db_name */ + 347, /* (86) cmd ::= USE db_name */ + 347, /* (87) cmd ::= ALTER DATABASE db_name alter_db_options */ + 347, /* (88) cmd ::= FLUSH DATABASE db_name */ + 347, /* (89) cmd ::= TRIM DATABASE db_name speed_opt */ + 347, /* (90) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ + 369, /* (91) not_exists_opt ::= IF NOT EXISTS */ + 369, /* (92) not_exists_opt ::= */ + 371, /* (93) exists_opt ::= IF EXISTS */ + 371, /* (94) exists_opt ::= */ + 370, /* (95) db_options ::= */ + 370, /* (96) db_options ::= db_options BUFFER NK_INTEGER */ + 370, /* (97) db_options ::= db_options CACHEMODEL NK_STRING */ + 370, /* (98) db_options ::= db_options CACHESIZE NK_INTEGER */ + 370, /* (99) db_options ::= db_options COMP NK_INTEGER */ + 370, /* (100) db_options ::= db_options DURATION NK_INTEGER */ + 370, /* (101) db_options ::= db_options DURATION NK_VARIABLE */ + 370, /* (102) db_options ::= db_options MAXROWS NK_INTEGER */ + 370, /* (103) db_options ::= db_options MINROWS NK_INTEGER */ + 370, /* (104) db_options ::= db_options KEEP integer_list */ + 370, /* (105) db_options ::= db_options KEEP variable_list */ + 370, /* (106) db_options ::= db_options PAGES NK_INTEGER */ + 370, /* (107) db_options ::= db_options PAGESIZE NK_INTEGER */ + 370, /* (108) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ + 370, /* (109) db_options ::= db_options PRECISION NK_STRING */ + 370, /* (110) db_options ::= db_options REPLICA NK_INTEGER */ + 370, /* (111) db_options ::= db_options VGROUPS NK_INTEGER */ + 370, /* (112) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + 370, /* (113) db_options ::= db_options RETENTIONS retention_list */ + 370, /* (114) db_options ::= db_options SCHEMALESS NK_INTEGER */ + 370, /* (115) db_options ::= db_options WAL_LEVEL NK_INTEGER */ + 370, /* (116) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + 370, /* (117) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + 370, /* (118) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + 370, /* (119) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + 370, /* (120) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + 370, /* (121) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + 370, /* (122) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + 370, /* (123) db_options ::= db_options STT_TRIGGER NK_INTEGER */ + 370, /* (124) db_options ::= db_options TABLE_PREFIX signed */ + 370, /* (125) db_options ::= db_options TABLE_SUFFIX signed */ + 370, /* (126) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ + 372, /* (127) alter_db_options ::= alter_db_option */ + 372, /* (128) alter_db_options ::= alter_db_options alter_db_option */ + 380, /* (129) alter_db_option ::= BUFFER NK_INTEGER */ + 380, /* (130) alter_db_option ::= CACHEMODEL NK_STRING */ + 380, /* (131) alter_db_option ::= CACHESIZE NK_INTEGER */ + 380, /* (132) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + 380, /* (133) alter_db_option ::= KEEP integer_list */ + 380, /* (134) alter_db_option ::= KEEP variable_list */ + 380, /* (135) alter_db_option ::= PAGES NK_INTEGER */ + 380, /* (136) alter_db_option ::= REPLICA NK_INTEGER */ + 380, /* (137) alter_db_option ::= WAL_LEVEL NK_INTEGER */ + 380, /* (138) alter_db_option ::= STT_TRIGGER NK_INTEGER */ + 380, /* (139) alter_db_option ::= MINROWS NK_INTEGER */ + 380, /* (140) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ + 380, /* (141) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + 380, /* (142) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ + 380, /* (143) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + 380, /* (144) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ + 376, /* (145) integer_list ::= NK_INTEGER */ + 376, /* (146) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + 377, /* (147) variable_list ::= NK_VARIABLE */ + 377, /* (148) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + 378, /* (149) retention_list ::= retention */ + 378, /* (150) retention_list ::= retention_list NK_COMMA retention */ + 381, /* (151) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + 381, /* (152) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ + 373, /* (153) speed_opt ::= */ + 373, /* (154) speed_opt ::= BWLIMIT NK_INTEGER */ + 374, /* (155) start_opt ::= */ + 374, /* (156) start_opt ::= START WITH NK_INTEGER */ + 374, /* (157) start_opt ::= START WITH NK_STRING */ + 374, /* (158) start_opt ::= START WITH TIMESTAMP NK_STRING */ + 375, /* (159) end_opt ::= */ + 375, /* (160) end_opt ::= END WITH NK_INTEGER */ + 375, /* (161) end_opt ::= END WITH NK_STRING */ + 375, /* (162) end_opt ::= END WITH TIMESTAMP NK_STRING */ + 347, /* (163) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + 347, /* (164) cmd ::= CREATE TABLE multi_create_clause */ + 347, /* (165) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + 347, /* (166) cmd ::= DROP TABLE multi_drop_clause */ + 347, /* (167) cmd ::= DROP STABLE exists_opt full_table_name */ + 347, /* (168) cmd ::= ALTER TABLE alter_table_clause */ + 347, /* (169) cmd ::= ALTER STABLE alter_table_clause */ + 389, /* (170) alter_table_clause ::= full_table_name alter_table_options */ + 389, /* (171) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + 389, /* (172) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + 389, /* (173) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + 389, /* (174) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + 389, /* (175) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + 389, /* (176) alter_table_clause ::= full_table_name DROP TAG column_name */ + 389, /* (177) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + 389, /* (178) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + 389, /* (179) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ + 386, /* (180) multi_create_clause ::= create_subtable_clause */ + 386, /* (181) multi_create_clause ::= multi_create_clause create_subtable_clause */ + 394, /* (182) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ + 388, /* (183) multi_drop_clause ::= drop_table_clause */ + 388, /* (184) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ + 397, /* (185) drop_table_clause ::= exists_opt full_table_name */ + 395, /* (186) specific_cols_opt ::= */ + 395, /* (187) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + 382, /* (188) full_table_name ::= table_name */ + 382, /* (189) full_table_name ::= db_name NK_DOT table_name */ + 383, /* (190) column_def_list ::= column_def */ + 383, /* (191) column_def_list ::= column_def_list NK_COMMA column_def */ + 399, /* (192) column_def ::= column_name type_name */ + 392, /* (193) type_name ::= BOOL */ + 392, /* (194) type_name ::= TINYINT */ + 392, /* (195) type_name ::= SMALLINT */ + 392, /* (196) type_name ::= INT */ + 392, /* (197) type_name ::= INTEGER */ + 392, /* (198) type_name ::= BIGINT */ + 392, /* (199) type_name ::= FLOAT */ + 392, /* (200) type_name ::= DOUBLE */ + 392, /* (201) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + 392, /* (202) type_name ::= TIMESTAMP */ + 392, /* (203) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + 392, /* (204) type_name ::= TINYINT UNSIGNED */ + 392, /* (205) type_name ::= SMALLINT UNSIGNED */ + 392, /* (206) type_name ::= INT UNSIGNED */ + 392, /* (207) type_name ::= BIGINT UNSIGNED */ + 392, /* (208) type_name ::= JSON */ + 392, /* (209) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + 392, /* (210) type_name ::= MEDIUMBLOB */ + 392, /* (211) type_name ::= BLOB */ + 392, /* (212) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + 392, /* (213) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ + 392, /* (214) type_name ::= DECIMAL */ + 392, /* (215) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + 392, /* (216) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 384, /* (217) tags_def_opt ::= */ + 384, /* (218) tags_def_opt ::= tags_def */ + 387, /* (219) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + 385, /* (220) table_options ::= */ + 385, /* (221) table_options ::= table_options COMMENT NK_STRING */ + 385, /* (222) table_options ::= table_options MAX_DELAY duration_list */ + 385, /* (223) table_options ::= table_options WATERMARK duration_list */ + 385, /* (224) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + 385, /* (225) table_options ::= table_options TTL NK_INTEGER */ + 385, /* (226) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + 385, /* (227) table_options ::= table_options DELETE_MARK duration_list */ + 390, /* (228) alter_table_options ::= alter_table_option */ + 390, /* (229) alter_table_options ::= alter_table_options alter_table_option */ + 402, /* (230) alter_table_option ::= COMMENT NK_STRING */ + 402, /* (231) alter_table_option ::= TTL NK_INTEGER */ + 400, /* (232) duration_list ::= duration_literal */ + 400, /* (233) duration_list ::= duration_list NK_COMMA duration_literal */ + 401, /* (234) rollup_func_list ::= rollup_func_name */ + 401, /* (235) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + 404, /* (236) rollup_func_name ::= function_name */ + 404, /* (237) rollup_func_name ::= FIRST */ + 404, /* (238) rollup_func_name ::= LAST */ + 398, /* (239) col_name_list ::= col_name */ + 398, /* (240) col_name_list ::= col_name_list NK_COMMA col_name */ + 406, /* (241) col_name ::= column_name */ + 347, /* (242) cmd ::= SHOW DNODES */ + 347, /* (243) cmd ::= SHOW USERS */ + 347, /* (244) cmd ::= SHOW USER PRIVILEGES */ + 347, /* (245) cmd ::= SHOW db_kind_opt DATABASES */ + 347, /* (246) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ + 347, /* (247) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + 347, /* (248) cmd ::= SHOW db_name_cond_opt VGROUPS */ + 347, /* (249) cmd ::= SHOW MNODES */ + 347, /* (250) cmd ::= SHOW QNODES */ + 347, /* (251) cmd ::= SHOW FUNCTIONS */ + 347, /* (252) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + 347, /* (253) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ + 347, /* (254) cmd ::= SHOW STREAMS */ + 347, /* (255) cmd ::= SHOW ACCOUNTS */ + 347, /* (256) cmd ::= SHOW APPS */ + 347, /* (257) cmd ::= SHOW CONNECTIONS */ + 347, /* (258) cmd ::= SHOW LICENCES */ + 347, /* (259) cmd ::= SHOW GRANTS */ + 347, /* (260) cmd ::= SHOW CREATE DATABASE db_name */ + 347, /* (261) cmd ::= SHOW CREATE TABLE full_table_name */ + 347, /* (262) cmd ::= SHOW CREATE STABLE full_table_name */ + 347, /* (263) cmd ::= SHOW QUERIES */ + 347, /* (264) cmd ::= SHOW SCORES */ + 347, /* (265) cmd ::= SHOW TOPICS */ + 347, /* (266) cmd ::= SHOW VARIABLES */ + 347, /* (267) cmd ::= SHOW CLUSTER VARIABLES */ + 347, /* (268) cmd ::= SHOW LOCAL VARIABLES */ + 347, /* (269) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + 347, /* (270) cmd ::= SHOW BNODES */ + 347, /* (271) cmd ::= SHOW SNODES */ + 347, /* (272) cmd ::= SHOW CLUSTER */ + 347, /* (273) cmd ::= SHOW TRANSACTIONS */ + 347, /* (274) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + 347, /* (275) cmd ::= SHOW CONSUMERS */ + 347, /* (276) cmd ::= SHOW SUBSCRIPTIONS */ + 347, /* (277) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + 347, /* (278) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ + 347, /* (279) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + 347, /* (280) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ + 347, /* (281) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + 347, /* (282) cmd ::= SHOW VNODES */ + 347, /* (283) cmd ::= SHOW db_name_cond_opt ALIVE */ + 347, /* (284) cmd ::= SHOW CLUSTER ALIVE */ + 347, /* (285) cmd ::= SHOW db_name_cond_opt VIEWS */ + 347, /* (286) cmd ::= SHOW CREATE VIEW full_table_name */ + 347, /* (287) cmd ::= SHOW COMPACTS */ + 347, /* (288) cmd ::= SHOW COMPACT NK_INTEGER */ + 408, /* (289) table_kind_db_name_cond_opt ::= */ + 408, /* (290) table_kind_db_name_cond_opt ::= table_kind */ + 408, /* (291) table_kind_db_name_cond_opt ::= db_name NK_DOT */ + 408, /* (292) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ + 414, /* (293) table_kind ::= NORMAL */ + 414, /* (294) table_kind ::= CHILD */ + 410, /* (295) db_name_cond_opt ::= */ + 410, /* (296) db_name_cond_opt ::= db_name NK_DOT */ + 409, /* (297) like_pattern_opt ::= */ + 409, /* (298) like_pattern_opt ::= LIKE NK_STRING */ + 411, /* (299) table_name_cond ::= table_name */ + 412, /* (300) from_db_opt ::= */ + 412, /* (301) from_db_opt ::= FROM db_name */ + 413, /* (302) tag_list_opt ::= */ + 413, /* (303) tag_list_opt ::= tag_item */ + 413, /* (304) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + 415, /* (305) tag_item ::= TBNAME */ + 415, /* (306) tag_item ::= QTAGS */ + 415, /* (307) tag_item ::= column_name */ + 415, /* (308) tag_item ::= column_name column_alias */ + 415, /* (309) tag_item ::= column_name AS column_alias */ + 407, /* (310) db_kind_opt ::= */ + 407, /* (311) db_kind_opt ::= USER */ + 407, /* (312) db_kind_opt ::= SYSTEM */ + 347, /* (313) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ + 347, /* (314) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ + 347, /* (315) cmd ::= DROP INDEX exists_opt full_index_name */ + 418, /* (316) full_index_name ::= index_name */ + 418, /* (317) full_index_name ::= db_name NK_DOT index_name */ + 417, /* (318) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + 417, /* (319) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ + 420, /* (320) func_list ::= func */ + 420, /* (321) func_list ::= func_list NK_COMMA func */ + 423, /* (322) func ::= sma_func_name NK_LP expression_list NK_RP */ + 424, /* (323) sma_func_name ::= function_name */ + 424, /* (324) sma_func_name ::= COUNT */ + 424, /* (325) sma_func_name ::= FIRST */ + 424, /* (326) sma_func_name ::= LAST */ + 424, /* (327) sma_func_name ::= LAST_ROW */ + 422, /* (328) sma_stream_opt ::= */ + 422, /* (329) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + 422, /* (330) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + 422, /* (331) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + 425, /* (332) with_meta ::= AS */ + 425, /* (333) with_meta ::= WITH META AS */ + 425, /* (334) with_meta ::= ONLY META AS */ + 347, /* (335) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + 347, /* (336) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ + 347, /* (337) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ + 347, /* (338) cmd ::= DROP TOPIC exists_opt topic_name */ + 347, /* (339) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + 347, /* (340) cmd ::= DESC full_table_name */ + 347, /* (341) cmd ::= DESCRIBE full_table_name */ + 347, /* (342) cmd ::= RESET QUERY CACHE */ + 347, /* (343) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + 347, /* (344) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ + 429, /* (345) analyze_opt ::= */ + 429, /* (346) analyze_opt ::= ANALYZE */ + 430, /* (347) explain_options ::= */ + 430, /* (348) explain_options ::= explain_options VERBOSE NK_BOOL */ + 430, /* (349) explain_options ::= explain_options RATIO NK_FLOAT */ + 347, /* (350) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ + 347, /* (351) cmd ::= DROP FUNCTION exists_opt function_name */ + 433, /* (352) agg_func_opt ::= */ + 433, /* (353) agg_func_opt ::= AGGREGATE */ + 434, /* (354) bufsize_opt ::= */ + 434, /* (355) bufsize_opt ::= BUFSIZE NK_INTEGER */ + 435, /* (356) language_opt ::= */ + 435, /* (357) language_opt ::= LANGUAGE NK_STRING */ + 432, /* (358) or_replace_opt ::= */ + 432, /* (359) or_replace_opt ::= OR REPLACE */ + 347, /* (360) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ + 347, /* (361) cmd ::= DROP VIEW exists_opt full_view_name */ + 436, /* (362) full_view_name ::= view_name */ + 436, /* (363) full_view_name ::= db_name NK_DOT view_name */ + 347, /* (364) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ + 347, /* (365) cmd ::= DROP STREAM exists_opt stream_name */ + 347, /* (366) cmd ::= PAUSE STREAM exists_opt stream_name */ + 347, /* (367) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + 440, /* (368) col_list_opt ::= */ + 440, /* (369) col_list_opt ::= NK_LP col_name_list NK_RP */ + 441, /* (370) tag_def_or_ref_opt ::= */ + 441, /* (371) tag_def_or_ref_opt ::= tags_def */ + 441, /* (372) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ + 439, /* (373) stream_options ::= */ + 439, /* (374) stream_options ::= stream_options TRIGGER AT_ONCE */ + 439, /* (375) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + 439, /* (376) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + 439, /* (377) stream_options ::= stream_options WATERMARK duration_literal */ + 439, /* (378) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + 439, /* (379) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + 439, /* (380) stream_options ::= stream_options DELETE_MARK duration_literal */ + 439, /* (381) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + 442, /* (382) subtable_opt ::= */ + 442, /* (383) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + 443, /* (384) ignore_opt ::= */ + 443, /* (385) ignore_opt ::= IGNORE UNTREATED */ + 347, /* (386) cmd ::= KILL CONNECTION NK_INTEGER */ + 347, /* (387) cmd ::= KILL QUERY NK_STRING */ + 347, /* (388) cmd ::= KILL TRANSACTION NK_INTEGER */ + 347, /* (389) cmd ::= KILL COMPACT NK_INTEGER */ + 347, /* (390) cmd ::= BALANCE VGROUP */ + 347, /* (391) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ + 347, /* (392) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + 347, /* (393) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + 347, /* (394) cmd ::= SPLIT VGROUP NK_INTEGER */ + 445, /* (395) on_vgroup_id ::= */ + 445, /* (396) on_vgroup_id ::= ON NK_INTEGER */ + 446, /* (397) dnode_list ::= DNODE NK_INTEGER */ + 446, /* (398) dnode_list ::= dnode_list DNODE NK_INTEGER */ + 347, /* (399) cmd ::= DELETE FROM full_table_name where_clause_opt */ + 347, /* (400) cmd ::= query_or_subquery */ + 347, /* (401) cmd ::= insert_query */ + 431, /* (402) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + 431, /* (403) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + 350, /* (404) literal ::= NK_INTEGER */ + 350, /* (405) literal ::= NK_FLOAT */ + 350, /* (406) literal ::= NK_STRING */ + 350, /* (407) literal ::= NK_BOOL */ + 350, /* (408) literal ::= TIMESTAMP NK_STRING */ + 350, /* (409) literal ::= duration_literal */ + 350, /* (410) literal ::= NULL */ + 350, /* (411) literal ::= NK_QUESTION */ + 403, /* (412) duration_literal ::= NK_VARIABLE */ + 379, /* (413) signed ::= NK_INTEGER */ + 379, /* (414) signed ::= NK_PLUS NK_INTEGER */ + 379, /* (415) signed ::= NK_MINUS NK_INTEGER */ + 379, /* (416) signed ::= NK_FLOAT */ + 379, /* (417) signed ::= NK_PLUS NK_FLOAT */ + 379, /* (418) signed ::= NK_MINUS NK_FLOAT */ + 393, /* (419) signed_literal ::= signed */ + 393, /* (420) signed_literal ::= NK_STRING */ + 393, /* (421) signed_literal ::= NK_BOOL */ + 393, /* (422) signed_literal ::= TIMESTAMP NK_STRING */ + 393, /* (423) signed_literal ::= duration_literal */ + 393, /* (424) signed_literal ::= NULL */ + 393, /* (425) signed_literal ::= literal_func */ + 393, /* (426) signed_literal ::= NK_QUESTION */ + 448, /* (427) literal_list ::= signed_literal */ + 448, /* (428) literal_list ::= literal_list NK_COMMA signed_literal */ + 362, /* (429) db_name ::= NK_ID */ + 363, /* (430) table_name ::= NK_ID */ + 391, /* (431) column_name ::= NK_ID */ + 405, /* (432) function_name ::= NK_ID */ + 437, /* (433) view_name ::= NK_ID */ + 449, /* (434) table_alias ::= NK_ID */ + 416, /* (435) column_alias ::= NK_ID */ + 416, /* (436) column_alias ::= NK_ALIAS */ + 355, /* (437) user_name ::= NK_ID */ + 364, /* (438) topic_name ::= NK_ID */ + 438, /* (439) stream_name ::= NK_ID */ + 428, /* (440) cgroup_name ::= NK_ID */ + 419, /* (441) index_name ::= NK_ID */ + 450, /* (442) expr_or_subquery ::= expression */ + 444, /* (443) expression ::= literal */ + 444, /* (444) expression ::= pseudo_column */ + 444, /* (445) expression ::= column_reference */ + 444, /* (446) expression ::= function_expression */ + 444, /* (447) expression ::= case_when_expression */ + 444, /* (448) expression ::= NK_LP expression NK_RP */ + 444, /* (449) expression ::= NK_PLUS expr_or_subquery */ + 444, /* (450) expression ::= NK_MINUS expr_or_subquery */ + 444, /* (451) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + 444, /* (452) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + 444, /* (453) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + 444, /* (454) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + 444, /* (455) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + 444, /* (456) expression ::= column_reference NK_ARROW NK_STRING */ + 444, /* (457) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + 444, /* (458) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + 396, /* (459) expression_list ::= expr_or_subquery */ + 396, /* (460) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + 452, /* (461) column_reference ::= column_name */ + 452, /* (462) column_reference ::= table_name NK_DOT column_name */ + 452, /* (463) column_reference ::= NK_ALIAS */ + 452, /* (464) column_reference ::= table_name NK_DOT NK_ALIAS */ + 451, /* (465) pseudo_column ::= ROWTS */ + 451, /* (466) pseudo_column ::= TBNAME */ + 451, /* (467) pseudo_column ::= table_name NK_DOT TBNAME */ + 451, /* (468) pseudo_column ::= QSTART */ + 451, /* (469) pseudo_column ::= QEND */ + 451, /* (470) pseudo_column ::= QDURATION */ + 451, /* (471) pseudo_column ::= WSTART */ + 451, /* (472) pseudo_column ::= WEND */ + 451, /* (473) pseudo_column ::= WDURATION */ + 451, /* (474) pseudo_column ::= IROWTS */ + 451, /* (475) pseudo_column ::= ISFILLED */ + 451, /* (476) pseudo_column ::= QTAGS */ + 453, /* (477) function_expression ::= function_name NK_LP expression_list NK_RP */ + 453, /* (478) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + 453, /* (479) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + 453, /* (480) function_expression ::= literal_func */ + 447, /* (481) literal_func ::= noarg_func NK_LP NK_RP */ + 447, /* (482) literal_func ::= NOW */ + 457, /* (483) noarg_func ::= NOW */ + 457, /* (484) noarg_func ::= TODAY */ + 457, /* (485) noarg_func ::= TIMEZONE */ + 457, /* (486) noarg_func ::= DATABASE */ + 457, /* (487) noarg_func ::= CLIENT_VERSION */ + 457, /* (488) noarg_func ::= SERVER_VERSION */ + 457, /* (489) noarg_func ::= SERVER_STATUS */ + 457, /* (490) noarg_func ::= CURRENT_USER */ + 457, /* (491) noarg_func ::= USER */ + 455, /* (492) star_func ::= COUNT */ + 455, /* (493) star_func ::= FIRST */ + 455, /* (494) star_func ::= LAST */ + 455, /* (495) star_func ::= LAST_ROW */ + 456, /* (496) star_func_para_list ::= NK_STAR */ + 456, /* (497) star_func_para_list ::= other_para_list */ + 458, /* (498) other_para_list ::= star_func_para */ + 458, /* (499) other_para_list ::= other_para_list NK_COMMA star_func_para */ + 459, /* (500) star_func_para ::= expr_or_subquery */ + 459, /* (501) star_func_para ::= table_name NK_DOT NK_STAR */ + 454, /* (502) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + 454, /* (503) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + 460, /* (504) when_then_list ::= when_then_expr */ + 460, /* (505) when_then_list ::= when_then_list when_then_expr */ + 463, /* (506) when_then_expr ::= WHEN common_expression THEN common_expression */ + 461, /* (507) case_when_else_opt ::= */ + 461, /* (508) case_when_else_opt ::= ELSE common_expression */ + 464, /* (509) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + 464, /* (510) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + 464, /* (511) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + 464, /* (512) predicate ::= expr_or_subquery IS NULL */ + 464, /* (513) predicate ::= expr_or_subquery IS NOT NULL */ + 464, /* (514) predicate ::= expr_or_subquery in_op in_predicate_value */ + 465, /* (515) compare_op ::= NK_LT */ + 465, /* (516) compare_op ::= NK_GT */ + 465, /* (517) compare_op ::= NK_LE */ + 465, /* (518) compare_op ::= NK_GE */ + 465, /* (519) compare_op ::= NK_NE */ + 465, /* (520) compare_op ::= NK_EQ */ + 465, /* (521) compare_op ::= LIKE */ + 465, /* (522) compare_op ::= NOT LIKE */ + 465, /* (523) compare_op ::= MATCH */ + 465, /* (524) compare_op ::= NMATCH */ + 465, /* (525) compare_op ::= CONTAINS */ + 466, /* (526) in_op ::= IN */ + 466, /* (527) in_op ::= NOT IN */ + 467, /* (528) in_predicate_value ::= NK_LP literal_list NK_RP */ + 468, /* (529) boolean_value_expression ::= boolean_primary */ + 468, /* (530) boolean_value_expression ::= NOT boolean_primary */ + 468, /* (531) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + 468, /* (532) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + 469, /* (533) boolean_primary ::= predicate */ + 469, /* (534) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + 462, /* (535) common_expression ::= expr_or_subquery */ + 462, /* (536) common_expression ::= boolean_value_expression */ + 470, /* (537) from_clause_opt ::= */ + 470, /* (538) from_clause_opt ::= FROM table_reference_list */ + 471, /* (539) table_reference_list ::= table_reference */ + 471, /* (540) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + 472, /* (541) table_reference ::= table_primary */ + 472, /* (542) table_reference ::= joined_table */ + 473, /* (543) table_primary ::= table_name alias_opt */ + 473, /* (544) table_primary ::= db_name NK_DOT table_name alias_opt */ + 473, /* (545) table_primary ::= subquery alias_opt */ + 473, /* (546) table_primary ::= parenthesized_joined_table */ + 475, /* (547) alias_opt ::= */ + 475, /* (548) alias_opt ::= table_alias */ + 475, /* (549) alias_opt ::= AS table_alias */ + 477, /* (550) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + 477, /* (551) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + 474, /* (552) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + 478, /* (553) join_type ::= */ + 478, /* (554) join_type ::= INNER */ + 479, /* (555) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + 480, /* (556) hint_list ::= */ + 480, /* (557) hint_list ::= NK_HINT */ + 482, /* (558) tag_mode_opt ::= */ + 482, /* (559) tag_mode_opt ::= TAGS */ + 481, /* (560) set_quantifier_opt ::= */ + 481, /* (561) set_quantifier_opt ::= DISTINCT */ + 481, /* (562) set_quantifier_opt ::= ALL */ + 483, /* (563) select_list ::= select_item */ + 483, /* (564) select_list ::= select_list NK_COMMA select_item */ + 491, /* (565) select_item ::= NK_STAR */ + 491, /* (566) select_item ::= common_expression */ + 491, /* (567) select_item ::= common_expression column_alias */ + 491, /* (568) select_item ::= common_expression AS column_alias */ + 491, /* (569) select_item ::= table_name NK_DOT NK_STAR */ + 427, /* (570) where_clause_opt ::= */ + 427, /* (571) where_clause_opt ::= WHERE search_condition */ + 484, /* (572) partition_by_clause_opt ::= */ + 484, /* (573) partition_by_clause_opt ::= PARTITION BY partition_list */ + 492, /* (574) partition_list ::= partition_item */ + 492, /* (575) partition_list ::= partition_list NK_COMMA partition_item */ + 493, /* (576) partition_item ::= expr_or_subquery */ + 493, /* (577) partition_item ::= expr_or_subquery column_alias */ + 493, /* (578) partition_item ::= expr_or_subquery AS column_alias */ + 488, /* (579) twindow_clause_opt ::= */ + 488, /* (580) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ + 488, /* (581) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + 488, /* (582) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + 488, /* (583) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + 488, /* (584) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + 421, /* (585) sliding_opt ::= */ + 421, /* (586) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ + 494, /* (587) interval_sliding_duration_literal ::= NK_VARIABLE */ + 494, /* (588) interval_sliding_duration_literal ::= NK_STRING */ + 494, /* (589) interval_sliding_duration_literal ::= NK_INTEGER */ + 487, /* (590) fill_opt ::= */ + 487, /* (591) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + 487, /* (592) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + 487, /* (593) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + 495, /* (594) fill_mode ::= NONE */ + 495, /* (595) fill_mode ::= PREV */ + 495, /* (596) fill_mode ::= NULL */ + 495, /* (597) fill_mode ::= NULL_F */ + 495, /* (598) fill_mode ::= LINEAR */ + 495, /* (599) fill_mode ::= NEXT */ + 489, /* (600) group_by_clause_opt ::= */ + 489, /* (601) group_by_clause_opt ::= GROUP BY group_by_list */ + 496, /* (602) group_by_list ::= expr_or_subquery */ + 496, /* (603) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 490, /* (604) having_clause_opt ::= */ + 490, /* (605) having_clause_opt ::= HAVING search_condition */ + 485, /* (606) range_opt ::= */ + 485, /* (607) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + 485, /* (608) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 486, /* (609) every_opt ::= */ + 486, /* (610) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + 497, /* (611) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + 498, /* (612) query_simple ::= query_specification */ + 498, /* (613) query_simple ::= union_query_expression */ + 502, /* (614) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + 502, /* (615) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + 503, /* (616) query_simple_or_subquery ::= query_simple */ + 503, /* (617) query_simple_or_subquery ::= subquery */ + 426, /* (618) query_or_subquery ::= query_expression */ + 426, /* (619) query_or_subquery ::= subquery */ + 499, /* (620) order_by_clause_opt ::= */ + 499, /* (621) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 500, /* (622) slimit_clause_opt ::= */ + 500, /* (623) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + 500, /* (624) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + 500, /* (625) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 501, /* (626) limit_clause_opt ::= */ + 501, /* (627) limit_clause_opt ::= LIMIT NK_INTEGER */ + 501, /* (628) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + 501, /* (629) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 476, /* (630) subquery ::= NK_LP query_expression NK_RP */ + 476, /* (631) subquery ::= NK_LP subquery NK_RP */ + 365, /* (632) search_condition ::= common_expression */ + 504, /* (633) sort_specification_list ::= sort_specification */ + 504, /* (634) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + 505, /* (635) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 506, /* (636) ordering_specification_opt ::= */ + 506, /* (637) ordering_specification_opt ::= ASC */ + 506, /* (638) ordering_specification_opt ::= DESC */ + 507, /* (639) null_ordering_opt ::= */ + 507, /* (640) null_ordering_opt ::= NULLS FIRST */ + 507, /* (641) null_ordering_opt ::= NULLS LAST */ }; /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number @@ -4286,358 +4656,361 @@ static const signed char yyRuleInfoNRhs[] = { -3, /* (284) cmd ::= SHOW CLUSTER ALIVE */ -3, /* (285) cmd ::= SHOW db_name_cond_opt VIEWS */ -4, /* (286) cmd ::= SHOW CREATE VIEW full_table_name */ - 0, /* (287) table_kind_db_name_cond_opt ::= */ - -1, /* (288) table_kind_db_name_cond_opt ::= table_kind */ - -2, /* (289) table_kind_db_name_cond_opt ::= db_name NK_DOT */ - -3, /* (290) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ - -1, /* (291) table_kind ::= NORMAL */ - -1, /* (292) table_kind ::= CHILD */ - 0, /* (293) db_name_cond_opt ::= */ - -2, /* (294) db_name_cond_opt ::= db_name NK_DOT */ - 0, /* (295) like_pattern_opt ::= */ - -2, /* (296) like_pattern_opt ::= LIKE NK_STRING */ - -1, /* (297) table_name_cond ::= table_name */ - 0, /* (298) from_db_opt ::= */ - -2, /* (299) from_db_opt ::= FROM db_name */ - 0, /* (300) tag_list_opt ::= */ - -1, /* (301) tag_list_opt ::= tag_item */ - -3, /* (302) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - -1, /* (303) tag_item ::= TBNAME */ - -1, /* (304) tag_item ::= QTAGS */ - -1, /* (305) tag_item ::= column_name */ - -2, /* (306) tag_item ::= column_name column_alias */ - -3, /* (307) tag_item ::= column_name AS column_alias */ - 0, /* (308) db_kind_opt ::= */ - -1, /* (309) db_kind_opt ::= USER */ - -1, /* (310) db_kind_opt ::= SYSTEM */ - -8, /* (311) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ - -9, /* (312) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ - -4, /* (313) cmd ::= DROP INDEX exists_opt full_index_name */ - -1, /* (314) full_index_name ::= index_name */ - -3, /* (315) full_index_name ::= db_name NK_DOT index_name */ - -10, /* (316) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - -12, /* (317) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ - -1, /* (318) func_list ::= func */ - -3, /* (319) func_list ::= func_list NK_COMMA func */ - -4, /* (320) func ::= sma_func_name NK_LP expression_list NK_RP */ - -1, /* (321) sma_func_name ::= function_name */ - -1, /* (322) sma_func_name ::= COUNT */ - -1, /* (323) sma_func_name ::= FIRST */ - -1, /* (324) sma_func_name ::= LAST */ - -1, /* (325) sma_func_name ::= LAST_ROW */ - 0, /* (326) sma_stream_opt ::= */ - -3, /* (327) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - -3, /* (328) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - -3, /* (329) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - -1, /* (330) with_meta ::= AS */ - -3, /* (331) with_meta ::= WITH META AS */ - -3, /* (332) with_meta ::= ONLY META AS */ - -6, /* (333) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - -7, /* (334) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ - -8, /* (335) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ - -4, /* (336) cmd ::= DROP TOPIC exists_opt topic_name */ - -7, /* (337) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - -2, /* (338) cmd ::= DESC full_table_name */ - -2, /* (339) cmd ::= DESCRIBE full_table_name */ - -3, /* (340) cmd ::= RESET QUERY CACHE */ - -4, /* (341) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - -4, /* (342) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ - 0, /* (343) analyze_opt ::= */ - -1, /* (344) analyze_opt ::= ANALYZE */ - 0, /* (345) explain_options ::= */ - -3, /* (346) explain_options ::= explain_options VERBOSE NK_BOOL */ - -3, /* (347) explain_options ::= explain_options RATIO NK_FLOAT */ - -12, /* (348) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ - -4, /* (349) cmd ::= DROP FUNCTION exists_opt function_name */ - 0, /* (350) agg_func_opt ::= */ - -1, /* (351) agg_func_opt ::= AGGREGATE */ - 0, /* (352) bufsize_opt ::= */ - -2, /* (353) bufsize_opt ::= BUFSIZE NK_INTEGER */ - 0, /* (354) language_opt ::= */ - -2, /* (355) language_opt ::= LANGUAGE NK_STRING */ - 0, /* (356) or_replace_opt ::= */ - -2, /* (357) or_replace_opt ::= OR REPLACE */ - -6, /* (358) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ - -4, /* (359) cmd ::= DROP VIEW exists_opt full_view_name */ - -1, /* (360) full_view_name ::= view_name */ - -3, /* (361) full_view_name ::= db_name NK_DOT view_name */ - -12, /* (362) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ - -4, /* (363) cmd ::= DROP STREAM exists_opt stream_name */ - -4, /* (364) cmd ::= PAUSE STREAM exists_opt stream_name */ - -5, /* (365) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ - 0, /* (366) col_list_opt ::= */ - -3, /* (367) col_list_opt ::= NK_LP col_name_list NK_RP */ - 0, /* (368) tag_def_or_ref_opt ::= */ - -1, /* (369) tag_def_or_ref_opt ::= tags_def */ - -4, /* (370) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ - 0, /* (371) stream_options ::= */ - -3, /* (372) stream_options ::= stream_options TRIGGER AT_ONCE */ - -3, /* (373) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - -4, /* (374) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - -3, /* (375) stream_options ::= stream_options WATERMARK duration_literal */ - -4, /* (376) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - -3, /* (377) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - -3, /* (378) stream_options ::= stream_options DELETE_MARK duration_literal */ - -4, /* (379) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ - 0, /* (380) subtable_opt ::= */ - -4, /* (381) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - 0, /* (382) ignore_opt ::= */ - -2, /* (383) ignore_opt ::= IGNORE UNTREATED */ - -3, /* (384) cmd ::= KILL CONNECTION NK_INTEGER */ - -3, /* (385) cmd ::= KILL QUERY NK_STRING */ - -3, /* (386) cmd ::= KILL TRANSACTION NK_INTEGER */ - -2, /* (387) cmd ::= BALANCE VGROUP */ - -4, /* (388) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ - -4, /* (389) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - -4, /* (390) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - -3, /* (391) cmd ::= SPLIT VGROUP NK_INTEGER */ - 0, /* (392) on_vgroup_id ::= */ - -2, /* (393) on_vgroup_id ::= ON NK_INTEGER */ - -2, /* (394) dnode_list ::= DNODE NK_INTEGER */ - -3, /* (395) dnode_list ::= dnode_list DNODE NK_INTEGER */ - -4, /* (396) cmd ::= DELETE FROM full_table_name where_clause_opt */ - -1, /* (397) cmd ::= query_or_subquery */ - -1, /* (398) cmd ::= insert_query */ - -7, /* (399) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - -4, /* (400) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - -1, /* (401) literal ::= NK_INTEGER */ - -1, /* (402) literal ::= NK_FLOAT */ - -1, /* (403) literal ::= NK_STRING */ - -1, /* (404) literal ::= NK_BOOL */ - -2, /* (405) literal ::= TIMESTAMP NK_STRING */ - -1, /* (406) literal ::= duration_literal */ - -1, /* (407) literal ::= NULL */ - -1, /* (408) literal ::= NK_QUESTION */ - -1, /* (409) duration_literal ::= NK_VARIABLE */ - -1, /* (410) signed ::= NK_INTEGER */ - -2, /* (411) signed ::= NK_PLUS NK_INTEGER */ - -2, /* (412) signed ::= NK_MINUS NK_INTEGER */ - -1, /* (413) signed ::= NK_FLOAT */ - -2, /* (414) signed ::= NK_PLUS NK_FLOAT */ - -2, /* (415) signed ::= NK_MINUS NK_FLOAT */ - -1, /* (416) signed_literal ::= signed */ - -1, /* (417) signed_literal ::= NK_STRING */ - -1, /* (418) signed_literal ::= NK_BOOL */ - -2, /* (419) signed_literal ::= TIMESTAMP NK_STRING */ - -1, /* (420) signed_literal ::= duration_literal */ - -1, /* (421) signed_literal ::= NULL */ - -1, /* (422) signed_literal ::= literal_func */ - -1, /* (423) signed_literal ::= NK_QUESTION */ - -1, /* (424) literal_list ::= signed_literal */ - -3, /* (425) literal_list ::= literal_list NK_COMMA signed_literal */ - -1, /* (426) db_name ::= NK_ID */ - -1, /* (427) table_name ::= NK_ID */ - -1, /* (428) column_name ::= NK_ID */ - -1, /* (429) function_name ::= NK_ID */ - -1, /* (430) view_name ::= NK_ID */ - -1, /* (431) table_alias ::= NK_ID */ - -1, /* (432) column_alias ::= NK_ID */ - -1, /* (433) column_alias ::= NK_ALIAS */ - -1, /* (434) user_name ::= NK_ID */ - -1, /* (435) topic_name ::= NK_ID */ - -1, /* (436) stream_name ::= NK_ID */ - -1, /* (437) cgroup_name ::= NK_ID */ - -1, /* (438) index_name ::= NK_ID */ - -1, /* (439) expr_or_subquery ::= expression */ - -1, /* (440) expression ::= literal */ - -1, /* (441) expression ::= pseudo_column */ - -1, /* (442) expression ::= column_reference */ - -1, /* (443) expression ::= function_expression */ - -1, /* (444) expression ::= case_when_expression */ - -3, /* (445) expression ::= NK_LP expression NK_RP */ - -2, /* (446) expression ::= NK_PLUS expr_or_subquery */ - -2, /* (447) expression ::= NK_MINUS expr_or_subquery */ - -3, /* (448) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - -3, /* (449) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - -3, /* (450) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - -3, /* (451) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - -3, /* (452) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - -3, /* (453) expression ::= column_reference NK_ARROW NK_STRING */ - -3, /* (454) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - -3, /* (455) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - -1, /* (456) expression_list ::= expr_or_subquery */ - -3, /* (457) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - -1, /* (458) column_reference ::= column_name */ - -3, /* (459) column_reference ::= table_name NK_DOT column_name */ - -1, /* (460) column_reference ::= NK_ALIAS */ - -3, /* (461) column_reference ::= table_name NK_DOT NK_ALIAS */ - -1, /* (462) pseudo_column ::= ROWTS */ - -1, /* (463) pseudo_column ::= TBNAME */ - -3, /* (464) pseudo_column ::= table_name NK_DOT TBNAME */ - -1, /* (465) pseudo_column ::= QSTART */ - -1, /* (466) pseudo_column ::= QEND */ - -1, /* (467) pseudo_column ::= QDURATION */ - -1, /* (468) pseudo_column ::= WSTART */ - -1, /* (469) pseudo_column ::= WEND */ - -1, /* (470) pseudo_column ::= WDURATION */ - -1, /* (471) pseudo_column ::= IROWTS */ - -1, /* (472) pseudo_column ::= ISFILLED */ - -1, /* (473) pseudo_column ::= QTAGS */ - -4, /* (474) function_expression ::= function_name NK_LP expression_list NK_RP */ - -4, /* (475) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - -6, /* (476) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - -1, /* (477) function_expression ::= literal_func */ - -3, /* (478) literal_func ::= noarg_func NK_LP NK_RP */ - -1, /* (479) literal_func ::= NOW */ - -1, /* (480) noarg_func ::= NOW */ - -1, /* (481) noarg_func ::= TODAY */ - -1, /* (482) noarg_func ::= TIMEZONE */ - -1, /* (483) noarg_func ::= DATABASE */ - -1, /* (484) noarg_func ::= CLIENT_VERSION */ - -1, /* (485) noarg_func ::= SERVER_VERSION */ - -1, /* (486) noarg_func ::= SERVER_STATUS */ - -1, /* (487) noarg_func ::= CURRENT_USER */ - -1, /* (488) noarg_func ::= USER */ - -1, /* (489) star_func ::= COUNT */ - -1, /* (490) star_func ::= FIRST */ - -1, /* (491) star_func ::= LAST */ - -1, /* (492) star_func ::= LAST_ROW */ - -1, /* (493) star_func_para_list ::= NK_STAR */ - -1, /* (494) star_func_para_list ::= other_para_list */ - -1, /* (495) other_para_list ::= star_func_para */ - -3, /* (496) other_para_list ::= other_para_list NK_COMMA star_func_para */ - -1, /* (497) star_func_para ::= expr_or_subquery */ - -3, /* (498) star_func_para ::= table_name NK_DOT NK_STAR */ - -4, /* (499) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - -5, /* (500) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - -1, /* (501) when_then_list ::= when_then_expr */ - -2, /* (502) when_then_list ::= when_then_list when_then_expr */ - -4, /* (503) when_then_expr ::= WHEN common_expression THEN common_expression */ - 0, /* (504) case_when_else_opt ::= */ - -2, /* (505) case_when_else_opt ::= ELSE common_expression */ - -3, /* (506) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - -5, /* (507) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - -6, /* (508) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - -3, /* (509) predicate ::= expr_or_subquery IS NULL */ - -4, /* (510) predicate ::= expr_or_subquery IS NOT NULL */ - -3, /* (511) predicate ::= expr_or_subquery in_op in_predicate_value */ - -1, /* (512) compare_op ::= NK_LT */ - -1, /* (513) compare_op ::= NK_GT */ - -1, /* (514) compare_op ::= NK_LE */ - -1, /* (515) compare_op ::= NK_GE */ - -1, /* (516) compare_op ::= NK_NE */ - -1, /* (517) compare_op ::= NK_EQ */ - -1, /* (518) compare_op ::= LIKE */ - -2, /* (519) compare_op ::= NOT LIKE */ - -1, /* (520) compare_op ::= MATCH */ - -1, /* (521) compare_op ::= NMATCH */ - -1, /* (522) compare_op ::= CONTAINS */ - -1, /* (523) in_op ::= IN */ - -2, /* (524) in_op ::= NOT IN */ - -3, /* (525) in_predicate_value ::= NK_LP literal_list NK_RP */ - -1, /* (526) boolean_value_expression ::= boolean_primary */ - -2, /* (527) boolean_value_expression ::= NOT boolean_primary */ - -3, /* (528) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - -3, /* (529) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - -1, /* (530) boolean_primary ::= predicate */ - -3, /* (531) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - -1, /* (532) common_expression ::= expr_or_subquery */ - -1, /* (533) common_expression ::= boolean_value_expression */ - 0, /* (534) from_clause_opt ::= */ - -2, /* (535) from_clause_opt ::= FROM table_reference_list */ - -1, /* (536) table_reference_list ::= table_reference */ - -3, /* (537) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - -1, /* (538) table_reference ::= table_primary */ - -1, /* (539) table_reference ::= joined_table */ - -2, /* (540) table_primary ::= table_name alias_opt */ - -4, /* (541) table_primary ::= db_name NK_DOT table_name alias_opt */ - -2, /* (542) table_primary ::= subquery alias_opt */ - -1, /* (543) table_primary ::= parenthesized_joined_table */ - 0, /* (544) alias_opt ::= */ - -1, /* (545) alias_opt ::= table_alias */ - -2, /* (546) alias_opt ::= AS table_alias */ - -3, /* (547) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - -3, /* (548) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - -6, /* (549) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - 0, /* (550) join_type ::= */ - -1, /* (551) join_type ::= INNER */ - -14, /* (552) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - 0, /* (553) hint_list ::= */ - -1, /* (554) hint_list ::= NK_HINT */ - 0, /* (555) tag_mode_opt ::= */ - -1, /* (556) tag_mode_opt ::= TAGS */ - 0, /* (557) set_quantifier_opt ::= */ - -1, /* (558) set_quantifier_opt ::= DISTINCT */ - -1, /* (559) set_quantifier_opt ::= ALL */ - -1, /* (560) select_list ::= select_item */ - -3, /* (561) select_list ::= select_list NK_COMMA select_item */ - -1, /* (562) select_item ::= NK_STAR */ - -1, /* (563) select_item ::= common_expression */ - -2, /* (564) select_item ::= common_expression column_alias */ - -3, /* (565) select_item ::= common_expression AS column_alias */ - -3, /* (566) select_item ::= table_name NK_DOT NK_STAR */ - 0, /* (567) where_clause_opt ::= */ - -2, /* (568) where_clause_opt ::= WHERE search_condition */ - 0, /* (569) partition_by_clause_opt ::= */ - -3, /* (570) partition_by_clause_opt ::= PARTITION BY partition_list */ - -1, /* (571) partition_list ::= partition_item */ - -3, /* (572) partition_list ::= partition_list NK_COMMA partition_item */ - -1, /* (573) partition_item ::= expr_or_subquery */ - -2, /* (574) partition_item ::= expr_or_subquery column_alias */ - -3, /* (575) partition_item ::= expr_or_subquery AS column_alias */ - 0, /* (576) twindow_clause_opt ::= */ - -6, /* (577) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ - -4, /* (578) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - -6, /* (579) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - -8, /* (580) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - -7, /* (581) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - 0, /* (582) sliding_opt ::= */ - -4, /* (583) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ - -1, /* (584) interval_sliding_duration_literal ::= NK_VARIABLE */ - -1, /* (585) interval_sliding_duration_literal ::= NK_STRING */ - -1, /* (586) interval_sliding_duration_literal ::= NK_INTEGER */ - 0, /* (587) fill_opt ::= */ - -4, /* (588) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - -6, /* (589) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - -6, /* (590) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - -1, /* (591) fill_mode ::= NONE */ - -1, /* (592) fill_mode ::= PREV */ - -1, /* (593) fill_mode ::= NULL */ - -1, /* (594) fill_mode ::= NULL_F */ - -1, /* (595) fill_mode ::= LINEAR */ - -1, /* (596) fill_mode ::= NEXT */ - 0, /* (597) group_by_clause_opt ::= */ - -3, /* (598) group_by_clause_opt ::= GROUP BY group_by_list */ - -1, /* (599) group_by_list ::= expr_or_subquery */ - -3, /* (600) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 0, /* (601) having_clause_opt ::= */ - -2, /* (602) having_clause_opt ::= HAVING search_condition */ - 0, /* (603) range_opt ::= */ - -6, /* (604) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - -4, /* (605) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 0, /* (606) every_opt ::= */ - -4, /* (607) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - -4, /* (608) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - -1, /* (609) query_simple ::= query_specification */ - -1, /* (610) query_simple ::= union_query_expression */ - -4, /* (611) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - -3, /* (612) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - -1, /* (613) query_simple_or_subquery ::= query_simple */ - -1, /* (614) query_simple_or_subquery ::= subquery */ - -1, /* (615) query_or_subquery ::= query_expression */ - -1, /* (616) query_or_subquery ::= subquery */ - 0, /* (617) order_by_clause_opt ::= */ - -3, /* (618) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 0, /* (619) slimit_clause_opt ::= */ - -2, /* (620) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - -4, /* (621) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - -4, /* (622) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 0, /* (623) limit_clause_opt ::= */ - -2, /* (624) limit_clause_opt ::= LIMIT NK_INTEGER */ - -4, /* (625) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - -4, /* (626) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - -3, /* (627) subquery ::= NK_LP query_expression NK_RP */ - -3, /* (628) subquery ::= NK_LP subquery NK_RP */ - -1, /* (629) search_condition ::= common_expression */ - -1, /* (630) sort_specification_list ::= sort_specification */ - -3, /* (631) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - -3, /* (632) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 0, /* (633) ordering_specification_opt ::= */ - -1, /* (634) ordering_specification_opt ::= ASC */ - -1, /* (635) ordering_specification_opt ::= DESC */ - 0, /* (636) null_ordering_opt ::= */ - -2, /* (637) null_ordering_opt ::= NULLS FIRST */ - -2, /* (638) null_ordering_opt ::= NULLS LAST */ + -2, /* (287) cmd ::= SHOW COMPACTS */ + -3, /* (288) cmd ::= SHOW COMPACT NK_INTEGER */ + 0, /* (289) table_kind_db_name_cond_opt ::= */ + -1, /* (290) table_kind_db_name_cond_opt ::= table_kind */ + -2, /* (291) table_kind_db_name_cond_opt ::= db_name NK_DOT */ + -3, /* (292) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ + -1, /* (293) table_kind ::= NORMAL */ + -1, /* (294) table_kind ::= CHILD */ + 0, /* (295) db_name_cond_opt ::= */ + -2, /* (296) db_name_cond_opt ::= db_name NK_DOT */ + 0, /* (297) like_pattern_opt ::= */ + -2, /* (298) like_pattern_opt ::= LIKE NK_STRING */ + -1, /* (299) table_name_cond ::= table_name */ + 0, /* (300) from_db_opt ::= */ + -2, /* (301) from_db_opt ::= FROM db_name */ + 0, /* (302) tag_list_opt ::= */ + -1, /* (303) tag_list_opt ::= tag_item */ + -3, /* (304) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + -1, /* (305) tag_item ::= TBNAME */ + -1, /* (306) tag_item ::= QTAGS */ + -1, /* (307) tag_item ::= column_name */ + -2, /* (308) tag_item ::= column_name column_alias */ + -3, /* (309) tag_item ::= column_name AS column_alias */ + 0, /* (310) db_kind_opt ::= */ + -1, /* (311) db_kind_opt ::= USER */ + -1, /* (312) db_kind_opt ::= SYSTEM */ + -8, /* (313) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ + -9, /* (314) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ + -4, /* (315) cmd ::= DROP INDEX exists_opt full_index_name */ + -1, /* (316) full_index_name ::= index_name */ + -3, /* (317) full_index_name ::= db_name NK_DOT index_name */ + -10, /* (318) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + -12, /* (319) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ + -1, /* (320) func_list ::= func */ + -3, /* (321) func_list ::= func_list NK_COMMA func */ + -4, /* (322) func ::= sma_func_name NK_LP expression_list NK_RP */ + -1, /* (323) sma_func_name ::= function_name */ + -1, /* (324) sma_func_name ::= COUNT */ + -1, /* (325) sma_func_name ::= FIRST */ + -1, /* (326) sma_func_name ::= LAST */ + -1, /* (327) sma_func_name ::= LAST_ROW */ + 0, /* (328) sma_stream_opt ::= */ + -3, /* (329) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + -3, /* (330) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + -3, /* (331) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + -1, /* (332) with_meta ::= AS */ + -3, /* (333) with_meta ::= WITH META AS */ + -3, /* (334) with_meta ::= ONLY META AS */ + -6, /* (335) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + -7, /* (336) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ + -8, /* (337) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ + -4, /* (338) cmd ::= DROP TOPIC exists_opt topic_name */ + -7, /* (339) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + -2, /* (340) cmd ::= DESC full_table_name */ + -2, /* (341) cmd ::= DESCRIBE full_table_name */ + -3, /* (342) cmd ::= RESET QUERY CACHE */ + -4, /* (343) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + -4, /* (344) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ + 0, /* (345) analyze_opt ::= */ + -1, /* (346) analyze_opt ::= ANALYZE */ + 0, /* (347) explain_options ::= */ + -3, /* (348) explain_options ::= explain_options VERBOSE NK_BOOL */ + -3, /* (349) explain_options ::= explain_options RATIO NK_FLOAT */ + -12, /* (350) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ + -4, /* (351) cmd ::= DROP FUNCTION exists_opt function_name */ + 0, /* (352) agg_func_opt ::= */ + -1, /* (353) agg_func_opt ::= AGGREGATE */ + 0, /* (354) bufsize_opt ::= */ + -2, /* (355) bufsize_opt ::= BUFSIZE NK_INTEGER */ + 0, /* (356) language_opt ::= */ + -2, /* (357) language_opt ::= LANGUAGE NK_STRING */ + 0, /* (358) or_replace_opt ::= */ + -2, /* (359) or_replace_opt ::= OR REPLACE */ + -6, /* (360) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ + -4, /* (361) cmd ::= DROP VIEW exists_opt full_view_name */ + -1, /* (362) full_view_name ::= view_name */ + -3, /* (363) full_view_name ::= db_name NK_DOT view_name */ + -12, /* (364) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ + -4, /* (365) cmd ::= DROP STREAM exists_opt stream_name */ + -4, /* (366) cmd ::= PAUSE STREAM exists_opt stream_name */ + -5, /* (367) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + 0, /* (368) col_list_opt ::= */ + -3, /* (369) col_list_opt ::= NK_LP col_name_list NK_RP */ + 0, /* (370) tag_def_or_ref_opt ::= */ + -1, /* (371) tag_def_or_ref_opt ::= tags_def */ + -4, /* (372) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ + 0, /* (373) stream_options ::= */ + -3, /* (374) stream_options ::= stream_options TRIGGER AT_ONCE */ + -3, /* (375) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + -4, /* (376) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + -3, /* (377) stream_options ::= stream_options WATERMARK duration_literal */ + -4, /* (378) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + -3, /* (379) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + -3, /* (380) stream_options ::= stream_options DELETE_MARK duration_literal */ + -4, /* (381) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + 0, /* (382) subtable_opt ::= */ + -4, /* (383) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + 0, /* (384) ignore_opt ::= */ + -2, /* (385) ignore_opt ::= IGNORE UNTREATED */ + -3, /* (386) cmd ::= KILL CONNECTION NK_INTEGER */ + -3, /* (387) cmd ::= KILL QUERY NK_STRING */ + -3, /* (388) cmd ::= KILL TRANSACTION NK_INTEGER */ + -3, /* (389) cmd ::= KILL COMPACT NK_INTEGER */ + -2, /* (390) cmd ::= BALANCE VGROUP */ + -4, /* (391) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ + -4, /* (392) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + -4, /* (393) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + -3, /* (394) cmd ::= SPLIT VGROUP NK_INTEGER */ + 0, /* (395) on_vgroup_id ::= */ + -2, /* (396) on_vgroup_id ::= ON NK_INTEGER */ + -2, /* (397) dnode_list ::= DNODE NK_INTEGER */ + -3, /* (398) dnode_list ::= dnode_list DNODE NK_INTEGER */ + -4, /* (399) cmd ::= DELETE FROM full_table_name where_clause_opt */ + -1, /* (400) cmd ::= query_or_subquery */ + -1, /* (401) cmd ::= insert_query */ + -7, /* (402) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + -4, /* (403) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + -1, /* (404) literal ::= NK_INTEGER */ + -1, /* (405) literal ::= NK_FLOAT */ + -1, /* (406) literal ::= NK_STRING */ + -1, /* (407) literal ::= NK_BOOL */ + -2, /* (408) literal ::= TIMESTAMP NK_STRING */ + -1, /* (409) literal ::= duration_literal */ + -1, /* (410) literal ::= NULL */ + -1, /* (411) literal ::= NK_QUESTION */ + -1, /* (412) duration_literal ::= NK_VARIABLE */ + -1, /* (413) signed ::= NK_INTEGER */ + -2, /* (414) signed ::= NK_PLUS NK_INTEGER */ + -2, /* (415) signed ::= NK_MINUS NK_INTEGER */ + -1, /* (416) signed ::= NK_FLOAT */ + -2, /* (417) signed ::= NK_PLUS NK_FLOAT */ + -2, /* (418) signed ::= NK_MINUS NK_FLOAT */ + -1, /* (419) signed_literal ::= signed */ + -1, /* (420) signed_literal ::= NK_STRING */ + -1, /* (421) signed_literal ::= NK_BOOL */ + -2, /* (422) signed_literal ::= TIMESTAMP NK_STRING */ + -1, /* (423) signed_literal ::= duration_literal */ + -1, /* (424) signed_literal ::= NULL */ + -1, /* (425) signed_literal ::= literal_func */ + -1, /* (426) signed_literal ::= NK_QUESTION */ + -1, /* (427) literal_list ::= signed_literal */ + -3, /* (428) literal_list ::= literal_list NK_COMMA signed_literal */ + -1, /* (429) db_name ::= NK_ID */ + -1, /* (430) table_name ::= NK_ID */ + -1, /* (431) column_name ::= NK_ID */ + -1, /* (432) function_name ::= NK_ID */ + -1, /* (433) view_name ::= NK_ID */ + -1, /* (434) table_alias ::= NK_ID */ + -1, /* (435) column_alias ::= NK_ID */ + -1, /* (436) column_alias ::= NK_ALIAS */ + -1, /* (437) user_name ::= NK_ID */ + -1, /* (438) topic_name ::= NK_ID */ + -1, /* (439) stream_name ::= NK_ID */ + -1, /* (440) cgroup_name ::= NK_ID */ + -1, /* (441) index_name ::= NK_ID */ + -1, /* (442) expr_or_subquery ::= expression */ + -1, /* (443) expression ::= literal */ + -1, /* (444) expression ::= pseudo_column */ + -1, /* (445) expression ::= column_reference */ + -1, /* (446) expression ::= function_expression */ + -1, /* (447) expression ::= case_when_expression */ + -3, /* (448) expression ::= NK_LP expression NK_RP */ + -2, /* (449) expression ::= NK_PLUS expr_or_subquery */ + -2, /* (450) expression ::= NK_MINUS expr_or_subquery */ + -3, /* (451) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + -3, /* (452) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + -3, /* (453) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + -3, /* (454) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + -3, /* (455) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + -3, /* (456) expression ::= column_reference NK_ARROW NK_STRING */ + -3, /* (457) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + -3, /* (458) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + -1, /* (459) expression_list ::= expr_or_subquery */ + -3, /* (460) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + -1, /* (461) column_reference ::= column_name */ + -3, /* (462) column_reference ::= table_name NK_DOT column_name */ + -1, /* (463) column_reference ::= NK_ALIAS */ + -3, /* (464) column_reference ::= table_name NK_DOT NK_ALIAS */ + -1, /* (465) pseudo_column ::= ROWTS */ + -1, /* (466) pseudo_column ::= TBNAME */ + -3, /* (467) pseudo_column ::= table_name NK_DOT TBNAME */ + -1, /* (468) pseudo_column ::= QSTART */ + -1, /* (469) pseudo_column ::= QEND */ + -1, /* (470) pseudo_column ::= QDURATION */ + -1, /* (471) pseudo_column ::= WSTART */ + -1, /* (472) pseudo_column ::= WEND */ + -1, /* (473) pseudo_column ::= WDURATION */ + -1, /* (474) pseudo_column ::= IROWTS */ + -1, /* (475) pseudo_column ::= ISFILLED */ + -1, /* (476) pseudo_column ::= QTAGS */ + -4, /* (477) function_expression ::= function_name NK_LP expression_list NK_RP */ + -4, /* (478) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + -6, /* (479) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + -1, /* (480) function_expression ::= literal_func */ + -3, /* (481) literal_func ::= noarg_func NK_LP NK_RP */ + -1, /* (482) literal_func ::= NOW */ + -1, /* (483) noarg_func ::= NOW */ + -1, /* (484) noarg_func ::= TODAY */ + -1, /* (485) noarg_func ::= TIMEZONE */ + -1, /* (486) noarg_func ::= DATABASE */ + -1, /* (487) noarg_func ::= CLIENT_VERSION */ + -1, /* (488) noarg_func ::= SERVER_VERSION */ + -1, /* (489) noarg_func ::= SERVER_STATUS */ + -1, /* (490) noarg_func ::= CURRENT_USER */ + -1, /* (491) noarg_func ::= USER */ + -1, /* (492) star_func ::= COUNT */ + -1, /* (493) star_func ::= FIRST */ + -1, /* (494) star_func ::= LAST */ + -1, /* (495) star_func ::= LAST_ROW */ + -1, /* (496) star_func_para_list ::= NK_STAR */ + -1, /* (497) star_func_para_list ::= other_para_list */ + -1, /* (498) other_para_list ::= star_func_para */ + -3, /* (499) other_para_list ::= other_para_list NK_COMMA star_func_para */ + -1, /* (500) star_func_para ::= expr_or_subquery */ + -3, /* (501) star_func_para ::= table_name NK_DOT NK_STAR */ + -4, /* (502) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + -5, /* (503) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + -1, /* (504) when_then_list ::= when_then_expr */ + -2, /* (505) when_then_list ::= when_then_list when_then_expr */ + -4, /* (506) when_then_expr ::= WHEN common_expression THEN common_expression */ + 0, /* (507) case_when_else_opt ::= */ + -2, /* (508) case_when_else_opt ::= ELSE common_expression */ + -3, /* (509) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + -5, /* (510) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + -6, /* (511) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + -3, /* (512) predicate ::= expr_or_subquery IS NULL */ + -4, /* (513) predicate ::= expr_or_subquery IS NOT NULL */ + -3, /* (514) predicate ::= expr_or_subquery in_op in_predicate_value */ + -1, /* (515) compare_op ::= NK_LT */ + -1, /* (516) compare_op ::= NK_GT */ + -1, /* (517) compare_op ::= NK_LE */ + -1, /* (518) compare_op ::= NK_GE */ + -1, /* (519) compare_op ::= NK_NE */ + -1, /* (520) compare_op ::= NK_EQ */ + -1, /* (521) compare_op ::= LIKE */ + -2, /* (522) compare_op ::= NOT LIKE */ + -1, /* (523) compare_op ::= MATCH */ + -1, /* (524) compare_op ::= NMATCH */ + -1, /* (525) compare_op ::= CONTAINS */ + -1, /* (526) in_op ::= IN */ + -2, /* (527) in_op ::= NOT IN */ + -3, /* (528) in_predicate_value ::= NK_LP literal_list NK_RP */ + -1, /* (529) boolean_value_expression ::= boolean_primary */ + -2, /* (530) boolean_value_expression ::= NOT boolean_primary */ + -3, /* (531) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + -3, /* (532) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + -1, /* (533) boolean_primary ::= predicate */ + -3, /* (534) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + -1, /* (535) common_expression ::= expr_or_subquery */ + -1, /* (536) common_expression ::= boolean_value_expression */ + 0, /* (537) from_clause_opt ::= */ + -2, /* (538) from_clause_opt ::= FROM table_reference_list */ + -1, /* (539) table_reference_list ::= table_reference */ + -3, /* (540) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + -1, /* (541) table_reference ::= table_primary */ + -1, /* (542) table_reference ::= joined_table */ + -2, /* (543) table_primary ::= table_name alias_opt */ + -4, /* (544) table_primary ::= db_name NK_DOT table_name alias_opt */ + -2, /* (545) table_primary ::= subquery alias_opt */ + -1, /* (546) table_primary ::= parenthesized_joined_table */ + 0, /* (547) alias_opt ::= */ + -1, /* (548) alias_opt ::= table_alias */ + -2, /* (549) alias_opt ::= AS table_alias */ + -3, /* (550) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + -3, /* (551) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + -6, /* (552) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + 0, /* (553) join_type ::= */ + -1, /* (554) join_type ::= INNER */ + -14, /* (555) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + 0, /* (556) hint_list ::= */ + -1, /* (557) hint_list ::= NK_HINT */ + 0, /* (558) tag_mode_opt ::= */ + -1, /* (559) tag_mode_opt ::= TAGS */ + 0, /* (560) set_quantifier_opt ::= */ + -1, /* (561) set_quantifier_opt ::= DISTINCT */ + -1, /* (562) set_quantifier_opt ::= ALL */ + -1, /* (563) select_list ::= select_item */ + -3, /* (564) select_list ::= select_list NK_COMMA select_item */ + -1, /* (565) select_item ::= NK_STAR */ + -1, /* (566) select_item ::= common_expression */ + -2, /* (567) select_item ::= common_expression column_alias */ + -3, /* (568) select_item ::= common_expression AS column_alias */ + -3, /* (569) select_item ::= table_name NK_DOT NK_STAR */ + 0, /* (570) where_clause_opt ::= */ + -2, /* (571) where_clause_opt ::= WHERE search_condition */ + 0, /* (572) partition_by_clause_opt ::= */ + -3, /* (573) partition_by_clause_opt ::= PARTITION BY partition_list */ + -1, /* (574) partition_list ::= partition_item */ + -3, /* (575) partition_list ::= partition_list NK_COMMA partition_item */ + -1, /* (576) partition_item ::= expr_or_subquery */ + -2, /* (577) partition_item ::= expr_or_subquery column_alias */ + -3, /* (578) partition_item ::= expr_or_subquery AS column_alias */ + 0, /* (579) twindow_clause_opt ::= */ + -6, /* (580) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ + -4, /* (581) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + -6, /* (582) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + -8, /* (583) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + -7, /* (584) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + 0, /* (585) sliding_opt ::= */ + -4, /* (586) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ + -1, /* (587) interval_sliding_duration_literal ::= NK_VARIABLE */ + -1, /* (588) interval_sliding_duration_literal ::= NK_STRING */ + -1, /* (589) interval_sliding_duration_literal ::= NK_INTEGER */ + 0, /* (590) fill_opt ::= */ + -4, /* (591) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + -6, /* (592) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + -6, /* (593) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + -1, /* (594) fill_mode ::= NONE */ + -1, /* (595) fill_mode ::= PREV */ + -1, /* (596) fill_mode ::= NULL */ + -1, /* (597) fill_mode ::= NULL_F */ + -1, /* (598) fill_mode ::= LINEAR */ + -1, /* (599) fill_mode ::= NEXT */ + 0, /* (600) group_by_clause_opt ::= */ + -3, /* (601) group_by_clause_opt ::= GROUP BY group_by_list */ + -1, /* (602) group_by_list ::= expr_or_subquery */ + -3, /* (603) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 0, /* (604) having_clause_opt ::= */ + -2, /* (605) having_clause_opt ::= HAVING search_condition */ + 0, /* (606) range_opt ::= */ + -6, /* (607) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + -4, /* (608) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 0, /* (609) every_opt ::= */ + -4, /* (610) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + -4, /* (611) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + -1, /* (612) query_simple ::= query_specification */ + -1, /* (613) query_simple ::= union_query_expression */ + -4, /* (614) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + -3, /* (615) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + -1, /* (616) query_simple_or_subquery ::= query_simple */ + -1, /* (617) query_simple_or_subquery ::= subquery */ + -1, /* (618) query_or_subquery ::= query_expression */ + -1, /* (619) query_or_subquery ::= subquery */ + 0, /* (620) order_by_clause_opt ::= */ + -3, /* (621) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 0, /* (622) slimit_clause_opt ::= */ + -2, /* (623) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + -4, /* (624) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + -4, /* (625) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 0, /* (626) limit_clause_opt ::= */ + -2, /* (627) limit_clause_opt ::= LIMIT NK_INTEGER */ + -4, /* (628) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + -4, /* (629) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + -3, /* (630) subquery ::= NK_LP query_expression NK_RP */ + -3, /* (631) subquery ::= NK_LP subquery NK_RP */ + -1, /* (632) search_condition ::= common_expression */ + -1, /* (633) sort_specification_list ::= sort_specification */ + -3, /* (634) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + -3, /* (635) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 0, /* (636) ordering_specification_opt ::= */ + -1, /* (637) ordering_specification_opt ::= ASC */ + -1, /* (638) ordering_specification_opt ::= DESC */ + 0, /* (639) null_ordering_opt ::= */ + -2, /* (640) null_ordering_opt ::= NULLS FIRST */ + -2, /* (641) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -4667,54 +5040,6 @@ static YYACTIONTYPE yy_reduce( (void)yyLookahead; (void)yyLookaheadToken; yymsp = yypParser->yytos; -#ifndef NDEBUG - if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ - yysize = yyRuleInfoNRhs[yyruleno]; - if( yysize ){ - fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n", - yyTracePrompt, - yyruleno, yyRuleName[yyruleno], - yyrulenoyytos - yypParser->yystack)>yypParser->yyhwm ){ - yypParser->yyhwm++; - assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack)); - } -#endif -#if YYSTACKDEPTH>0 - if( yypParser->yytos>=yypParser->yystackEnd ){ - yyStackOverflow(yypParser); - /* The call to yyStackOverflow() above pops the stack until it is - ** empty, causing the main parser loop to exit. So the return value - ** is never used and does not matter. */ - return 0; - } -#else - if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){ - if( yyGrowStack(yypParser) ){ - yyStackOverflow(yypParser); - /* The call to yyStackOverflow() above pops the stack until it is - ** empty, causing the main parser loop to exit. So the return value - ** is never used and does not matter. */ - return 0; - } - yymsp = yypParser->yytos; - } -#endif - } switch( yyruleno ){ /* Beginning here are the reduction cases. A typical example @@ -4728,15 +5053,21 @@ static YYACTIONTYPE yy_reduce( /********** Begin reduce actions **********************************************/ YYMINORTYPE yylhsminor; case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ +#line 50 "sql.y" { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,347,&yymsp[0].minor); - break; - case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ -{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } +#line 5058 "sql.c" yy_destructor(yypParser,348,&yymsp[0].minor); break; + case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ +#line 51 "sql.y" +{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } +#line 5064 "sql.c" + yy_destructor(yypParser,349,&yymsp[0].minor); + break; case 2: /* account_options ::= */ +#line 55 "sql.y" { } +#line 5070 "sql.c" break; case 3: /* account_options ::= account_options PPS literal */ case 4: /* account_options ::= account_options TSERIES literal */ yytestcase(yyruleno==4); @@ -4747,20 +5078,26 @@ 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,347,&yymsp[-2].minor); +{ yy_destructor(yypParser,348,&yymsp[-2].minor); +#line 56 "sql.y" { } - yy_destructor(yypParser,349,&yymsp[0].minor); +#line 5084 "sql.c" + yy_destructor(yypParser,350,&yymsp[0].minor); } break; case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,350,&yymsp[0].minor); +{ yy_destructor(yypParser,351,&yymsp[0].minor); +#line 68 "sql.y" { } +#line 5092 "sql.c" } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,348,&yymsp[-1].minor); +{ yy_destructor(yypParser,349,&yymsp[-1].minor); +#line 69 "sql.y" { } - yy_destructor(yypParser,350,&yymsp[0].minor); +#line 5099 "sql.c" + yy_destructor(yypParser,351,&yymsp[0].minor); } break; case 14: /* alter_account_option ::= PASS literal */ @@ -4773,501 +5110,735 @@ static YYACTIONTYPE yy_reduce( case 21: /* alter_account_option ::= USERS literal */ yytestcase(yyruleno==21); case 22: /* alter_account_option ::= CONNS literal */ yytestcase(yyruleno==22); case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23); +#line 73 "sql.y" { } - yy_destructor(yypParser,349,&yymsp[0].minor); +#line 5115 "sql.c" + yy_destructor(yypParser,350,&yymsp[0].minor); break; case 24: /* ip_range_list ::= NK_STRING */ -{ yylhsminor.yy106 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy106 = yylhsminor.yy106; +#line 86 "sql.y" +{ yylhsminor.yy88 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } +#line 5121 "sql.c" + yymsp[0].minor.yy88 = yylhsminor.yy88; break; case 25: /* ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ -{ yylhsminor.yy106 = addNodeToList(pCxt, yymsp[-2].minor.yy106, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy106 = yylhsminor.yy106; +#line 87 "sql.y" +{ yylhsminor.yy88 = addNodeToList(pCxt, yymsp[-2].minor.yy88, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } +#line 5127 "sql.c" + yymsp[-2].minor.yy88 = yylhsminor.yy88; break; case 26: /* white_list ::= HOST ip_range_list */ -{ yymsp[-1].minor.yy106 = yymsp[0].minor.yy106; } +#line 91 "sql.y" +{ yymsp[-1].minor.yy88 = yymsp[0].minor.yy88; } +#line 5133 "sql.c" break; case 27: /* white_list_opt ::= */ case 186: /* specific_cols_opt ::= */ yytestcase(yyruleno==186); case 217: /* tags_def_opt ::= */ yytestcase(yyruleno==217); - case 300: /* tag_list_opt ::= */ yytestcase(yyruleno==300); - case 366: /* col_list_opt ::= */ yytestcase(yyruleno==366); - case 368: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==368); - case 569: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==569); - case 597: /* group_by_clause_opt ::= */ yytestcase(yyruleno==597); - case 617: /* order_by_clause_opt ::= */ yytestcase(yyruleno==617); -{ yymsp[1].minor.yy106 = NULL; } + case 302: /* tag_list_opt ::= */ yytestcase(yyruleno==302); + case 368: /* col_list_opt ::= */ yytestcase(yyruleno==368); + case 370: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==370); + case 572: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==572); + case 600: /* group_by_clause_opt ::= */ yytestcase(yyruleno==600); + case 620: /* order_by_clause_opt ::= */ yytestcase(yyruleno==620); +#line 95 "sql.y" +{ yymsp[1].minor.yy88 = NULL; } +#line 5146 "sql.c" break; case 28: /* white_list_opt ::= white_list */ case 218: /* tags_def_opt ::= tags_def */ yytestcase(yyruleno==218); - case 369: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==369); - case 494: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==494); -{ yylhsminor.yy106 = yymsp[0].minor.yy106; } - yymsp[0].minor.yy106 = yylhsminor.yy106; + case 371: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==371); + case 497: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==497); +#line 96 "sql.y" +{ yylhsminor.yy88 = yymsp[0].minor.yy88; } +#line 5154 "sql.c" + yymsp[0].minor.yy88 = yylhsminor.yy88; break; case 29: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ +#line 100 "sql.y" { - pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-4].minor.yy785, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy431); - pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy106); + pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-4].minor.yy993, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy279); + pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy88); } +#line 5163 "sql.c" break; case 30: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy785, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +#line 104 "sql.y" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy993, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +#line 5168 "sql.c" break; case 31: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy785, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +#line 105 "sql.y" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy993, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +#line 5173 "sql.c" break; case 32: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy785, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +#line 106 "sql.y" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy993, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +#line 5178 "sql.c" break; case 33: /* cmd ::= ALTER USER user_name ADD white_list */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy785, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy106); } +#line 107 "sql.y" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy993, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy88); } +#line 5183 "sql.c" break; case 34: /* cmd ::= ALTER USER user_name DROP white_list */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy785, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy106); } +#line 108 "sql.y" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy993, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy88); } +#line 5188 "sql.c" break; case 35: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy785); } +#line 109 "sql.y" +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy993); } +#line 5193 "sql.c" break; case 36: /* sysinfo_opt ::= */ -{ yymsp[1].minor.yy431 = 1; } +#line 113 "sql.y" +{ yymsp[1].minor.yy279 = 1; } +#line 5198 "sql.c" break; case 37: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ -{ yymsp[-1].minor.yy431 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +#line 114 "sql.y" +{ yymsp[-1].minor.yy279 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +#line 5203 "sql.c" break; case 38: /* cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy987, &yymsp[-3].minor.yy573, &yymsp[0].minor.yy785, yymsp[-2].minor.yy80); } +#line 117 "sql.y" +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy221, &yymsp[-3].minor.yy241, &yymsp[0].minor.yy993, yymsp[-2].minor.yy232); } +#line 5208 "sql.c" break; case 39: /* cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy987, &yymsp[-3].minor.yy573, &yymsp[0].minor.yy785, yymsp[-2].minor.yy80); } +#line 118 "sql.y" +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy221, &yymsp[-3].minor.yy241, &yymsp[0].minor.yy993, yymsp[-2].minor.yy232); } +#line 5213 "sql.c" break; case 40: /* privileges ::= ALL */ -{ yymsp[0].minor.yy987 = PRIVILEGE_TYPE_ALL; } +#line 122 "sql.y" +{ yymsp[0].minor.yy221 = PRIVILEGE_TYPE_ALL; } +#line 5218 "sql.c" break; case 41: /* privileges ::= priv_type_list */ case 43: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==43); -{ yylhsminor.yy987 = yymsp[0].minor.yy987; } - yymsp[0].minor.yy987 = yylhsminor.yy987; +#line 123 "sql.y" +{ yylhsminor.yy221 = yymsp[0].minor.yy221; } +#line 5224 "sql.c" + yymsp[0].minor.yy221 = yylhsminor.yy221; break; case 42: /* privileges ::= SUBSCRIBE */ -{ yymsp[0].minor.yy987 = PRIVILEGE_TYPE_SUBSCRIBE; } +#line 124 "sql.y" +{ yymsp[0].minor.yy221 = PRIVILEGE_TYPE_SUBSCRIBE; } +#line 5230 "sql.c" break; case 44: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy987 = yymsp[-2].minor.yy987 | yymsp[0].minor.yy987; } - yymsp[-2].minor.yy987 = yylhsminor.yy987; +#line 129 "sql.y" +{ yylhsminor.yy221 = yymsp[-2].minor.yy221 | yymsp[0].minor.yy221; } +#line 5235 "sql.c" + yymsp[-2].minor.yy221 = yylhsminor.yy221; break; case 45: /* priv_type ::= READ */ -{ yymsp[0].minor.yy987 = PRIVILEGE_TYPE_READ; } +#line 133 "sql.y" +{ yymsp[0].minor.yy221 = PRIVILEGE_TYPE_READ; } +#line 5241 "sql.c" break; case 46: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy987 = PRIVILEGE_TYPE_WRITE; } +#line 134 "sql.y" +{ yymsp[0].minor.yy221 = PRIVILEGE_TYPE_WRITE; } +#line 5246 "sql.c" break; case 47: /* priv_type ::= ALTER */ -{ yymsp[0].minor.yy987 = PRIVILEGE_TYPE_ALTER; } +#line 135 "sql.y" +{ yymsp[0].minor.yy221 = PRIVILEGE_TYPE_ALTER; } +#line 5251 "sql.c" break; case 48: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy573.first = yymsp[-2].minor.yy0; yylhsminor.yy573.second = yymsp[0].minor.yy0; } - yymsp[-2].minor.yy573 = yylhsminor.yy573; +#line 139 "sql.y" +{ yylhsminor.yy241.first = yymsp[-2].minor.yy0; yylhsminor.yy241.second = yymsp[0].minor.yy0; } +#line 5256 "sql.c" + yymsp[-2].minor.yy241 = yylhsminor.yy241; break; case 49: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy573.first = yymsp[-2].minor.yy785; yylhsminor.yy573.second = yymsp[0].minor.yy0; } - yymsp[-2].minor.yy573 = yylhsminor.yy573; +#line 140 "sql.y" +{ yylhsminor.yy241.first = yymsp[-2].minor.yy993; yylhsminor.yy241.second = yymsp[0].minor.yy0; } +#line 5262 "sql.c" + yymsp[-2].minor.yy241 = yylhsminor.yy241; break; case 50: /* priv_level ::= db_name NK_DOT table_name */ -{ yylhsminor.yy573.first = yymsp[-2].minor.yy785; yylhsminor.yy573.second = yymsp[0].minor.yy785; } - yymsp[-2].minor.yy573 = yylhsminor.yy573; +#line 141 "sql.y" +{ yylhsminor.yy241.first = yymsp[-2].minor.yy993; yylhsminor.yy241.second = yymsp[0].minor.yy993; } +#line 5268 "sql.c" + yymsp[-2].minor.yy241 = yylhsminor.yy241; break; case 51: /* priv_level ::= topic_name */ -{ yylhsminor.yy573.first = yymsp[0].minor.yy785; yylhsminor.yy573.second = nil_token; } - yymsp[0].minor.yy573 = yylhsminor.yy573; +#line 142 "sql.y" +{ yylhsminor.yy241.first = yymsp[0].minor.yy993; yylhsminor.yy241.second = nil_token; } +#line 5274 "sql.c" + yymsp[0].minor.yy241 = yylhsminor.yy241; break; case 52: /* with_opt ::= */ case 155: /* start_opt ::= */ yytestcase(yyruleno==155); case 159: /* end_opt ::= */ yytestcase(yyruleno==159); - case 295: /* like_pattern_opt ::= */ yytestcase(yyruleno==295); - case 380: /* subtable_opt ::= */ yytestcase(yyruleno==380); - case 504: /* case_when_else_opt ::= */ yytestcase(yyruleno==504); - case 534: /* from_clause_opt ::= */ yytestcase(yyruleno==534); - case 567: /* where_clause_opt ::= */ yytestcase(yyruleno==567); - case 576: /* twindow_clause_opt ::= */ yytestcase(yyruleno==576); - case 582: /* sliding_opt ::= */ yytestcase(yyruleno==582); - case 587: /* fill_opt ::= */ yytestcase(yyruleno==587); - case 601: /* having_clause_opt ::= */ yytestcase(yyruleno==601); - case 603: /* range_opt ::= */ yytestcase(yyruleno==603); - case 606: /* every_opt ::= */ yytestcase(yyruleno==606); - case 619: /* slimit_clause_opt ::= */ yytestcase(yyruleno==619); - case 623: /* limit_clause_opt ::= */ yytestcase(yyruleno==623); -{ yymsp[1].minor.yy80 = NULL; } + case 297: /* like_pattern_opt ::= */ yytestcase(yyruleno==297); + case 382: /* subtable_opt ::= */ yytestcase(yyruleno==382); + case 507: /* case_when_else_opt ::= */ yytestcase(yyruleno==507); + case 537: /* from_clause_opt ::= */ yytestcase(yyruleno==537); + case 570: /* where_clause_opt ::= */ yytestcase(yyruleno==570); + case 579: /* twindow_clause_opt ::= */ yytestcase(yyruleno==579); + case 585: /* sliding_opt ::= */ yytestcase(yyruleno==585); + case 590: /* fill_opt ::= */ yytestcase(yyruleno==590); + case 604: /* having_clause_opt ::= */ yytestcase(yyruleno==604); + case 606: /* range_opt ::= */ yytestcase(yyruleno==606); + case 609: /* every_opt ::= */ yytestcase(yyruleno==609); + case 622: /* slimit_clause_opt ::= */ yytestcase(yyruleno==622); + case 626: /* limit_clause_opt ::= */ yytestcase(yyruleno==626); +#line 144 "sql.y" +{ yymsp[1].minor.yy232 = NULL; } +#line 5295 "sql.c" break; case 53: /* with_opt ::= WITH search_condition */ - case 535: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==535); - case 568: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==568); - case 602: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==602); -{ yymsp[-1].minor.yy80 = yymsp[0].minor.yy80; } + case 538: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==538); + case 571: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==571); + case 605: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==605); +#line 145 "sql.y" +{ yymsp[-1].minor.yy232 = yymsp[0].minor.yy232; } +#line 5303 "sql.c" break; case 54: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy785, NULL); } +#line 148 "sql.y" +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy993, NULL); } +#line 5308 "sql.c" break; case 55: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy785, &yymsp[0].minor.yy0); } +#line 149 "sql.y" +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy993, &yymsp[0].minor.yy0); } +#line 5313 "sql.c" break; case 56: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy923, false); } +#line 150 "sql.y" +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy985, false); } +#line 5318 "sql.c" break; case 57: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy785, yymsp[0].minor.yy923, false); } +#line 151 "sql.y" +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy993, yymsp[0].minor.yy985, false); } +#line 5323 "sql.c" break; case 58: /* cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy923); } +#line 152 "sql.y" +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy985); } +#line 5328 "sql.c" break; case 59: /* cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy785, false, yymsp[0].minor.yy923); } +#line 153 "sql.y" +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy993, false, yymsp[0].minor.yy985); } +#line 5333 "sql.c" break; case 60: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ +#line 154 "sql.y" { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } +#line 5338 "sql.c" break; case 61: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ +#line 155 "sql.y" { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } +#line 5343 "sql.c" break; case 62: /* cmd ::= ALTER ALL DNODES NK_STRING */ +#line 156 "sql.y" { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[0].minor.yy0, NULL); } +#line 5348 "sql.c" break; case 63: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ +#line 157 "sql.y" { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } +#line 5353 "sql.c" break; case 64: /* cmd ::= RESTORE DNODE NK_INTEGER */ +#line 158 "sql.y" { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_DNODE_STMT, &yymsp[0].minor.yy0); } +#line 5358 "sql.c" break; case 65: /* dnode_endpoint ::= NK_STRING */ case 66: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==66); case 67: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==67); - case 322: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==322); - case 323: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==323); - case 324: /* sma_func_name ::= LAST */ yytestcase(yyruleno==324); - case 325: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==325); - case 426: /* db_name ::= NK_ID */ yytestcase(yyruleno==426); - case 427: /* table_name ::= NK_ID */ yytestcase(yyruleno==427); - case 428: /* column_name ::= NK_ID */ yytestcase(yyruleno==428); - case 429: /* function_name ::= NK_ID */ yytestcase(yyruleno==429); - case 430: /* view_name ::= NK_ID */ yytestcase(yyruleno==430); - case 431: /* table_alias ::= NK_ID */ yytestcase(yyruleno==431); - case 432: /* column_alias ::= NK_ID */ yytestcase(yyruleno==432); - case 433: /* column_alias ::= NK_ALIAS */ yytestcase(yyruleno==433); - case 434: /* user_name ::= NK_ID */ yytestcase(yyruleno==434); - case 435: /* topic_name ::= NK_ID */ yytestcase(yyruleno==435); - case 436: /* stream_name ::= NK_ID */ yytestcase(yyruleno==436); - case 437: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==437); - case 438: /* index_name ::= NK_ID */ yytestcase(yyruleno==438); - case 480: /* noarg_func ::= NOW */ yytestcase(yyruleno==480); - case 481: /* noarg_func ::= TODAY */ yytestcase(yyruleno==481); - case 482: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==482); - case 483: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==483); - case 484: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==484); - case 485: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==485); - case 486: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==486); - case 487: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==487); - case 488: /* noarg_func ::= USER */ yytestcase(yyruleno==488); - case 489: /* star_func ::= COUNT */ yytestcase(yyruleno==489); - case 490: /* star_func ::= FIRST */ yytestcase(yyruleno==490); - case 491: /* star_func ::= LAST */ yytestcase(yyruleno==491); - case 492: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==492); -{ yylhsminor.yy785 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy785 = yylhsminor.yy785; + case 324: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==324); + case 325: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==325); + case 326: /* sma_func_name ::= LAST */ yytestcase(yyruleno==326); + case 327: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==327); + case 429: /* db_name ::= NK_ID */ yytestcase(yyruleno==429); + case 430: /* table_name ::= NK_ID */ yytestcase(yyruleno==430); + case 431: /* column_name ::= NK_ID */ yytestcase(yyruleno==431); + case 432: /* function_name ::= NK_ID */ yytestcase(yyruleno==432); + case 433: /* view_name ::= NK_ID */ yytestcase(yyruleno==433); + case 434: /* table_alias ::= NK_ID */ yytestcase(yyruleno==434); + case 435: /* column_alias ::= NK_ID */ yytestcase(yyruleno==435); + case 436: /* column_alias ::= NK_ALIAS */ yytestcase(yyruleno==436); + case 437: /* user_name ::= NK_ID */ yytestcase(yyruleno==437); + case 438: /* topic_name ::= NK_ID */ yytestcase(yyruleno==438); + case 439: /* stream_name ::= NK_ID */ yytestcase(yyruleno==439); + case 440: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==440); + case 441: /* index_name ::= NK_ID */ yytestcase(yyruleno==441); + case 483: /* noarg_func ::= NOW */ yytestcase(yyruleno==483); + case 484: /* noarg_func ::= TODAY */ yytestcase(yyruleno==484); + case 485: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==485); + case 486: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==486); + case 487: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==487); + case 488: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==488); + case 489: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==489); + case 490: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==490); + case 491: /* noarg_func ::= USER */ yytestcase(yyruleno==491); + case 492: /* star_func ::= COUNT */ yytestcase(yyruleno==492); + case 493: /* star_func ::= FIRST */ yytestcase(yyruleno==493); + case 494: /* star_func ::= LAST */ yytestcase(yyruleno==494); + case 495: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==495); +#line 162 "sql.y" +{ yylhsminor.yy993 = yymsp[0].minor.yy0; } +#line 5395 "sql.c" + yymsp[0].minor.yy993 = yylhsminor.yy993; break; case 68: /* force_opt ::= */ case 92: /* not_exists_opt ::= */ yytestcase(yyruleno==92); case 94: /* exists_opt ::= */ yytestcase(yyruleno==94); - case 343: /* analyze_opt ::= */ yytestcase(yyruleno==343); - case 350: /* agg_func_opt ::= */ yytestcase(yyruleno==350); - case 356: /* or_replace_opt ::= */ yytestcase(yyruleno==356); - case 382: /* ignore_opt ::= */ yytestcase(yyruleno==382); - case 555: /* tag_mode_opt ::= */ yytestcase(yyruleno==555); - case 557: /* set_quantifier_opt ::= */ yytestcase(yyruleno==557); -{ yymsp[1].minor.yy923 = false; } + case 345: /* analyze_opt ::= */ yytestcase(yyruleno==345); + case 352: /* agg_func_opt ::= */ yytestcase(yyruleno==352); + case 358: /* or_replace_opt ::= */ yytestcase(yyruleno==358); + case 384: /* ignore_opt ::= */ yytestcase(yyruleno==384); + case 558: /* tag_mode_opt ::= */ yytestcase(yyruleno==558); + case 560: /* set_quantifier_opt ::= */ yytestcase(yyruleno==560); +#line 168 "sql.y" +{ yymsp[1].minor.yy985 = false; } +#line 5409 "sql.c" break; case 69: /* force_opt ::= FORCE */ case 70: /* unsafe_opt ::= UNSAFE */ yytestcase(yyruleno==70); - case 344: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==344); - case 351: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==351); - case 556: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==556); - case 558: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==558); -{ yymsp[0].minor.yy923 = true; } + case 346: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==346); + case 353: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==353); + case 559: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==559); + case 561: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==561); +#line 169 "sql.y" +{ yymsp[0].minor.yy985 = true; } +#line 5419 "sql.c" break; case 71: /* cmd ::= ALTER LOCAL NK_STRING */ +#line 176 "sql.y" { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } +#line 5424 "sql.c" break; case 72: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */ +#line 177 "sql.y" { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } +#line 5429 "sql.c" break; case 73: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ +#line 180 "sql.y" { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_QNODE_STMT, &yymsp[0].minor.yy0); } +#line 5434 "sql.c" break; case 74: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */ +#line 181 "sql.y" { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_QNODE_STMT, &yymsp[0].minor.yy0); } +#line 5439 "sql.c" break; case 75: /* cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ +#line 182 "sql.y" { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_QNODE_STMT, &yymsp[0].minor.yy0); } +#line 5444 "sql.c" break; case 76: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ +#line 185 "sql.y" { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_BNODE_STMT, &yymsp[0].minor.yy0); } +#line 5449 "sql.c" break; case 77: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */ +#line 186 "sql.y" { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_BNODE_STMT, &yymsp[0].minor.yy0); } +#line 5454 "sql.c" break; case 78: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ +#line 189 "sql.y" { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_SNODE_STMT, &yymsp[0].minor.yy0); } +#line 5459 "sql.c" break; case 79: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */ +#line 190 "sql.y" { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_SNODE_STMT, &yymsp[0].minor.yy0); } +#line 5464 "sql.c" break; case 80: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ +#line 193 "sql.y" { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_MNODE_STMT, &yymsp[0].minor.yy0); } +#line 5469 "sql.c" break; case 81: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */ +#line 194 "sql.y" { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } +#line 5474 "sql.c" break; case 82: /* cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ +#line 195 "sql.y" { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_MNODE_STMT, &yymsp[0].minor.yy0); } +#line 5479 "sql.c" break; case 83: /* cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ +#line 198 "sql.y" { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_VNODE_STMT, &yymsp[0].minor.yy0); } +#line 5484 "sql.c" break; case 84: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy923, &yymsp[-1].minor.yy785, yymsp[0].minor.yy80); } +#line 201 "sql.y" +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy985, &yymsp[-1].minor.yy993, yymsp[0].minor.yy232); } +#line 5489 "sql.c" break; case 85: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy923, &yymsp[0].minor.yy785); } +#line 202 "sql.y" +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy985, &yymsp[0].minor.yy993); } +#line 5494 "sql.c" break; case 86: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy785); } +#line 203 "sql.y" +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy993); } +#line 5499 "sql.c" break; case 87: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy785, yymsp[0].minor.yy80); } +#line 204 "sql.y" +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy993, yymsp[0].minor.yy232); } +#line 5504 "sql.c" break; case 88: /* cmd ::= FLUSH DATABASE db_name */ -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy785); } +#line 205 "sql.y" +{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy993); } +#line 5509 "sql.c" break; case 89: /* cmd ::= TRIM DATABASE db_name speed_opt */ -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy785, yymsp[0].minor.yy982); } +#line 206 "sql.y" +{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy993, yymsp[0].minor.yy92); } +#line 5514 "sql.c" break; case 90: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */ -{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy785, yymsp[-1].minor.yy80, yymsp[0].minor.yy80); } +#line 207 "sql.y" +{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy993, yymsp[-1].minor.yy232, yymsp[0].minor.yy232); } +#line 5519 "sql.c" break; case 91: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy923 = true; } +#line 211 "sql.y" +{ yymsp[-2].minor.yy985 = true; } +#line 5524 "sql.c" break; case 93: /* exists_opt ::= IF EXISTS */ - case 357: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==357); - case 383: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==383); -{ yymsp[-1].minor.yy923 = true; } + case 359: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==359); + case 385: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==385); +#line 216 "sql.y" +{ yymsp[-1].minor.yy985 = true; } +#line 5531 "sql.c" break; case 95: /* db_options ::= */ -{ yymsp[1].minor.yy80 = createDefaultDatabaseOptions(pCxt); } +#line 219 "sql.y" +{ yymsp[1].minor.yy232 = createDefaultDatabaseOptions(pCxt); } +#line 5536 "sql.c" break; case 96: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 220 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } +#line 5541 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 97: /* db_options ::= db_options CACHEMODEL NK_STRING */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 221 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } +#line 5547 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 98: /* db_options ::= db_options CACHESIZE NK_INTEGER */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 222 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } +#line 5553 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 99: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 223 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_COMP, &yymsp[0].minor.yy0); } +#line 5559 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 100: /* db_options ::= db_options DURATION NK_INTEGER */ case 101: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==101); -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 224 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } +#line 5566 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 102: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 226 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } +#line 5572 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 103: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 227 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } +#line 5578 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 104: /* db_options ::= db_options KEEP integer_list */ case 105: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==105); -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_KEEP, yymsp[0].minor.yy106); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 228 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_KEEP, yymsp[0].minor.yy88); } +#line 5585 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 106: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 230 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } +#line 5591 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 107: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 231 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } +#line 5597 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 108: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 232 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } +#line 5603 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 109: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 233 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } +#line 5609 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 110: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 234 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } +#line 5615 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 111: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 236 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } +#line 5621 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 112: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 237 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } +#line 5627 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 113: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_RETENTIONS, yymsp[0].minor.yy106); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 238 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_RETENTIONS, yymsp[0].minor.yy88); } +#line 5633 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 114: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 239 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } +#line 5639 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 115: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 240 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_WAL, &yymsp[0].minor.yy0); } +#line 5645 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 116: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 241 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } +#line 5651 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 117: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 242 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } +#line 5657 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 118: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ +#line 243 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-3].minor.yy80, DB_OPTION_WAL_RETENTION_PERIOD, &t); + yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-3].minor.yy232, DB_OPTION_WAL_RETENTION_PERIOD, &t); } - yymsp[-3].minor.yy80 = yylhsminor.yy80; +#line 5667 "sql.c" + yymsp[-3].minor.yy232 = yylhsminor.yy232; break; case 119: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 248 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } +#line 5673 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 120: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ +#line 249 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-3].minor.yy80, DB_OPTION_WAL_RETENTION_SIZE, &t); + yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-3].minor.yy232, DB_OPTION_WAL_RETENTION_SIZE, &t); } - yymsp[-3].minor.yy80 = yylhsminor.yy80; +#line 5683 "sql.c" + yymsp[-3].minor.yy232 = yylhsminor.yy232; break; case 121: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 254 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } +#line 5689 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 122: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 255 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } +#line 5695 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 123: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 256 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } +#line 5701 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 124: /* db_options ::= db_options TABLE_PREFIX signed */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy80); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 257 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy232); } +#line 5707 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 125: /* db_options ::= db_options TABLE_SUFFIX signed */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy80); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 258 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy232); } +#line 5713 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 126: /* db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ -{ yylhsminor.yy80 = setDatabaseOption(pCxt, yymsp[-2].minor.yy80, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 259 "sql.y" +{ yylhsminor.yy232 = setDatabaseOption(pCxt, yymsp[-2].minor.yy232, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } +#line 5719 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 127: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy80 = createAlterDatabaseOptions(pCxt); yylhsminor.yy80 = setAlterDatabaseOption(pCxt, yylhsminor.yy80, &yymsp[0].minor.yy455); } - yymsp[0].minor.yy80 = yylhsminor.yy80; +#line 261 "sql.y" +{ yylhsminor.yy232 = createAlterDatabaseOptions(pCxt); yylhsminor.yy232 = setAlterDatabaseOption(pCxt, yylhsminor.yy232, &yymsp[0].minor.yy117); } +#line 5725 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; case 128: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy80 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy80, &yymsp[0].minor.yy455); } - yymsp[-1].minor.yy80 = yylhsminor.yy80; +#line 262 "sql.y" +{ yylhsminor.yy232 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy232, &yymsp[0].minor.yy117); } +#line 5731 "sql.c" + yymsp[-1].minor.yy232 = yylhsminor.yy232; break; case 129: /* alter_db_option ::= BUFFER NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } +#line 266 "sql.y" +{ yymsp[-1].minor.yy117.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy117.val = yymsp[0].minor.yy0; } +#line 5737 "sql.c" break; case 130: /* alter_db_option ::= CACHEMODEL NK_STRING */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } +#line 267 "sql.y" +{ yymsp[-1].minor.yy117.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy117.val = yymsp[0].minor.yy0; } +#line 5742 "sql.c" break; case 131: /* alter_db_option ::= CACHESIZE NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } +#line 268 "sql.y" +{ yymsp[-1].minor.yy117.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy117.val = yymsp[0].minor.yy0; } +#line 5747 "sql.c" break; case 132: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } +#line 269 "sql.y" +{ yymsp[-1].minor.yy117.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy117.val = yymsp[0].minor.yy0; } +#line 5752 "sql.c" break; case 133: /* alter_db_option ::= KEEP integer_list */ case 134: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==134); -{ yymsp[-1].minor.yy455.type = DB_OPTION_KEEP; yymsp[-1].minor.yy455.pList = yymsp[0].minor.yy106; } +#line 270 "sql.y" +{ yymsp[-1].minor.yy117.type = DB_OPTION_KEEP; yymsp[-1].minor.yy117.pList = yymsp[0].minor.yy88; } +#line 5758 "sql.c" break; case 135: /* alter_db_option ::= PAGES NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_PAGES; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } +#line 272 "sql.y" +{ yymsp[-1].minor.yy117.type = DB_OPTION_PAGES; yymsp[-1].minor.yy117.val = yymsp[0].minor.yy0; } +#line 5763 "sql.c" break; case 136: /* alter_db_option ::= REPLICA NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } +#line 273 "sql.y" +{ yymsp[-1].minor.yy117.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy117.val = yymsp[0].minor.yy0; } +#line 5768 "sql.c" break; case 137: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_WAL; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } +#line 275 "sql.y" +{ yymsp[-1].minor.yy117.type = DB_OPTION_WAL; yymsp[-1].minor.yy117.val = yymsp[0].minor.yy0; } +#line 5773 "sql.c" break; case 138: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } +#line 276 "sql.y" +{ yymsp[-1].minor.yy117.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy117.val = yymsp[0].minor.yy0; } +#line 5778 "sql.c" break; case 139: /* alter_db_option ::= MINROWS NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } +#line 277 "sql.y" +{ yymsp[-1].minor.yy117.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy117.val = yymsp[0].minor.yy0; } +#line 5783 "sql.c" break; case 140: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } +#line 278 "sql.y" +{ yymsp[-1].minor.yy117.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy117.val = yymsp[0].minor.yy0; } +#line 5788 "sql.c" break; case 141: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ +#line 279 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yymsp[-2].minor.yy455.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy455.val = t; + yymsp[-2].minor.yy117.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy117.val = t; } +#line 5797 "sql.c" break; case 142: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } +#line 284 "sql.y" +{ yymsp[-1].minor.yy117.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy117.val = yymsp[0].minor.yy0; } +#line 5802 "sql.c" break; case 143: /* alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ +#line 285 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yymsp[-2].minor.yy455.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy455.val = t; + yymsp[-2].minor.yy117.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy117.val = t; } +#line 5811 "sql.c" break; case 144: /* alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } +#line 290 "sql.y" +{ yymsp[-1].minor.yy117.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy117.val = yymsp[0].minor.yy0; } +#line 5816 "sql.c" break; case 145: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy106 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy106 = yylhsminor.yy106; +#line 294 "sql.y" +{ yylhsminor.yy88 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } +#line 5821 "sql.c" + yymsp[0].minor.yy88 = yylhsminor.yy88; break; case 146: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 395: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==395); -{ yylhsminor.yy106 = addNodeToList(pCxt, yymsp[-2].minor.yy106, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy106 = yylhsminor.yy106; + case 398: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==398); +#line 295 "sql.y" +{ yylhsminor.yy88 = addNodeToList(pCxt, yymsp[-2].minor.yy88, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } +#line 5828 "sql.c" + yymsp[-2].minor.yy88 = yylhsminor.yy88; break; case 147: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy106 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy106 = yylhsminor.yy106; +#line 299 "sql.y" +{ yylhsminor.yy88 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } +#line 5834 "sql.c" + yymsp[0].minor.yy88 = yylhsminor.yy88; break; case 148: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy106 = addNodeToList(pCxt, yymsp[-2].minor.yy106, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy106 = yylhsminor.yy106; +#line 300 "sql.y" +{ yylhsminor.yy88 = addNodeToList(pCxt, yymsp[-2].minor.yy88, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } +#line 5840 "sql.c" + yymsp[-2].minor.yy88 = yylhsminor.yy88; break; case 149: /* retention_list ::= retention */ case 180: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==180); @@ -5275,1260 +5846,1897 @@ static YYACTIONTYPE yy_reduce( case 190: /* column_def_list ::= column_def */ yytestcase(yyruleno==190); case 234: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==234); case 239: /* col_name_list ::= col_name */ yytestcase(yyruleno==239); - case 301: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==301); - case 318: /* func_list ::= func */ yytestcase(yyruleno==318); - case 424: /* literal_list ::= signed_literal */ yytestcase(yyruleno==424); - case 495: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==495); - case 501: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==501); - case 560: /* select_list ::= select_item */ yytestcase(yyruleno==560); - case 571: /* partition_list ::= partition_item */ yytestcase(yyruleno==571); - case 630: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==630); -{ yylhsminor.yy106 = createNodeList(pCxt, yymsp[0].minor.yy80); } - yymsp[0].minor.yy106 = yylhsminor.yy106; + case 303: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==303); + case 320: /* func_list ::= func */ yytestcase(yyruleno==320); + case 427: /* literal_list ::= signed_literal */ yytestcase(yyruleno==427); + case 498: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==498); + case 504: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==504); + case 563: /* select_list ::= select_item */ yytestcase(yyruleno==563); + case 574: /* partition_list ::= partition_item */ yytestcase(yyruleno==574); + case 633: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==633); +#line 304 "sql.y" +{ yylhsminor.yy88 = createNodeList(pCxt, yymsp[0].minor.yy232); } +#line 5859 "sql.c" + yymsp[0].minor.yy88 = yylhsminor.yy88; break; case 150: /* retention_list ::= retention_list NK_COMMA retention */ case 184: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==184); case 191: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==191); case 235: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==235); case 240: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==240); - case 302: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==302); - case 319: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==319); - case 425: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==425); - case 496: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==496); - case 561: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==561); - case 572: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==572); - case 631: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==631); -{ yylhsminor.yy106 = addNodeToList(pCxt, yymsp[-2].minor.yy106, yymsp[0].minor.yy80); } - yymsp[-2].minor.yy106 = yylhsminor.yy106; + case 304: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==304); + case 321: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==321); + case 428: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==428); + case 499: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==499); + case 564: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==564); + case 575: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==575); + case 634: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==634); +#line 305 "sql.y" +{ yylhsminor.yy88 = addNodeToList(pCxt, yymsp[-2].minor.yy88, yymsp[0].minor.yy232); } +#line 5876 "sql.c" + yymsp[-2].minor.yy88 = yylhsminor.yy88; break; case 151: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ case 152: /* retention ::= NK_MINUS NK_COLON NK_VARIABLE */ yytestcase(yyruleno==152); -{ yylhsminor.yy80 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 307 "sql.y" +{ yylhsminor.yy232 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } +#line 5883 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 153: /* speed_opt ::= */ - case 352: /* bufsize_opt ::= */ yytestcase(yyruleno==352); -{ yymsp[1].minor.yy982 = 0; } + case 354: /* bufsize_opt ::= */ yytestcase(yyruleno==354); +#line 312 "sql.y" +{ yymsp[1].minor.yy92 = 0; } +#line 5890 "sql.c" break; case 154: /* speed_opt ::= BWLIMIT NK_INTEGER */ - case 353: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==353); -{ yymsp[-1].minor.yy982 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } + case 355: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==355); +#line 313 "sql.y" +{ yymsp[-1].minor.yy92 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } +#line 5896 "sql.c" break; case 156: /* start_opt ::= START WITH NK_INTEGER */ case 160: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==160); -{ yymsp[-2].minor.yy80 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } +#line 316 "sql.y" +{ yymsp[-2].minor.yy232 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } +#line 5902 "sql.c" break; case 157: /* start_opt ::= START WITH NK_STRING */ case 161: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==161); -{ yymsp[-2].minor.yy80 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +#line 317 "sql.y" +{ yymsp[-2].minor.yy232 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +#line 5908 "sql.c" break; case 158: /* start_opt ::= START WITH TIMESTAMP NK_STRING */ case 162: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==162); -{ yymsp[-3].minor.yy80 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +#line 318 "sql.y" +{ yymsp[-3].minor.yy232 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +#line 5914 "sql.c" break; case 163: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ case 165: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==165); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy923, yymsp[-5].minor.yy80, yymsp[-3].minor.yy106, yymsp[-1].minor.yy106, yymsp[0].minor.yy80); } +#line 327 "sql.y" +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy985, yymsp[-5].minor.yy232, yymsp[-3].minor.yy88, yymsp[-1].minor.yy88, yymsp[0].minor.yy232); } +#line 5920 "sql.c" break; case 164: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy106); } +#line 328 "sql.y" +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy88); } +#line 5925 "sql.c" break; case 166: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy106); } +#line 331 "sql.y" +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy88); } +#line 5930 "sql.c" break; case 167: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy923, yymsp[0].minor.yy80); } +#line 332 "sql.y" +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy985, yymsp[0].minor.yy232); } +#line 5935 "sql.c" break; case 168: /* cmd ::= ALTER TABLE alter_table_clause */ - case 397: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==397); - case 398: /* cmd ::= insert_query */ yytestcase(yyruleno==398); -{ pCxt->pRootNode = yymsp[0].minor.yy80; } + case 400: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==400); + case 401: /* cmd ::= insert_query */ yytestcase(yyruleno==401); +#line 334 "sql.y" +{ pCxt->pRootNode = yymsp[0].minor.yy232; } +#line 5942 "sql.c" break; case 169: /* cmd ::= ALTER STABLE alter_table_clause */ -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy80); } +#line 335 "sql.y" +{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy232); } +#line 5947 "sql.c" break; case 170: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy80 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy80, yymsp[0].minor.yy80); } - yymsp[-1].minor.yy80 = yylhsminor.yy80; +#line 337 "sql.y" +{ yylhsminor.yy232 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy232, yymsp[0].minor.yy232); } +#line 5952 "sql.c" + yymsp[-1].minor.yy232 = yylhsminor.yy232; break; case 171: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy80 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy80, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy785, yymsp[0].minor.yy292); } - yymsp[-4].minor.yy80 = yylhsminor.yy80; +#line 339 "sql.y" +{ yylhsminor.yy232 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy232, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy993, yymsp[0].minor.yy400); } +#line 5958 "sql.c" + yymsp[-4].minor.yy232 = yylhsminor.yy232; break; case 172: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy80 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy80, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy785); } - yymsp[-3].minor.yy80 = yylhsminor.yy80; +#line 340 "sql.y" +{ yylhsminor.yy232 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy232, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy993); } +#line 5964 "sql.c" + yymsp[-3].minor.yy232 = yylhsminor.yy232; break; case 173: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy80 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy80, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy785, yymsp[0].minor.yy292); } - yymsp[-4].minor.yy80 = yylhsminor.yy80; +#line 342 "sql.y" +{ yylhsminor.yy232 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy232, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy993, yymsp[0].minor.yy400); } +#line 5970 "sql.c" + yymsp[-4].minor.yy232 = yylhsminor.yy232; break; case 174: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy80 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy80, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy785, &yymsp[0].minor.yy785); } - yymsp[-4].minor.yy80 = yylhsminor.yy80; +#line 344 "sql.y" +{ yylhsminor.yy232 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy232, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy993, &yymsp[0].minor.yy993); } +#line 5976 "sql.c" + yymsp[-4].minor.yy232 = yylhsminor.yy232; break; case 175: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy80 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy80, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy785, yymsp[0].minor.yy292); } - yymsp[-4].minor.yy80 = yylhsminor.yy80; +#line 346 "sql.y" +{ yylhsminor.yy232 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy232, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy993, yymsp[0].minor.yy400); } +#line 5982 "sql.c" + yymsp[-4].minor.yy232 = yylhsminor.yy232; break; case 176: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy80 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy80, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy785); } - yymsp[-3].minor.yy80 = yylhsminor.yy80; +#line 347 "sql.y" +{ yylhsminor.yy232 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy232, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy993); } +#line 5988 "sql.c" + yymsp[-3].minor.yy232 = yylhsminor.yy232; break; case 177: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy80 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy80, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy785, yymsp[0].minor.yy292); } - yymsp[-4].minor.yy80 = yylhsminor.yy80; +#line 349 "sql.y" +{ yylhsminor.yy232 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy232, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy993, yymsp[0].minor.yy400); } +#line 5994 "sql.c" + yymsp[-4].minor.yy232 = yylhsminor.yy232; break; case 178: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy80 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy80, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy785, &yymsp[0].minor.yy785); } - yymsp[-4].minor.yy80 = yylhsminor.yy80; +#line 351 "sql.y" +{ yylhsminor.yy232 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy232, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy993, &yymsp[0].minor.yy993); } +#line 6000 "sql.c" + yymsp[-4].minor.yy232 = yylhsminor.yy232; break; case 179: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ -{ yylhsminor.yy80 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy80, &yymsp[-2].minor.yy785, yymsp[0].minor.yy80); } - yymsp[-5].minor.yy80 = yylhsminor.yy80; +#line 353 "sql.y" +{ yylhsminor.yy232 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy232, &yymsp[-2].minor.yy993, yymsp[0].minor.yy232); } +#line 6006 "sql.c" + yymsp[-5].minor.yy232 = yylhsminor.yy232; break; case 181: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 502: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==502); -{ yylhsminor.yy106 = addNodeToList(pCxt, yymsp[-1].minor.yy106, yymsp[0].minor.yy80); } - yymsp[-1].minor.yy106 = yylhsminor.yy106; + case 505: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==505); +#line 358 "sql.y" +{ yylhsminor.yy88 = addNodeToList(pCxt, yymsp[-1].minor.yy88, yymsp[0].minor.yy232); } +#line 6013 "sql.c" + yymsp[-1].minor.yy88 = yylhsminor.yy88; break; case 182: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ -{ yylhsminor.yy80 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy923, yymsp[-8].minor.yy80, yymsp[-6].minor.yy80, yymsp[-5].minor.yy106, yymsp[-2].minor.yy106, yymsp[0].minor.yy80); } - yymsp[-9].minor.yy80 = yylhsminor.yy80; +#line 362 "sql.y" +{ yylhsminor.yy232 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy985, yymsp[-8].minor.yy232, yymsp[-6].minor.yy232, yymsp[-5].minor.yy88, yymsp[-2].minor.yy88, yymsp[0].minor.yy232); } +#line 6019 "sql.c" + yymsp[-9].minor.yy232 = yylhsminor.yy232; break; case 185: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy80 = createDropTableClause(pCxt, yymsp[-1].minor.yy923, yymsp[0].minor.yy80); } - yymsp[-1].minor.yy80 = yylhsminor.yy80; +#line 369 "sql.y" +{ yylhsminor.yy232 = createDropTableClause(pCxt, yymsp[-1].minor.yy985, yymsp[0].minor.yy232); } +#line 6025 "sql.c" + yymsp[-1].minor.yy232 = yylhsminor.yy232; break; case 187: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ - case 367: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==367); -{ yymsp[-2].minor.yy106 = yymsp[-1].minor.yy106; } + case 369: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==369); +#line 374 "sql.y" +{ yymsp[-2].minor.yy88 = yymsp[-1].minor.yy88; } +#line 6032 "sql.c" break; case 188: /* full_table_name ::= table_name */ -{ yylhsminor.yy80 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy785, NULL); } - yymsp[0].minor.yy80 = yylhsminor.yy80; +#line 376 "sql.y" +{ yylhsminor.yy232 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy993, NULL); } +#line 6037 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; case 189: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy80 = createRealTableNode(pCxt, &yymsp[-2].minor.yy785, &yymsp[0].minor.yy785, NULL); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 377 "sql.y" +{ yylhsminor.yy232 = createRealTableNode(pCxt, &yymsp[-2].minor.yy993, &yymsp[0].minor.yy993, NULL); } +#line 6043 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 192: /* column_def ::= column_name type_name */ -{ yylhsminor.yy80 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy785, yymsp[0].minor.yy292, NULL); } - yymsp[-1].minor.yy80 = yylhsminor.yy80; +#line 384 "sql.y" +{ yylhsminor.yy232 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy993, yymsp[0].minor.yy400, NULL); } +#line 6049 "sql.c" + yymsp[-1].minor.yy232 = yylhsminor.yy232; break; case 193: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy292 = createDataType(TSDB_DATA_TYPE_BOOL); } +#line 389 "sql.y" +{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_BOOL); } +#line 6055 "sql.c" break; case 194: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy292 = createDataType(TSDB_DATA_TYPE_TINYINT); } +#line 390 "sql.y" +{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_TINYINT); } +#line 6060 "sql.c" break; case 195: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy292 = createDataType(TSDB_DATA_TYPE_SMALLINT); } +#line 391 "sql.y" +{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_SMALLINT); } +#line 6065 "sql.c" break; case 196: /* type_name ::= INT */ case 197: /* type_name ::= INTEGER */ yytestcase(yyruleno==197); -{ yymsp[0].minor.yy292 = createDataType(TSDB_DATA_TYPE_INT); } +#line 392 "sql.y" +{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_INT); } +#line 6071 "sql.c" break; case 198: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy292 = createDataType(TSDB_DATA_TYPE_BIGINT); } +#line 394 "sql.y" +{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_BIGINT); } +#line 6076 "sql.c" break; case 199: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy292 = createDataType(TSDB_DATA_TYPE_FLOAT); } +#line 395 "sql.y" +{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_FLOAT); } +#line 6081 "sql.c" break; case 200: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy292 = createDataType(TSDB_DATA_TYPE_DOUBLE); } +#line 396 "sql.y" +{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_DOUBLE); } +#line 6086 "sql.c" break; case 201: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy292 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } +#line 397 "sql.y" +{ yymsp[-3].minor.yy400 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } +#line 6091 "sql.c" break; case 202: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy292 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } +#line 398 "sql.y" +{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } +#line 6096 "sql.c" break; case 203: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy292 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } +#line 399 "sql.y" +{ yymsp[-3].minor.yy400 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } +#line 6101 "sql.c" break; case 204: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy292 = createDataType(TSDB_DATA_TYPE_UTINYINT); } +#line 400 "sql.y" +{ yymsp[-1].minor.yy400 = createDataType(TSDB_DATA_TYPE_UTINYINT); } +#line 6106 "sql.c" break; case 205: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy292 = createDataType(TSDB_DATA_TYPE_USMALLINT); } +#line 401 "sql.y" +{ yymsp[-1].minor.yy400 = createDataType(TSDB_DATA_TYPE_USMALLINT); } +#line 6111 "sql.c" break; case 206: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy292 = createDataType(TSDB_DATA_TYPE_UINT); } +#line 402 "sql.y" +{ yymsp[-1].minor.yy400 = createDataType(TSDB_DATA_TYPE_UINT); } +#line 6116 "sql.c" break; case 207: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy292 = createDataType(TSDB_DATA_TYPE_UBIGINT); } +#line 403 "sql.y" +{ yymsp[-1].minor.yy400 = createDataType(TSDB_DATA_TYPE_UBIGINT); } +#line 6121 "sql.c" break; case 208: /* type_name ::= JSON */ -{ yymsp[0].minor.yy292 = createDataType(TSDB_DATA_TYPE_JSON); } +#line 404 "sql.y" +{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_JSON); } +#line 6126 "sql.c" break; case 209: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy292 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } +#line 405 "sql.y" +{ yymsp[-3].minor.yy400 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } +#line 6131 "sql.c" break; case 210: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy292 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } +#line 406 "sql.y" +{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } +#line 6136 "sql.c" break; case 211: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy292 = createDataType(TSDB_DATA_TYPE_BLOB); } +#line 407 "sql.y" +{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_BLOB); } +#line 6141 "sql.c" break; case 212: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy292 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } +#line 408 "sql.y" +{ yymsp[-3].minor.yy400 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } +#line 6146 "sql.c" break; case 213: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy292 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } +#line 409 "sql.y" +{ yymsp[-3].minor.yy400 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } +#line 6151 "sql.c" break; case 214: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy292 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +#line 410 "sql.y" +{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +#line 6156 "sql.c" break; case 215: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy292 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +#line 411 "sql.y" +{ yymsp[-3].minor.yy400 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +#line 6161 "sql.c" break; case 216: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy292 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +#line 412 "sql.y" +{ yymsp[-5].minor.yy400 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +#line 6166 "sql.c" break; case 219: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ - case 370: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==370); -{ yymsp[-3].minor.yy106 = yymsp[-1].minor.yy106; } + case 372: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==372); +#line 421 "sql.y" +{ yymsp[-3].minor.yy88 = yymsp[-1].minor.yy88; } +#line 6172 "sql.c" break; case 220: /* table_options ::= */ -{ yymsp[1].minor.yy80 = createDefaultTableOptions(pCxt); } +#line 423 "sql.y" +{ yymsp[1].minor.yy232 = createDefaultTableOptions(pCxt); } +#line 6177 "sql.c" break; case 221: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy80 = setTableOption(pCxt, yymsp[-2].minor.yy80, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 424 "sql.y" +{ yylhsminor.yy232 = setTableOption(pCxt, yymsp[-2].minor.yy232, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } +#line 6182 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 222: /* table_options ::= table_options MAX_DELAY duration_list */ -{ yylhsminor.yy80 = setTableOption(pCxt, yymsp[-2].minor.yy80, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy106); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 425 "sql.y" +{ yylhsminor.yy232 = setTableOption(pCxt, yymsp[-2].minor.yy232, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy88); } +#line 6188 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 223: /* table_options ::= table_options WATERMARK duration_list */ -{ yylhsminor.yy80 = setTableOption(pCxt, yymsp[-2].minor.yy80, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy106); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 426 "sql.y" +{ yylhsminor.yy232 = setTableOption(pCxt, yymsp[-2].minor.yy232, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy88); } +#line 6194 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 224: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -{ yylhsminor.yy80 = setTableOption(pCxt, yymsp[-4].minor.yy80, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy106); } - yymsp[-4].minor.yy80 = yylhsminor.yy80; +#line 427 "sql.y" +{ yylhsminor.yy232 = setTableOption(pCxt, yymsp[-4].minor.yy232, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy88); } +#line 6200 "sql.c" + yymsp[-4].minor.yy232 = yylhsminor.yy232; break; case 225: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy80 = setTableOption(pCxt, yymsp[-2].minor.yy80, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 428 "sql.y" +{ yylhsminor.yy232 = setTableOption(pCxt, yymsp[-2].minor.yy232, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } +#line 6206 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 226: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy80 = setTableOption(pCxt, yymsp[-4].minor.yy80, TABLE_OPTION_SMA, yymsp[-1].minor.yy106); } - yymsp[-4].minor.yy80 = yylhsminor.yy80; +#line 429 "sql.y" +{ yylhsminor.yy232 = setTableOption(pCxt, yymsp[-4].minor.yy232, TABLE_OPTION_SMA, yymsp[-1].minor.yy88); } +#line 6212 "sql.c" + yymsp[-4].minor.yy232 = yylhsminor.yy232; break; case 227: /* table_options ::= table_options DELETE_MARK duration_list */ -{ yylhsminor.yy80 = setTableOption(pCxt, yymsp[-2].minor.yy80, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy106); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 430 "sql.y" +{ yylhsminor.yy232 = setTableOption(pCxt, yymsp[-2].minor.yy232, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy88); } +#line 6218 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; case 228: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy80 = createAlterTableOptions(pCxt); yylhsminor.yy80 = setTableOption(pCxt, yylhsminor.yy80, yymsp[0].minor.yy455.type, &yymsp[0].minor.yy455.val); } - yymsp[0].minor.yy80 = yylhsminor.yy80; +#line 432 "sql.y" +{ yylhsminor.yy232 = createAlterTableOptions(pCxt); yylhsminor.yy232 = setTableOption(pCxt, yylhsminor.yy232, yymsp[0].minor.yy117.type, &yymsp[0].minor.yy117.val); } +#line 6224 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; case 229: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy80 = setTableOption(pCxt, yymsp[-1].minor.yy80, yymsp[0].minor.yy455.type, &yymsp[0].minor.yy455.val); } - yymsp[-1].minor.yy80 = yylhsminor.yy80; +#line 433 "sql.y" +{ yylhsminor.yy232 = setTableOption(pCxt, yymsp[-1].minor.yy232, yymsp[0].minor.yy117.type, &yymsp[0].minor.yy117.val); } +#line 6230 "sql.c" + yymsp[-1].minor.yy232 = yylhsminor.yy232; break; case 230: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy455.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } +#line 437 "sql.y" +{ yymsp[-1].minor.yy117.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy117.val = yymsp[0].minor.yy0; } +#line 6236 "sql.c" break; case 231: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } +#line 438 "sql.y" +{ yymsp[-1].minor.yy117.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy117.val = yymsp[0].minor.yy0; } +#line 6241 "sql.c" break; case 232: /* duration_list ::= duration_literal */ - case 456: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==456); -{ yylhsminor.yy106 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy80)); } - yymsp[0].minor.yy106 = yylhsminor.yy106; + case 459: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==459); +#line 442 "sql.y" +{ yylhsminor.yy88 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy232)); } +#line 6247 "sql.c" + yymsp[0].minor.yy88 = yylhsminor.yy88; break; case 233: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 457: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==457); -{ yylhsminor.yy106 = addNodeToList(pCxt, yymsp[-2].minor.yy106, releaseRawExprNode(pCxt, yymsp[0].minor.yy80)); } - yymsp[-2].minor.yy106 = yylhsminor.yy106; + case 460: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==460); +#line 443 "sql.y" +{ yylhsminor.yy88 = addNodeToList(pCxt, yymsp[-2].minor.yy88, releaseRawExprNode(pCxt, yymsp[0].minor.yy232)); } +#line 6254 "sql.c" + yymsp[-2].minor.yy88 = yylhsminor.yy88; break; case 236: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy80 = createFunctionNode(pCxt, &yymsp[0].minor.yy785, NULL); } - yymsp[0].minor.yy80 = yylhsminor.yy80; +#line 450 "sql.y" +{ yylhsminor.yy232 = createFunctionNode(pCxt, &yymsp[0].minor.yy993, NULL); } +#line 6260 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; case 237: /* rollup_func_name ::= FIRST */ case 238: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==238); - case 304: /* tag_item ::= QTAGS */ yytestcase(yyruleno==304); -{ yylhsminor.yy80 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 306: /* tag_item ::= QTAGS */ yytestcase(yyruleno==306); +#line 451 "sql.y" +{ yylhsminor.yy232 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } +#line 6268 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; case 241: /* col_name ::= column_name */ - case 305: /* tag_item ::= column_name */ yytestcase(yyruleno==305); -{ yylhsminor.yy80 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy785); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 307: /* tag_item ::= column_name */ yytestcase(yyruleno==307); +#line 459 "sql.y" +{ yylhsminor.yy232 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy993); } +#line 6275 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; case 242: /* cmd ::= SHOW DNODES */ +#line 462 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } +#line 6281 "sql.c" break; case 243: /* cmd ::= SHOW USERS */ +#line 463 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } +#line 6286 "sql.c" break; case 244: /* cmd ::= SHOW USER PRIVILEGES */ +#line 464 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); } +#line 6291 "sql.c" break; case 245: /* cmd ::= SHOW db_kind_opt DATABASES */ +#line 465 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); - setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy459); + setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy281); } +#line 6299 "sql.c" break; case 246: /* cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ +#line 469 "sql.y" { - pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy709, yymsp[0].minor.yy80, OP_TYPE_LIKE); + pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy133, yymsp[0].minor.yy232, OP_TYPE_LIKE); } +#line 6306 "sql.c" break; case 247: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy80, yymsp[0].minor.yy80, OP_TYPE_LIKE); } +#line 472 "sql.y" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy232, yymsp[0].minor.yy232, OP_TYPE_LIKE); } +#line 6311 "sql.c" break; case 248: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy80, NULL, OP_TYPE_LIKE); } +#line 473 "sql.y" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy232, NULL, OP_TYPE_LIKE); } +#line 6316 "sql.c" break; case 249: /* cmd ::= SHOW MNODES */ +#line 474 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } +#line 6321 "sql.c" break; case 250: /* cmd ::= SHOW QNODES */ +#line 476 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } +#line 6326 "sql.c" break; case 251: /* cmd ::= SHOW FUNCTIONS */ +#line 477 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } +#line 6331 "sql.c" break; case 252: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy80, yymsp[-1].minor.yy80, OP_TYPE_EQUAL); } +#line 478 "sql.y" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy232, yymsp[-1].minor.yy232, OP_TYPE_EQUAL); } +#line 6336 "sql.c" break; case 253: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy785), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy785), OP_TYPE_EQUAL); } +#line 479 "sql.y" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy993), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy993), OP_TYPE_EQUAL); } +#line 6341 "sql.c" break; case 254: /* cmd ::= SHOW STREAMS */ +#line 480 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } +#line 6346 "sql.c" break; case 255: /* cmd ::= SHOW ACCOUNTS */ +#line 481 "sql.y" { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } +#line 6351 "sql.c" break; case 256: /* cmd ::= SHOW APPS */ +#line 482 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } +#line 6356 "sql.c" break; case 257: /* cmd ::= SHOW CONNECTIONS */ +#line 483 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } +#line 6361 "sql.c" break; case 258: /* cmd ::= SHOW LICENCES */ case 259: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==259); +#line 484 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } +#line 6367 "sql.c" break; case 260: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy785); } +#line 486 "sql.y" +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy993); } +#line 6372 "sql.c" break; case 261: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy80); } +#line 487 "sql.y" +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy232); } +#line 6377 "sql.c" break; case 262: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy80); } +#line 488 "sql.y" +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy232); } +#line 6382 "sql.c" break; case 263: /* cmd ::= SHOW QUERIES */ +#line 489 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } +#line 6387 "sql.c" break; case 264: /* cmd ::= SHOW SCORES */ +#line 490 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } +#line 6392 "sql.c" break; case 265: /* cmd ::= SHOW TOPICS */ +#line 491 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } +#line 6397 "sql.c" break; case 266: /* cmd ::= SHOW VARIABLES */ case 267: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==267); +#line 492 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); } +#line 6403 "sql.c" break; case 268: /* cmd ::= SHOW LOCAL VARIABLES */ +#line 494 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } +#line 6408 "sql.c" break; case 269: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy80); } +#line 495 "sql.y" +{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy232); } +#line 6413 "sql.c" break; case 270: /* cmd ::= SHOW BNODES */ +#line 496 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } +#line 6418 "sql.c" break; case 271: /* cmd ::= SHOW SNODES */ +#line 497 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } +#line 6423 "sql.c" break; case 272: /* cmd ::= SHOW CLUSTER */ +#line 498 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } +#line 6428 "sql.c" break; case 273: /* cmd ::= SHOW TRANSACTIONS */ +#line 499 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } +#line 6433 "sql.c" break; case 274: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy80); } +#line 500 "sql.y" +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy232); } +#line 6438 "sql.c" break; case 275: /* cmd ::= SHOW CONSUMERS */ +#line 501 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } +#line 6443 "sql.c" break; case 276: /* cmd ::= SHOW SUBSCRIPTIONS */ +#line 502 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } +#line 6448 "sql.c" break; case 277: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy80, yymsp[-1].minor.yy80, OP_TYPE_EQUAL); } +#line 503 "sql.y" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy232, yymsp[-1].minor.yy232, OP_TYPE_EQUAL); } +#line 6453 "sql.c" break; case 278: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy785), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy785), OP_TYPE_EQUAL); } +#line 504 "sql.y" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy993), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy993), OP_TYPE_EQUAL); } +#line 6458 "sql.c" break; case 279: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy80, yymsp[0].minor.yy80, yymsp[-3].minor.yy106); } +#line 505 "sql.y" +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy232, yymsp[0].minor.yy232, yymsp[-3].minor.yy88); } +#line 6463 "sql.c" break; case 280: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy785), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy785), yymsp[-4].minor.yy106); } +#line 506 "sql.y" +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy993), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy993), yymsp[-4].minor.yy88); } +#line 6468 "sql.c" break; case 281: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ +#line 507 "sql.y" { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } +#line 6473 "sql.c" break; case 282: /* cmd ::= SHOW VNODES */ +#line 508 "sql.y" { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, NULL); } +#line 6478 "sql.c" break; case 283: /* cmd ::= SHOW db_name_cond_opt ALIVE */ -{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy80, QUERY_NODE_SHOW_DB_ALIVE_STMT); } +#line 510 "sql.y" +{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy232, QUERY_NODE_SHOW_DB_ALIVE_STMT); } +#line 6483 "sql.c" break; case 284: /* cmd ::= SHOW CLUSTER ALIVE */ +#line 511 "sql.y" { pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); } +#line 6488 "sql.c" break; case 285: /* cmd ::= SHOW db_name_cond_opt VIEWS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-1].minor.yy80, NULL, OP_TYPE_LIKE); } +#line 512 "sql.y" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-1].minor.yy232, NULL, OP_TYPE_LIKE); } +#line 6493 "sql.c" break; case 286: /* cmd ::= SHOW CREATE VIEW full_table_name */ -{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy80); } +#line 513 "sql.y" +{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy232); } +#line 6498 "sql.c" break; - case 287: /* table_kind_db_name_cond_opt ::= */ -{ yymsp[1].minor.yy709.kind = SHOW_KIND_ALL; yymsp[1].minor.yy709.dbName = nil_token; } + case 287: /* cmd ::= SHOW COMPACTS */ +#line 514 "sql.y" +{ pCxt->pRootNode = createShowCompactsStmt(pCxt, QUERY_NODE_SHOW_COMPACTS_STMT); } +#line 6503 "sql.c" break; - case 288: /* table_kind_db_name_cond_opt ::= table_kind */ -{ yylhsminor.yy709.kind = yymsp[0].minor.yy459; yylhsminor.yy709.dbName = nil_token; } - yymsp[0].minor.yy709 = yylhsminor.yy709; + case 288: /* cmd ::= SHOW COMPACT NK_INTEGER */ +#line 515 "sql.y" +{ pCxt->pRootNode = createShowCompactDetailsStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } +#line 6508 "sql.c" break; - case 289: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy709.kind = SHOW_KIND_ALL; yylhsminor.yy709.dbName = yymsp[-1].minor.yy785; } - yymsp[-1].minor.yy709 = yylhsminor.yy709; + case 289: /* table_kind_db_name_cond_opt ::= */ +#line 519 "sql.y" +{ yymsp[1].minor.yy133.kind = SHOW_KIND_ALL; yymsp[1].minor.yy133.dbName = nil_token; } +#line 6513 "sql.c" break; - case 290: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ -{ yylhsminor.yy709.kind = yymsp[-2].minor.yy459; yylhsminor.yy709.dbName = yymsp[-1].minor.yy785; } - yymsp[-2].minor.yy709 = yylhsminor.yy709; + case 290: /* table_kind_db_name_cond_opt ::= table_kind */ +#line 520 "sql.y" +{ yylhsminor.yy133.kind = yymsp[0].minor.yy281; yylhsminor.yy133.dbName = nil_token; } +#line 6518 "sql.c" + yymsp[0].minor.yy133 = yylhsminor.yy133; break; - case 291: /* table_kind ::= NORMAL */ -{ yymsp[0].minor.yy459 = SHOW_KIND_TABLES_NORMAL; } + case 291: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */ +#line 521 "sql.y" +{ yylhsminor.yy133.kind = SHOW_KIND_ALL; yylhsminor.yy133.dbName = yymsp[-1].minor.yy993; } +#line 6524 "sql.c" + yymsp[-1].minor.yy133 = yylhsminor.yy133; break; - case 292: /* table_kind ::= CHILD */ -{ yymsp[0].minor.yy459 = SHOW_KIND_TABLES_CHILD; } + case 292: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ +#line 522 "sql.y" +{ yylhsminor.yy133.kind = yymsp[-2].minor.yy281; yylhsminor.yy133.dbName = yymsp[-1].minor.yy993; } +#line 6530 "sql.c" + yymsp[-2].minor.yy133 = yylhsminor.yy133; break; - case 293: /* db_name_cond_opt ::= */ - case 298: /* from_db_opt ::= */ yytestcase(yyruleno==298); -{ yymsp[1].minor.yy80 = createDefaultDatabaseCondValue(pCxt); } + case 293: /* table_kind ::= NORMAL */ +#line 526 "sql.y" +{ yymsp[0].minor.yy281 = SHOW_KIND_TABLES_NORMAL; } +#line 6536 "sql.c" break; - case 294: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy80 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy785); } - yymsp[-1].minor.yy80 = yylhsminor.yy80; + case 294: /* table_kind ::= CHILD */ +#line 527 "sql.y" +{ yymsp[0].minor.yy281 = SHOW_KIND_TABLES_CHILD; } +#line 6541 "sql.c" break; - case 296: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy80 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + case 295: /* db_name_cond_opt ::= */ + case 300: /* from_db_opt ::= */ yytestcase(yyruleno==300); +#line 529 "sql.y" +{ yymsp[1].minor.yy232 = createDefaultDatabaseCondValue(pCxt); } +#line 6547 "sql.c" break; - case 297: /* table_name_cond ::= table_name */ -{ yylhsminor.yy80 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy785); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 296: /* db_name_cond_opt ::= db_name NK_DOT */ +#line 530 "sql.y" +{ yylhsminor.yy232 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy993); } +#line 6552 "sql.c" + yymsp[-1].minor.yy232 = yylhsminor.yy232; break; - case 299: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy80 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy785); } + case 298: /* like_pattern_opt ::= LIKE NK_STRING */ +#line 533 "sql.y" +{ yymsp[-1].minor.yy232 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } +#line 6558 "sql.c" break; - case 303: /* tag_item ::= TBNAME */ -{ yylhsminor.yy80 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 299: /* table_name_cond ::= table_name */ +#line 535 "sql.y" +{ yylhsminor.yy232 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy993); } +#line 6563 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 306: /* tag_item ::= column_name column_alias */ -{ yylhsminor.yy80 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy785), &yymsp[0].minor.yy785); } - yymsp[-1].minor.yy80 = yylhsminor.yy80; + case 301: /* from_db_opt ::= FROM db_name */ +#line 538 "sql.y" +{ yymsp[-1].minor.yy232 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy993); } +#line 6569 "sql.c" break; - case 307: /* tag_item ::= column_name AS column_alias */ -{ yylhsminor.yy80 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy785), &yymsp[0].minor.yy785); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 305: /* tag_item ::= TBNAME */ +#line 546 "sql.y" +{ yylhsminor.yy232 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } +#line 6574 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 308: /* db_kind_opt ::= */ -{ yymsp[1].minor.yy459 = SHOW_KIND_ALL; } + case 308: /* tag_item ::= column_name column_alias */ +#line 549 "sql.y" +{ yylhsminor.yy232 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy993), &yymsp[0].minor.yy993); } +#line 6580 "sql.c" + yymsp[-1].minor.yy232 = yylhsminor.yy232; break; - case 309: /* db_kind_opt ::= USER */ -{ yymsp[0].minor.yy459 = SHOW_KIND_DATABASES_USER; } + case 309: /* tag_item ::= column_name AS column_alias */ +#line 550 "sql.y" +{ yylhsminor.yy232 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy993), &yymsp[0].minor.yy993); } +#line 6586 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 310: /* db_kind_opt ::= SYSTEM */ -{ yymsp[0].minor.yy459 = SHOW_KIND_DATABASES_SYSTEM; } + case 310: /* db_kind_opt ::= */ +#line 554 "sql.y" +{ yymsp[1].minor.yy281 = SHOW_KIND_ALL; } +#line 6592 "sql.c" break; - case 311: /* cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy923, yymsp[-3].minor.yy80, yymsp[-1].minor.yy80, NULL, yymsp[0].minor.yy80); } + case 311: /* db_kind_opt ::= USER */ +#line 555 "sql.y" +{ yymsp[0].minor.yy281 = SHOW_KIND_DATABASES_USER; } +#line 6597 "sql.c" break; - case 312: /* cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy923, yymsp[-5].minor.yy80, yymsp[-3].minor.yy80, yymsp[-1].minor.yy106, NULL); } + case 312: /* db_kind_opt ::= SYSTEM */ +#line 556 "sql.y" +{ yymsp[0].minor.yy281 = SHOW_KIND_DATABASES_SYSTEM; } +#line 6602 "sql.c" break; - case 313: /* cmd ::= DROP INDEX exists_opt full_index_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy923, yymsp[0].minor.yy80); } + case 313: /* cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ +#line 560 "sql.y" +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy985, yymsp[-3].minor.yy232, yymsp[-1].minor.yy232, NULL, yymsp[0].minor.yy232); } +#line 6607 "sql.c" break; - case 314: /* full_index_name ::= index_name */ -{ yylhsminor.yy80 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy785); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 314: /* cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ +#line 562 "sql.y" +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy985, yymsp[-5].minor.yy232, yymsp[-3].minor.yy232, yymsp[-1].minor.yy88, NULL); } +#line 6612 "sql.c" break; - case 315: /* full_index_name ::= db_name NK_DOT index_name */ -{ yylhsminor.yy80 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy785, &yymsp[0].minor.yy785); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 315: /* cmd ::= DROP INDEX exists_opt full_index_name */ +#line 563 "sql.y" +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy985, yymsp[0].minor.yy232); } +#line 6617 "sql.c" break; - case 316: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-9].minor.yy80 = createIndexOption(pCxt, yymsp[-7].minor.yy106, releaseRawExprNode(pCxt, yymsp[-3].minor.yy80), NULL, yymsp[-1].minor.yy80, yymsp[0].minor.yy80); } + case 316: /* full_index_name ::= index_name */ +#line 565 "sql.y" +{ yylhsminor.yy232 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy993); } +#line 6622 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 317: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-11].minor.yy80 = createIndexOption(pCxt, yymsp[-9].minor.yy106, releaseRawExprNode(pCxt, yymsp[-5].minor.yy80), releaseRawExprNode(pCxt, yymsp[-3].minor.yy80), yymsp[-1].minor.yy80, yymsp[0].minor.yy80); } + case 317: /* full_index_name ::= db_name NK_DOT index_name */ +#line 566 "sql.y" +{ yylhsminor.yy232 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy993, &yymsp[0].minor.yy993); } +#line 6628 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 320: /* func ::= sma_func_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy80 = createFunctionNode(pCxt, &yymsp[-3].minor.yy785, yymsp[-1].minor.yy106); } - yymsp[-3].minor.yy80 = yylhsminor.yy80; + case 318: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ +#line 569 "sql.y" +{ yymsp[-9].minor.yy232 = createIndexOption(pCxt, yymsp[-7].minor.yy88, releaseRawExprNode(pCxt, yymsp[-3].minor.yy232), NULL, yymsp[-1].minor.yy232, yymsp[0].minor.yy232); } +#line 6634 "sql.c" break; - case 321: /* sma_func_name ::= function_name */ - case 545: /* alias_opt ::= table_alias */ yytestcase(yyruleno==545); -{ yylhsminor.yy785 = yymsp[0].minor.yy785; } - yymsp[0].minor.yy785 = yylhsminor.yy785; + case 319: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ +#line 572 "sql.y" +{ yymsp[-11].minor.yy232 = createIndexOption(pCxt, yymsp[-9].minor.yy88, releaseRawExprNode(pCxt, yymsp[-5].minor.yy232), releaseRawExprNode(pCxt, yymsp[-3].minor.yy232), yymsp[-1].minor.yy232, yymsp[0].minor.yy232); } +#line 6639 "sql.c" break; - case 326: /* sma_stream_opt ::= */ - case 371: /* stream_options ::= */ yytestcase(yyruleno==371); -{ yymsp[1].minor.yy80 = createStreamOptions(pCxt); } + case 322: /* func ::= sma_func_name NK_LP expression_list NK_RP */ +#line 579 "sql.y" +{ yylhsminor.yy232 = createFunctionNode(pCxt, &yymsp[-3].minor.yy993, yymsp[-1].minor.yy88); } +#line 6644 "sql.c" + yymsp[-3].minor.yy232 = yylhsminor.yy232; break; - case 327: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy80)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy80); yylhsminor.yy80 = yymsp[-2].minor.yy80; } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 323: /* sma_func_name ::= function_name */ + case 548: /* alias_opt ::= table_alias */ yytestcase(yyruleno==548); +#line 583 "sql.y" +{ yylhsminor.yy993 = yymsp[0].minor.yy993; } +#line 6651 "sql.c" + yymsp[0].minor.yy993 = yylhsminor.yy993; break; - case 328: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy80)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy80); yylhsminor.yy80 = yymsp[-2].minor.yy80; } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 328: /* sma_stream_opt ::= */ + case 373: /* stream_options ::= */ yytestcase(yyruleno==373); +#line 589 "sql.y" +{ yymsp[1].minor.yy232 = createStreamOptions(pCxt); } +#line 6658 "sql.c" break; - case 329: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy80)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy80); yylhsminor.yy80 = yymsp[-2].minor.yy80; } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 329: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ +#line 590 "sql.y" +{ ((SStreamOptions*)yymsp[-2].minor.yy232)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy232); yylhsminor.yy232 = yymsp[-2].minor.yy232; } +#line 6663 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 330: /* with_meta ::= AS */ -{ yymsp[0].minor.yy982 = 0; } + case 330: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ +#line 591 "sql.y" +{ ((SStreamOptions*)yymsp[-2].minor.yy232)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy232); yylhsminor.yy232 = yymsp[-2].minor.yy232; } +#line 6669 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 331: /* with_meta ::= WITH META AS */ -{ yymsp[-2].minor.yy982 = 1; } + case 331: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ +#line 592 "sql.y" +{ ((SStreamOptions*)yymsp[-2].minor.yy232)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy232); yylhsminor.yy232 = yymsp[-2].minor.yy232; } +#line 6675 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 332: /* with_meta ::= ONLY META AS */ -{ yymsp[-2].minor.yy982 = 2; } + case 332: /* with_meta ::= AS */ +#line 597 "sql.y" +{ yymsp[0].minor.yy92 = 0; } +#line 6681 "sql.c" break; - case 333: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy923, &yymsp[-2].minor.yy785, yymsp[0].minor.yy80); } + case 333: /* with_meta ::= WITH META AS */ +#line 598 "sql.y" +{ yymsp[-2].minor.yy92 = 1; } +#line 6686 "sql.c" break; - case 334: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy923, &yymsp[-3].minor.yy785, &yymsp[0].minor.yy785, yymsp[-2].minor.yy982); } + case 334: /* with_meta ::= ONLY META AS */ +#line 599 "sql.y" +{ yymsp[-2].minor.yy92 = 2; } +#line 6691 "sql.c" break; - case 335: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy923, &yymsp[-4].minor.yy785, yymsp[-1].minor.yy80, yymsp[-3].minor.yy982, yymsp[0].minor.yy80); } + case 335: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ +#line 601 "sql.y" +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy985, &yymsp[-2].minor.yy993, yymsp[0].minor.yy232); } +#line 6696 "sql.c" break; - case 336: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy923, &yymsp[0].minor.yy785); } + case 336: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ +#line 603 "sql.y" +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy985, &yymsp[-3].minor.yy993, &yymsp[0].minor.yy993, yymsp[-2].minor.yy92); } +#line 6701 "sql.c" break; - case 337: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy923, &yymsp[-2].minor.yy785, &yymsp[0].minor.yy785); } + case 337: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ +#line 605 "sql.y" +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy985, &yymsp[-4].minor.yy993, yymsp[-1].minor.yy232, yymsp[-3].minor.yy92, yymsp[0].minor.yy232); } +#line 6706 "sql.c" break; - case 338: /* cmd ::= DESC full_table_name */ - case 339: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==339); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy80); } + case 338: /* cmd ::= DROP TOPIC exists_opt topic_name */ +#line 607 "sql.y" +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy985, &yymsp[0].minor.yy993); } +#line 6711 "sql.c" break; - case 340: /* cmd ::= RESET QUERY CACHE */ + case 339: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ +#line 608 "sql.y" +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy985, &yymsp[-2].minor.yy993, &yymsp[0].minor.yy993); } +#line 6716 "sql.c" + break; + case 340: /* cmd ::= DESC full_table_name */ + case 341: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==341); +#line 611 "sql.y" +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy232); } +#line 6722 "sql.c" + break; + case 342: /* cmd ::= RESET QUERY CACHE */ +#line 615 "sql.y" { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } +#line 6727 "sql.c" break; - case 341: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - case 342: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==342); -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy923, yymsp[-1].minor.yy80, yymsp[0].minor.yy80); } + case 343: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + case 344: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==344); +#line 618 "sql.y" +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy985, yymsp[-1].minor.yy232, yymsp[0].minor.yy232); } +#line 6733 "sql.c" break; - case 345: /* explain_options ::= */ -{ yymsp[1].minor.yy80 = createDefaultExplainOptions(pCxt); } + case 347: /* explain_options ::= */ +#line 626 "sql.y" +{ yymsp[1].minor.yy232 = createDefaultExplainOptions(pCxt); } +#line 6738 "sql.c" break; - case 346: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy80 = setExplainVerbose(pCxt, yymsp[-2].minor.yy80, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 348: /* explain_options ::= explain_options VERBOSE NK_BOOL */ +#line 627 "sql.y" +{ yylhsminor.yy232 = setExplainVerbose(pCxt, yymsp[-2].minor.yy232, &yymsp[0].minor.yy0); } +#line 6743 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 347: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy80 = setExplainRatio(pCxt, yymsp[-2].minor.yy80, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 349: /* explain_options ::= explain_options RATIO NK_FLOAT */ +#line 628 "sql.y" +{ yylhsminor.yy232 = setExplainRatio(pCxt, yymsp[-2].minor.yy232, &yymsp[0].minor.yy0); } +#line 6749 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 348: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ -{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy923, yymsp[-9].minor.yy923, &yymsp[-6].minor.yy785, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy292, yymsp[-1].minor.yy982, &yymsp[0].minor.yy785, yymsp[-10].minor.yy923); } + case 350: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ +#line 633 "sql.y" +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy985, yymsp[-9].minor.yy985, &yymsp[-6].minor.yy993, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy400, yymsp[-1].minor.yy92, &yymsp[0].minor.yy993, yymsp[-10].minor.yy985); } +#line 6755 "sql.c" break; - case 349: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy923, &yymsp[0].minor.yy785); } + case 351: /* cmd ::= DROP FUNCTION exists_opt function_name */ +#line 634 "sql.y" +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy985, &yymsp[0].minor.yy993); } +#line 6760 "sql.c" break; - case 354: /* language_opt ::= */ - case 392: /* on_vgroup_id ::= */ yytestcase(yyruleno==392); -{ yymsp[1].minor.yy785 = nil_token; } + case 356: /* language_opt ::= */ + case 395: /* on_vgroup_id ::= */ yytestcase(yyruleno==395); +#line 648 "sql.y" +{ yymsp[1].minor.yy993 = nil_token; } +#line 6766 "sql.c" break; - case 355: /* language_opt ::= LANGUAGE NK_STRING */ - case 393: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==393); -{ yymsp[-1].minor.yy785 = yymsp[0].minor.yy0; } + case 357: /* language_opt ::= LANGUAGE NK_STRING */ + case 396: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==396); +#line 649 "sql.y" +{ yymsp[-1].minor.yy993 = yymsp[0].minor.yy0; } +#line 6772 "sql.c" break; - case 358: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy923, yymsp[-2].minor.yy80, &yymsp[-1].minor.yy0, yymsp[0].minor.yy80); } + case 360: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ +#line 658 "sql.y" +{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy985, yymsp[-2].minor.yy232, &yymsp[-1].minor.yy0, yymsp[0].minor.yy232); } +#line 6777 "sql.c" break; - case 359: /* cmd ::= DROP VIEW exists_opt full_view_name */ -{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy923, yymsp[0].minor.yy80); } + case 361: /* cmd ::= DROP VIEW exists_opt full_view_name */ +#line 659 "sql.y" +{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy985, yymsp[0].minor.yy232); } +#line 6782 "sql.c" break; - case 360: /* full_view_name ::= view_name */ -{ yylhsminor.yy80 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy785); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 362: /* full_view_name ::= view_name */ +#line 661 "sql.y" +{ yylhsminor.yy232 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy993); } +#line 6787 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 361: /* full_view_name ::= db_name NK_DOT view_name */ -{ yylhsminor.yy80 = createViewNode(pCxt, &yymsp[-2].minor.yy785, &yymsp[0].minor.yy785); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 363: /* full_view_name ::= db_name NK_DOT view_name */ +#line 662 "sql.y" +{ yylhsminor.yy232 = createViewNode(pCxt, &yymsp[-2].minor.yy993, &yymsp[0].minor.yy993); } +#line 6793 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 362: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy923, &yymsp[-8].minor.yy785, yymsp[-5].minor.yy80, yymsp[-7].minor.yy80, yymsp[-3].minor.yy106, yymsp[-2].minor.yy80, yymsp[0].minor.yy80, yymsp[-4].minor.yy106); } + case 364: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ +#line 667 "sql.y" +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy985, &yymsp[-8].minor.yy993, yymsp[-5].minor.yy232, yymsp[-7].minor.yy232, yymsp[-3].minor.yy88, yymsp[-2].minor.yy232, yymsp[0].minor.yy232, yymsp[-4].minor.yy88); } +#line 6799 "sql.c" break; - case 363: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy923, &yymsp[0].minor.yy785); } + case 365: /* cmd ::= DROP STREAM exists_opt stream_name */ +#line 668 "sql.y" +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy985, &yymsp[0].minor.yy993); } +#line 6804 "sql.c" break; - case 364: /* cmd ::= PAUSE STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy923, &yymsp[0].minor.yy785); } + case 366: /* cmd ::= PAUSE STREAM exists_opt stream_name */ +#line 669 "sql.y" +{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy985, &yymsp[0].minor.yy993); } +#line 6809 "sql.c" break; - case 365: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ -{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy923, yymsp[-1].minor.yy923, &yymsp[0].minor.yy785); } + case 367: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ +#line 670 "sql.y" +{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy985, yymsp[-1].minor.yy985, &yymsp[0].minor.yy993); } +#line 6814 "sql.c" break; - case 372: /* stream_options ::= stream_options TRIGGER AT_ONCE */ - case 373: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==373); -{ yylhsminor.yy80 = setStreamOptions(pCxt, yymsp[-2].minor.yy80, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 374: /* stream_options ::= stream_options TRIGGER AT_ONCE */ + case 375: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==375); +#line 684 "sql.y" +{ yylhsminor.yy232 = setStreamOptions(pCxt, yymsp[-2].minor.yy232, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } +#line 6820 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 374: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -{ yylhsminor.yy80 = setStreamOptions(pCxt, yymsp[-3].minor.yy80, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy80)); } - yymsp[-3].minor.yy80 = yylhsminor.yy80; + case 376: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ +#line 686 "sql.y" +{ yylhsminor.yy232 = setStreamOptions(pCxt, yymsp[-3].minor.yy232, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy232)); } +#line 6826 "sql.c" + yymsp[-3].minor.yy232 = yylhsminor.yy232; break; - case 375: /* stream_options ::= stream_options WATERMARK duration_literal */ -{ yylhsminor.yy80 = setStreamOptions(pCxt, yymsp[-2].minor.yy80, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy80)); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 377: /* stream_options ::= stream_options WATERMARK duration_literal */ +#line 687 "sql.y" +{ yylhsminor.yy232 = setStreamOptions(pCxt, yymsp[-2].minor.yy232, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy232)); } +#line 6832 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 376: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ -{ yylhsminor.yy80 = setStreamOptions(pCxt, yymsp[-3].minor.yy80, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-3].minor.yy80 = yylhsminor.yy80; + case 378: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ +#line 688 "sql.y" +{ yylhsminor.yy232 = setStreamOptions(pCxt, yymsp[-3].minor.yy232, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } +#line 6838 "sql.c" + yymsp[-3].minor.yy232 = yylhsminor.yy232; break; - case 377: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ -{ yylhsminor.yy80 = setStreamOptions(pCxt, yymsp[-2].minor.yy80, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 379: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ +#line 689 "sql.y" +{ yylhsminor.yy232 = setStreamOptions(pCxt, yymsp[-2].minor.yy232, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } +#line 6844 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 378: /* stream_options ::= stream_options DELETE_MARK duration_literal */ -{ yylhsminor.yy80 = setStreamOptions(pCxt, yymsp[-2].minor.yy80, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy80)); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 380: /* stream_options ::= stream_options DELETE_MARK duration_literal */ +#line 690 "sql.y" +{ yylhsminor.yy232 = setStreamOptions(pCxt, yymsp[-2].minor.yy232, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy232)); } +#line 6850 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 379: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ -{ yylhsminor.yy80 = setStreamOptions(pCxt, yymsp[-3].minor.yy80, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-3].minor.yy80 = yylhsminor.yy80; + case 381: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ +#line 691 "sql.y" +{ yylhsminor.yy232 = setStreamOptions(pCxt, yymsp[-3].minor.yy232, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } +#line 6856 "sql.c" + yymsp[-3].minor.yy232 = yylhsminor.yy232; break; - case 381: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 583: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==583); - case 607: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==607); -{ yymsp[-3].minor.yy80 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy80); } + case 383: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + case 586: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==586); + case 610: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==610); +#line 694 "sql.y" +{ yymsp[-3].minor.yy232 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy232); } +#line 6864 "sql.c" break; - case 384: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 386: /* cmd ::= KILL CONNECTION NK_INTEGER */ +#line 702 "sql.y" { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } +#line 6869 "sql.c" break; - case 385: /* cmd ::= KILL QUERY NK_STRING */ + case 387: /* cmd ::= KILL QUERY NK_STRING */ +#line 703 "sql.y" { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } +#line 6874 "sql.c" break; - case 386: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 388: /* cmd ::= KILL TRANSACTION NK_INTEGER */ +#line 704 "sql.y" { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } +#line 6879 "sql.c" break; - case 387: /* cmd ::= BALANCE VGROUP */ + case 389: /* cmd ::= KILL COMPACT NK_INTEGER */ +#line 705 "sql.y" +{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_COMPACT_STMT, &yymsp[0].minor.yy0); } +#line 6884 "sql.c" + break; + case 390: /* cmd ::= BALANCE VGROUP */ +#line 708 "sql.y" { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } +#line 6889 "sql.c" break; - case 388: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ -{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy785); } + case 391: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ +#line 709 "sql.y" +{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy993); } +#line 6894 "sql.c" break; - case 389: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 392: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ +#line 710 "sql.y" { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } +#line 6899 "sql.c" break; - case 390: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy106); } + case 393: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ +#line 711 "sql.y" +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy88); } +#line 6904 "sql.c" break; - case 391: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 394: /* cmd ::= SPLIT VGROUP NK_INTEGER */ +#line 712 "sql.y" { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } +#line 6909 "sql.c" break; - case 394: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy106 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + case 397: /* dnode_list ::= DNODE NK_INTEGER */ +#line 721 "sql.y" +{ yymsp[-1].minor.yy88 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } +#line 6914 "sql.c" break; - case 396: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy80, yymsp[0].minor.yy80); } + case 399: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ +#line 728 "sql.y" +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy232, yymsp[0].minor.yy232); } +#line 6919 "sql.c" break; - case 399: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ -{ yymsp[-6].minor.yy80 = createInsertStmt(pCxt, yymsp[-4].minor.yy80, yymsp[-2].minor.yy106, yymsp[0].minor.yy80); } + case 402: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ +#line 737 "sql.y" +{ yymsp[-6].minor.yy232 = createInsertStmt(pCxt, yymsp[-4].minor.yy232, yymsp[-2].minor.yy88, yymsp[0].minor.yy232); } +#line 6924 "sql.c" break; - case 400: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ -{ yymsp[-3].minor.yy80 = createInsertStmt(pCxt, yymsp[-1].minor.yy80, NULL, yymsp[0].minor.yy80); } + case 403: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ +#line 738 "sql.y" +{ yymsp[-3].minor.yy232 = createInsertStmt(pCxt, yymsp[-1].minor.yy232, NULL, yymsp[0].minor.yy232); } +#line 6929 "sql.c" break; - case 401: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy80 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 404: /* literal ::= NK_INTEGER */ +#line 741 "sql.y" +{ yylhsminor.yy232 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } +#line 6934 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 402: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy80 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 405: /* literal ::= NK_FLOAT */ +#line 742 "sql.y" +{ yylhsminor.yy232 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } +#line 6940 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 403: /* literal ::= NK_STRING */ -{ yylhsminor.yy80 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 406: /* literal ::= NK_STRING */ +#line 743 "sql.y" +{ yylhsminor.yy232 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } +#line 6946 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 404: /* literal ::= NK_BOOL */ -{ yylhsminor.yy80 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 407: /* literal ::= NK_BOOL */ +#line 744 "sql.y" +{ yylhsminor.yy232 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } +#line 6952 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 405: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy80 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy80 = yylhsminor.yy80; + case 408: /* literal ::= TIMESTAMP NK_STRING */ +#line 745 "sql.y" +{ yylhsminor.yy232 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } +#line 6958 "sql.c" + yymsp[-1].minor.yy232 = yylhsminor.yy232; break; - case 406: /* literal ::= duration_literal */ - case 416: /* signed_literal ::= signed */ yytestcase(yyruleno==416); - case 439: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==439); - case 440: /* expression ::= literal */ yytestcase(yyruleno==440); - case 442: /* expression ::= column_reference */ yytestcase(yyruleno==442); - case 443: /* expression ::= function_expression */ yytestcase(yyruleno==443); - case 444: /* expression ::= case_when_expression */ yytestcase(yyruleno==444); - case 477: /* function_expression ::= literal_func */ yytestcase(yyruleno==477); - case 526: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==526); - case 530: /* boolean_primary ::= predicate */ yytestcase(yyruleno==530); - case 532: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==532); - case 533: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==533); - case 536: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==536); - case 538: /* table_reference ::= table_primary */ yytestcase(yyruleno==538); - case 539: /* table_reference ::= joined_table */ yytestcase(yyruleno==539); - case 543: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==543); - case 609: /* query_simple ::= query_specification */ yytestcase(yyruleno==609); - case 610: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==610); - case 613: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==613); - case 615: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==615); -{ yylhsminor.yy80 = yymsp[0].minor.yy80; } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 409: /* literal ::= duration_literal */ + case 419: /* signed_literal ::= signed */ yytestcase(yyruleno==419); + case 442: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==442); + case 443: /* expression ::= literal */ yytestcase(yyruleno==443); + case 445: /* expression ::= column_reference */ yytestcase(yyruleno==445); + case 446: /* expression ::= function_expression */ yytestcase(yyruleno==446); + case 447: /* expression ::= case_when_expression */ yytestcase(yyruleno==447); + case 480: /* function_expression ::= literal_func */ yytestcase(yyruleno==480); + case 529: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==529); + case 533: /* boolean_primary ::= predicate */ yytestcase(yyruleno==533); + case 535: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==535); + case 536: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==536); + case 539: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==539); + case 541: /* table_reference ::= table_primary */ yytestcase(yyruleno==541); + case 542: /* table_reference ::= joined_table */ yytestcase(yyruleno==542); + case 546: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==546); + case 612: /* query_simple ::= query_specification */ yytestcase(yyruleno==612); + case 613: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==613); + case 616: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==616); + case 618: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==618); +#line 746 "sql.y" +{ yylhsminor.yy232 = yymsp[0].minor.yy232; } +#line 6983 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 407: /* literal ::= NULL */ -{ yylhsminor.yy80 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 410: /* literal ::= NULL */ +#line 747 "sql.y" +{ yylhsminor.yy232 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } +#line 6989 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 408: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy80 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 411: /* literal ::= NK_QUESTION */ +#line 748 "sql.y" +{ yylhsminor.yy232 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } +#line 6995 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 409: /* duration_literal ::= NK_VARIABLE */ - case 584: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==584); - case 585: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==585); - case 586: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==586); -{ yylhsminor.yy80 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 412: /* duration_literal ::= NK_VARIABLE */ + case 587: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==587); + case 588: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==588); + case 589: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==589); +#line 750 "sql.y" +{ yylhsminor.yy232 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } +#line 7004 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 410: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy80 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 413: /* signed ::= NK_INTEGER */ +#line 752 "sql.y" +{ yylhsminor.yy232 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } +#line 7010 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 411: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy80 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + case 414: /* signed ::= NK_PLUS NK_INTEGER */ +#line 753 "sql.y" +{ yymsp[-1].minor.yy232 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } +#line 7016 "sql.c" break; - case 412: /* signed ::= NK_MINUS NK_INTEGER */ + case 415: /* signed ::= NK_MINUS NK_INTEGER */ +#line 754 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy80 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy232 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy80 = yylhsminor.yy80; +#line 7025 "sql.c" + yymsp[-1].minor.yy232 = yylhsminor.yy232; break; - case 413: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy80 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 416: /* signed ::= NK_FLOAT */ +#line 759 "sql.y" +{ yylhsminor.yy232 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } +#line 7031 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 414: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy80 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + case 417: /* signed ::= NK_PLUS NK_FLOAT */ +#line 760 "sql.y" +{ yymsp[-1].minor.yy232 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } +#line 7037 "sql.c" break; - case 415: /* signed ::= NK_MINUS NK_FLOAT */ + case 418: /* signed ::= NK_MINUS NK_FLOAT */ +#line 761 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy80 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy232 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy80 = yylhsminor.yy80; +#line 7046 "sql.c" + yymsp[-1].minor.yy232 = yylhsminor.yy232; break; - case 417: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy80 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 420: /* signed_literal ::= NK_STRING */ +#line 768 "sql.y" +{ yylhsminor.yy232 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } +#line 7052 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 418: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy80 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 421: /* signed_literal ::= NK_BOOL */ +#line 769 "sql.y" +{ yylhsminor.yy232 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } +#line 7058 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 419: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy80 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + case 422: /* signed_literal ::= TIMESTAMP NK_STRING */ +#line 770 "sql.y" +{ yymsp[-1].minor.yy232 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +#line 7064 "sql.c" break; - case 420: /* signed_literal ::= duration_literal */ - case 422: /* signed_literal ::= literal_func */ yytestcase(yyruleno==422); - case 497: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==497); - case 563: /* select_item ::= common_expression */ yytestcase(yyruleno==563); - case 573: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==573); - case 614: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==614); - case 616: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==616); - case 629: /* search_condition ::= common_expression */ yytestcase(yyruleno==629); -{ yylhsminor.yy80 = releaseRawExprNode(pCxt, yymsp[0].minor.yy80); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 423: /* signed_literal ::= duration_literal */ + case 425: /* signed_literal ::= literal_func */ yytestcase(yyruleno==425); + case 500: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==500); + case 566: /* select_item ::= common_expression */ yytestcase(yyruleno==566); + case 576: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==576); + case 617: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==617); + case 619: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==619); + case 632: /* search_condition ::= common_expression */ yytestcase(yyruleno==632); +#line 771 "sql.y" +{ yylhsminor.yy232 = releaseRawExprNode(pCxt, yymsp[0].minor.yy232); } +#line 7076 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 421: /* signed_literal ::= NULL */ -{ yylhsminor.yy80 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 424: /* signed_literal ::= NULL */ +#line 772 "sql.y" +{ yylhsminor.yy232 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } +#line 7082 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 423: /* signed_literal ::= NK_QUESTION */ -{ yylhsminor.yy80 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 426: /* signed_literal ::= NK_QUESTION */ +#line 774 "sql.y" +{ yylhsminor.yy232 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } +#line 7088 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 441: /* expression ::= pseudo_column */ -{ yylhsminor.yy80 = yymsp[0].minor.yy80; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy80, true); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 444: /* expression ::= pseudo_column */ +#line 836 "sql.y" +{ yylhsminor.yy232 = yymsp[0].minor.yy232; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy232, true); } +#line 7094 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 445: /* expression ::= NK_LP expression NK_RP */ - case 531: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==531); - case 628: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==628); -{ yylhsminor.yy80 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy80)); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 448: /* expression ::= NK_LP expression NK_RP */ + case 534: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==534); + case 631: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==631); +#line 840 "sql.y" +{ yylhsminor.yy232 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy232)); } +#line 7102 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 446: /* expression ::= NK_PLUS expr_or_subquery */ + case 449: /* expression ::= NK_PLUS expr_or_subquery */ +#line 841 "sql.y" { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy80); - yylhsminor.yy80 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy80)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy232); + yylhsminor.yy232 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy232)); } - yymsp[-1].minor.yy80 = yylhsminor.yy80; +#line 7111 "sql.c" + yymsp[-1].minor.yy232 = yylhsminor.yy232; break; - case 447: /* expression ::= NK_MINUS expr_or_subquery */ + case 450: /* expression ::= NK_MINUS expr_or_subquery */ +#line 845 "sql.y" { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy80); - yylhsminor.yy80 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy80), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy232); + yylhsminor.yy232 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy232), NULL)); } - yymsp[-1].minor.yy80 = yylhsminor.yy80; +#line 7120 "sql.c" + yymsp[-1].minor.yy232 = yylhsminor.yy232; break; - case 448: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + case 451: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ +#line 849 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy80); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy80); - yylhsminor.yy80 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy80), releaseRawExprNode(pCxt, yymsp[0].minor.yy80))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy232); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy232); + yylhsminor.yy232 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy232), releaseRawExprNode(pCxt, yymsp[0].minor.yy232))); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 7130 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 449: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + case 452: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ +#line 854 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy80); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy80); - yylhsminor.yy80 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy80), releaseRawExprNode(pCxt, yymsp[0].minor.yy80))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy232); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy232); + yylhsminor.yy232 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy232), releaseRawExprNode(pCxt, yymsp[0].minor.yy232))); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 7140 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 450: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + case 453: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ +#line 859 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy80); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy80); - yylhsminor.yy80 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy80), releaseRawExprNode(pCxt, yymsp[0].minor.yy80))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy232); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy232); + yylhsminor.yy232 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy232), releaseRawExprNode(pCxt, yymsp[0].minor.yy232))); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 7150 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 451: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + case 454: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ +#line 864 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy80); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy80); - yylhsminor.yy80 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy80), releaseRawExprNode(pCxt, yymsp[0].minor.yy80))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy232); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy232); + yylhsminor.yy232 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy232), releaseRawExprNode(pCxt, yymsp[0].minor.yy232))); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 7160 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 452: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + case 455: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ +#line 869 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy80); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy80); - yylhsminor.yy80 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy80), releaseRawExprNode(pCxt, yymsp[0].minor.yy80))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy232); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy232); + yylhsminor.yy232 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy232), releaseRawExprNode(pCxt, yymsp[0].minor.yy232))); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 7170 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 453: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 456: /* expression ::= column_reference NK_ARROW NK_STRING */ +#line 874 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy80); - yylhsminor.yy80 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy80), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy232); + yylhsminor.yy232 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy232), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 7179 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 454: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + case 457: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ +#line 878 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy80); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy80); - yylhsminor.yy80 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy80), releaseRawExprNode(pCxt, yymsp[0].minor.yy80))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy232); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy232); + yylhsminor.yy232 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy232), releaseRawExprNode(pCxt, yymsp[0].minor.yy232))); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 7189 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 455: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + case 458: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ +#line 883 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy80); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy80); - yylhsminor.yy80 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy80), releaseRawExprNode(pCxt, yymsp[0].minor.yy80))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy232); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy232); + yylhsminor.yy232 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy232), releaseRawExprNode(pCxt, yymsp[0].minor.yy232))); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 7199 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 458: /* column_reference ::= column_name */ -{ yylhsminor.yy80 = createRawExprNode(pCxt, &yymsp[0].minor.yy785, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy785)); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 461: /* column_reference ::= column_name */ +#line 894 "sql.y" +{ yylhsminor.yy232 = createRawExprNode(pCxt, &yymsp[0].minor.yy993, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy993)); } +#line 7205 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 459: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy80 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy785, &yymsp[0].minor.yy785, createColumnNode(pCxt, &yymsp[-2].minor.yy785, &yymsp[0].minor.yy785)); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 462: /* column_reference ::= table_name NK_DOT column_name */ +#line 895 "sql.y" +{ yylhsminor.yy232 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy993, &yymsp[0].minor.yy993, createColumnNode(pCxt, &yymsp[-2].minor.yy993, &yymsp[0].minor.yy993)); } +#line 7211 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 460: /* column_reference ::= NK_ALIAS */ -{ yylhsminor.yy80 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 463: /* column_reference ::= NK_ALIAS */ +#line 896 "sql.y" +{ yylhsminor.yy232 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } +#line 7217 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 461: /* column_reference ::= table_name NK_DOT NK_ALIAS */ -{ yylhsminor.yy80 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy785, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy785, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 464: /* column_reference ::= table_name NK_DOT NK_ALIAS */ +#line 897 "sql.y" +{ yylhsminor.yy232 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy993, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy993, &yymsp[0].minor.yy0)); } +#line 7223 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 462: /* pseudo_column ::= ROWTS */ - case 463: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==463); - case 465: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==465); - case 466: /* pseudo_column ::= QEND */ yytestcase(yyruleno==466); - case 467: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==467); - case 468: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==468); - case 469: /* pseudo_column ::= WEND */ yytestcase(yyruleno==469); - case 470: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==470); - case 471: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==471); - case 472: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==472); - case 473: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==473); - case 479: /* literal_func ::= NOW */ yytestcase(yyruleno==479); -{ yylhsminor.yy80 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 465: /* pseudo_column ::= ROWTS */ + case 466: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==466); + case 468: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==468); + case 469: /* pseudo_column ::= QEND */ yytestcase(yyruleno==469); + case 470: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==470); + case 471: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==471); + case 472: /* pseudo_column ::= WEND */ yytestcase(yyruleno==472); + case 473: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==473); + case 474: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==474); + case 475: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==475); + case 476: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==476); + case 482: /* literal_func ::= NOW */ yytestcase(yyruleno==482); +#line 899 "sql.y" +{ yylhsminor.yy232 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } +#line 7240 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 464: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy80 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy785, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy785)))); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 467: /* pseudo_column ::= table_name NK_DOT TBNAME */ +#line 901 "sql.y" +{ yylhsminor.yy232 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy993, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy993)))); } +#line 7246 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 474: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 475: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==475); -{ yylhsminor.yy80 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy785, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy785, yymsp[-1].minor.yy106)); } - yymsp[-3].minor.yy80 = yylhsminor.yy80; + case 477: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 478: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==478); +#line 912 "sql.y" +{ yylhsminor.yy232 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy993, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy993, yymsp[-1].minor.yy88)); } +#line 7253 "sql.c" + yymsp[-3].minor.yy232 = yylhsminor.yy232; break; - case 476: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ -{ yylhsminor.yy80 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy80), yymsp[-1].minor.yy292)); } - yymsp[-5].minor.yy80 = yylhsminor.yy80; + case 479: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ +#line 915 "sql.y" +{ yylhsminor.yy232 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy232), yymsp[-1].minor.yy400)); } +#line 7259 "sql.c" + yymsp[-5].minor.yy232 = yylhsminor.yy232; break; - case 478: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy80 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy785, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy785, NULL)); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 481: /* literal_func ::= noarg_func NK_LP NK_RP */ +#line 918 "sql.y" +{ yylhsminor.yy232 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy993, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy993, NULL)); } +#line 7265 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 493: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy106 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy106 = yylhsminor.yy106; + case 496: /* star_func_para_list ::= NK_STAR */ +#line 942 "sql.y" +{ yylhsminor.yy88 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } +#line 7271 "sql.c" + yymsp[0].minor.yy88 = yylhsminor.yy88; break; - case 498: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 566: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==566); -{ yylhsminor.yy80 = createColumnNode(pCxt, &yymsp[-2].minor.yy785, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 501: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 569: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==569); +#line 951 "sql.y" +{ yylhsminor.yy232 = createColumnNode(pCxt, &yymsp[-2].minor.yy993, &yymsp[0].minor.yy0); } +#line 7278 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 499: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ -{ yylhsminor.yy80 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy106, yymsp[-1].minor.yy80)); } - yymsp[-3].minor.yy80 = yylhsminor.yy80; + case 502: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ +#line 954 "sql.y" +{ yylhsminor.yy232 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy88, yymsp[-1].minor.yy232)); } +#line 7284 "sql.c" + yymsp[-3].minor.yy232 = yylhsminor.yy232; break; - case 500: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ -{ yylhsminor.yy80 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy80), yymsp[-2].minor.yy106, yymsp[-1].minor.yy80)); } - yymsp[-4].minor.yy80 = yylhsminor.yy80; + case 503: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ +#line 956 "sql.y" +{ yylhsminor.yy232 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy232), yymsp[-2].minor.yy88, yymsp[-1].minor.yy232)); } +#line 7290 "sql.c" + yymsp[-4].minor.yy232 = yylhsminor.yy232; break; - case 503: /* when_then_expr ::= WHEN common_expression THEN common_expression */ -{ yymsp[-3].minor.yy80 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy80), releaseRawExprNode(pCxt, yymsp[0].minor.yy80)); } + case 506: /* when_then_expr ::= WHEN common_expression THEN common_expression */ +#line 963 "sql.y" +{ yymsp[-3].minor.yy232 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy232), releaseRawExprNode(pCxt, yymsp[0].minor.yy232)); } +#line 7296 "sql.c" break; - case 505: /* case_when_else_opt ::= ELSE common_expression */ -{ yymsp[-1].minor.yy80 = releaseRawExprNode(pCxt, yymsp[0].minor.yy80); } + case 508: /* case_when_else_opt ::= ELSE common_expression */ +#line 966 "sql.y" +{ yymsp[-1].minor.yy232 = releaseRawExprNode(pCxt, yymsp[0].minor.yy232); } +#line 7301 "sql.c" break; - case 506: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 511: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==511); + case 509: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 514: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==514); +#line 969 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy80); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy80); - yylhsminor.yy80 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy428, releaseRawExprNode(pCxt, yymsp[-2].minor.yy80), releaseRawExprNode(pCxt, yymsp[0].minor.yy80))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy232); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy232); + yylhsminor.yy232 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy708, releaseRawExprNode(pCxt, yymsp[-2].minor.yy232), releaseRawExprNode(pCxt, yymsp[0].minor.yy232))); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 7311 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 507: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + case 510: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ +#line 976 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy80); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy80); - yylhsminor.yy80 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy80), releaseRawExprNode(pCxt, yymsp[-2].minor.yy80), releaseRawExprNode(pCxt, yymsp[0].minor.yy80))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy232); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy232); + yylhsminor.yy232 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy232), releaseRawExprNode(pCxt, yymsp[-2].minor.yy232), releaseRawExprNode(pCxt, yymsp[0].minor.yy232))); } - yymsp[-4].minor.yy80 = yylhsminor.yy80; +#line 7321 "sql.c" + yymsp[-4].minor.yy232 = yylhsminor.yy232; break; - case 508: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + case 511: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ +#line 982 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy80); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy80); - yylhsminor.yy80 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy80), releaseRawExprNode(pCxt, yymsp[-2].minor.yy80), releaseRawExprNode(pCxt, yymsp[0].minor.yy80))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy232); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy232); + yylhsminor.yy232 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy232), releaseRawExprNode(pCxt, yymsp[-2].minor.yy232), releaseRawExprNode(pCxt, yymsp[0].minor.yy232))); } - yymsp[-5].minor.yy80 = yylhsminor.yy80; +#line 7331 "sql.c" + yymsp[-5].minor.yy232 = yylhsminor.yy232; break; - case 509: /* predicate ::= expr_or_subquery IS NULL */ + case 512: /* predicate ::= expr_or_subquery IS NULL */ +#line 987 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy80); - yylhsminor.yy80 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy80), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy232); + yylhsminor.yy232 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy232), NULL)); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 7340 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 510: /* predicate ::= expr_or_subquery IS NOT NULL */ + case 513: /* predicate ::= expr_or_subquery IS NOT NULL */ +#line 991 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy80); - yylhsminor.yy80 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy80), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy232); + yylhsminor.yy232 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy232), NULL)); } - yymsp[-3].minor.yy80 = yylhsminor.yy80; +#line 7349 "sql.c" + yymsp[-3].minor.yy232 = yylhsminor.yy232; break; - case 512: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy428 = OP_TYPE_LOWER_THAN; } + case 515: /* compare_op ::= NK_LT */ +#line 1003 "sql.y" +{ yymsp[0].minor.yy708 = OP_TYPE_LOWER_THAN; } +#line 7355 "sql.c" break; - case 513: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy428 = OP_TYPE_GREATER_THAN; } + case 516: /* compare_op ::= NK_GT */ +#line 1004 "sql.y" +{ yymsp[0].minor.yy708 = OP_TYPE_GREATER_THAN; } +#line 7360 "sql.c" break; - case 514: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy428 = OP_TYPE_LOWER_EQUAL; } + case 517: /* compare_op ::= NK_LE */ +#line 1005 "sql.y" +{ yymsp[0].minor.yy708 = OP_TYPE_LOWER_EQUAL; } +#line 7365 "sql.c" break; - case 515: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy428 = OP_TYPE_GREATER_EQUAL; } + case 518: /* compare_op ::= NK_GE */ +#line 1006 "sql.y" +{ yymsp[0].minor.yy708 = OP_TYPE_GREATER_EQUAL; } +#line 7370 "sql.c" break; - case 516: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy428 = OP_TYPE_NOT_EQUAL; } + case 519: /* compare_op ::= NK_NE */ +#line 1007 "sql.y" +{ yymsp[0].minor.yy708 = OP_TYPE_NOT_EQUAL; } +#line 7375 "sql.c" break; - case 517: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy428 = OP_TYPE_EQUAL; } + case 520: /* compare_op ::= NK_EQ */ +#line 1008 "sql.y" +{ yymsp[0].minor.yy708 = OP_TYPE_EQUAL; } +#line 7380 "sql.c" break; - case 518: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy428 = OP_TYPE_LIKE; } + case 521: /* compare_op ::= LIKE */ +#line 1009 "sql.y" +{ yymsp[0].minor.yy708 = OP_TYPE_LIKE; } +#line 7385 "sql.c" break; - case 519: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy428 = OP_TYPE_NOT_LIKE; } + case 522: /* compare_op ::= NOT LIKE */ +#line 1010 "sql.y" +{ yymsp[-1].minor.yy708 = OP_TYPE_NOT_LIKE; } +#line 7390 "sql.c" break; - case 520: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy428 = OP_TYPE_MATCH; } + case 523: /* compare_op ::= MATCH */ +#line 1011 "sql.y" +{ yymsp[0].minor.yy708 = OP_TYPE_MATCH; } +#line 7395 "sql.c" break; - case 521: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy428 = OP_TYPE_NMATCH; } + case 524: /* compare_op ::= NMATCH */ +#line 1012 "sql.y" +{ yymsp[0].minor.yy708 = OP_TYPE_NMATCH; } +#line 7400 "sql.c" break; - case 522: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy428 = OP_TYPE_JSON_CONTAINS; } + case 525: /* compare_op ::= CONTAINS */ +#line 1013 "sql.y" +{ yymsp[0].minor.yy708 = OP_TYPE_JSON_CONTAINS; } +#line 7405 "sql.c" break; - case 523: /* in_op ::= IN */ -{ yymsp[0].minor.yy428 = OP_TYPE_IN; } + case 526: /* in_op ::= IN */ +#line 1017 "sql.y" +{ yymsp[0].minor.yy708 = OP_TYPE_IN; } +#line 7410 "sql.c" break; - case 524: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy428 = OP_TYPE_NOT_IN; } + case 527: /* in_op ::= NOT IN */ +#line 1018 "sql.y" +{ yymsp[-1].minor.yy708 = OP_TYPE_NOT_IN; } +#line 7415 "sql.c" break; - case 525: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -{ yylhsminor.yy80 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy106)); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 528: /* in_predicate_value ::= NK_LP literal_list NK_RP */ +#line 1020 "sql.y" +{ yylhsminor.yy232 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy88)); } +#line 7420 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 527: /* boolean_value_expression ::= NOT boolean_primary */ + case 530: /* boolean_value_expression ::= NOT boolean_primary */ +#line 1024 "sql.y" { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy80); - yylhsminor.yy80 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy80), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy232); + yylhsminor.yy232 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy232), NULL)); } - yymsp[-1].minor.yy80 = yylhsminor.yy80; +#line 7429 "sql.c" + yymsp[-1].minor.yy232 = yylhsminor.yy232; break; - case 528: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 531: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ +#line 1029 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy80); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy80); - yylhsminor.yy80 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy80), releaseRawExprNode(pCxt, yymsp[0].minor.yy80))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy232); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy232); + yylhsminor.yy232 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy232), releaseRawExprNode(pCxt, yymsp[0].minor.yy232))); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 7439 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 529: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 532: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ +#line 1035 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy80); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy80); - yylhsminor.yy80 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy80), releaseRawExprNode(pCxt, yymsp[0].minor.yy80))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy232); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy232); + yylhsminor.yy232 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy232), releaseRawExprNode(pCxt, yymsp[0].minor.yy232))); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; +#line 7449 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 537: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy80 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy80, yymsp[0].minor.yy80, NULL); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 540: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +#line 1053 "sql.y" +{ yylhsminor.yy232 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy232, yymsp[0].minor.yy232, NULL); } +#line 7455 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 540: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy80 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy785, &yymsp[0].minor.yy785); } - yymsp[-1].minor.yy80 = yylhsminor.yy80; + case 543: /* table_primary ::= table_name alias_opt */ +#line 1059 "sql.y" +{ yylhsminor.yy232 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy993, &yymsp[0].minor.yy993); } +#line 7461 "sql.c" + yymsp[-1].minor.yy232 = yylhsminor.yy232; break; - case 541: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy80 = createRealTableNode(pCxt, &yymsp[-3].minor.yy785, &yymsp[-1].minor.yy785, &yymsp[0].minor.yy785); } - yymsp[-3].minor.yy80 = yylhsminor.yy80; + case 544: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +#line 1060 "sql.y" +{ yylhsminor.yy232 = createRealTableNode(pCxt, &yymsp[-3].minor.yy993, &yymsp[-1].minor.yy993, &yymsp[0].minor.yy993); } +#line 7467 "sql.c" + yymsp[-3].minor.yy232 = yylhsminor.yy232; break; - case 542: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy80 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy80), &yymsp[0].minor.yy785); } - yymsp[-1].minor.yy80 = yylhsminor.yy80; + case 545: /* table_primary ::= subquery alias_opt */ +#line 1061 "sql.y" +{ yylhsminor.yy232 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy232), &yymsp[0].minor.yy993); } +#line 7473 "sql.c" + yymsp[-1].minor.yy232 = yylhsminor.yy232; break; - case 544: /* alias_opt ::= */ -{ yymsp[1].minor.yy785 = nil_token; } + case 547: /* alias_opt ::= */ +#line 1066 "sql.y" +{ yymsp[1].minor.yy993 = nil_token; } +#line 7479 "sql.c" break; - case 546: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy785 = yymsp[0].minor.yy785; } + case 549: /* alias_opt ::= AS table_alias */ +#line 1068 "sql.y" +{ yymsp[-1].minor.yy993 = yymsp[0].minor.yy993; } +#line 7484 "sql.c" break; - case 547: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 548: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==548); -{ yymsp[-2].minor.yy80 = yymsp[-1].minor.yy80; } + case 550: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 551: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==551); +#line 1070 "sql.y" +{ yymsp[-2].minor.yy232 = yymsp[-1].minor.yy232; } +#line 7490 "sql.c" break; - case 549: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -{ yylhsminor.yy80 = createJoinTableNode(pCxt, yymsp[-4].minor.yy828, yymsp[-5].minor.yy80, yymsp[-2].minor.yy80, yymsp[0].minor.yy80); } - yymsp[-5].minor.yy80 = yylhsminor.yy80; + case 552: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +#line 1075 "sql.y" +{ yylhsminor.yy232 = createJoinTableNode(pCxt, yymsp[-4].minor.yy436, yymsp[-5].minor.yy232, yymsp[-2].minor.yy232, yymsp[0].minor.yy232); } +#line 7495 "sql.c" + yymsp[-5].minor.yy232 = yylhsminor.yy232; break; - case 550: /* join_type ::= */ -{ yymsp[1].minor.yy828 = JOIN_TYPE_INNER; } + case 553: /* join_type ::= */ +#line 1079 "sql.y" +{ yymsp[1].minor.yy436 = JOIN_TYPE_INNER; } +#line 7501 "sql.c" break; - case 551: /* join_type ::= INNER */ -{ yymsp[0].minor.yy828 = JOIN_TYPE_INNER; } + case 554: /* join_type ::= INNER */ +#line 1080 "sql.y" +{ yymsp[0].minor.yy436 = JOIN_TYPE_INNER; } +#line 7506 "sql.c" break; - case 552: /* query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + case 555: /* query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ +#line 1086 "sql.y" { - yymsp[-13].minor.yy80 = createSelectStmt(pCxt, yymsp[-11].minor.yy923, yymsp[-9].minor.yy106, yymsp[-8].minor.yy80, yymsp[-12].minor.yy106); - yymsp[-13].minor.yy80 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy80, yymsp[-10].minor.yy923); - yymsp[-13].minor.yy80 = addWhereClause(pCxt, yymsp[-13].minor.yy80, yymsp[-7].minor.yy80); - yymsp[-13].minor.yy80 = addPartitionByClause(pCxt, yymsp[-13].minor.yy80, yymsp[-6].minor.yy106); - yymsp[-13].minor.yy80 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy80, yymsp[-2].minor.yy80); - yymsp[-13].minor.yy80 = addGroupByClause(pCxt, yymsp[-13].minor.yy80, yymsp[-1].minor.yy106); - yymsp[-13].minor.yy80 = addHavingClause(pCxt, yymsp[-13].minor.yy80, yymsp[0].minor.yy80); - yymsp[-13].minor.yy80 = addRangeClause(pCxt, yymsp[-13].minor.yy80, yymsp[-5].minor.yy80); - yymsp[-13].minor.yy80 = addEveryClause(pCxt, yymsp[-13].minor.yy80, yymsp[-4].minor.yy80); - yymsp[-13].minor.yy80 = addFillClause(pCxt, yymsp[-13].minor.yy80, yymsp[-3].minor.yy80); + yymsp[-13].minor.yy232 = createSelectStmt(pCxt, yymsp[-11].minor.yy985, yymsp[-9].minor.yy88, yymsp[-8].minor.yy232, yymsp[-12].minor.yy88); + yymsp[-13].minor.yy232 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy232, yymsp[-10].minor.yy985); + yymsp[-13].minor.yy232 = addWhereClause(pCxt, yymsp[-13].minor.yy232, yymsp[-7].minor.yy232); + yymsp[-13].minor.yy232 = addPartitionByClause(pCxt, yymsp[-13].minor.yy232, yymsp[-6].minor.yy88); + yymsp[-13].minor.yy232 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy232, yymsp[-2].minor.yy232); + yymsp[-13].minor.yy232 = addGroupByClause(pCxt, yymsp[-13].minor.yy232, yymsp[-1].minor.yy88); + yymsp[-13].minor.yy232 = addHavingClause(pCxt, yymsp[-13].minor.yy232, yymsp[0].minor.yy232); + yymsp[-13].minor.yy232 = addRangeClause(pCxt, yymsp[-13].minor.yy232, yymsp[-5].minor.yy232); + yymsp[-13].minor.yy232 = addEveryClause(pCxt, yymsp[-13].minor.yy232, yymsp[-4].minor.yy232); + yymsp[-13].minor.yy232 = addFillClause(pCxt, yymsp[-13].minor.yy232, yymsp[-3].minor.yy232); } +#line 7522 "sql.c" break; - case 553: /* hint_list ::= */ -{ yymsp[1].minor.yy106 = createHintNodeList(pCxt, NULL); } + case 556: /* hint_list ::= */ +#line 1101 "sql.y" +{ yymsp[1].minor.yy88 = createHintNodeList(pCxt, NULL); } +#line 7527 "sql.c" break; - case 554: /* hint_list ::= NK_HINT */ -{ yylhsminor.yy106 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy106 = yylhsminor.yy106; + case 557: /* hint_list ::= NK_HINT */ +#line 1102 "sql.y" +{ yylhsminor.yy88 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } +#line 7532 "sql.c" + yymsp[0].minor.yy88 = yylhsminor.yy88; break; - case 559: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy923 = false; } + case 562: /* set_quantifier_opt ::= ALL */ +#line 1113 "sql.y" +{ yymsp[0].minor.yy985 = false; } +#line 7538 "sql.c" break; - case 562: /* select_item ::= NK_STAR */ -{ yylhsminor.yy80 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy80 = yylhsminor.yy80; + case 565: /* select_item ::= NK_STAR */ +#line 1120 "sql.y" +{ yylhsminor.yy232 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } +#line 7543 "sql.c" + yymsp[0].minor.yy232 = yylhsminor.yy232; break; - case 564: /* select_item ::= common_expression column_alias */ - case 574: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==574); -{ yylhsminor.yy80 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy80), &yymsp[0].minor.yy785); } - yymsp[-1].minor.yy80 = yylhsminor.yy80; + case 567: /* select_item ::= common_expression column_alias */ + case 577: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==577); +#line 1122 "sql.y" +{ yylhsminor.yy232 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy232), &yymsp[0].minor.yy993); } +#line 7550 "sql.c" + yymsp[-1].minor.yy232 = yylhsminor.yy232; break; - case 565: /* select_item ::= common_expression AS column_alias */ - case 575: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==575); -{ yylhsminor.yy80 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy80), &yymsp[0].minor.yy785); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 568: /* select_item ::= common_expression AS column_alias */ + case 578: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==578); +#line 1123 "sql.y" +{ yylhsminor.yy232 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy232), &yymsp[0].minor.yy993); } +#line 7557 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 570: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 598: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==598); - case 618: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==618); -{ yymsp[-2].minor.yy106 = yymsp[0].minor.yy106; } + case 573: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 601: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==601); + case 621: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==621); +#line 1132 "sql.y" +{ yymsp[-2].minor.yy88 = yymsp[0].minor.yy88; } +#line 7565 "sql.c" break; - case 577: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ -{ yymsp[-5].minor.yy80 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy80), releaseRawExprNode(pCxt, yymsp[-1].minor.yy80)); } + case 580: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ +#line 1145 "sql.y" +{ yymsp[-5].minor.yy232 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy232), releaseRawExprNode(pCxt, yymsp[-1].minor.yy232)); } +#line 7570 "sql.c" break; - case 578: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy80 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy80)); } + case 581: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ +#line 1146 "sql.y" +{ yymsp[-3].minor.yy232 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy232)); } +#line 7575 "sql.c" break; - case 579: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy80 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy80), NULL, yymsp[-1].minor.yy80, yymsp[0].minor.yy80); } + case 582: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ +#line 1148 "sql.y" +{ yymsp[-5].minor.yy232 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy232), NULL, yymsp[-1].minor.yy232, yymsp[0].minor.yy232); } +#line 7580 "sql.c" break; - case 580: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy80 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy80), releaseRawExprNode(pCxt, yymsp[-3].minor.yy80), yymsp[-1].minor.yy80, yymsp[0].minor.yy80); } + case 583: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ +#line 1152 "sql.y" +{ yymsp[-7].minor.yy232 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy232), releaseRawExprNode(pCxt, yymsp[-3].minor.yy232), yymsp[-1].minor.yy232, yymsp[0].minor.yy232); } +#line 7585 "sql.c" break; - case 581: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ -{ yymsp[-6].minor.yy80 = createEventWindowNode(pCxt, yymsp[-3].minor.yy80, yymsp[0].minor.yy80); } + case 584: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ +#line 1154 "sql.y" +{ yymsp[-6].minor.yy232 = createEventWindowNode(pCxt, yymsp[-3].minor.yy232, yymsp[0].minor.yy232); } +#line 7590 "sql.c" break; - case 588: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy80 = createFillNode(pCxt, yymsp[-1].minor.yy36, NULL); } + case 591: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +#line 1164 "sql.y" +{ yymsp[-3].minor.yy232 = createFillNode(pCxt, yymsp[-1].minor.yy246, NULL); } +#line 7595 "sql.c" break; - case 589: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ -{ yymsp[-5].minor.yy80 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy106)); } + case 592: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ +#line 1165 "sql.y" +{ yymsp[-5].minor.yy232 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy88)); } +#line 7600 "sql.c" break; - case 590: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ -{ yymsp[-5].minor.yy80 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy106)); } + case 593: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ +#line 1166 "sql.y" +{ yymsp[-5].minor.yy232 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy88)); } +#line 7605 "sql.c" break; - case 591: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy36 = FILL_MODE_NONE; } + case 594: /* fill_mode ::= NONE */ +#line 1170 "sql.y" +{ yymsp[0].minor.yy246 = FILL_MODE_NONE; } +#line 7610 "sql.c" break; - case 592: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy36 = FILL_MODE_PREV; } + case 595: /* fill_mode ::= PREV */ +#line 1171 "sql.y" +{ yymsp[0].minor.yy246 = FILL_MODE_PREV; } +#line 7615 "sql.c" break; - case 593: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy36 = FILL_MODE_NULL; } + case 596: /* fill_mode ::= NULL */ +#line 1172 "sql.y" +{ yymsp[0].minor.yy246 = FILL_MODE_NULL; } +#line 7620 "sql.c" break; - case 594: /* fill_mode ::= NULL_F */ -{ yymsp[0].minor.yy36 = FILL_MODE_NULL_F; } + case 597: /* fill_mode ::= NULL_F */ +#line 1173 "sql.y" +{ yymsp[0].minor.yy246 = FILL_MODE_NULL_F; } +#line 7625 "sql.c" break; - case 595: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy36 = FILL_MODE_LINEAR; } + case 598: /* fill_mode ::= LINEAR */ +#line 1174 "sql.y" +{ yymsp[0].minor.yy246 = FILL_MODE_LINEAR; } +#line 7630 "sql.c" break; - case 596: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy36 = FILL_MODE_NEXT; } + case 599: /* fill_mode ::= NEXT */ +#line 1175 "sql.y" +{ yymsp[0].minor.yy246 = FILL_MODE_NEXT; } +#line 7635 "sql.c" break; - case 599: /* group_by_list ::= expr_or_subquery */ -{ yylhsminor.yy106 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy80))); } - yymsp[0].minor.yy106 = yylhsminor.yy106; + case 602: /* group_by_list ::= expr_or_subquery */ +#line 1184 "sql.y" +{ yylhsminor.yy88 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy232))); } +#line 7640 "sql.c" + yymsp[0].minor.yy88 = yylhsminor.yy88; break; - case 600: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ -{ yylhsminor.yy106 = addNodeToList(pCxt, yymsp[-2].minor.yy106, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy80))); } - yymsp[-2].minor.yy106 = yylhsminor.yy106; + case 603: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ +#line 1185 "sql.y" +{ yylhsminor.yy88 = addNodeToList(pCxt, yymsp[-2].minor.yy88, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy232))); } +#line 7646 "sql.c" + yymsp[-2].minor.yy88 = yylhsminor.yy88; break; - case 604: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ -{ yymsp[-5].minor.yy80 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy80), releaseRawExprNode(pCxt, yymsp[-1].minor.yy80)); } + case 607: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ +#line 1192 "sql.y" +{ yymsp[-5].minor.yy232 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy232), releaseRawExprNode(pCxt, yymsp[-1].minor.yy232)); } +#line 7652 "sql.c" break; - case 605: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy80 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy80)); } + case 608: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ +#line 1194 "sql.y" +{ yymsp[-3].minor.yy232 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy232)); } +#line 7657 "sql.c" break; - case 608: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 611: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ +#line 1201 "sql.y" { - yylhsminor.yy80 = addOrderByClause(pCxt, yymsp[-3].minor.yy80, yymsp[-2].minor.yy106); - yylhsminor.yy80 = addSlimitClause(pCxt, yylhsminor.yy80, yymsp[-1].minor.yy80); - yylhsminor.yy80 = addLimitClause(pCxt, yylhsminor.yy80, yymsp[0].minor.yy80); + yylhsminor.yy232 = addOrderByClause(pCxt, yymsp[-3].minor.yy232, yymsp[-2].minor.yy88); + yylhsminor.yy232 = addSlimitClause(pCxt, yylhsminor.yy232, yymsp[-1].minor.yy232); + yylhsminor.yy232 = addLimitClause(pCxt, yylhsminor.yy232, yymsp[0].minor.yy232); } - yymsp[-3].minor.yy80 = yylhsminor.yy80; +#line 7666 "sql.c" + yymsp[-3].minor.yy232 = yylhsminor.yy232; break; - case 611: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ -{ yylhsminor.yy80 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy80, yymsp[0].minor.yy80); } - yymsp[-3].minor.yy80 = yylhsminor.yy80; + case 614: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ +#line 1211 "sql.y" +{ yylhsminor.yy232 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy232, yymsp[0].minor.yy232); } +#line 7672 "sql.c" + yymsp[-3].minor.yy232 = yylhsminor.yy232; break; - case 612: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ -{ yylhsminor.yy80 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy80, yymsp[0].minor.yy80); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 615: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ +#line 1213 "sql.y" +{ yylhsminor.yy232 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy232, yymsp[0].minor.yy232); } +#line 7678 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 620: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 624: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==624); -{ yymsp[-1].minor.yy80 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 623: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 627: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==627); +#line 1227 "sql.y" +{ yymsp[-1].minor.yy232 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } +#line 7685 "sql.c" break; - case 621: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 625: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==625); -{ yymsp[-3].minor.yy80 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 624: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 628: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==628); +#line 1228 "sql.y" +{ yymsp[-3].minor.yy232 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } +#line 7691 "sql.c" break; - case 622: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 626: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==626); -{ yymsp[-3].minor.yy80 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 625: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 629: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==629); +#line 1229 "sql.y" +{ yymsp[-3].minor.yy232 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } +#line 7697 "sql.c" break; - case 627: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy80 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy80); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 630: /* subquery ::= NK_LP query_expression NK_RP */ +#line 1237 "sql.y" +{ yylhsminor.yy232 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy232); } +#line 7702 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 632: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy80 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy80), yymsp[-1].minor.yy812, yymsp[0].minor.yy763); } - yymsp[-2].minor.yy80 = yylhsminor.yy80; + case 635: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ +#line 1251 "sql.y" +{ yylhsminor.yy232 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy232), yymsp[-1].minor.yy834, yymsp[0].minor.yy153); } +#line 7708 "sql.c" + yymsp[-2].minor.yy232 = yylhsminor.yy232; break; - case 633: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy812 = ORDER_ASC; } + case 636: /* ordering_specification_opt ::= */ +#line 1255 "sql.y" +{ yymsp[1].minor.yy834 = ORDER_ASC; } +#line 7714 "sql.c" break; - case 634: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy812 = ORDER_ASC; } + case 637: /* ordering_specification_opt ::= ASC */ +#line 1256 "sql.y" +{ yymsp[0].minor.yy834 = ORDER_ASC; } +#line 7719 "sql.c" break; - case 635: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy812 = ORDER_DESC; } + case 638: /* ordering_specification_opt ::= DESC */ +#line 1257 "sql.y" +{ yymsp[0].minor.yy834 = ORDER_DESC; } +#line 7724 "sql.c" break; - case 636: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy763 = NULL_ORDER_DEFAULT; } + case 639: /* null_ordering_opt ::= */ +#line 1261 "sql.y" +{ yymsp[1].minor.yy153 = NULL_ORDER_DEFAULT; } +#line 7729 "sql.c" break; - case 637: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy763 = NULL_ORDER_FIRST; } + case 640: /* null_ordering_opt ::= NULLS FIRST */ +#line 1262 "sql.y" +{ yymsp[-1].minor.yy153 = NULL_ORDER_FIRST; } +#line 7734 "sql.c" break; - case 638: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy763 = NULL_ORDER_LAST; } + case 641: /* null_ordering_opt ::= NULLS LAST */ +#line 1263 "sql.y" +{ yymsp[-1].minor.yy153 = NULL_ORDER_LAST; } +#line 7739 "sql.c" break; default: break; @@ -6590,6 +7798,7 @@ static void yy_syntax_error( ParseCTX_FETCH #define TOKEN yyminor /************ Begin %syntax_error code ****************************************/ +#line 29 "sql.y" if (TSDB_CODE_SUCCESS == pCxt->errCode) { if(TOKEN.z) { @@ -6600,6 +7809,7 @@ static void yy_syntax_error( } else if (TSDB_CODE_PAR_DB_NOT_SPECIFIED == pCxt->errCode && TK_NK_FLOAT == TOKEN.type) { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z); } +#line 7812 "sql.c" /************ End %syntax_error code ******************************************/ ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ ParseCTX_STORE @@ -6685,12 +7895,56 @@ void Parse( } #endif - do{ + while(1){ /* Exit by "break" */ + assert( yypParser->yytos>=yypParser->yystack ); assert( yyact==yypParser->yytos->stateno ); yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact); if( yyact >= YY_MIN_REDUCE ){ - yyact = yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor, - yyminor ParseCTX_PARAM); + unsigned int yyruleno = yyact - YY_MIN_REDUCE; /* Reduce by this rule */ +#ifndef NDEBUG + assert( yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ); + if( yyTraceFILE ){ + int yysize = yyRuleInfoNRhs[yyruleno]; + if( yysize ){ + fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n", + yyTracePrompt, + yyruleno, yyRuleName[yyruleno], + yyrulenoyytos[yysize].stateno); + }else{ + fprintf(yyTraceFILE, "%sReduce %d [%s]%s.\n", + yyTracePrompt, yyruleno, yyRuleName[yyruleno], + yyrulenoyytos - yypParser->yystack)>yypParser->yyhwm ){ + yypParser->yyhwm++; + assert( yypParser->yyhwm == + (int)(yypParser->yytos - yypParser->yystack)); + } +#endif +#if YYSTACKDEPTH>0 + if( yypParser->yytos>=yypParser->yystackEnd ){ + yyStackOverflow(yypParser); + break; + } +#else + if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){ + if( yyGrowStack(yypParser) ){ + yyStackOverflow(yypParser); + break; + } + } +#endif + } + yyact = yy_reduce(yypParser,yyruleno,yymajor,yyminor ParseCTX_PARAM); }else if( yyact <= YY_MAX_SHIFTREDUCE ){ yy_shift(yypParser,yyact,(YYCODETYPE)yymajor,yyminor); #ifndef YYNOERRORRECOVERY @@ -6746,14 +8000,13 @@ void Parse( yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion); yymajor = YYNOCODE; }else{ - while( yypParser->yytos >= yypParser->yystack - && (yyact = yy_find_reduce_action( - yypParser->yytos->stateno, - YYERRORSYMBOL)) > YY_MAX_SHIFTREDUCE - ){ + while( yypParser->yytos > yypParser->yystack ){ + yyact = yy_find_reduce_action(yypParser->yytos->stateno, + YYERRORSYMBOL); + if( yyact<=YY_MAX_SHIFTREDUCE ) break; yy_pop_parser_stack(yypParser); } - if( yypParser->yytos < yypParser->yystack || yymajor==0 ){ + if( yypParser->yytos <= yypParser->yystack || yymajor==0 ){ yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); yy_parse_failed(yypParser); #ifndef YYNOERRORRECOVERY @@ -6803,7 +8056,7 @@ void Parse( break; #endif } - }while( yypParser->yytos>yypParser->yystack ); + } #ifndef NDEBUG if( yyTraceFILE ){ yyStackEntry *i; diff --git a/source/libs/stream/src/streamMeta.c b/source/libs/stream/src/streamMeta.c index 807f120cb7..23cb6f5a35 100644 --- a/source/libs/stream/src/streamMeta.c +++ b/source/libs/stream/src/streamMeta.c @@ -31,7 +31,6 @@ int32_t streamMetaId = 0; int32_t taskDbWrapperId = 0; static void metaHbToMnode(void* param, void* tmrId); -static void streamMetaClear(SStreamMeta* pMeta); static int32_t streamMetaBegin(SStreamMeta* pMeta); static void streamMetaCloseImpl(void* arg); @@ -395,41 +394,6 @@ _err: return NULL; } -int32_t streamMetaReopen(SStreamMeta* pMeta) { - streamMetaClear(pMeta); - - // NOTE: role should not be changed during reopen meta - pMeta->streamBackendRid = -1; - pMeta->streamBackend = NULL; - - char* defaultPath = taosMemoryCalloc(1, strlen(pMeta->path) + 128); - sprintf(defaultPath, "%s%s%s", pMeta->path, TD_DIRSEP, "state"); - taosRemoveDir(defaultPath); - - char* newPath = taosMemoryCalloc(1, strlen(pMeta->path) + 128); - sprintf(newPath, "%s%s%s", pMeta->path, TD_DIRSEP, "received"); - - int32_t code = taosStatFile(newPath, NULL, NULL, NULL); - if (code == 0) { - // directory exists - code = taosRenameFile(newPath, defaultPath); - if (code != 0) { - terrno = TAOS_SYSTEM_ERROR(code); - stError("vgId:%d failed to rename file, from %s to %s, code:%s", pMeta->vgId, newPath, defaultPath, - tstrerror(terrno)); - - taosMemoryFree(defaultPath); - taosMemoryFree(newPath); - return -1; - } - } - - taosMemoryFree(defaultPath); - taosMemoryFree(newPath); - - return 0; -} - // todo refactor: the lock shoud be restricted in one function void streamMetaInitBackend(SStreamMeta* pMeta) { pMeta->streamBackend = streamBackendInit(pMeta->path, pMeta->chkpId, pMeta->vgId); @@ -829,28 +793,27 @@ static void doClear(void* pKey, void* pVal, TBC* pCur, SArray* pRecycleList) { taosArrayDestroy(pRecycleList); } -int32_t streamMetaReloadAllTasks(SStreamMeta* pMeta) { - if (pMeta == NULL) return 0; - - return streamMetaLoadAllTasks(pMeta); -} int32_t streamMetaLoadAllTasks(SStreamMeta* pMeta) { TBC* pCur = NULL; - int32_t vgId = pMeta->vgId; - - stInfo("vgId:%d load stream tasks from meta files", vgId); - - if (tdbTbcOpen(pMeta->pTaskDb, &pCur, NULL) < 0) { - stError("vgId:%d failed to open stream meta, code:%s", vgId, tstrerror(terrno)); - return -1; - } - void* pKey = NULL; int32_t kLen = 0; void* pVal = NULL; int32_t vLen = 0; SDecoder decoder; - SArray* pRecycleList = taosArrayInit(4, sizeof(STaskId)); + + if (pMeta == NULL) { + return TSDB_CODE_SUCCESS; + } + + SArray* pRecycleList = taosArrayInit(4, sizeof(STaskId)); + int32_t vgId = pMeta->vgId; + stInfo("vgId:%d load stream tasks from meta files", vgId); + + if (tdbTbcOpen(pMeta->pTaskDb, &pCur, NULL) < 0) { + stError("vgId:%d failed to open stream meta, code:%s", vgId, tstrerror(terrno)); + taosArrayDestroy(pRecycleList); + return -1; + } tdbTbcMoveToFirst(pCur); while (tdbTbcNext(pCur, &pKey, &kLen, &pVal, &vLen) == 0) { diff --git a/source/libs/sync/src/syncSnapshot.c b/source/libs/sync/src/syncSnapshot.c index cbdc60b2b3..f060e9da13 100644 --- a/source/libs/sync/src/syncSnapshot.c +++ b/source/libs/sync/src/syncSnapshot.c @@ -107,6 +107,19 @@ void syncSnapBlockDestroy(void *ptr) { taosMemoryFree(pBlk); } +static int32_t snapshotSenderClearInfoData(SSyncSnapshotSender *pSender) { + if (pSender->snapshotParam.data) { + taosMemoryFree(pSender->snapshotParam.data); + pSender->snapshotParam.data = NULL; + } + + if (pSender->snapshot.data) { + taosMemoryFree(pSender->snapshot.data); + pSender->snapshot.data = NULL; + } + return 0; +} + void snapshotSenderDestroy(SSyncSnapshotSender *pSender) { if (pSender == NULL) return; @@ -121,10 +134,8 @@ void snapshotSenderDestroy(SSyncSnapshotSender *pSender) { syncSnapBufferDestroy(&pSender->pSndBuf); } - if (pSender->snapshotParam.data) { - taosMemoryFree(pSender->snapshotParam.data); - pSender->snapshotParam.data = NULL; - } + snapshotSenderClearInfoData(pSender); + // free sender taosMemoryFree(pSender); } @@ -209,6 +220,8 @@ void snapshotSenderStop(SSyncSnapshotSender *pSender, bool finish) { syncSnapBufferReset(pSender->pSndBuf); + snapshotSenderClearInfoData(pSender); + SRaftId destId = pSender->pSyncNode->replicasId[pSender->replicaIndex]; sSInfo(pSender, "snapshot sender stop, to dnode:%d, finish:%d", DID(&destId), finish); } @@ -419,6 +432,19 @@ SSyncSnapshotReceiver *snapshotReceiverCreate(SSyncNode *pSyncNode, SRaftId from return pReceiver; } +static int32_t snapshotReceiverClearInfoData(SSyncSnapshotReceiver *pReceiver) { + if (pReceiver->snapshotParam.data) { + taosMemoryFree(pReceiver->snapshotParam.data); + pReceiver->snapshotParam.data = NULL; + } + + if (pReceiver->snapshot.data) { + taosMemoryFree(pReceiver->snapshot.data); + pReceiver->snapshot.data = NULL; + } + return 0; +} + void snapshotReceiverDestroy(SSyncSnapshotReceiver *pReceiver) { if (pReceiver == NULL) return; @@ -432,22 +458,13 @@ void snapshotReceiverDestroy(SSyncSnapshotReceiver *pReceiver) { pReceiver->pWriter = NULL; } - // free data of snapshot info - if (pReceiver->snapshotParam.data) { - taosMemoryFree(pReceiver->snapshotParam.data); - pReceiver->snapshotParam.data = NULL; - } - - if (pReceiver->snapshot.data) { - taosMemoryFree(pReceiver->snapshot.data); - pReceiver->snapshot.data = NULL; - } - // free snap buf if (pReceiver->pRcvBuf) { syncSnapBufferDestroy(&pReceiver->pRcvBuf); } + snapshotReceiverClearInfoData(pReceiver); + // free receiver taosMemoryFree(pReceiver); } @@ -533,6 +550,8 @@ void snapshotReceiverStop(SSyncSnapshotReceiver *pReceiver) { } syncSnapBufferReset(pReceiver->pRcvBuf); + + snapshotReceiverClearInfoData(pReceiver); } taosThreadMutexUnlock(&pReceiver->pRcvBuf->mutex); } @@ -664,7 +683,10 @@ static int32_t syncSnapReceiverExchgSnapInfo(SSyncNode *pSyncNode, SSyncSnapshot memcpy(pInfo->data, pMsg->data, pMsg->dataLen); // exchange snap info - pSyncNode->pFsm->FpGetSnapshotInfo(pSyncNode->pFsm, pInfo); + if (pSyncNode->pFsm->FpGetSnapshotInfo(pSyncNode->pFsm, pInfo) != 0) { + sRError(pReceiver, "failed to get snapshot info. type: %d", pMsg->payloadType); + goto _out; + } SSyncTLV *datHead = pInfo->data; if (datHead->typ != TDMT_SYNC_PREP_SNAPSHOT_REPLY) { sRError(pReceiver, "unexpected data typ in data of snapshot info. typ: %d", datHead->typ); diff --git a/source/util/src/tcompare.c b/source/util/src/tcompare.c index 4bacda48d2..b6b71855f3 100644 --- a/source/util/src/tcompare.c +++ b/source/util/src/tcompare.c @@ -1097,7 +1097,8 @@ int32_t patternMatch(const char *pattern, size_t psize, const char *str, size_t c1 = str[j++]; ++nMatchChar; - if (c == '\\' && pattern[i] == '_' && c1 == '_') { + if (c == '\\' && pattern[i] == c1 && + (c1 == '_' || c1 == '%')) { i++; continue; } diff --git a/source/util/test/utilTests.cpp b/source/util/test/utilTests.cpp index ff1d91aa9d..01a55ae710 100644 --- a/source/util/test/utilTests.cpp +++ b/source/util/test/utilTests.cpp @@ -204,6 +204,11 @@ TEST(utilTest, char_pattern_match_test) { const char* str12 = NULL; ret = patternMatch(pattern12, 4, str12, 0, &pInfo); ASSERT_EQ(ret, TSDB_PATTERN_NOMATCH); + + const char* pattern13 = "a\\%c"; + const char* str13 = "a%c"; + ret = patternMatch(pattern13, 5, str13, strlen(str13), &pInfo); + ASSERT_EQ(ret, TSDB_PATTERN_MATCH); } TEST(utilTest, char_pattern_match_no_terminated) { diff --git a/tests/develop-test/2-query/table_count_scan.py b/tests/develop-test/2-query/table_count_scan.py index 758d28948d..40d2e2a887 100644 --- a/tests/develop-test/2-query/table_count_scan.py +++ b/tests/develop-test/2-query/table_count_scan.py @@ -65,7 +65,7 @@ class TDTestCase: tdSql.query('select count(*),db_name, stable_name from information_schema.ins_tables group by db_name, stable_name;') tdSql.checkRows(3) - tdSql.checkData(0, 0, 24) + tdSql.checkData(0, 0, 26) tdSql.checkData(0, 1, 'information_schema') tdSql.checkData(0, 2, None) tdSql.checkData(1, 0, 3) @@ -77,7 +77,7 @@ class TDTestCase: tdSql.query('select count(1) v,db_name, stable_name from information_schema.ins_tables group by db_name, stable_name order by v desc;') tdSql.checkRows(3) - tdSql.checkData(0, 0, 24) + tdSql.checkData(0, 0, 26) tdSql.checkData(0, 1, 'information_schema') tdSql.checkData(0, 2, None) tdSql.checkData(1, 0, 5) @@ -93,7 +93,7 @@ class TDTestCase: tdSql.checkData(1, 1, 'performance_schema') tdSql.checkData(0, 0, 3) tdSql.checkData(0, 1, 'tbl_count') - tdSql.checkData(2, 0, 24) + tdSql.checkData(2, 0, 26) tdSql.checkData(2, 1, 'information_schema') tdSql.query("select count(*) from information_schema.ins_tables where db_name='tbl_count'") @@ -106,7 +106,7 @@ class TDTestCase: tdSql.query('select count(*) from information_schema.ins_tables') tdSql.checkRows(1) - tdSql.checkData(0, 0, 32) + tdSql.checkData(0, 0, 34) tdSql.execute('create table stba (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(10), c9 nchar(10), c10 tinyint unsigned, c11 smallint unsigned, c12 int unsigned, c13 bigint unsigned) TAGS(t1 int, t2 binary(10), t3 double);') @@ -189,7 +189,7 @@ class TDTestCase: tdSql.checkData(2, 0, 5) tdSql.checkData(2, 1, 'performance_schema') tdSql.checkData(2, 2, None) - tdSql.checkData(3, 0, 24) + tdSql.checkData(3, 0, 26) tdSql.checkData(3, 1, 'information_schema') tdSql.checkData(3, 2, None) @@ -204,7 +204,7 @@ class TDTestCase: tdSql.checkData(2, 0, 5) tdSql.checkData(2, 1, 'performance_schema') tdSql.checkData(2, 2, None) - tdSql.checkData(3, 0, 24) + tdSql.checkData(3, 0, 26) tdSql.checkData(3, 1, 'information_schema') tdSql.checkData(3, 2, None) @@ -215,7 +215,7 @@ class TDTestCase: tdSql.checkData(0, 1, 'tbl_count') tdSql.checkData(1, 0, 5) tdSql.checkData(1, 1, 'performance_schema') - tdSql.checkData(2, 0, 24) + tdSql.checkData(2, 0, 26) tdSql.checkData(2, 1, 'information_schema') tdSql.query("select count(*) from information_schema.ins_tables where db_name='tbl_count'") @@ -228,7 +228,7 @@ class TDTestCase: tdSql.query('select count(*) from information_schema.ins_tables') tdSql.checkRows(1) - tdSql.checkData(0, 0, 33) + tdSql.checkData(0, 0, 35) tdSql.execute('drop database tbl_count') diff --git a/tests/docs-examples-test/csharp.sh b/tests/docs-examples-test/csharp.sh index c08ffd6d62..9d7867d829 100644 --- a/tests/docs-examples-test/csharp.sh +++ b/tests/docs-examples-test/csharp.sh @@ -11,10 +11,9 @@ dotnet run --project connect/connect.csproj taos -s "drop database if exists power" dotnet run --project sqlInsert/sqlinsert.csproj dotnet run --project query/query.csproj -dotnet run --project asyncQuery/asyncquery.csproj -dotnet run --project subscribe/subscribe.csproj +#dotnet run --project subscribe/subscribe.csproj -taos -s "drop topic if exists topic_example" +#taos -s "drop topic if exists topic_example" taos -s "drop database if exists power" dotnet run --project stmtInsert/stmtinsert.csproj @@ -28,10 +27,12 @@ taos -s "drop database if exists test" dotnet run --project optsJSON/optsJSON.csproj taos -s "create database if not exists test" +taos -s "drop database if exists power" dotnet run --project wsConnect/wsConnect.csproj dotnet run --project wsInsert/wsInsert.csproj -dotnet run --project wsStmt/wsStmt.csproj dotnet run --project wsQuery/wsQuery.csproj +taos -s "drop database if exists power" +dotnet run --project wsStmt/wsStmt.csproj taos -s "drop database if exists test" taos -s "drop database if exists power" diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index d0961830e4..eb77e74f71 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -243,6 +243,7 @@ e ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/compress_tsz1.py ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/compress_tsz2.py ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/view/non_marterial_view/test_view.py +,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/test_show_table_distributed.py ,,n,system-test,python3 ./test.py -f 0-others/compatibility.py ,,n,system-test,python3 ./test.py -f 0-others/tag_index_basic.py ,,n,system-test,python3 ./test.py -f 0-others/udfpy_main.py diff --git a/tests/script/tsim/query/sys_tbname.sim b/tests/script/tsim/query/sys_tbname.sim index f49a8e0a7d..8bf0fb4700 100644 --- a/tests/script/tsim/query/sys_tbname.sim +++ b/tests/script/tsim/query/sys_tbname.sim @@ -58,7 +58,7 @@ endi sql select tbname from information_schema.ins_tables; print $rows $data00 -if $rows != 33 then +if $rows != 35 then return -1 endi if $data00 != @ins_tables@ then diff --git a/tests/script/tsim/query/tableCount.sim b/tests/script/tsim/query/tableCount.sim index 6e65852dcc..315a39e56d 100644 --- a/tests/script/tsim/query/tableCount.sim +++ b/tests/script/tsim/query/tableCount.sim @@ -53,7 +53,7 @@ sql select stable_name,count(table_name) from information_schema.ins_tables grou if $rows != 3 then return -1 endi -if $data01 != 30 then +if $data01 != 32 then return -1 endi if $data11 != 10 then @@ -72,7 +72,7 @@ endi if $data11 != 5 then return -1 endi -if $data21 != 24 then +if $data21 != 26 then return -1 endi if $data31 != 5 then @@ -97,7 +97,7 @@ endi if $data42 != 3 then return -1 endi -if $data52 != 24 then +if $data52 != 26 then return -1 endi if $data62 != 5 then diff --git a/tests/system-test/0-others/information_schema.py b/tests/system-test/0-others/information_schema.py index 2bfe33d0af..20305bf4c1 100644 --- a/tests/system-test/0-others/information_schema.py +++ b/tests/system-test/0-others/information_schema.py @@ -57,7 +57,8 @@ class TDTestCase: self.nchar_str = '涛思数据' self.ins_list = ['ins_dnodes','ins_mnodes','ins_qnodes','ins_snodes','ins_cluster','ins_databases','ins_functions',\ 'ins_indexes','ins_stables','ins_tables','ins_tags','ins_columns','ins_users','ins_grants','ins_vgroups','ins_configs','ins_dnode_variables',\ - 'ins_topics','ins_subscriptions','ins_streams','ins_stream_tasks','ins_vnodes','ins_user_privileges','ins_views'] + 'ins_topics','ins_subscriptions','ins_streams','ins_stream_tasks','ins_vnodes','ins_user_privileges','ins_views', + 'ins_compacts', 'ins_compact_details'] self.perf_list = ['perf_connections','perf_queries','perf_consumers','perf_trans','perf_apps'] def insert_data(self,column_dict,tbname,row_num): insert_sql = self.setsql.set_insertsql(column_dict,tbname,self.binary_str,self.nchar_str) @@ -217,7 +218,7 @@ class TDTestCase: tdSql.checkEqual(20470,len(tdSql.queryResult)) tdSql.query("select * from information_schema.ins_columns where db_name ='information_schema'") - tdSql.checkEqual(210, len(tdSql.queryResult)) + tdSql.checkEqual(219, len(tdSql.queryResult)) tdSql.query("select * from information_schema.ins_columns where db_name ='performance_schema'") tdSql.checkEqual(54, len(tdSql.queryResult)) diff --git a/tests/system-test/0-others/test_show_table_distributed.py b/tests/system-test/0-others/test_show_table_distributed.py new file mode 100644 index 0000000000..c414f8ba88 --- /dev/null +++ b/tests/system-test/0-others/test_show_table_distributed.py @@ -0,0 +1,77 @@ +from itertools import product +import taos +import random +import time +from taos.tmq import * +from util.cases import * +from util.common import * +from util.log import * +from util.sql import * +from util.sqlset import * + + +class TDTestCase: + """This test case is used to veirfy show table distributed command""" + + def init(self, conn, logSql, replicaVar=1): + self.replicaVar = int(replicaVar) + tdLog.debug("start to execute %s" % __file__) + # init the tdsql + tdSql.init(conn.cursor()) + self.dbname = "distributed_db" + self.stname = "st" + self.ctnum = 1 + self.row_num = 99 + + # create database + tdSql.execute(f'create database if not exists {self.dbname};') + tdSql.execute(f'use {self.dbname};') + # create super table + tdSql.execute(f'create table {self.dbname}.{self.stname} (ts timestamp, id int, temperature float) tags (name binary(20));') + # create child table + for i in range(self.ctnum): + tdSql.execute(f'create table ct_{str(i+1)} using {self.stname} tags ("name{str(i+1)}");') + # insert data + sql = f"insert into ct_{str(i+1)} values " + for j in range(self.row_num): + sql += f"(now+{j+1}s, {j+1}, {random.uniform(15, 30)}) " + sql += ";" + tdSql.execute(sql) + tdLog.debug("init finished") + + def checkRes(self, queryRes): + mem_rows_num = 0 + stt_rows_num = 0 + for item in queryRes: + if "Inmem_Rows=" in item[0]: + mem_rows_num = int(item[0].split("=")[1].split(" ")[0].replace("[", "").replace("]", "")) + tdLog.debug("mem_rows_num: %s" % mem_rows_num) + if "Stt_Rows=" in item[0]: + stt_rows_num = int(item[0].split("=")[2].replace("[", "").replace("]", "")) + tdLog.debug("stt_rows_num: %s" % stt_rows_num) + return mem_rows_num, stt_rows_num + + def run(self): + tdSql.query(f"show table distributed {self.stname};") + tdLog.debug(tdSql.queryResult) + mem_rows_num, stt_rows_num = self.checkRes(tdSql.queryResult) + tdLog.debug("mem_rows_num: %s, stt_rows_num: %s" % (mem_rows_num, stt_rows_num)) + assert(99 == mem_rows_num and 0 == stt_rows_num) + + tdSql.execute(f"flush database {self.dbname};") + time.sleep(1) + tdSql.query(f"show table distributed {self.stname};") + tdLog.debug(tdSql.queryResult) + mem_rows_num, stt_rows_num = self.checkRes(tdSql.queryResult) + tdLog.debug("mem_rows_num: %s, stt_rows_num: %s" % (mem_rows_num, stt_rows_num)) + assert(0 == mem_rows_num and 99 == stt_rows_num) + + def stop(self): + # remove the user + tdSql.execute(f'drop database {self.dbname};') + # close the connection + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) diff --git a/utils/test/c/tmqSim.c b/utils/test/c/tmqSim.c index 14e30008fe..006bd516d0 100644 --- a/utils/test/c/tmqSim.c +++ b/utils/test/c/tmqSim.c @@ -906,6 +906,7 @@ void* consumeThreadFunc(void* param) { pPrint("tmq_commit() manual commit when consume end.\n"); /*tmq_commit(pInfo->tmq, NULL, 0);*/ tmq_commit_sync(pInfo->tmq, NULL); + tmq_commit_cb_print(pInfo->tmq, 0, pInfo); taosFprintfFile(g_fp, "tmq_commit() manual commit over.\n"); pPrint("tmq_commit() manual commit over.\n"); }