diff --git a/docs/zh/07-develop/07-tmq.mdx b/docs/zh/07-develop/07-tmq.mdx
index df651eab96..a852e71ff4 100644
--- a/docs/zh/07-develop/07-tmq.mdx
+++ b/docs/zh/07-develop/07-tmq.mdx
@@ -91,6 +91,7 @@ TDengine 会为 WAL 文件自动创建索引以支持快速随机访问,并提
不同语言下, TMQ 订阅相关的 API 及数据结构如下(详细的接口说明可以参考连接器章节,注意consumer结构不是线程安全的,在一个线程使用consumer时,不要在另一个线程close这个consumer):
+
```c
@@ -101,17 +102,17 @@ TDengine 会为 WAL 文件自动创建索引以支持快速随机访问,并提
typedef void(tmq_commit_cb(tmq_t *tmq, int32_t code, void *param));
typedef enum tmq_conf_res_t {
- TMQ_CONF_UNKNOWN = -2,
- TMQ_CONF_INVALID = -1,
- TMQ_CONF_OK = 0,
- } tmq_conf_res_t;
+ TMQ_CONF_UNKNOWN = -2,
+ TMQ_CONF_INVALID = -1,
+ TMQ_CONF_OK = 0,
+ } tmq_conf_res_t;
typedef struct tmq_topic_assignment {
- int32_t vgId;
- int64_t currentOffset;
- int64_t begin;
- int64_t end;
- } tmq_topic_assignment;
+ int32_t vgId;
+ int64_t currentOffset;
+ int64_t begin;
+ int64_t end;
+ } tmq_topic_assignment;
DLL_EXPORT tmq_conf_t *tmq_conf_new();
DLL_EXPORT tmq_conf_res_t tmq_conf_set(tmq_conf_t *conf, const char *key, const char *value);
@@ -146,7 +147,6 @@ TDengine 会为 WAL 文件自动创建索引以支持快速随机访问,并提
DLL_EXPORT int64_t tmq_get_vgroup_offset(TAOS_RES* res);
DLL_EXPORT const char *tmq_err2str(int32_t code);
```
-
@@ -250,281 +250,280 @@ TDengine 会为 WAL 文件自动创建索引以支持快速随机访问,并提
+ futures::Stream<
Item = Result<(Self::Offset, MessageSet), Self::Error>,
>,
- >,
- >;
- async fn commit(&self, offset: Self::Offset) -> Result<(), Self::Error>;
+ >,
+ >;
+ async fn commit(&self, offset: Self::Offset) -> Result<(), Self::Error>;
- async fn unsubscribe(self);
- ```
+ async fn unsubscribe(self);
+ ```
- 可在 上查看详细 API 说明。
+ 可在 上查看详细 API 说明。
-
+
-
+
- ```js
- function TMQConsumer(config)
+ ```js
+ function TMQConsumer(config)
+
+ function subscribe(topic)
+
+ function consume(timeout)
+
+ function subscription()
+
+ function unsubscribe()
+
+ function commit(msg)
+
+ function close()
+ ```
- function subscribe(topic)
+
- function consume(timeout)
+
- function subscription()
+ ```csharp
+ class ConsumerBuilder
+
+ ConsumerBuilder(IEnumerable> config)
+
+ public IConsumer Build()
+
+ void Subscribe(IEnumerable topics)
+
+ void Subscribe(string topic)
+
+ ConsumeResult Consume(int millisecondsTimeout)
+
+ List Subscription()
+
+ void Unsubscribe()
+
+ List Commit()
+
+ void Close()
+ ```
+
+
- function unsubscribe()
+# 数据订阅示例
+## 写入数据
- function commit(msg)
+首先完成建库、建一张超级表和多张子表操作,然后就可以写入数据了,比如:
- function close()
- ```
-
-
-
-
-
- ```csharp
- class ConsumerBuilder
-
- ConsumerBuilder(IEnumerable> config)
-
- public IConsumer Build()
-
- void Subscribe(IEnumerable topics)
-
- void Subscribe(string topic)
-
- ConsumeResult Consume(int millisecondsTimeout)
-
- List Subscription()
-
- void Unsubscribe()
-
- List Commit()
-
- void Close()
- ```
-
-
-
-
- # 数据订阅示例
- ## 写入数据
-
- 首先完成建库、建一张超级表和多张子表操作,然后就可以写入数据了,比如:
-
- ```sql
- DROP DATABASE IF EXISTS tmqdb;
- CREATE DATABASE tmqdb WAL_RETENTION_PERIOD 3600;
- CREATE TABLE tmqdb.stb (ts TIMESTAMP, c1 INT, c2 FLOAT, c3 VARCHAR(16)) TAGS(t1 INT, t3 VARCHAR(16));
- CREATE TABLE tmqdb.ctb0 USING tmqdb.stb TAGS(0, "subtable0");
- CREATE TABLE tmqdb.ctb1 USING tmqdb.stb TAGS(1, "subtable1");
- INSERT INTO tmqdb.ctb0 VALUES(now, 0, 0, 'a0')(now+1s, 0, 0, 'a00');
+```sql
+DROP DATABASE IF EXISTS tmqdb;
+CREATE DATABASE tmqdb WAL_RETENTION_PERIOD 3600;
+CREATE TABLE tmqdb.stb (ts TIMESTAMP, c1 INT, c2 FLOAT, c3 VARCHAR(16)) TAGS(t1 INT, t3 VARCHAR(16));
+CREATE TABLE tmqdb.ctb0 USING tmqdb.stb TAGS(0, "subtable0");
+CREATE TABLE tmqdb.ctb1 USING tmqdb.stb TAGS(1, "subtable1");
+INSERT INTO tmqdb.ctb0 VALUES(now, 0, 0, 'a0')(now+1s, 0, 0, 'a00');
INSERT INTO tmqdb.ctb1 VALUES(now, 1, 1, 'a1')(now+1s, 11, 11, 'a11');
```
## 创建 topic
- 使用 SQL 创建一个 topic:
+使用 SQL 创建一个 topic:
- ```sql
- CREATE TOPIC topic_name AS SELECT ts, c1, c2, c3 FROM tmqdb.stb WHERE c1 > 1;
- ```
+```sql
+CREATE TOPIC topic_name AS SELECT ts, c1, c2, c3 FROM tmqdb.stb WHERE c1 > 1;
+```
- ## 创建消费者 *consumer*
+## 创建消费者 *consumer*
- 对于不同编程语言,其设置方式如下:
+对于不同编程语言,其设置方式如下:
-
-
+
- ```c
- /* 根据需要,设置消费组 (group.id)、自动提交 (enable.auto.commit)、
- 自动提交时间间隔 (auto.commit.interval.ms)、用户名 (td.connect.user)、密码 (td.connect.pass) 等参数 */
- tmq_conf_t* conf = tmq_conf_new();
- tmq_conf_set(conf, "enable.auto.commit", "true");
- tmq_conf_set(conf, "auto.commit.interval.ms", "1000");
- tmq_conf_set(conf, "group.id", "cgrpName");
- tmq_conf_set(conf, "td.connect.user", "root");
- tmq_conf_set(conf, "td.connect.pass", "taosdata");
- tmq_conf_set(conf, "auto.offset.reset", "latest");
- tmq_conf_set(conf, "msg.with.table.name", "true");
- tmq_conf_set_auto_commit_cb(conf, tmq_commit_cb_print, NULL);
+
+ ```c
+ /* 根据需要,设置消费组 (group.id)、自动提交 (enable.auto.commit)、
+ 自动提交时间间隔 (auto.commit.interval.ms)、用户名 (td.connect.user)、密码 (td.connect.pass) 等参数 */
+ tmq_conf_t* conf = tmq_conf_new();
+ tmq_conf_set(conf, "enable.auto.commit", "true");
+ tmq_conf_set(conf, "auto.commit.interval.ms", "1000");
+ tmq_conf_set(conf, "group.id", "cgrpName");
+ tmq_conf_set(conf, "td.connect.user", "root");
+ tmq_conf_set(conf, "td.connect.pass", "taosdata");
+ tmq_conf_set(conf, "auto.offset.reset", "latest");
+ tmq_conf_set(conf, "msg.with.table.name", "true");
+ tmq_conf_set_auto_commit_cb(conf, tmq_commit_cb_print, NULL);
- tmq_t* tmq = tmq_consumer_new(conf, NULL, 0);
- tmq_conf_destroy(conf);
- ```
-
-
-
-
- 对于 Java 程序,还可以使用如下配置项:
-
- | 参数名称 | 类型 | 参数说明 |
- | ----------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------- |
- | `td.connect.type` | string | 连接类型,"jni" 指原生连接,"ws" 指 websocket 连接,默认值为 "jni" |
- | `bootstrap.servers` | string | 连接地址,如 `localhost:6030` |
- | `value.deserializer` | string | 值解析方法,使用此方法应实现 `com.taosdata.jdbc.tmq.Deserializer` 接口或继承 `com.taosdata.jdbc.tmq.ReferenceDeserializer` 类 |
- | `value.deserializer.encoding` | string | 指定字符串解析的字符集 | |
-
- 需要注意:此处使用 `bootstrap.servers` 替代 `td.connect.ip` 和 `td.connect.port`,以提供与 Kafka 一致的接口。
-
- ```java
- Properties properties = new Properties();
- properties.setProperty("enable.auto.commit", "true");
- properties.setProperty("auto.commit.interval.ms", "1000");
- properties.setProperty("group.id", "cgrpName");
- properties.setProperty("bootstrap.servers", "127.0.0.1:6030");
- properties.setProperty("td.connect.user", "root");
- properties.setProperty("td.connect.pass", "taosdata");
- properties.setProperty("auto.offset.reset", "latest");
- properties.setProperty("msg.with.table.name", "true");
- properties.setProperty("value.deserializer", "com.taos.example.MetersDeserializer");
-
- TaosConsumer consumer = new TaosConsumer<>(properties);
-
- /* value deserializer definition. */
- import com.taosdata.jdbc.tmq.ReferenceDeserializer;
-
- public class MetersDeserializer extends ReferenceDeserializer {
- }
- ```
-
-
-
-
-
- ```go
- conf := &tmq.ConfigMap{
- "group.id": "test",
- "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": "test_tmq_c",
- "enable.auto.commit": "false",
- "msg.with.table.name": "true",
- }
- consumer, err := NewConsumer(conf)
- ```
-
-
-
-
-
- ```rust
- let mut dsn: Dsn = "taos://".parse()?;
- dsn.set("group.id", "group1");
- dsn.set("client.id", "test");
- dsn.set("auto.offset.reset", "latest");
-
- let tmq = TmqBuilder::from_dsn(dsn)?;
-
- let mut consumer = tmq.build()?;
- ```
-
-
-
-
-
- Python 语言下引入 `taos` 库的 `Consumer` 类,创建一个 Consumer 示例:
-
- ```python
- from taos.tmq import Consumer
-
- # Syntax: `consumer = Consumer(configs)`
- #
- # Example:
- consumer = Consumer(
- {
- "group.id": "local",
- "client.id": "1",
- "enable.auto.commit": "true",
- "auto.commit.interval.ms": "1000",
- "td.connect.ip": "127.0.0.1",
- "td.connect.user": "root",
- "td.connect.pass": "taosdata",
- "auto.offset.reset": "latest",
- "msg.with.table.name": "true",
- }
- )
- ```
-
-
-
-
-
- ```js
- // 根据需要,设置消费组 (group.id)、自动提交 (enable.auto.commit)、
- // 自动提交时间间隔 (auto.commit.interval.ms)、用户名 (td.connect.user)、密码 (td.connect.pass) 等参数
-
- let consumer = taos.consumer({
-'enable.auto.commit': 'true',
- 'auto.commit.interval.ms','1000',
- 'group.id': 'tg2',
- 'td.connect.user': 'root',
- 'td.connect.pass': 'taosdata',
- 'auto.offset.reset','latest',
- 'msg.with.table.name': 'true',
- 'td.connect.ip','127.0.0.1',
- 'td.connect.port','6030'
- });
+ tmq_t* tmq = tmq_consumer_new(conf, NULL, 0);
+ tmq_conf_destroy(conf);
```
+
-
+
-
-
- ```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();
+ 对于 Java 程序,还可以使用如下配置项:
+
+ | 参数名称 | 类型 | 参数说明 |
+ | ----------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------- |
+ | `td.connect.type` | string | 连接类型,"jni" 指原生连接,"ws" 指 websocket 连接,默认值为 "jni" |
+ | `bootstrap.servers` | string | 连接地址,如 `localhost:6030` |
+ | `value.deserializer` | string | 值解析方法,使用此方法应实现 `com.taosdata.jdbc.tmq.Deserializer` 接口或继承 `com.taosdata.jdbc.tmq.ReferenceDeserializer` 类 |
+ | `value.deserializer.encoding` | string | 指定字符串解析的字符集 | |
+
+ 需要注意:此处使用 `bootstrap.servers` 替代 `td.connect.ip` 和 `td.connect.port`,以提供与 Kafka 一致的接口。
+
+ ```java
+ Properties properties = new Properties();
+ properties.setProperty("enable.auto.commit", "true");
+ properties.setProperty("auto.commit.interval.ms", "1000");
+ properties.setProperty("group.id", "cgrpName");
+ properties.setProperty("bootstrap.servers", "127.0.0.1:6030");
+ properties.setProperty("td.connect.user", "root");
+ properties.setProperty("td.connect.pass", "taosdata");
+ properties.setProperty("auto.offset.reset", "latest");
+ properties.setProperty("msg.with.table.name", "true");
+ properties.setProperty("value.deserializer", "com.taos.example.MetersDeserializer");
+
+ TaosConsumer consumer = new TaosConsumer<>(properties);
+
+ /* value deserializer definition. */
+ import com.taosdata.jdbc.tmq.ReferenceDeserializer;
+
+ public class MetersDeserializer extends ReferenceDeserializer {
+ }
```
+
-
+
+
+ ```go
+ conf := &tmq.ConfigMap{
+ "group.id": "test",
+ "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": "test_tmq_c",
+ "enable.auto.commit": "false",
+ "msg.with.table.name": "true",
+ }
+ consumer, err := NewConsumer(conf)
+ ```
+
+
-
+
+
+ ```rust
+ let mut dsn: Dsn = "taos://".parse()?;
+ dsn.set("group.id", "group1");
+ dsn.set("client.id", "test");
+ dsn.set("auto.offset.reset", "latest");
+
+ let tmq = TmqBuilder::from_dsn(dsn)?;
+
+ let mut consumer = tmq.build()?;
+ ```
+
+
- 上述配置中包括 consumer group ID,如果多个 consumer 指定的 consumer group ID 一样,则自动形成一个 consumer group,共享消费进度。
+
+
+ Python 语言下引入 `taos` 库的 `Consumer` 类,创建一个 Consumer 示例:
+
+ ```python
+ from taos.tmq import Consumer
+
+ # Syntax: `consumer = Consumer(configs)`
+ #
+ # Example:
+ consumer = Consumer(
+ {
+ "group.id": "local",
+ "client.id": "1",
+ "enable.auto.commit": "true",
+ "auto.commit.interval.ms": "1000",
+ "td.connect.ip": "127.0.0.1",
+ "td.connect.user": "root",
+ "td.connect.pass": "taosdata",
+ "auto.offset.reset": "latest",
+ "msg.with.table.name": "true",
+ }
+ )
+ ```
+
+
- ## 订阅 *topics*
+
+
+ ```js
+ // 根据需要,设置消费组 (group.id)、自动提交 (enable.auto.commit)、
+ // 自动提交时间间隔 (auto.commit.interval.ms)、用户名 (td.connect.user)、密码 (td.connect.pass) 等参数
+
+ let consumer = taos.consumer({
+ 'enable.auto.commit': 'true',
+ 'auto.commit.interval.ms','1000',
+ 'group.id': 'tg2',
+ 'td.connect.user': 'root',
+ 'td.connect.pass': 'taosdata',
+ 'auto.offset.reset','latest',
+ 'msg.with.table.name': 'true',
+ 'td.connect.ip','127.0.0.1',
+ 'td.connect.port','6030'
+ });
+ ```
+
+
- 一个 consumer 支持同时订阅多个 topic。
+
+
+ ```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();
+ ```
+
+
+
+
+
+上述配置中包括 consumer group ID,如果多个 consumer 指定的 consumer group ID 一样,则自动形成一个 consumer group,共享消费进度。
+
+## 订阅 *topics*
-
-
+一个 consumer 支持同时订阅多个 topic。
+
+
-```c
+
+
+ ```c
// 创建订阅 topics 列表
tmq_list_t* topicList = tmq_list_new();
tmq_list_append(topicList, "topicName");
// 启动订阅
tmq_subscribe(tmq, topicList);
tmq_list_destroy(topicList);
-
+
```
-
-
-
-
+
+
+
+
```java
List topics = new ArrayList<>();
topics.add("tmq_topic");
consumer.subscribe(topics);
```
-
-
-
+
+
+
```go
err = consumer.Subscribe("example_tmq_topic", nil)
@@ -533,26 +532,26 @@ INSERT INTO tmqdb.ctb1 VALUES(now, 1, 1, 'a1')(now+1s, 11, 11, 'a11');
}
```
-
-
+
+
-```rust
+ ```rust
consumer.subscribe(["tmq_meters"]).await?;
```
-
+
-
+
-```python
+ ```python
consumer.subscribe(['topic1', 'topic2'])
```
-
+
-
+
-```js
+ ```js
// 创建订阅 topics 列表
let topics = ['topic_test']
@@ -560,11 +559,11 @@ INSERT INTO tmqdb.ctb1 VALUES(now, 1, 1, 'a1')(now+1s, 11, 11, 'a11');
consumer.subscribe(topics);
```
-
+
-
+
-```csharp
+ ```csharp
// 创建订阅 topics 列表
List topics = new List();
topics.add("tmq_topic");
@@ -572,18 +571,19 @@ INSERT INTO tmqdb.ctb1 VALUES(now, 1, 1, 'a1')(now+1s, 11, 11, 'a11');
consumer.Subscribe(topics);
```
-
+
-
+
- ## 消费
+## 消费
- 以下代码展示了不同语言下如何对 TMQ 消息进行消费。
+以下代码展示了不同语言下如何对 TMQ 消息进行消费。
-
-
+
-```c
+
+
+ ```c
// 消费数据
while (running) {
TAOS_RES* msg = tmq_consumer_poll(tmq, timeOut);
@@ -591,11 +591,11 @@ INSERT INTO tmqdb.ctb1 VALUES(now, 1, 1, 'a1')(now+1s, 11, 11, 'a11');
}
```
-这里是一个 **while** 循环,每调用一次 tmq_consumer_poll(),获取一个消息,该消息与普通查询返回的结果集完全相同,可以使用相同的解析 API 完成消息内容的解析。
-
-
-
+ 这里是一个 **while** 循环,每调用一次 tmq_consumer_poll(),获取一个消息,该消息与普通查询返回的结果集完全相同,可以使用相同的解析 API 完成消息内容的解析。
+
+
+
```java
while(running){
ConsumerRecords meters = consumer.poll(Duration.ofMillis(100));
@@ -604,10 +604,10 @@ INSERT INTO tmqdb.ctb1 VALUES(now, 1, 1, 'a1')(now+1s, 11, 11, 'a11');
}
}
```
+
+
-
-
-
+
```go
for {
@@ -625,9 +625,9 @@ INSERT INTO tmqdb.ctb1 VALUES(now, 1, 1, 'a1')(now+1s, 11, 11, 'a11');
}
```
-
+
-
+
```rust
{
@@ -660,8 +660,8 @@ INSERT INTO tmqdb.ctb1 VALUES(now, 1, 1, 'a1')(now+1s, 11, 11, 'a11');
}
```
-
-
+
+
```python
while True:
@@ -677,9 +677,9 @@ INSERT INTO tmqdb.ctb1 VALUES(now, 1, 1, 'a1')(now+1s, 11, 11, 'a11');
print(block.fetchall())
```
-
+
-
+
```js
while(true){
@@ -691,11 +691,11 @@ INSERT INTO tmqdb.ctb1 VALUES(now, 1, 1, 'a1')(now+1s, 11, 11, 'a11');
}
```
-
+
-
+
-```csharp
+ ```csharp
// 消费数据
while (true)
{
@@ -708,18 +708,19 @@ INSERT INTO tmqdb.ctb1 VALUES(now, 1, 1, 'a1')(now+1s, 11, 11, 'a11');
}
```
-
+
-
+
- ## 结束消费
+## 结束消费
- 消费结束后,应当取消订阅。
+消费结束后,应当取消订阅。
-
-
+
+
+
-```c
+ ```c
/* 取消订阅 */
tmq_unsubscribe(tmq);
@@ -727,10 +728,10 @@ INSERT INTO tmqdb.ctb1 VALUES(now, 1, 1, 'a1')(now+1s, 11, 11, 'a11');
tmq_consumer_close(tmq);
```
-
-
+
+
-```java
+ ```java
/* 取消订阅 */
consumer.unsubscribe();
@@ -738,11 +739,11 @@ INSERT INTO tmqdb.ctb1 VALUES(now, 1, 1, 'a1')(now+1s, 11, 11, 'a11');
consumer.close();
```
-
+
+
+
-
-
-```go
+ ```go
/* Unsubscribe */
_ = consumer.Unsubscribe()
@@ -750,38 +751,38 @@ INSERT INTO tmqdb.ctb1 VALUES(now, 1, 1, 'a1')(now+1s, 11, 11, 'a11');
_ = consumer.Close()
```
-
+
+
+
-
-
-```rust
+ ```rust
consumer.unsubscribe().await;
```
-
+
-
+
-```py
+ ```py
# 取消订阅
consumer.unsubscribe()
# 关闭消费
consumer.close()
```
-
-
+
+
-```js
+ ```js
consumer.unsubscribe();
consumer.close();
```
-
+
-
+
-```csharp
+ ```csharp
// 取消订阅
consumer.Unsubscribe();
@@ -789,7 +790,7 @@ INSERT INTO tmqdb.ctb1 VALUES(now, 1, 1, 'a1')(now+1s, 11, 11, 'a11');
consumer.Close();
```
-
+
@@ -799,41 +800,41 @@ INSERT INTO tmqdb.ctb1 VALUES(now, 1, 1, 'a1')(now+1s, 11, 11, 'a11');
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
#订阅高级功能
diff --git a/include/libs/stream/tstream.h b/include/libs/stream/tstream.h
index b1bcda6041..c9b48c9979 100644
--- a/include/libs/stream/tstream.h
+++ b/include/libs/stream/tstream.h
@@ -463,7 +463,8 @@ struct SStreamTask {
struct SStreamMeta* pMeta;
SSHashObj* pNameMap;
void* pBackend;
- char reserve[256];
+ int8_t subtableWithoutMd5;
+ char reserve[255];
};
typedef int32_t (*startComplete_fn_t)(struct SStreamMeta*);
@@ -532,7 +533,7 @@ int32_t tEncodeStreamEpInfo(SEncoder* pEncoder, const SStreamChildEpInfo* pInfo)
int32_t tDecodeStreamEpInfo(SDecoder* pDecoder, SStreamChildEpInfo* pInfo);
SStreamTask* tNewStreamTask(int64_t streamId, int8_t taskLevel, SEpSet* pEpset, bool fillHistory, int64_t triggerParam,
- SArray* pTaskList, bool hasFillhistory);
+ SArray* pTaskList, bool hasFillhistory, int8_t subtableWithoutMd5);
int32_t tEncodeStreamTask(SEncoder* pEncoder, const SStreamTask* pTask);
int32_t tDecodeStreamTask(SDecoder* pDecoder, SStreamTask* pTask);
void tFreeStreamTask(SStreamTask* pTask);
diff --git a/include/os/osFile.h b/include/os/osFile.h
index 4d760a791f..eb0862a719 100644
--- a/include/os/osFile.h
+++ b/include/os/osFile.h
@@ -119,6 +119,8 @@ int32_t taosSetFileHandlesLimit();
int32_t taosLinkFile(char *src, char *dst);
+bool lastErrorIsFileNotExist();
+
#ifdef __cplusplus
}
#endif
diff --git a/source/client/src/clientRawBlockWrite.c b/source/client/src/clientRawBlockWrite.c
index 1ea3eaf219..448243cc3d 100644
--- a/source/client/src/clientRawBlockWrite.c
+++ b/source/client/src/clientRawBlockWrite.c
@@ -21,8 +21,8 @@
#include "tglobal.h"
#include "tmsgtype.h"
-#define LOG_ID_TAG "connId:0x%"PRIx64",reqId:0x%"PRIx64
-#define LOG_ID_VALUE *(int64_t*)taos,pRequest->requestId
+#define LOG_ID_TAG "connId:0x%" PRIx64 ",reqId:0x%" PRIx64
+#define LOG_ID_VALUE *(int64_t*)taos, pRequest->requestId
static tb_uid_t processSuid(tb_uid_t suid, char* db) { return suid + MurmurHash3_32(db, strlen(db)); }
@@ -31,8 +31,7 @@ static char* buildCreateTableJson(SSchemaWrapper* schemaRow, SSchemaWrapper* sch
char* string = NULL;
cJSON* json = cJSON_CreateObject();
if (json == NULL) {
- uError("create json object failed")
- return NULL;
+ uError("create json object failed") return NULL;
}
cJSON* type = cJSON_CreateString("create");
cJSON_AddItemToObject(json, "type", type);
@@ -56,7 +55,7 @@ static char* buildCreateTableJson(SSchemaWrapper* schemaRow, SSchemaWrapper* sch
cJSON_AddItemToObject(column, "name", cname);
cJSON* ctype = cJSON_CreateNumber(s->type);
cJSON_AddItemToObject(column, "type", ctype);
- if (s->type == TSDB_DATA_TYPE_BINARY || s->type == TSDB_DATA_TYPE_VARBINARY|| s->type == TSDB_DATA_TYPE_GEOMETRY) {
+ if (s->type == TSDB_DATA_TYPE_BINARY || s->type == TSDB_DATA_TYPE_VARBINARY || s->type == TSDB_DATA_TYPE_GEOMETRY) {
int32_t length = s->bytes - VARSTR_HEADER_SIZE;
cJSON* cbytes = cJSON_CreateNumber(length);
cJSON_AddItemToObject(column, "length", cbytes);
@@ -131,7 +130,8 @@ static char* buildAlterSTableJson(void* alterData, int32_t alterDataLen) {
cJSON* colType = cJSON_CreateNumber(field->type);
cJSON_AddItemToObject(json, "colType", colType);
- if (field->type == TSDB_DATA_TYPE_BINARY || field->type == TSDB_DATA_TYPE_VARBINARY || field->type == TSDB_DATA_TYPE_GEOMETRY) {
+ if (field->type == TSDB_DATA_TYPE_BINARY || field->type == TSDB_DATA_TYPE_VARBINARY ||
+ field->type == TSDB_DATA_TYPE_GEOMETRY) {
int32_t length = field->bytes - VARSTR_HEADER_SIZE;
cJSON* cbytes = cJSON_CreateNumber(length);
cJSON_AddItemToObject(json, "colLength", cbytes);
@@ -156,7 +156,8 @@ static char* buildAlterSTableJson(void* alterData, int32_t alterDataLen) {
cJSON_AddItemToObject(json, "colName", colName);
cJSON* colType = cJSON_CreateNumber(field->type);
cJSON_AddItemToObject(json, "colType", colType);
- if (field->type == TSDB_DATA_TYPE_BINARY || field->type == TSDB_DATA_TYPE_VARBINARY || field->type == TSDB_DATA_TYPE_GEOMETRY) {
+ if (field->type == TSDB_DATA_TYPE_BINARY || field->type == TSDB_DATA_TYPE_VARBINARY ||
+ field->type == TSDB_DATA_TYPE_GEOMETRY) {
int32_t length = field->bytes - VARSTR_HEADER_SIZE;
cJSON* cbytes = cJSON_CreateNumber(length);
cJSON_AddItemToObject(json, "colLength", cbytes);
@@ -182,7 +183,7 @@ static char* buildAlterSTableJson(void* alterData, int32_t alterDataLen) {
}
string = cJSON_PrintUnformatted(json);
- end:
+end:
cJSON_Delete(json);
tFreeSMAltertbReq(&req);
return string;
@@ -295,9 +296,9 @@ static void buildChildElement(cJSON* json, SVCreateTbReq* pCreateReq) {
cJSON* tvalue = NULL;
if (IS_VAR_DATA_TYPE(pTagVal->type)) {
char* buf = NULL;
- if(pTagVal->type == TSDB_DATA_TYPE_VARBINARY){
- buf = taosMemoryCalloc(pTagVal->nData*2 + 2 + 3, 1);
- }else{
+ if (pTagVal->type == TSDB_DATA_TYPE_VARBINARY) {
+ buf = taosMemoryCalloc(pTagVal->nData * 2 + 2 + 3, 1);
+ } else {
buf = taosMemoryCalloc(pTagVal->nData + 3, 1);
}
@@ -315,7 +316,7 @@ static void buildChildElement(cJSON* json, SVCreateTbReq* pCreateReq) {
cJSON_AddItemToArray(tags, tag);
}
- end:
+end:
cJSON_AddItemToObject(json, "tags", tags);
taosArrayDestroy(pTagVals);
}
@@ -469,7 +470,8 @@ static char* processAlterTable(SMqMetaRsp* metaRsp) {
cJSON* colType = cJSON_CreateNumber(vAlterTbReq.type);
cJSON_AddItemToObject(json, "colType", colType);
- if (vAlterTbReq.type == TSDB_DATA_TYPE_BINARY || vAlterTbReq.type == TSDB_DATA_TYPE_VARBINARY || vAlterTbReq.type == TSDB_DATA_TYPE_GEOMETRY) {
+ if (vAlterTbReq.type == TSDB_DATA_TYPE_BINARY || vAlterTbReq.type == TSDB_DATA_TYPE_VARBINARY ||
+ vAlterTbReq.type == TSDB_DATA_TYPE_GEOMETRY) {
int32_t length = vAlterTbReq.bytes - VARSTR_HEADER_SIZE;
cJSON* cbytes = cJSON_CreateNumber(length);
cJSON_AddItemToObject(json, "colLength", cbytes);
@@ -490,7 +492,8 @@ static char* processAlterTable(SMqMetaRsp* metaRsp) {
cJSON_AddItemToObject(json, "colName", colName);
cJSON* colType = cJSON_CreateNumber(vAlterTbReq.colModType);
cJSON_AddItemToObject(json, "colType", colType);
- if (vAlterTbReq.colModType == TSDB_DATA_TYPE_BINARY || vAlterTbReq.colModType == TSDB_DATA_TYPE_VARBINARY || vAlterTbReq.colModType == TSDB_DATA_TYPE_GEOMETRY) {
+ if (vAlterTbReq.colModType == TSDB_DATA_TYPE_BINARY || vAlterTbReq.colModType == TSDB_DATA_TYPE_VARBINARY ||
+ vAlterTbReq.colModType == TSDB_DATA_TYPE_GEOMETRY) {
int32_t length = vAlterTbReq.colModBytes - VARSTR_HEADER_SIZE;
cJSON* cbytes = cJSON_CreateNumber(length);
cJSON_AddItemToObject(json, "colLength", cbytes);
@@ -527,9 +530,9 @@ static char* processAlterTable(SMqMetaRsp* metaRsp) {
}
buf = parseTagDatatoJson(vAlterTbReq.pTagVal);
} else {
- if(vAlterTbReq.tagType == TSDB_DATA_TYPE_VARBINARY){
- buf = taosMemoryCalloc(vAlterTbReq.nTagVal*2 + 2 + 3, 1);
- }else{
+ if (vAlterTbReq.tagType == TSDB_DATA_TYPE_VARBINARY) {
+ buf = taosMemoryCalloc(vAlterTbReq.nTagVal * 2 + 2 + 3, 1);
+ } else {
buf = taosMemoryCalloc(vAlterTbReq.nTagVal + 3, 1);
}
dataConverToStr(buf, vAlterTbReq.tagType, vAlterTbReq.pTagVal, vAlterTbReq.nTagVal, NULL);
@@ -677,7 +680,7 @@ _exit:
}
static int32_t taosCreateStb(TAOS* taos, void* meta, int32_t metaLen) {
- if(taos == NULL || meta == NULL) {
+ if (taos == NULL || meta == NULL) {
terrno = TSDB_CODE_INVALID_PARA;
return terrno;
}
@@ -692,7 +695,7 @@ static int32_t taosCreateStb(TAOS* taos, void* meta, int32_t metaLen) {
terrno = code;
return code;
}
- uDebug(LOG_ID_TAG" create stable, meta:%p, metaLen:%d", LOG_ID_VALUE, meta, metaLen);
+ uDebug(LOG_ID_TAG " create stable, meta:%p, metaLen:%d", LOG_ID_VALUE, meta, metaLen);
pRequest->syncQuery = true;
if (!pRequest->pDb) {
code = TSDB_CODE_PAR_DB_NOT_SPECIFIED;
@@ -731,8 +734,8 @@ static int32_t taosCreateStb(TAOS* taos, void* meta, int32_t metaLen) {
pReq.source = TD_REQ_FROM_TAOX;
pReq.igExists = true;
- uDebug(LOG_ID_TAG" create stable name:%s suid:%" PRId64 " processSuid:%" PRId64,
- LOG_ID_VALUE, req.name, req.suid, pReq.suid);
+ uDebug(LOG_ID_TAG " create stable name:%s suid:%" PRId64 " processSuid:%" PRId64, LOG_ID_VALUE, req.name, req.suid,
+ pReq.suid);
STscObj* pTscObj = pRequest->pTscObj;
SName tableName;
tNameExtractFullName(toName(pTscObj->acctId, pRequest->pDb, req.name, &tableName), pReq.name);
@@ -766,7 +769,7 @@ static int32_t taosCreateStb(TAOS* taos, void* meta, int32_t metaLen) {
taosMemoryFree(pCmdMsg.pMsg);
end:
- uDebug(LOG_ID_TAG" create stable return, msg:%s", LOG_ID_VALUE, tstrerror(code));
+ uDebug(LOG_ID_TAG " create stable return, msg:%s", LOG_ID_VALUE, tstrerror(code));
destroyRequest(pRequest);
tFreeSMCreateStbReq(&pReq);
tDecoderClear(&coder);
@@ -775,7 +778,7 @@ end:
}
static int32_t taosDropStb(TAOS* taos, void* meta, int32_t metaLen) {
- if(taos == NULL || meta == NULL) {
+ if (taos == NULL || meta == NULL) {
terrno = TSDB_CODE_INVALID_PARA;
return terrno;
}
@@ -791,7 +794,7 @@ static int32_t taosDropStb(TAOS* taos, void* meta, int32_t metaLen) {
return code;
}
- uDebug(LOG_ID_TAG" drop stable, meta:%p, metaLen:%d", LOG_ID_VALUE, meta, metaLen);
+ uDebug(LOG_ID_TAG " drop stable, meta:%p, metaLen:%d", LOG_ID_VALUE, meta, metaLen);
pRequest->syncQuery = true;
if (!pRequest->pDb) {
code = TSDB_CODE_PAR_DB_NOT_SPECIFIED;
@@ -812,9 +815,9 @@ static int32_t taosDropStb(TAOS* taos, void* meta, int32_t metaLen) {
goto end;
}
SRequestConnInfo conn = {.pTrans = pRequest->pTscObj->pAppInfo->pTransporter,
- .requestId = pRequest->requestId,
- .requestObjRefId = pRequest->self,
- .mgmtEps = getEpSet_s(&pRequest->pTscObj->pAppInfo->mgmtEp)};
+ .requestId = pRequest->requestId,
+ .requestObjRefId = pRequest->self,
+ .mgmtEps = getEpSet_s(&pRequest->pTscObj->pAppInfo->mgmtEp)};
SName pName = {0};
toName(pRequest->pTscObj->acctId, pRequest->pDb, req.name, &pName);
STableMeta* pTableMeta = NULL;
@@ -835,8 +838,8 @@ static int32_t taosDropStb(TAOS* taos, void* meta, int32_t metaLen) {
pReq.source = TD_REQ_FROM_TAOX;
// pReq.suid = processSuid(req.suid, pRequest->pDb);
- uDebug(LOG_ID_TAG" drop stable name:%s suid:%" PRId64 " new suid:%" PRId64,
- LOG_ID_VALUE, req.name, req.suid, pReq.suid);
+ uDebug(LOG_ID_TAG " drop stable name:%s suid:%" PRId64 " new suid:%" PRId64, LOG_ID_VALUE, req.name, req.suid,
+ pReq.suid);
STscObj* pTscObj = pRequest->pTscObj;
SName tableName = {0};
tNameExtractFullName(toName(pTscObj->acctId, pRequest->pDb, req.name, &tableName), pReq.name);
@@ -870,7 +873,7 @@ static int32_t taosDropStb(TAOS* taos, void* meta, int32_t metaLen) {
taosMemoryFree(pCmdMsg.pMsg);
end:
- uDebug(LOG_ID_TAG" drop stable return, msg:%s", LOG_ID_VALUE, tstrerror(code));
+ uDebug(LOG_ID_TAG " drop stable return, msg:%s", LOG_ID_VALUE, tstrerror(code));
destroyRequest(pRequest);
tDecoderClear(&coder);
terrno = code;
@@ -889,7 +892,7 @@ static void destroyCreateTbReqBatch(void* data) {
}
static int32_t taosCreateTable(TAOS* taos, void* meta, int32_t metaLen) {
- if(taos == NULL || meta == NULL) {
+ if (taos == NULL || meta == NULL) {
terrno = TSDB_CODE_INVALID_PARA;
return terrno;
}
@@ -939,9 +942,9 @@ static int32_t taosCreateTable(TAOS* taos, void* meta, int32_t metaLen) {
taosHashSetFreeFp(pVgroupHashmap, destroyCreateTbReqBatch);
SRequestConnInfo conn = {.pTrans = pTscObj->pAppInfo->pTransporter,
- .requestId = pRequest->requestId,
- .requestObjRefId = pRequest->self,
- .mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp)};
+ .requestId = pRequest->requestId,
+ .requestObjRefId = pRequest->self,
+ .mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp)};
pRequest->tableList = taosArrayInit(req.nReqs, sizeof(SName));
// loop to create table
@@ -1033,7 +1036,7 @@ static int32_t taosCreateTable(TAOS* taos, void* meta, int32_t metaLen) {
code = pRequest->code;
end:
- uDebug(LOG_ID_TAG" create table return, msg:%s", LOG_ID_VALUE, tstrerror(code));
+ uDebug(LOG_ID_TAG " create table return, msg:%s", LOG_ID_VALUE, tstrerror(code));
for (int32_t iReq = 0; iReq < req.nReqs; iReq++) {
pCreateReq = req.pReqs + iReq;
taosMemoryFreeClear(pCreateReq->comment);
@@ -1062,7 +1065,7 @@ static void destroyDropTbReqBatch(void* data) {
}
static int32_t taosDropTable(TAOS* taos, void* meta, int32_t metaLen) {
- if(taos == NULL || meta == NULL) {
+ if (taos == NULL || meta == NULL) {
terrno = TSDB_CODE_INVALID_PARA;
return terrno;
}
@@ -1111,9 +1114,9 @@ static int32_t taosDropTable(TAOS* taos, void* meta, int32_t metaLen) {
taosHashSetFreeFp(pVgroupHashmap, destroyDropTbReqBatch);
SRequestConnInfo conn = {.pTrans = pTscObj->pAppInfo->pTransporter,
- .requestId = pRequest->requestId,
- .requestObjRefId = pRequest->self,
- .mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp)};
+ .requestId = pRequest->requestId,
+ .requestObjRefId = pRequest->self,
+ .mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp)};
pRequest->tableList = taosArrayInit(req.nReqs, sizeof(SName));
// loop to create table
for (int32_t iReq = 0; iReq < req.nReqs; iReq++) {
@@ -1142,7 +1145,8 @@ static int32_t taosDropTable(TAOS* taos, void* meta, int32_t metaLen) {
tb_uid_t oldSuid = pDropReq->suid;
pDropReq->suid = pTableMeta->suid;
taosMemoryFreeClear(pTableMeta);
- uDebug(LOG_ID_TAG" drop table name:%s suid:%" PRId64 " new suid:%" PRId64, LOG_ID_VALUE, pDropReq->name, oldSuid, pDropReq->suid);
+ uDebug(LOG_ID_TAG " drop table name:%s suid:%" PRId64 " new suid:%" PRId64, LOG_ID_VALUE, pDropReq->name, oldSuid,
+ pDropReq->suid);
taosArrayPush(pRequest->tableList, &pName);
SVgroupDropTableBatch* pTableBatch = taosHashGet(pVgroupHashmap, &pInfo.vgId, sizeof(pInfo.vgId));
@@ -1185,7 +1189,7 @@ static int32_t taosDropTable(TAOS* taos, void* meta, int32_t metaLen) {
code = pRequest->code;
end:
- uDebug(LOG_ID_TAG" drop table return, msg:%s", LOG_ID_VALUE, tstrerror(code));
+ uDebug(LOG_ID_TAG " drop table return, msg:%s", LOG_ID_VALUE, tstrerror(code));
taosHashCleanup(pVgroupHashmap);
destroyRequest(pRequest);
tDecoderClear(&coder);
@@ -1227,16 +1231,16 @@ end:
//}
static int32_t taosDeleteData(TAOS* taos, void* meta, int32_t metaLen) {
- if(taos == NULL || meta == NULL) {
+ if (taos == NULL || meta == NULL) {
terrno = TSDB_CODE_INVALID_PARA;
return terrno;
}
- SDeleteRes req = {0};
- SDecoder coder = {0};
+ SDeleteRes req = {0};
+ SDecoder coder = {0};
char sql[256] = {0};
int32_t code = TSDB_CODE_SUCCESS;
- uDebug("connId:0x%"PRIx64" delete data, meta:%p, len:%d", *(int64_t*)taos, meta, metaLen);
+ uDebug("connId:0x%" PRIx64 " delete data, meta:%p, len:%d", *(int64_t*)taos, meta, metaLen);
// decode and process req
void* data = POINTER_SHIFT(meta, sizeof(SMsgHead));
@@ -1260,14 +1264,14 @@ static int32_t taosDeleteData(TAOS* taos, void* meta, int32_t metaLen) {
taos_free_result(res);
end:
- uDebug("connId:0x%"PRIx64" delete data sql:%s, code:%s", *(int64_t*)taos, sql, tstrerror(code));
+ uDebug("connId:0x%" PRIx64 " delete data sql:%s, code:%s", *(int64_t*)taos, sql, tstrerror(code));
tDecoderClear(&coder);
terrno = code;
return code;
}
static int32_t taosAlterTable(TAOS* taos, void* meta, int32_t metaLen) {
- if(taos == NULL || meta == NULL) {
+ if (taos == NULL || meta == NULL) {
terrno = TSDB_CODE_INVALID_PARA;
return terrno;
}
@@ -1312,9 +1316,9 @@ static int32_t taosAlterTable(TAOS* taos, void* meta, int32_t metaLen) {
}
SRequestConnInfo conn = {.pTrans = pTscObj->pAppInfo->pTransporter,
- .requestId = pRequest->requestId,
- .requestObjRefId = pRequest->self,
- .mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp)};
+ .requestId = pRequest->requestId,
+ .requestObjRefId = pRequest->self,
+ .mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp)};
SVgroupInfo pInfo = {0};
SName pName = {0};
@@ -1394,8 +1398,8 @@ int taos_write_raw_block_with_fields(TAOS* taos, int rows, char* pData, const ch
return taos_write_raw_block_with_fields_with_reqid(taos, rows, pData, tbname, fields, numFields, 0);
}
-int taos_write_raw_block_with_fields_with_reqid(TAOS *taos, int rows, char *pData, const char *tbname,
- TAOS_FIELD *fields, int numFields, int64_t reqid){
+int taos_write_raw_block_with_fields_with_reqid(TAOS* taos, int rows, char* pData, const char* tbname,
+ TAOS_FIELD* fields, int numFields, int64_t reqid) {
if (!taos || !pData || !tbname) {
terrno = TSDB_CODE_INVALID_PARA;
return terrno;
@@ -1410,8 +1414,8 @@ int taos_write_raw_block_with_fields_with_reqid(TAOS *taos, int rows, char *pDat
return terrno;
}
- uDebug(LOG_ID_TAG " write raw block with field, rows:%d, pData:%p, tbname:%s, fields:%p, numFields:%d",
- LOG_ID_VALUE, rows, pData, tbname, fields, numFields);
+ uDebug(LOG_ID_TAG " write raw block with field, rows:%d, pData:%p, tbname:%s, fields:%p, numFields:%d", LOG_ID_VALUE,
+ rows, pData, tbname, fields, numFields);
pRequest->syncQuery = true;
if (!pRequest->pDb) {
@@ -1562,12 +1566,12 @@ end:
return code;
}
-static void* getRawDataFromRes(void *pRetrieve){
+static void* getRawDataFromRes(void* pRetrieve) {
void* rawData = NULL;
// deal with compatibility
- if(*(int64_t*)pRetrieve == 0){
+ if (*(int64_t*)pRetrieve == 0) {
rawData = ((SRetrieveTableRsp*)pRetrieve)->data;
- }else if(*(int64_t*)pRetrieve == 1){
+ } else if (*(int64_t*)pRetrieve == 1) {
rawData = ((SRetrieveTableRspForTmq*)pRetrieve)->data;
}
ASSERT(rawData != NULL);
@@ -1575,7 +1579,7 @@ static void* getRawDataFromRes(void *pRetrieve){
}
static int32_t tmqWriteRawDataImpl(TAOS* taos, void* data, int32_t dataLen) {
- if(taos == NULL || data == NULL){
+ if (taos == NULL || data == NULL) {
terrno = TSDB_CODE_INVALID_PARA;
return terrno;
}
@@ -1644,11 +1648,11 @@ static int32_t tmqWriteRawDataImpl(TAOS* taos, void* data, int32_t dataLen) {
strcpy(pName.tname, tbName);
code = catalogGetTableMeta(pCatalog, &conn, &pName, &pTableMeta);
-// if (code == TSDB_CODE_PAR_TABLE_NOT_EXIST) {
-// uError("WriteRaw:catalogGetTableMeta table not exist. table name: %s", tbName);
-// code = TSDB_CODE_SUCCESS;
-// continue;
-// }
+ // if (code == TSDB_CODE_PAR_TABLE_NOT_EXIST) {
+ // uError("WriteRaw:catalogGetTableMeta table not exist. table name: %s", tbName);
+ // code = TSDB_CODE_SUCCESS;
+ // continue;
+ // }
if (code != TSDB_CODE_SUCCESS) {
goto end;
}
@@ -1704,7 +1708,7 @@ end:
}
static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen) {
- if(taos == NULL || data == NULL){
+ if (taos == NULL || data == NULL) {
terrno = TSDB_CODE_INVALID_PARA;
return terrno;
}
@@ -1757,7 +1761,7 @@ static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen)
}
pVgHash = taosHashInit(16, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_NO_LOCK);
- uDebug(LOG_ID_TAG" write raw metadata block num:%d", LOG_ID_VALUE, rspObj.rsp.blockNum);
+ uDebug(LOG_ID_TAG " write raw metadata block num:%d", LOG_ID_VALUE, rspObj.rsp.blockNum);
while (++rspObj.resIter < rspObj.rsp.blockNum) {
void* pRetrieve = taosArrayGetP(rspObj.rsp.blockData, rspObj.resIter);
if (!rspObj.rsp.withSchema) {
@@ -1770,7 +1774,7 @@ static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen)
goto end;
}
- uDebug(LOG_ID_TAG" write raw metadata block tbname:%s", LOG_ID_VALUE, tbName);
+ uDebug(LOG_ID_TAG " write raw metadata block tbname:%s", LOG_ID_VALUE, tbName);
SName pName = {TSDB_TABLE_NAME_T, pRequest->pTscObj->acctId, {0}, {0}};
strcpy(pName.dbname, pRequest->pDb);
strcpy(pName.tname, tbName);
@@ -1817,11 +1821,11 @@ static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen)
strcpy(pName.tname, pCreateReqDst->ctb.stbName);
}
code = catalogGetTableMeta(pCatalog, &conn, &pName, &pTableMeta);
-// if (code == TSDB_CODE_PAR_TABLE_NOT_EXIST) {
-// uError("WriteRaw:catalogGetTableMeta table not exist. table name: %s", tbName);
-// code = TSDB_CODE_SUCCESS;
-// continue;
-// }
+ // if (code == TSDB_CODE_PAR_TABLE_NOT_EXIST) {
+ // uError("WriteRaw:catalogGetTableMeta table not exist. table name: %s", tbName);
+ // code = TSDB_CODE_SUCCESS;
+ // continue;
+ // }
if (code != TSDB_CODE_SUCCESS) {
goto end;
}
diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c
index 3c3aee3032..1904874a0b 100644
--- a/source/client/src/clientTmq.c
+++ b/source/client/src/clientTmq.c
@@ -26,7 +26,7 @@
#define EMPTY_BLOCK_POLL_IDLE_DURATION 10
#define DEFAULT_AUTO_COMMIT_INTERVAL 5000
-#define DEFAULT_HEARTBEAT_INTERVAL 3000
+#define DEFAULT_HEARTBEAT_INTERVAL 3000
struct SMqMgmt {
int8_t inited;
@@ -63,7 +63,7 @@ struct tmq_conf_t {
int8_t withTbName;
int8_t snapEnable;
int8_t replayEnable;
- int8_t sourceExcluded; // do not consume, bit
+ int8_t sourceExcluded; // do not consume, bit
uint16_t port;
int32_t autoCommitInterval;
char* ip;
@@ -83,15 +83,15 @@ struct tmq_t {
int32_t autoCommitInterval;
int8_t resetOffsetCfg;
int8_t replayEnable;
- int8_t sourceExcluded; // do not consume, bit
+ int8_t sourceExcluded; // do not consume, bit
uint64_t consumerId;
tmq_commit_cb* commitCb;
void* commitCbUserParam;
// status
- SRWLatch lock;
- int8_t status;
- int32_t epoch;
+ SRWLatch lock;
+ int8_t status;
+ int32_t epoch;
// poll info
int64_t pollCnt;
int64_t totalRows;
@@ -132,8 +132,8 @@ enum {
typedef struct SVgOffsetInfo {
STqOffsetVal committedOffset;
- STqOffsetVal endOffset; // the last version in TAOS_RES + 1
- STqOffsetVal beginOffset; // the first version in TAOS_RES
+ STqOffsetVal endOffset; // the last version in TAOS_RES + 1
+ STqOffsetVal beginOffset; // the first version in TAOS_RES
int64_t walVerBegin;
int64_t walVerEnd;
} SVgOffsetInfo;
@@ -144,11 +144,11 @@ typedef struct {
SVgOffsetInfo offsetInfo;
int32_t vgId;
int32_t vgStatus;
- int32_t vgSkipCnt; // here used to mark the slow vgroups
- int64_t emptyBlockReceiveTs; // once empty block is received, idle for ignoreCnt then start to poll data
- int64_t blockReceiveTs; // once empty block is received, idle for ignoreCnt then start to poll data
- int64_t blockSleepForReplay; // once empty block is received, idle for ignoreCnt then start to poll data
- bool seekUpdated; // offset is updated by seek operator, therefore, not update by vnode rsp.
+ int32_t vgSkipCnt; // here used to mark the slow vgroups
+ int64_t emptyBlockReceiveTs; // once empty block is received, idle for ignoreCnt then start to poll data
+ int64_t blockReceiveTs; // once empty block is received, idle for ignoreCnt then start to poll data
+ int64_t blockSleepForReplay; // once empty block is received, idle for ignoreCnt then start to poll data
+ bool seekUpdated; // offset is updated by seek operator, therefore, not update by vnode rsp.
SEpSet epSet;
} SMqClientVg;
@@ -178,23 +178,23 @@ typedef struct {
} SMqPollRspWrapper;
typedef struct {
-// int64_t refId;
-// int32_t epoch;
+ // int64_t refId;
+ // int32_t epoch;
tsem_t rspSem;
int32_t rspErr;
} SMqSubscribeCbParam;
typedef struct {
- int64_t refId;
- bool sync;
- void* pParam;
+ int64_t refId;
+ bool sync;
+ void* pParam;
} SMqAskEpCbParam;
typedef struct {
- int64_t refId;
- char topicName[TSDB_TOPIC_FNAME_LEN];
- int32_t vgId;
- uint64_t requestId; // request id for debug purpose
+ int64_t refId;
+ char topicName[TSDB_TOPIC_FNAME_LEN];
+ int32_t vgId;
+ uint64_t requestId; // request id for debug purpose
} SMqPollCbParam;
typedef struct SMqVgCommon {
@@ -208,14 +208,14 @@ typedef struct SMqVgCommon {
} SMqVgCommon;
typedef struct SMqSeekParam {
- tsem_t sem;
- int32_t code;
+ tsem_t sem;
+ int32_t code;
} SMqSeekParam;
typedef struct SMqCommittedParam {
- tsem_t sem;
- int32_t code;
- SMqVgOffset vgOffset;
+ tsem_t sem;
+ int32_t code;
+ SMqVgOffset vgOffset;
} SMqCommittedParam;
typedef struct SMqVgWalInfoParam {
@@ -238,10 +238,10 @@ typedef struct {
typedef struct {
SMqCommitCbParamSet* params;
-// SMqVgOffset* pOffset;
- char topicName[TSDB_TOPIC_FNAME_LEN];
- int32_t vgId;
- tmq_t* pTmq;
+ // SMqVgOffset* pOffset;
+ char topicName[TSDB_TOPIC_FNAME_LEN];
+ int32_t vgId;
+ tmq_t* pTmq;
} SMqCommitCbParam;
typedef struct SSyncCommitInfo {
@@ -252,7 +252,8 @@ typedef struct SSyncCommitInfo {
static int32_t syncAskEp(tmq_t* tmq);
static int32_t makeTopicVgroupKey(char* dst, const char* topicName, int32_t vg);
static int32_t tmqCommitDone(SMqCommitCbParamSet* pParamSet);
-static int32_t doSendCommitMsg(tmq_t* tmq, int32_t vgId, SEpSet* epSet, STqOffsetVal* offset, const char* pTopicName, SMqCommitCbParamSet* pParamSet);
+static int32_t doSendCommitMsg(tmq_t* tmq, int32_t vgId, SEpSet* epSet, STqOffsetVal* offset, const char* pTopicName,
+ SMqCommitCbParamSet* pParamSet);
static void commitRspCountDown(SMqCommitCbParamSet* pParamSet, int64_t consumerId, const char* pTopic, int32_t vgId);
static void askEp(tmq_t* pTmq, void* param, bool sync, bool updateEpset);
@@ -287,7 +288,7 @@ void tmq_conf_destroy(tmq_conf_t* conf) {
}
tmq_conf_res_t tmq_conf_set(tmq_conf_t* conf, const char* key, const char* value) {
- if (conf == NULL || key == NULL || value == NULL){
+ if (conf == NULL || key == NULL || value == NULL) {
return TMQ_CONF_INVALID;
}
if (strcasecmp(key, "group.id") == 0) {
@@ -402,7 +403,7 @@ tmq_conf_res_t tmq_conf_set(tmq_conf_t* conf, const char* key, const char* value
tmq_list_t* tmq_list_new() { return (tmq_list_t*)taosArrayInit(0, sizeof(void*)); }
int32_t tmq_list_append(tmq_list_t* list, const char* src) {
- if(list == NULL) return -1;
+ if (list == NULL) return -1;
SArray* container = &list->container;
if (src == NULL || src[0] == 0) return -1;
char* topic = taosStrdup(src);
@@ -411,19 +412,19 @@ int32_t tmq_list_append(tmq_list_t* list, const char* src) {
}
void tmq_list_destroy(tmq_list_t* list) {
- if(list == NULL) return;
+ if (list == NULL) return;
SArray* container = &list->container;
taosArrayDestroyP(container, taosMemoryFree);
}
int32_t tmq_list_get_size(const tmq_list_t* list) {
- if(list == NULL) return -1;
+ if (list == NULL) return -1;
const SArray* container = &list->container;
return taosArrayGetSize(container);
}
char** tmq_list_to_c_array(const tmq_list_t* list) {
- if(list == NULL) return NULL;
+ if (list == NULL) return NULL;
const SArray* container = &list->container;
return container->pData;
}
@@ -439,7 +440,8 @@ static int32_t tmqCommitCb(void* param, SDataBuf* pBuf, int32_t code) {
return 0;
}
-static int32_t doSendCommitMsg(tmq_t* tmq, int32_t vgId, SEpSet* epSet, STqOffsetVal* offset, const char* pTopicName, SMqCommitCbParamSet* pParamSet) {
+static int32_t doSendCommitMsg(tmq_t* tmq, int32_t vgId, SEpSet* epSet, STqOffsetVal* offset, const char* pTopicName,
+ SMqCommitCbParamSet* pParamSet) {
SMqVgOffset pOffset = {0};
pOffset.consumerId = tmq->consumerId;
@@ -479,7 +481,7 @@ static int32_t doSendCommitMsg(tmq_t* tmq, int32_t vgId, SEpSet* epSet, STqOffse
}
pParam->params = pParamSet;
-// pParam->pOffset = pOffset;
+ // pParam->pOffset = pOffset;
pParam->vgId = vgId;
pParam->pTmq = tmq;
@@ -493,7 +495,7 @@ static int32_t doSendCommitMsg(tmq_t* tmq, int32_t vgId, SEpSet* epSet, STqOffse
return TSDB_CODE_OUT_OF_MEMORY;
}
- pMsgSendInfo->msgInfo = (SDataBuf) { .pData = buf, .len = sizeof(SMsgHead) + len, .handle = NULL };
+ pMsgSendInfo->msgInfo = (SDataBuf){.pData = buf, .len = sizeof(SMsgHead) + len, .handle = NULL};
pMsgSendInfo->requestId = generateRequestId();
pMsgSendInfo->requestObjRefId = 0;
@@ -505,7 +507,7 @@ static int32_t doSendCommitMsg(tmq_t* tmq, int32_t vgId, SEpSet* epSet, STqOffse
int64_t transporterId = 0;
atomic_add_fetch_32(&pParamSet->waitingRspNum, 1);
code = asyncSendMsgToServer(tmq->pTscObj->pAppInfo->pTransporter, epSet, &transporterId, pMsgSendInfo);
- if(code != 0){
+ if (code != 0) {
atomic_sub_fetch_32(&pParamSet->waitingRspNum, 1);
return code;
}
@@ -527,7 +529,8 @@ static SMqClientTopic* getTopicByName(tmq_t* tmq, const char* pTopicName) {
return NULL;
}
-static SMqCommitCbParamSet* prepareCommitCbParamSet(tmq_t* tmq, tmq_commit_cb* pCommitFp, void* userParam, int32_t rspNum){
+static SMqCommitCbParamSet* prepareCommitCbParamSet(tmq_t* tmq, tmq_commit_cb* pCommitFp, void* userParam,
+ int32_t rspNum) {
SMqCommitCbParamSet* pParamSet = taosMemoryCalloc(1, sizeof(SMqCommitCbParamSet));
if (pParamSet == NULL) {
return NULL;
@@ -542,14 +545,14 @@ static SMqCommitCbParamSet* prepareCommitCbParamSet(tmq_t* tmq, tmq_commit_cb* p
return pParamSet;
}
-static int32_t getClientVg(tmq_t* tmq, char* pTopicName, int32_t vgId, SMqClientVg** pVg){
+static int32_t getClientVg(tmq_t* tmq, char* pTopicName, int32_t vgId, SMqClientVg** pVg) {
SMqClientTopic* pTopic = getTopicByName(tmq, pTopicName);
if (pTopic == NULL) {
tscError("consumer:0x%" PRIx64 " invalid topic name:%s", tmq->consumerId, pTopicName);
return TSDB_CODE_TMQ_INVALID_TOPIC;
}
- int32_t numOfVgs = taosArrayGetSize(pTopic->vgs);
+ int32_t numOfVgs = taosArrayGetSize(pTopic->vgs);
for (int32_t i = 0; i < numOfVgs; ++i) {
SMqClientVg* pClientVg = taosArrayGet(pTopic->vgs, i);
if (pClientVg->vgId == vgId) {
@@ -561,19 +564,20 @@ static int32_t getClientVg(tmq_t* tmq, char* pTopicName, int32_t vgId, SMqClient
return *pVg == NULL ? TSDB_CODE_TMQ_INVALID_VGID : TSDB_CODE_SUCCESS;
}
-static int32_t asyncCommitOffset(tmq_t* tmq, char* pTopicName, int32_t vgId, STqOffsetVal* offsetVal, tmq_commit_cb* pCommitFp, void* userParam) {
+static int32_t asyncCommitOffset(tmq_t* tmq, char* pTopicName, int32_t vgId, STqOffsetVal* offsetVal,
+ tmq_commit_cb* pCommitFp, void* userParam) {
tscInfo("consumer:0x%" PRIx64 " do manual commit offset for %s, vgId:%d", tmq->consumerId, pTopicName, vgId);
taosRLockLatch(&tmq->lock);
SMqClientVg* pVg = NULL;
- int32_t code = getClientVg(tmq, pTopicName, vgId, &pVg);
- if(code != 0){
+ int32_t code = getClientVg(tmq, pTopicName, vgId, &pVg);
+ if (code != 0) {
goto end;
}
if (offsetVal->type <= 0) {
code = TSDB_CODE_TMQ_INVALID_MSG;
goto end;
}
- if (tOffsetEqual(offsetVal, &pVg->offsetInfo.committedOffset)){
+ if (tOffsetEqual(offsetVal, &pVg->offsetInfo.committedOffset)) {
code = TSDB_CODE_TMQ_SAME_COMMITTED_VALUE;
goto end;
}
@@ -605,11 +609,11 @@ end:
return code;
}
-static void asyncCommitFromResult(tmq_t* tmq, const TAOS_RES* pRes, tmq_commit_cb* pCommitFp, void* userParam){
- char* pTopicName = NULL;
- int32_t vgId = 0;
+static void asyncCommitFromResult(tmq_t* tmq, const TAOS_RES* pRes, tmq_commit_cb* pCommitFp, void* userParam) {
+ char* pTopicName = NULL;
+ int32_t vgId = 0;
STqOffsetVal offsetVal = {0};
- int32_t code = 0;
+ int32_t code = 0;
if (pRes == NULL || tmq == NULL) {
code = TSDB_CODE_INVALID_PARA;
@@ -639,8 +643,8 @@ static void asyncCommitFromResult(tmq_t* tmq, const TAOS_RES* pRes, tmq_commit_c
code = asyncCommitOffset(tmq, pTopicName, vgId, &offsetVal, pCommitFp, userParam);
end:
- if(code != TSDB_CODE_SUCCESS && pCommitFp != NULL){
- if(code == TSDB_CODE_TMQ_SAME_COMMITTED_VALUE) code = TSDB_CODE_SUCCESS;
+ if (code != TSDB_CODE_SUCCESS && pCommitFp != NULL) {
+ if (code == TSDB_CODE_TMQ_SAME_COMMITTED_VALUE) code = TSDB_CODE_SUCCESS;
pCommitFp(tmq, code, userParam);
}
}
@@ -662,11 +666,13 @@ static void asyncCommitAllOffsets(tmq_t* tmq, tmq_commit_cb* pCommitFp, void* us
SMqClientTopic* pTopic = taosArrayGet(tmq->clientTopics, i);
int32_t numOfVgroups = taosArrayGetSize(pTopic->vgs);
- tscInfo("consumer:0x%" PRIx64 " commit offset for topics:%s, numOfVgs:%d", tmq->consumerId, pTopic->topicName, numOfVgroups);
+ tscInfo("consumer:0x%" PRIx64 " commit offset for topics:%s, numOfVgs:%d", tmq->consumerId, pTopic->topicName,
+ numOfVgroups);
for (int32_t j = 0; j < numOfVgroups; j++) {
SMqClientVg* pVg = taosArrayGet(pTopic->vgs, j);
- if (pVg->offsetInfo.endOffset.type > 0 && !tOffsetEqual(&pVg->offsetInfo.endOffset, &pVg->offsetInfo.committedOffset)) {
+ if (pVg->offsetInfo.endOffset.type > 0 &&
+ !tOffsetEqual(&pVg->offsetInfo.endOffset, &pVg->offsetInfo.committedOffset)) {
char offsetBuf[TSDB_OFFSET_LEN] = {0};
tFormatOffset(offsetBuf, tListLen(offsetBuf), &pVg->offsetInfo.endOffset);
@@ -675,23 +681,27 @@ static void asyncCommitAllOffsets(tmq_t* tmq, tmq_commit_cb* pCommitFp, void* us
code = doSendCommitMsg(tmq, pVg->vgId, &pVg->epSet, &pVg->offsetInfo.endOffset, pTopic->topicName, pParamSet);
if (code != TSDB_CODE_SUCCESS) {
- tscError("consumer:0x%" PRIx64 " topic:%s on vgId:%d end commit msg failed, send offset:%s committed:%s, code:%s ordinal:%d/%d",
- tmq->consumerId, pTopic->topicName, pVg->vgId, offsetBuf, commitBuf, tstrerror(terrno), j + 1, numOfVgroups);
+ tscError("consumer:0x%" PRIx64
+ " topic:%s on vgId:%d end commit msg failed, send offset:%s committed:%s, code:%s ordinal:%d/%d",
+ tmq->consumerId, pTopic->topicName, pVg->vgId, offsetBuf, commitBuf, tstrerror(terrno), j + 1,
+ numOfVgroups);
continue;
}
- tscInfo("consumer:0x%" PRIx64 " topic:%s on vgId:%d send commit msg success, send offset:%s committed:%s, ordinal:%d/%d",
+ tscInfo("consumer:0x%" PRIx64
+ " topic:%s on vgId:%d send commit msg success, send offset:%s committed:%s, ordinal:%d/%d",
tmq->consumerId, pTopic->topicName, pVg->vgId, offsetBuf, commitBuf, j + 1, numOfVgroups);
pVg->offsetInfo.committedOffset = pVg->offsetInfo.endOffset;
} else {
tscInfo("consumer:0x%" PRIx64 " topic:%s vgId:%d, no commit, current:%" PRId64 ", ordinal:%d/%d",
- tmq->consumerId, pTopic->topicName, pVg->vgId, pVg->offsetInfo.endOffset.version, j + 1, numOfVgroups);
+ tmq->consumerId, pTopic->topicName, pVg->vgId, pVg->offsetInfo.endOffset.version, j + 1, numOfVgroups);
}
}
}
taosRUnLockLatch(&tmq->lock);
- tscInfo("consumer:0x%" PRIx64 " total commit:%d for %d topics", tmq->consumerId, pParamSet->waitingRspNum - 1, numOfTopics);
+ tscInfo("consumer:0x%" PRIx64 " total commit:%d for %d topics", tmq->consumerId, pParamSet->waitingRspNum - 1,
+ numOfTopics);
// request is sent
if (pParamSet->waitingRspNum != 1) {
@@ -702,7 +712,7 @@ static void asyncCommitAllOffsets(tmq_t* tmq, tmq_commit_cb* pCommitFp, void* us
end:
taosMemoryFree(pParamSet);
- if(pCommitFp != NULL) {
+ if (pCommitFp != NULL) {
pCommitFp(tmq, code, userParam);
}
return;
@@ -710,10 +720,10 @@ end:
static void generateTimedTask(int64_t refId, int32_t type) {
tmq_t* tmq = taosAcquireRef(tmqMgmt.rsetId, refId);
- if(tmq == NULL) return;
+ if (tmq == NULL) return;
int8_t* pTaskType = taosAllocateQitem(sizeof(int8_t), DEF_QITEM, 0);
- if(pTaskType == NULL) return;
+ if (pTaskType == NULL) return;
*pTaskType = type;
taosWriteQitem(tmq->delayedTask, pTaskType);
@@ -729,8 +739,8 @@ void tmqAssignAskEpTask(void* param, void* tmrId) {
void tmqReplayTask(void* param, void* tmrId) {
int64_t refId = *(int64_t*)param;
- tmq_t* tmq = taosAcquireRef(tmqMgmt.rsetId, refId);
- if(tmq == NULL) goto END;
+ tmq_t* tmq = taosAcquireRef(tmqMgmt.rsetId, refId);
+ if (tmq == NULL) goto END;
tsem_post(&tmq->rspSem);
taosReleaseRef(tmqMgmt.rsetId, refId);
@@ -753,13 +763,13 @@ int32_t tmqHbCb(void* param, SDataBuf* pMsg, int32_t code) {
tmq_t* tmq = taosAcquireRef(tmqMgmt.rsetId, refId);
if (tmq != NULL) {
taosWLockLatch(&tmq->lock);
- for(int32_t i = 0; i < taosArrayGetSize(rsp.topicPrivileges); i++){
+ for (int32_t i = 0; i < taosArrayGetSize(rsp.topicPrivileges); i++) {
STopicPrivilege* privilege = taosArrayGet(rsp.topicPrivileges, i);
- if(privilege->noPrivilege == 1){
+ if (privilege->noPrivilege == 1) {
int32_t topicNumCur = taosArrayGetSize(tmq->clientTopics);
for (int32_t j = 0; j < topicNumCur; j++) {
SMqClientTopic* pTopicCur = taosArrayGet(tmq->clientTopics, j);
- if(strcmp(pTopicCur->topicName, privilege->topic) == 0){
+ if (strcmp(pTopicCur->topicName, privilege->topic) == 0) {
tscInfo("consumer:0x%" PRIx64 ", has no privilege, topic:%s", tmq->consumerId, privilege->topic);
pTopicCur->noPrivilege = 1;
}
@@ -790,22 +800,22 @@ void tmqSendHbReq(void* param, void* tmrId) {
req.epoch = tmq->epoch;
taosRLockLatch(&tmq->lock);
req.topics = taosArrayInit(taosArrayGetSize(tmq->clientTopics), sizeof(TopicOffsetRows));
- for(int i = 0; i < taosArrayGetSize(tmq->clientTopics); i++){
- SMqClientTopic* pTopic = taosArrayGet(tmq->clientTopics, i);
- int32_t numOfVgroups = taosArrayGetSize(pTopic->vgs);
+ for (int i = 0; i < taosArrayGetSize(tmq->clientTopics); i++) {
+ SMqClientTopic* pTopic = taosArrayGet(tmq->clientTopics, i);
+ int32_t numOfVgroups = taosArrayGetSize(pTopic->vgs);
TopicOffsetRows* data = taosArrayReserve(req.topics, 1);
strcpy(data->topicName, pTopic->topicName);
data->offsetRows = taosArrayInit(numOfVgroups, sizeof(OffsetRows));
- for(int j = 0; j < numOfVgroups; j++){
+ for (int j = 0; j < numOfVgroups; j++) {
SMqClientVg* pVg = taosArrayGet(pTopic->vgs, j);
- OffsetRows* offRows = taosArrayReserve(data->offsetRows, 1);
+ OffsetRows* offRows = taosArrayReserve(data->offsetRows, 1);
offRows->vgId = pVg->vgId;
offRows->rows = pVg->numOfRows;
offRows->offset = pVg->offsetInfo.endOffset;
- offRows->ever = pVg->offsetInfo.walVerEnd;
+ offRows->ever = pVg->offsetInfo.walVerEnd;
char buf[TSDB_OFFSET_LEN] = {0};
tFormatOffset(buf, TSDB_OFFSET_LEN, &offRows->offset);
- tscInfo("consumer:0x%" PRIx64 ",report offset, group:%s vgId:%d, offset:%s/%"PRId64", rows:%"PRId64,
+ tscInfo("consumer:0x%" PRIx64 ",report offset, group:%s vgId:%d, offset:%s/%" PRId64 ", rows:%" PRId64,
tmq->consumerId, tmq->groupId, offRows->vgId, buf, offRows->ever, offRows->rows);
}
}
@@ -835,13 +845,13 @@ void tmqSendHbReq(void* param, void* tmrId) {
goto OVER;
}
- sendInfo->msgInfo = (SDataBuf){ .pData = pReq, .len = tlen, .handle = NULL };
+ sendInfo->msgInfo = (SDataBuf){.pData = pReq, .len = tlen, .handle = NULL};
sendInfo->requestId = generateRequestId();
sendInfo->requestObjRefId = 0;
sendInfo->paramFreeFp = taosMemoryFree;
sendInfo->param = taosMemoryMalloc(sizeof(int64_t));
- *(int64_t *)sendInfo->param = refId;
+ *(int64_t*)sendInfo->param = refId;
sendInfo->fp = tmqHbCb;
sendInfo->msgType = TDMT_MND_TMQ_HB;
@@ -972,7 +982,7 @@ int32_t tmqSubscribeCb(void* param, SDataBuf* pMsg, int32_t code) {
}
int32_t tmq_subscription(tmq_t* tmq, tmq_list_t** topics) {
- if(tmq == NULL) return TSDB_CODE_INVALID_PARA;
+ if (tmq == NULL) return TSDB_CODE_INVALID_PARA;
if (*topics == NULL) {
*topics = tmq_list_new();
}
@@ -986,7 +996,7 @@ int32_t tmq_subscription(tmq_t* tmq, tmq_list_t** topics) {
}
int32_t tmq_unsubscribe(tmq_t* tmq) {
- if(tmq == NULL) return TSDB_CODE_INVALID_PARA;
+ if (tmq == NULL) return TSDB_CODE_INVALID_PARA;
if (tmq->status != TMQ_CONSUMER_STATUS__READY) {
tscInfo("consumer:0x%" PRIx64 " not in ready state, unsubscribe it directly", tmq->consumerId);
return 0;
@@ -1060,9 +1070,10 @@ static void tmqMgmtInit(void) {
}
}
-#define SET_ERROR_MSG(MSG) if(errstr!=NULL)snprintf(errstr,errstrLen,MSG);
+#define SET_ERROR_MSG(MSG) \
+ if (errstr != NULL) snprintf(errstr, errstrLen, MSG);
tmq_t* tmq_consumer_new(tmq_conf_t* conf, char* errstr, int32_t errstrLen) {
- if(conf == NULL) {
+ if (conf == NULL) {
SET_ERROR_MSG("configure is null")
return NULL;
}
@@ -1114,7 +1125,7 @@ tmq_t* tmq_consumer_new(tmq_conf_t* conf, char* errstr, int32_t errstrLen) {
pTmq->resetOffsetCfg = conf->resetOffset;
pTmq->replayEnable = conf->replayEnable;
pTmq->sourceExcluded = conf->sourceExcluded;
- if(conf->replayEnable){
+ if (conf->replayEnable) {
pTmq->autoCommit = false;
}
taosInitRWLatch(&pTmq->lock);
@@ -1154,7 +1165,8 @@ tmq_t* tmq_consumer_new(tmq_conf_t* conf, char* errstr, int32_t errstrLen) {
tFormatOffset(buf, tListLen(buf), &offset);
tscInfo("consumer:0x%" PRIx64 " is setup, refId:%" PRId64
", groupId:%s, snapshot:%d, autoCommit:%d, commitInterval:%dms, offset:%s",
- pTmq->consumerId, pTmq->refId, pTmq->groupId, pTmq->useSnapshot, pTmq->autoCommit, pTmq->autoCommitInterval, buf);
+ pTmq->consumerId, pTmq->refId, pTmq->groupId, pTmq->useSnapshot, pTmq->autoCommit, pTmq->autoCommitInterval,
+ buf);
return pTmq;
@@ -1164,7 +1176,7 @@ _failed:
}
int32_t tmq_subscribe(tmq_t* tmq, const tmq_list_t* topic_list) {
- if(tmq == NULL || topic_list == NULL) return TSDB_CODE_INVALID_PARA;
+ if (tmq == NULL || topic_list == NULL) return TSDB_CODE_INVALID_PARA;
const int32_t MAX_RETRY_COUNT = 120 * 2; // let's wait for 2 mins at most
const SArray* container = &topic_list->container;
int32_t sz = taosArrayGetSize(container);
@@ -1224,7 +1236,7 @@ int32_t tmq_subscribe(tmq_t* tmq, const tmq_list_t* topic_list) {
goto FAIL;
}
- SMqSubscribeCbParam param = { .rspErr = 0};
+ SMqSubscribeCbParam param = {.rspErr = 0};
if (tsem_init(¶m.rspSem, 0, 0) != 0) {
code = TSDB_CODE_TSC_INTERNAL_ERROR;
goto FAIL;
@@ -1242,7 +1254,7 @@ int32_t tmq_subscribe(tmq_t* tmq, const tmq_list_t* topic_list) {
int64_t transporterId = 0;
code = asyncSendMsgToServer(tmq->pTscObj->pAppInfo->pTransporter, &epSet, &transporterId, sendInfo);
- if(code != 0){
+ if (code != 0) {
goto FAIL;
}
@@ -1293,20 +1305,20 @@ FAIL:
}
void tmq_conf_set_auto_commit_cb(tmq_conf_t* conf, tmq_commit_cb* cb, void* param) {
- if(conf == NULL) return;
+ if (conf == NULL) return;
conf->commitCb = cb;
conf->commitCbUserParam = param;
}
-static SMqClientVg* getVgInfo(tmq_t* tmq, char* topicName, int32_t vgId){
+static SMqClientVg* getVgInfo(tmq_t* tmq, char* topicName, int32_t vgId) {
int32_t topicNumCur = taosArrayGetSize(tmq->clientTopics);
- for(int i = 0; i < topicNumCur; i++){
+ for (int i = 0; i < topicNumCur; i++) {
SMqClientTopic* pTopicCur = taosArrayGet(tmq->clientTopics, i);
- if(strcmp(pTopicCur->topicName, topicName) == 0){
+ if (strcmp(pTopicCur->topicName, topicName) == 0) {
int32_t vgNumCur = taosArrayGetSize(pTopicCur->vgs);
for (int32_t j = 0; j < vgNumCur; j++) {
SMqClientVg* pVgCur = taosArrayGet(pTopicCur->vgs, j);
- if(pVgCur->vgId == vgId){
+ if (pVgCur->vgId == vgId) {
return pVgCur;
}
}
@@ -1315,21 +1327,21 @@ static SMqClientVg* getVgInfo(tmq_t* tmq, char* topicName, int32_t vgId){
return NULL;
}
-static SMqClientTopic* getTopicInfo(tmq_t* tmq, char* topicName){
+static SMqClientTopic* getTopicInfo(tmq_t* tmq, char* topicName) {
int32_t topicNumCur = taosArrayGetSize(tmq->clientTopics);
- for(int i = 0; i < topicNumCur; i++){
+ for (int i = 0; i < topicNumCur; i++) {
SMqClientTopic* pTopicCur = taosArrayGet(tmq->clientTopics, i);
- if(strcmp(pTopicCur->topicName, topicName) == 0){
+ if (strcmp(pTopicCur->topicName, topicName) == 0) {
return pTopicCur;
}
}
return NULL;
}
-static void setVgIdle(tmq_t* tmq, char* topicName, int32_t vgId){
+static void setVgIdle(tmq_t* tmq, char* topicName, int32_t vgId) {
taosWLockLatch(&tmq->lock);
SMqClientVg* pVg = getVgInfo(tmq, topicName, vgId);
- if(pVg){
+ if (pVg) {
atomic_store_32(&pVg->vgStatus, TMQ_VG_STATUS__IDLE);
}
taosWUnLockLatch(&tmq->lock);
@@ -1337,10 +1349,10 @@ static void setVgIdle(tmq_t* tmq, char* topicName, int32_t vgId){
int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) {
SMqPollCbParam* pParam = (SMqPollCbParam*)param;
- int64_t refId = pParam->refId;
- int32_t vgId = pParam->vgId;
- uint64_t requestId = pParam->requestId;
- tmq_t* tmq = taosAcquireRef(tmqMgmt.rsetId, refId);
+ int64_t refId = pParam->refId;
+ int32_t vgId = pParam->vgId;
+ uint64_t requestId = pParam->requestId;
+ tmq_t* tmq = taosAcquireRef(tmqMgmt.rsetId, refId);
if (tmq == NULL) {
code = TSDB_CODE_TMQ_CONSUMER_CLOSED;
goto FAIL;
@@ -1354,7 +1366,7 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) {
goto FAIL;
}
- if(code != 0){
+ if (code != 0) {
goto END;
}
@@ -1363,7 +1375,7 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) {
if (msgEpoch < clientEpoch) {
// do not write into queue since updating epoch reset
tscWarn("consumer:0x%" PRIx64
- " msg discard from vgId:%d since from earlier epoch, rsp epoch %d, current epoch %d, reqId:0x%" PRIx64,
+ " msg discard from vgId:%d since from earlier epoch, rsp epoch %d, current epoch %d, reqId:0x%" PRIx64,
tmq->consumerId, vgId, msgEpoch, clientEpoch, requestId);
code = -1;
goto END;
@@ -1416,10 +1428,10 @@ END:
taosReleaseRef(tmqMgmt.rsetId, refId);
FAIL:
- if(tmq) tsem_post(&tmq->rspSem);
+ if (tmq) tsem_post(&tmq->rspSem);
taosMemoryFree(pParam);
- if(pMsg) taosMemoryFreeClear(pMsg->pData);
- if(pMsg) taosMemoryFreeClear(pMsg->pEpSet);
+ if (pMsg) taosMemoryFreeClear(pMsg->pData);
+ if (pMsg) taosMemoryFreeClear(pMsg->pEpSet);
return code;
}
@@ -1456,7 +1468,8 @@ static void initClientTopicFromRsp(SMqClientTopic* pTopic, SMqSubTopicEp* pTopic
STqOffsetVal offsetNew = {0};
offsetNew.type = tmq->resetOffsetCfg;
- tscInfo("consumer:0x%" PRIx64 ", update topic:%s, new numOfVgs:%d, num:%d, port:%d", tmq->consumerId, pTopic->topicName, vgNumGet, pVgEp->epSet.numOfEps,pVgEp->epSet.eps[pVgEp->epSet.inUse].port);
+ tscInfo("consumer:0x%" PRIx64 ", update topic:%s, new numOfVgs:%d, num:%d, port:%d", tmq->consumerId,
+ pTopic->topicName, vgNumGet, pVgEp->epSet.numOfEps, pVgEp->epSet.eps[pVgEp->epSet.inUse].port);
SMqClientVg clientVg = {
.pollCnt = 0,
@@ -1495,9 +1508,9 @@ static bool doUpdateLocalEp(tmq_t* tmq, int32_t epoch, const SMqAskEpRsp* pRsp)
int32_t topicNumGet = taosArrayGetSize(pRsp->topics);
if (epoch < tmq->epoch || (epoch == tmq->epoch && topicNumGet == 0)) {
- tscInfo("consumer:0x%" PRIx64 " no update ep epoch from %d to epoch %d, incoming topics:%d",
- tmq->consumerId, tmq->epoch, epoch, topicNumGet);
- if(atomic_load_8(&tmq->status) == TMQ_CONSUMER_STATUS__RECOVER){
+ tscInfo("consumer:0x%" PRIx64 " no update ep epoch from %d to epoch %d, incoming topics:%d", tmq->consumerId,
+ tmq->epoch, epoch, topicNumGet);
+ if (atomic_load_8(&tmq->status) == TMQ_CONSUMER_STATUS__RECOVER) {
atomic_store_8(&tmq->status, TMQ_CONSUMER_STATUS__READY);
}
return false;
@@ -1533,10 +1546,12 @@ static bool doUpdateLocalEp(tmq_t* tmq, int32_t epoch, const SMqAskEpRsp* pRsp)
char buf[TSDB_OFFSET_LEN] = {0};
tFormatOffset(buf, TSDB_OFFSET_LEN, &pVgCur->offsetInfo.endOffset);
tscInfo("consumer:0x%" PRIx64 ", epoch:%d vgId:%d vgKey:%s, offset:%s", tmq->consumerId, epoch, pVgCur->vgId,
- vgKey, buf);
+ vgKey, buf);
- SVgroupSaveInfo info = {.currentOffset = pVgCur->offsetInfo.endOffset, .seekOffset = pVgCur->offsetInfo.beginOffset,
- .commitOffset = pVgCur->offsetInfo.committedOffset, .numOfRows = pVgCur->numOfRows,
+ SVgroupSaveInfo info = {.currentOffset = pVgCur->offsetInfo.endOffset,
+ .seekOffset = pVgCur->offsetInfo.beginOffset,
+ .commitOffset = pVgCur->offsetInfo.committedOffset,
+ .numOfRows = pVgCur->numOfRows,
.vgStatus = pVgCur->vgStatus};
taosHashPut(pVgOffsetHashMap, vgKey, strlen(vgKey), &info, sizeof(SVgroupSaveInfo));
}
@@ -1616,16 +1631,16 @@ SMqRspObj* tmqBuildRspFromWrapper(SMqPollRspWrapper* pWrapper, SMqClientVg* pVg,
pRspObj->rsp.withSchema = true;
pRspObj->rsp.blockSchema = taosArrayInit(pRspObj->rsp.blockNum, sizeof(void*));
}
- // extract the rows in this data packet
+ // extract the rows in this data packet
for (int32_t i = 0; i < pRspObj->rsp.blockNum; ++i) {
SRetrieveTableRspForTmq* pRetrieve = (SRetrieveTableRspForTmq*)taosArrayGetP(pRspObj->rsp.blockData, i);
- int64_t rows = htobe64(pRetrieve->numOfRows);
+ int64_t rows = htobe64(pRetrieve->numOfRows);
pVg->numOfRows += rows;
(*numOfRows) += rows;
- if (needTransformSchema) { //withSchema is false if subscribe subquery, true if subscribe db or stable
- SSchemaWrapper *schema = tCloneSSchemaWrapper(&pWrapper->topicHandle->schema);
- if(schema){
+ if (needTransformSchema) { // withSchema is false if subscribe subquery, true if subscribe db or stable
+ SSchemaWrapper* schema = tCloneSSchemaWrapper(&pWrapper->topicHandle->schema);
+ if (schema) {
taosArrayPush(pRspObj->rsp.blockSchema, &schema);
}
}
@@ -1649,7 +1664,7 @@ SMqTaosxRspObj* tmqBuildTaosxRspFromWrapper(SMqPollRspWrapper* pWrapper, SMqClie
// extract the rows in this data packet
for (int32_t i = 0; i < pRspObj->rsp.blockNum; ++i) {
SRetrieveTableRspForTmq* pRetrieve = (SRetrieveTableRspForTmq*)taosArrayGetP(pRspObj->rsp.blockData, i);
- int64_t rows = htobe64(pRetrieve->numOfRows);
+ int64_t rows = htobe64(pRetrieve->numOfRows);
pVg->numOfRows += rows;
(*numOfRows) += rows;
}
@@ -1657,15 +1672,15 @@ SMqTaosxRspObj* tmqBuildTaosxRspFromWrapper(SMqPollRspWrapper* pWrapper, SMqClie
}
static int32_t doTmqPollImpl(tmq_t* pTmq, SMqClientTopic* pTopic, SMqClientVg* pVg, int64_t timeout) {
- SMqPollReq req = {0};
- char* msg = NULL;
+ SMqPollReq req = {0};
+ char* msg = NULL;
SMqPollCbParam* pParam = NULL;
- SMsgSendInfo* sendInfo = NULL;
- int code = 0;
+ SMsgSendInfo* sendInfo = NULL;
+ int code = 0;
tmqBuildConsumeReqImpl(&req, pTmq, timeout, pTopic, pVg);
int32_t msgSize = tSerializeSMqPollReq(NULL, 0, &req);
- if (msgSize < 0){
+ if (msgSize < 0) {
code = TSDB_CODE_INVALID_MSG;
goto FAIL;
}
@@ -1709,14 +1724,14 @@ static int32_t doTmqPollImpl(tmq_t* pTmq, SMqClientTopic* pTopic, SMqClientVg* p
char offsetFormatBuf[TSDB_OFFSET_LEN] = {0};
tFormatOffset(offsetFormatBuf, tListLen(offsetFormatBuf), &pVg->offsetInfo.endOffset);
code = asyncSendMsgToServer(pTmq->pTscObj->pAppInfo->pTransporter, &pVg->epSet, &transporterId, sendInfo);
- tscDebug("consumer:0x%" PRIx64 " send poll to %s vgId:%d, code:%d, epoch %d, req:%s, reqId:0x%" PRIx64, pTmq->consumerId,
- pTopic->topicName, pVg->vgId, code, pTmq->epoch, offsetFormatBuf, req.reqId);
- if(code != 0){
+ tscDebug("consumer:0x%" PRIx64 " send poll to %s vgId:%d, code:%d, epoch %d, req:%s, reqId:0x%" PRIx64,
+ pTmq->consumerId, pTopic->topicName, pVg->vgId, code, pTmq->epoch, offsetFormatBuf, req.reqId);
+ if (code != 0) {
goto FAIL;
}
pVg->pollCnt++;
- pVg->seekUpdated = false; // reset this flag.
+ pVg->seekUpdated = false; // reset this flag.
pTmq->pollCnt++;
return 0;
@@ -1727,7 +1742,7 @@ FAIL:
// broadcast the poll request to all related vnodes
static int32_t tmqPollImpl(tmq_t* tmq, int64_t timeout) {
- if(atomic_load_8(&tmq->status) == TMQ_CONSUMER_STATUS__RECOVER){
+ if (atomic_load_8(&tmq->status) == TMQ_CONSUMER_STATUS__RECOVER) {
return 0;
}
int32_t code = 0;
@@ -1739,7 +1754,7 @@ static int32_t tmqPollImpl(tmq_t* tmq, int64_t timeout) {
for (int i = 0; i < numOfTopics; i++) {
SMqClientTopic* pTopic = taosArrayGet(tmq->clientTopics, i);
int32_t numOfVg = taosArrayGetSize(pTopic->vgs);
- if(pTopic->noPrivilege){
+ if (pTopic->noPrivilege) {
tscDebug("consumer:0x%" PRIx64 " has no privilegr for topic:%s", tmq->consumerId, pTopic->topicName);
continue;
}
@@ -1751,9 +1766,10 @@ static int32_t tmqPollImpl(tmq_t* tmq, int64_t timeout) {
continue;
}
- if (tmq->replayEnable && taosGetTimestampMs() - pVg->blockReceiveTs < pVg->blockSleepForReplay) { // less than 10ms
- tscTrace("consumer:0x%" PRIx64 " epoch %d, vgId:%d idle for %" PRId64 "ms before start next poll when replay", tmq->consumerId,
- tmq->epoch, pVg->vgId, pVg->blockSleepForReplay);
+ if (tmq->replayEnable &&
+ taosGetTimestampMs() - pVg->blockReceiveTs < pVg->blockSleepForReplay) { // less than 10ms
+ tscTrace("consumer:0x%" PRIx64 " epoch %d, vgId:%d idle for %" PRId64 "ms before start next poll when replay",
+ tmq->consumerId, tmq->epoch, pVg->vgId, pVg->blockSleepForReplay);
continue;
}
@@ -1779,13 +1795,14 @@ end:
return code;
}
-static void updateVgInfo(SMqClientVg* pVg, STqOffsetVal* reqOffset, STqOffsetVal* rspOffset, int64_t sver, int64_t ever, int64_t consumerId, bool hasData){
+static void updateVgInfo(SMqClientVg* pVg, STqOffsetVal* reqOffset, STqOffsetVal* rspOffset, int64_t sver, int64_t ever,
+ int64_t consumerId, bool hasData) {
if (!pVg->seekUpdated) {
- tscDebug("consumer:0x%" PRIx64" local offset is update, since seekupdate not set", consumerId);
- if(hasData) pVg->offsetInfo.beginOffset = *reqOffset;
+ tscDebug("consumer:0x%" PRIx64 " local offset is update, since seekupdate not set", consumerId);
+ if (hasData) pVg->offsetInfo.beginOffset = *reqOffset;
pVg->offsetInfo.endOffset = *rspOffset;
} else {
- tscDebug("consumer:0x%" PRIx64" local offset is NOT update, since seekupdate is set", consumerId);
+ tscDebug("consumer:0x%" PRIx64 " local offset is NOT update, since seekupdate is set", consumerId);
}
// update the status
@@ -1820,17 +1837,19 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout) {
tscDebug("consumer:0x%" PRIx64 " wait for the re-balance, set status to be RECOVER", tmq->consumerId);
} else if (pRspWrapper->code == TSDB_CODE_TQ_NO_COMMITTED_OFFSET) {
terrno = pRspWrapper->code;
- tscError("consumer:0x%" PRIx64 " unexpected rsp from poll, code:%s", tmq->consumerId, tstrerror(pRspWrapper->code));
+ tscError("consumer:0x%" PRIx64 " unexpected rsp from poll, code:%s", tmq->consumerId,
+ tstrerror(pRspWrapper->code));
taosFreeQitem(pRspWrapper);
return NULL;
- } else{
- if(pRspWrapper->code == TSDB_CODE_VND_INVALID_VGROUP_ID){ // for vnode transform
+ } else {
+ if (pRspWrapper->code == TSDB_CODE_VND_INVALID_VGROUP_ID) { // for vnode transform
askEp(tmq, NULL, false, true);
}
- tscError("consumer:0x%" PRIx64 " msg from vgId:%d discarded, since %s", tmq->consumerId, pollRspWrapper->vgId, tstrerror(pRspWrapper->code));
+ tscError("consumer:0x%" PRIx64 " msg from vgId:%d discarded, since %s", tmq->consumerId, pollRspWrapper->vgId,
+ tstrerror(pRspWrapper->code));
taosWLockLatch(&tmq->lock);
SMqClientVg* pVg = getVgInfo(tmq, pollRspWrapper->topicName, pollRspWrapper->vgId);
- if(pVg) pVg->emptyBlockReceiveTs = taosGetTimestampMs();
+ if (pVg) pVg->emptyBlockReceiveTs = taosGetTimestampMs();
taosWUnLockLatch(&tmq->lock);
}
setVgIdle(tmq, pollRspWrapper->topicName, pollRspWrapper->vgId);
@@ -1846,7 +1865,7 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout) {
SMqClientVg* pVg = getVgInfo(tmq, pollRspWrapper->topicName, pollRspWrapper->vgId);
pollRspWrapper->vgHandle = pVg;
pollRspWrapper->topicHandle = getTopicInfo(tmq, pollRspWrapper->topicName);
- if(pollRspWrapper->vgHandle == NULL || pollRspWrapper->topicHandle == NULL){
+ if (pollRspWrapper->vgHandle == NULL || pollRspWrapper->topicHandle == NULL) {
tscError("consumer:0x%" PRIx64 " get vg or topic error, topic:%s vgId:%d", tmq->consumerId,
pollRspWrapper->topicName, pollRspWrapper->vgId);
taosWUnLockLatch(&tmq->lock);
@@ -1861,7 +1880,8 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout) {
pVg->epSet = *pollRspWrapper->pEpset;
}
- updateVgInfo(pVg, &pDataRsp->reqOffset, &pDataRsp->rspOffset, pDataRsp->head.walsver, pDataRsp->head.walever, tmq->consumerId, pDataRsp->blockNum != 0);
+ updateVgInfo(pVg, &pDataRsp->reqOffset, &pDataRsp->rspOffset, pDataRsp->head.walsver, pDataRsp->head.walever,
+ tmq->consumerId, pDataRsp->blockNum != 0);
char buf[TSDB_OFFSET_LEN] = {0};
tFormatOffset(buf, TSDB_OFFSET_LEN, &pDataRsp->rspOffset);
@@ -1878,10 +1898,10 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout) {
SMqRspObj* pRsp = tmqBuildRspFromWrapper(pollRspWrapper, pVg, &numOfRows);
tmq->totalRows += numOfRows;
pVg->emptyBlockReceiveTs = 0;
- if(tmq->replayEnable){
+ if (tmq->replayEnable) {
pVg->blockReceiveTs = taosGetTimestampMs();
pVg->blockSleepForReplay = pRsp->rsp.sleepTime;
- if(pVg->blockSleepForReplay > 0){
+ if (pVg->blockSleepForReplay > 0) {
int64_t* pRefId1 = taosMemoryMalloc(sizeof(int64_t));
*pRefId1 = tmq->refId;
taosTmrStart(tmqReplayTask, pVg->blockSleepForReplay, pRefId1, tmqMgmt.timer);
@@ -1897,7 +1917,7 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout) {
}
} else {
tscInfo("consumer:0x%" PRIx64 " vgId:%d msg discard since epoch mismatch: msg epoch %d, consumer epoch %d",
- tmq->consumerId, pollRspWrapper->vgId, pDataRsp->head.epoch, consumerEpoch);
+ tmq->consumerId, pollRspWrapper->vgId, pDataRsp->head.epoch, consumerEpoch);
setVgIdle(tmq, pollRspWrapper->topicName, pollRspWrapper->vgId);
tmqFreeRspWrapper(pRspWrapper);
taosFreeQitem(pRspWrapper);
@@ -1913,14 +1933,15 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout) {
SMqClientVg* pVg = getVgInfo(tmq, pollRspWrapper->topicName, pollRspWrapper->vgId);
pollRspWrapper->vgHandle = pVg;
pollRspWrapper->topicHandle = getTopicInfo(tmq, pollRspWrapper->topicName);
- if(pollRspWrapper->vgHandle == NULL || pollRspWrapper->topicHandle == NULL){
+ if (pollRspWrapper->vgHandle == NULL || pollRspWrapper->topicHandle == NULL) {
tscError("consumer:0x%" PRIx64 " get vg or topic error, topic:%s vgId:%d", tmq->consumerId,
pollRspWrapper->topicName, pollRspWrapper->vgId);
taosWUnLockLatch(&tmq->lock);
return NULL;
}
- updateVgInfo(pVg, &pollRspWrapper->metaRsp.rspOffset, &pollRspWrapper->metaRsp.rspOffset, pollRspWrapper->metaRsp.head.walsver, pollRspWrapper->metaRsp.head.walever, tmq->consumerId, true);
+ updateVgInfo(pVg, &pollRspWrapper->metaRsp.rspOffset, &pollRspWrapper->metaRsp.rspOffset,
+ pollRspWrapper->metaRsp.head.walsver, pollRspWrapper->metaRsp.head.walever, tmq->consumerId, true);
// build rsp
SMqMetaRspObj* pRsp = tmqBuildMetaRspFromWrapper(pollRspWrapper);
taosFreeQitem(pRspWrapper);
@@ -1928,7 +1949,7 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout) {
return pRsp;
} else {
tscInfo("consumer:0x%" PRIx64 " vgId:%d msg discard since epoch mismatch: msg epoch %d, consumer epoch %d",
- tmq->consumerId, pollRspWrapper->vgId, pollRspWrapper->metaRsp.head.epoch, consumerEpoch);
+ tmq->consumerId, pollRspWrapper->vgId, pollRspWrapper->metaRsp.head.epoch, consumerEpoch);
setVgIdle(tmq, pollRspWrapper->topicName, pollRspWrapper->vgId);
tmqFreeRspWrapper(pRspWrapper);
taosFreeQitem(pRspWrapper);
@@ -1942,14 +1963,16 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout) {
SMqClientVg* pVg = getVgInfo(tmq, pollRspWrapper->topicName, pollRspWrapper->vgId);
pollRspWrapper->vgHandle = pVg;
pollRspWrapper->topicHandle = getTopicInfo(tmq, pollRspWrapper->topicName);
- if(pollRspWrapper->vgHandle == NULL || pollRspWrapper->topicHandle == NULL){
+ if (pollRspWrapper->vgHandle == NULL || pollRspWrapper->topicHandle == NULL) {
tscError("consumer:0x%" PRIx64 " get vg or topic error, topic:%s vgId:%d", tmq->consumerId,
pollRspWrapper->topicName, pollRspWrapper->vgId);
taosWUnLockLatch(&tmq->lock);
return NULL;
}
- updateVgInfo(pVg, &pollRspWrapper->taosxRsp.reqOffset, &pollRspWrapper->taosxRsp.rspOffset, pollRspWrapper->taosxRsp.head.walsver, pollRspWrapper->taosxRsp.head.walever, tmq->consumerId, pollRspWrapper->taosxRsp.blockNum != 0);
+ updateVgInfo(pVg, &pollRspWrapper->taosxRsp.reqOffset, &pollRspWrapper->taosxRsp.rspOffset,
+ pollRspWrapper->taosxRsp.head.walsver, pollRspWrapper->taosxRsp.head.walever, tmq->consumerId,
+ pollRspWrapper->taosxRsp.blockNum != 0);
if (pollRspWrapper->taosxRsp.blockNum == 0) {
tscDebug("consumer:0x%" PRIx64 " taosx empty block received, vgId:%d, vg total:%" PRId64 ", reqId:0x%" PRIx64,
@@ -1967,7 +1990,7 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout) {
void* pRsp = NULL;
int64_t numOfRows = 0;
if (pollRspWrapper->taosxRsp.createTableNum == 0) {
- tscError("consumer:0x%" PRIx64" createTableNum should > 0 if rsp type is data_meta", tmq->consumerId);
+ tscError("consumer:0x%" PRIx64 " createTableNum should > 0 if rsp type is data_meta", tmq->consumerId);
} else {
pRsp = tmqBuildTaosxRspFromWrapper(pollRspWrapper, pVg, &numOfRows);
}
@@ -1977,7 +2000,7 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout) {
char buf[TSDB_OFFSET_LEN] = {0};
tFormatOffset(buf, TSDB_OFFSET_LEN, &pVg->offsetInfo.endOffset);
tscDebug("consumer:0x%" PRIx64 " process taosx poll rsp, vgId:%d, offset:%s, blocks:%d, rows:%" PRId64
- ", vg total:%" PRId64 ", total:%" PRId64 ", reqId:0x%" PRIx64,
+ ", vg total:%" PRId64 ", total:%" PRId64 ", reqId:0x%" PRIx64,
tmq->consumerId, pVg->vgId, buf, pollRspWrapper->dataRsp.blockNum, numOfRows, pVg->numOfRows,
tmq->totalRows, pollRspWrapper->reqId);
@@ -1986,12 +2009,12 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout) {
return pRsp;
} else {
tscInfo("consumer:0x%" PRIx64 " vgId:%d msg discard since epoch mismatch: msg epoch %d, consumer epoch %d",
- tmq->consumerId, pollRspWrapper->vgId, pollRspWrapper->taosxRsp.head.epoch, consumerEpoch);
+ tmq->consumerId, pollRspWrapper->vgId, pollRspWrapper->taosxRsp.head.epoch, consumerEpoch);
setVgIdle(tmq, pollRspWrapper->topicName, pollRspWrapper->vgId);
tmqFreeRspWrapper(pRspWrapper);
taosFreeQitem(pRspWrapper);
}
- } else if(pRspWrapper->tmqRspType == TMQ_MSG_TYPE__EP_RSP){
+ } else if (pRspWrapper->tmqRspType == TMQ_MSG_TYPE__EP_RSP) {
tscDebug("consumer:0x%" PRIx64 " ep msg received", tmq->consumerId);
SMqAskEpRspWrapper* pEpRspWrapper = (SMqAskEpRspWrapper*)pRspWrapper;
SMqAskEpRsp* rspMsg = &pEpRspWrapper->msg;
@@ -2005,7 +2028,7 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout) {
}
TAOS_RES* tmq_consumer_poll(tmq_t* tmq, int64_t timeout) {
- if(tmq == NULL) return NULL;
+ if (tmq == NULL) return NULL;
void* rspObj = NULL;
int64_t startTime = taosGetTimestampMs();
@@ -2021,7 +2044,7 @@ TAOS_RES* tmq_consumer_poll(tmq_t* tmq, int64_t timeout) {
}
while (1) {
- if(atomic_load_8(&tmq->status) != TMQ_CONSUMER_STATUS__RECOVER){
+ if (atomic_load_8(&tmq->status) != TMQ_CONSUMER_STATUS__RECOVER) {
break;
}
tscInfo("consumer:0x%" PRIx64 " tmq status is recover", tmq->consumerId);
@@ -2091,7 +2114,7 @@ static void displayConsumeStatistics(tmq_t* pTmq) {
}
int32_t tmq_consumer_close(tmq_t* tmq) {
- if(tmq == NULL) return TSDB_CODE_INVALID_PARA;
+ if (tmq == NULL) return TSDB_CODE_INVALID_PARA;
tscInfo("consumer:0x%" PRIx64 " start to close consumer, status:%d", tmq->consumerId, tmq->status);
displayConsumeStatistics(tmq);
@@ -2138,7 +2161,7 @@ const char* tmq_err2str(int32_t err) {
}
tmq_res_t tmq_get_res_type(TAOS_RES* res) {
- if (res == NULL){
+ if (res == NULL) {
return TMQ_RES_INVALID;
}
if (TD_RES_TMQ(res)) {
@@ -2153,7 +2176,7 @@ tmq_res_t tmq_get_res_type(TAOS_RES* res) {
}
const char* tmq_get_topic_name(TAOS_RES* res) {
- if (res == NULL){
+ if (res == NULL) {
return NULL;
}
if (TD_RES_TMQ(res)) {
@@ -2171,7 +2194,7 @@ const char* tmq_get_topic_name(TAOS_RES* res) {
}
const char* tmq_get_db_name(TAOS_RES* res) {
- if (res == NULL){
+ if (res == NULL) {
return NULL;
}
@@ -2190,7 +2213,7 @@ const char* tmq_get_db_name(TAOS_RES* res) {
}
int32_t tmq_get_vgroup_id(TAOS_RES* res) {
- if (res == NULL){
+ if (res == NULL) {
return -1;
}
if (TD_RES_TMQ(res)) {
@@ -2208,15 +2231,15 @@ int32_t tmq_get_vgroup_id(TAOS_RES* res) {
}
int64_t tmq_get_vgroup_offset(TAOS_RES* res) {
- if (res == NULL){
+ if (res == NULL) {
return TSDB_CODE_INVALID_PARA;
}
if (TD_RES_TMQ(res)) {
- SMqRspObj* pRspObj = (SMqRspObj*) res;
+ SMqRspObj* pRspObj = (SMqRspObj*)res;
STqOffsetVal* pOffset = &pRspObj->rsp.reqOffset;
if (pOffset->type == TMQ_OFFSET__LOG) {
return pRspObj->rsp.reqOffset.version;
- }else{
+ } else {
tscError("invalid offset type:%d", pOffset->type);
}
} else if (TD_RES_TMQ_META(res)) {
@@ -2225,11 +2248,11 @@ int64_t tmq_get_vgroup_offset(TAOS_RES* res) {
return pRspObj->metaRsp.rspOffset.version;
}
} else if (TD_RES_TMQ_METADATA(res)) {
- SMqTaosxRspObj* pRspObj = (SMqTaosxRspObj*) res;
+ SMqTaosxRspObj* pRspObj = (SMqTaosxRspObj*)res;
if (pRspObj->rsp.reqOffset.type == TMQ_OFFSET__LOG) {
return pRspObj->rsp.reqOffset.version;
}
- } else{
+ } else {
tscError("invalid tmq type:%d", *(int8_t*)res);
}
@@ -2238,7 +2261,7 @@ int64_t tmq_get_vgroup_offset(TAOS_RES* res) {
}
const char* tmq_get_table_name(TAOS_RES* res) {
- if (res == NULL){
+ if (res == NULL) {
return NULL;
}
if (TD_RES_TMQ(res)) {
@@ -2262,7 +2285,7 @@ const char* tmq_get_table_name(TAOS_RES* res) {
void tmq_commit_async(tmq_t* tmq, const TAOS_RES* pRes, tmq_commit_cb* cb, void* param) {
if (tmq == NULL) {
tscError("invalid tmq handle, null");
- if(cb != NULL) {
+ if (cb != NULL) {
cb(tmq, TSDB_CODE_INVALID_PARA, param);
}
return;
@@ -2274,8 +2297,8 @@ void tmq_commit_async(tmq_t* tmq, const TAOS_RES* pRes, tmq_commit_cb* cb, void*
}
}
-static void commitCallBackFn(tmq_t *UNUSED_PARAM(tmq), int32_t code, void* param) {
- SSyncCommitInfo* pInfo = (SSyncCommitInfo*) param;
+static void commitCallBackFn(tmq_t* UNUSED_PARAM(tmq), int32_t code, void* param) {
+ SSyncCommitInfo* pInfo = (SSyncCommitInfo*)param;
pInfo->code = code;
tsem_post(&pInfo->sem);
}
@@ -2309,34 +2332,35 @@ int32_t tmq_commit_sync(tmq_t* tmq, const TAOS_RES* pRes) {
}
// wal range will be ok after calling tmq_get_topic_assignment or poll interface
-static int32_t checkWalRange(SVgOffsetInfo* offset, int64_t value){
+static int32_t checkWalRange(SVgOffsetInfo* offset, int64_t value) {
if (offset->walVerBegin == -1 || offset->walVerEnd == -1) {
tscError("Assignment or poll interface need to be called first");
return TSDB_CODE_TMQ_NEED_INITIALIZED;
}
if (value != -1 && (value < offset->walVerBegin || value > offset->walVerEnd)) {
- tscError("invalid seek params, offset:%" PRId64 ", valid range:[%" PRId64 ", %" PRId64 "]", value, offset->walVerBegin, offset->walVerEnd);
+ tscError("invalid seek params, offset:%" PRId64 ", valid range:[%" PRId64 ", %" PRId64 "]", value,
+ offset->walVerBegin, offset->walVerEnd);
return TSDB_CODE_TMQ_VERSION_OUT_OF_RANGE;
}
return 0;
}
-int32_t tmq_commit_offset_sync(tmq_t *tmq, const char *pTopicName, int32_t vgId, int64_t offset){
+int32_t tmq_commit_offset_sync(tmq_t* tmq, const char* pTopicName, int32_t vgId, int64_t offset) {
if (tmq == NULL || pTopicName == NULL) {
tscError("invalid tmq handle, null");
return TSDB_CODE_INVALID_PARA;
}
int32_t accId = tmq->pTscObj->acctId;
- char tname[TSDB_TOPIC_FNAME_LEN] = {0};
+ char tname[TSDB_TOPIC_FNAME_LEN] = {0};
sprintf(tname, "%d.%s", accId, pTopicName);
taosWLockLatch(&tmq->lock);
SMqClientVg* pVg = NULL;
- int32_t code = getClientVg(tmq, tname, vgId, &pVg);
- if(code != 0){
+ int32_t code = getClientVg(tmq, tname, vgId, &pVg);
+ if (code != 0) {
taosWUnLockLatch(&tmq->lock);
return code;
}
@@ -2353,7 +2377,7 @@ int32_t tmq_commit_offset_sync(tmq_t *tmq, const char *pTopicName, int32_t vgId,
SSyncCommitInfo* pInfo = taosMemoryMalloc(sizeof(SSyncCommitInfo));
if (pInfo == NULL) {
- tscError("consumer:0x%"PRIx64" failed to prepare seek operation", tmq->consumerId);
+ tscError("consumer:0x%" PRIx64 " failed to prepare seek operation", tmq->consumerId);
return TSDB_CODE_OUT_OF_MEMORY;
}
@@ -2361,36 +2385,38 @@ int32_t tmq_commit_offset_sync(tmq_t *tmq, const char *pTopicName, int32_t vgId,
pInfo->code = 0;
code = asyncCommitOffset(tmq, tname, vgId, &offsetVal, commitCallBackFn, pInfo);
- if(code == 0){
+ if (code == 0) {
tsem_wait(&pInfo->sem);
code = pInfo->code;
}
- if(code == TSDB_CODE_TMQ_SAME_COMMITTED_VALUE) code = TSDB_CODE_SUCCESS;
+ if (code == TSDB_CODE_TMQ_SAME_COMMITTED_VALUE) code = TSDB_CODE_SUCCESS;
tsem_destroy(&pInfo->sem);
taosMemoryFree(pInfo);
- tscInfo("consumer:0x%" PRIx64 " sync send commit to vgId:%d, offset:%" PRId64" code:%s", tmq->consumerId, vgId, offset, tstrerror(code));
+ tscInfo("consumer:0x%" PRIx64 " sync send commit to vgId:%d, offset:%" PRId64 " code:%s", tmq->consumerId, vgId,
+ offset, tstrerror(code));
return code;
}
-void tmq_commit_offset_async(tmq_t *tmq, const char *pTopicName, int32_t vgId, int64_t offset, tmq_commit_cb *cb, void *param){
+void tmq_commit_offset_async(tmq_t* tmq, const char* pTopicName, int32_t vgId, int64_t offset, tmq_commit_cb* cb,
+ void* param) {
int32_t code = 0;
if (tmq == NULL || pTopicName == NULL) {
tscError("invalid tmq handle, null");
code = TSDB_CODE_INVALID_PARA;
- goto end;
+ goto end;
}
int32_t accId = tmq->pTscObj->acctId;
- char tname[TSDB_TOPIC_FNAME_LEN] = {0};
+ char tname[TSDB_TOPIC_FNAME_LEN] = {0};
sprintf(tname, "%d.%s", accId, pTopicName);
taosWLockLatch(&tmq->lock);
SMqClientVg* pVg = NULL;
code = getClientVg(tmq, tname, vgId, &pVg);
- if(code != 0){
+ if (code != 0) {
taosWUnLockLatch(&tmq->lock);
goto end;
}
@@ -2407,11 +2433,12 @@ void tmq_commit_offset_async(tmq_t *tmq, const char *pTopicName, int32_t vgId, i
code = asyncCommitOffset(tmq, tname, vgId, &offsetVal, cb, param);
- tscInfo("consumer:0x%" PRIx64 " async send commit to vgId:%d, offset:%" PRId64" code:%s", tmq->consumerId, vgId, offset, tstrerror(code));
+ tscInfo("consumer:0x%" PRIx64 " async send commit to vgId:%d, offset:%" PRId64 " code:%s", tmq->consumerId, vgId,
+ offset, tstrerror(code));
end:
- if(code != 0 && cb != NULL){
- if(code == TSDB_CODE_TMQ_SAME_COMMITTED_VALUE) code = TSDB_CODE_SUCCESS;
+ if (code != 0 && cb != NULL) {
+ if (code == TSDB_CODE_TMQ_SAME_COMMITTED_VALUE) code = TSDB_CODE_SUCCESS;
cb(tmq, code, param);
}
}
@@ -2431,14 +2458,13 @@ int32_t askEpCb(void* param, SDataBuf* pMsg, int32_t code) {
SMqRspHead* head = pMsg->pData;
int32_t epoch = atomic_load_32(&tmq->epoch);
- tscInfo("consumer:0x%" PRIx64 ", recv ep, msg epoch %d, current epoch %d", tmq->consumerId,
- head->epoch, epoch);
- if(pParam->sync){
+ tscInfo("consumer:0x%" PRIx64 ", recv ep, msg epoch %d, current epoch %d", tmq->consumerId, head->epoch, epoch);
+ if (pParam->sync) {
SMqAskEpRsp rsp = {0};
tDecodeSMqAskEpRsp(POINTER_SHIFT(pMsg->pData, sizeof(SMqRspHead)), &rsp);
doUpdateLocalEp(tmq, head->epoch, &rsp);
tDeleteSMqAskEpRsp(&rsp);
- }else{
+ } else {
SMqAskEpRspWrapper* pWrapper = taosAllocateQitem(sizeof(SMqAskEpRspWrapper), DEF_QITEM, 0);
if (pWrapper == NULL) {
code = TSDB_CODE_OUT_OF_MEMORY;
@@ -2457,7 +2483,7 @@ END:
taosReleaseRef(tmqMgmt.rsetId, pParam->refId);
FAIL:
- if(pParam->sync){
+ if (pParam->sync) {
SAskEpInfo* pInfo = pParam->pParam;
pInfo->code = code;
tsem_post(&pInfo->sem);
@@ -2485,11 +2511,11 @@ int32_t syncAskEp(tmq_t* pTmq) {
void askEp(tmq_t* pTmq, void* param, bool sync, bool updateEpSet) {
SMqAskEpReq req = {0};
req.consumerId = pTmq->consumerId;
- req.epoch = updateEpSet ? -1 :pTmq->epoch;
+ req.epoch = updateEpSet ? -1 : pTmq->epoch;
strcpy(req.cgroup, pTmq->groupId);
- int code = 0;
+ int code = 0;
SMqAskEpCbParam* pParam = NULL;
- void* pReq = NULL;
+ void* pReq = NULL;
int32_t tlen = tSerializeSMqAskEpReq(NULL, 0, &req);
if (tlen < 0) {
@@ -2541,7 +2567,7 @@ void askEp(tmq_t* pTmq, void* param, bool sync, bool updateEpSet) {
int64_t transporterId = 0;
code = asyncSendMsgToServer(pTmq->pTscObj->pAppInfo->pTransporter, &epSet, &transporterId, sendInfo);
- if(code == 0){
+ if (code == 0) {
return;
}
@@ -2566,7 +2592,7 @@ int32_t tmqCommitDone(SMqCommitCbParamSet* pParamSet) {
}
// if no more waiting rsp
- if(pParamSet->callbackFn != NULL){
+ if (pParamSet->callbackFn != NULL) {
pParamSet->callbackFn(tmq, pParamSet->code, pParamSet->userParam);
}
@@ -2578,10 +2604,12 @@ int32_t tmqCommitDone(SMqCommitCbParamSet* pParamSet) {
void commitRspCountDown(SMqCommitCbParamSet* pParamSet, int64_t consumerId, const char* pTopic, int32_t vgId) {
int32_t waitingRspNum = atomic_sub_fetch_32(&pParamSet->waitingRspNum, 1);
if (waitingRspNum == 0) {
- tscInfo("consumer:0x%" PRIx64 " topic:%s vgId:%d all commit-rsp received, commit completed", consumerId, pTopic, vgId);
+ tscInfo("consumer:0x%" PRIx64 " topic:%s vgId:%d all commit-rsp received, commit completed", consumerId, pTopic,
+ vgId);
tmqCommitDone(pParamSet);
} else {
- tscInfo("consumer:0x%" PRIx64 " topic:%s vgId:%d commit-rsp received, remain:%d", consumerId, pTopic, vgId, waitingRspNum);
+ tscInfo("consumer:0x%" PRIx64 " topic:%s vgId:%d commit-rsp received, remain:%d", consumerId, pTopic, vgId,
+ waitingRspNum);
}
}
@@ -2590,7 +2618,8 @@ SReqResultInfo* tmqGetNextResInfo(TAOS_RES* res, bool convertUcs4) {
pRspObj->resIter++;
if (pRspObj->resIter < pRspObj->rsp.blockNum) {
- SRetrieveTableRspForTmq* pRetrieveTmq = (SRetrieveTableRspForTmq*)taosArrayGetP(pRspObj->rsp.blockData, pRspObj->resIter);
+ SRetrieveTableRspForTmq* pRetrieveTmq =
+ (SRetrieveTableRspForTmq*)taosArrayGetP(pRspObj->rsp.blockData, pRspObj->resIter);
if (pRspObj->rsp.withSchema) {
SSchemaWrapper* pSW = (SSchemaWrapper*)taosArrayGetP(pRspObj->rsp.blockSchema, pRspObj->resIter);
setResSchemaInfo(&pRspObj->resInfo, pSW->pSchema, pSW->nCols);
@@ -2609,7 +2638,7 @@ SReqResultInfo* tmqGetNextResInfo(TAOS_RES* res, bool convertUcs4) {
// TODO handle the compressed case
pRspObj->resInfo.totalRows += pRspObj->resInfo.numOfRows;
setResultDataPtr(&pRspObj->resInfo, pRspObj->resInfo.fields, pRspObj->resInfo.numOfCols, pRspObj->resInfo.numOfRows,
- convertUcs4);
+ convertUcs4);
return &pRspObj->resInfo;
}
@@ -2619,7 +2648,7 @@ SReqResultInfo* tmqGetNextResInfo(TAOS_RES* res, bool convertUcs4) {
static int32_t tmqGetWalInfoCb(void* param, SDataBuf* pMsg, int32_t code) {
SMqVgWalInfoParam* pParam = param;
- SMqVgCommon* pCommon = pParam->pCommon;
+ SMqVgCommon* pCommon = pParam->pCommon;
int32_t total = atomic_add_fetch_32(&pCommon->numOfRsp, 1);
if (code != TSDB_CODE_SUCCESS) {
@@ -2628,7 +2657,7 @@ static int32_t tmqGetWalInfoCb(void* param, SDataBuf* pMsg, int32_t code) {
pCommon->code = code;
} else {
SMqDataRsp rsp;
- SDecoder decoder;
+ SDecoder decoder;
tDecoderInit(&decoder, POINTER_SHIFT(pMsg->pData, sizeof(SMqRspHead)), pMsg->len - sizeof(SMqRspHead));
tDecodeMqDataRsp(&decoder, &rsp);
tDecoderClear(&decoder);
@@ -2656,7 +2685,7 @@ static int32_t tmqGetWalInfoCb(void* param, SDataBuf* pMsg, int32_t code) {
}
static void destroyCommonInfo(SMqVgCommon* pCommon) {
- if(pCommon == NULL){
+ if (pCommon == NULL) {
return;
}
taosArrayDestroy(pCommon->pList);
@@ -2666,7 +2695,7 @@ static void destroyCommonInfo(SMqVgCommon* pCommon) {
taosMemoryFree(pCommon);
}
-static bool isInSnapshotMode(int8_t type, bool useSnapshot){
+static bool isInSnapshotMode(int8_t type, bool useSnapshot) {
if ((type < TMQ_OFFSET__LOG && useSnapshot) || type > TMQ_OFFSET__LOG) {
return true;
}
@@ -2676,7 +2705,7 @@ static bool isInSnapshotMode(int8_t type, bool useSnapshot){
static int32_t tmCommittedCb(void* param, SDataBuf* pMsg, int32_t code) {
SMqCommittedParam* pParam = param;
- if (code != 0){
+ if (code != 0) {
goto end;
}
if (pMsg) {
@@ -2689,8 +2718,8 @@ static int32_t tmCommittedCb(void* param, SDataBuf* pMsg, int32_t code) {
tDecoderClear(&decoder);
}
- end:
- if(pMsg){
+end:
+ if (pMsg) {
taosMemoryFree(pMsg->pData);
taosMemoryFree(pMsg->pEpSet);
}
@@ -2699,8 +2728,8 @@ static int32_t tmCommittedCb(void* param, SDataBuf* pMsg, int32_t code) {
return 0;
}
-int64_t getCommittedFromServer(tmq_t *tmq, char* tname, int32_t vgId, SEpSet* epSet){
- int32_t code = 0;
+int64_t getCommittedFromServer(tmq_t* tmq, char* tname, int32_t vgId, SEpSet* epSet) {
+ int32_t code = 0;
SMqVgOffset pOffset = {0};
pOffset.consumerId = tmq->consumerId;
@@ -2753,7 +2782,7 @@ int64_t getCommittedFromServer(tmq_t *tmq, char* tname, int32_t vgId, SEpSet* ep
int64_t transporterId = 0;
code = asyncSendMsgToServer(tmq->pTscObj->pAppInfo->pTransporter, epSet, &transporterId, sendInfo);
- if(code != 0){
+ if (code != 0) {
taosMemoryFree(buf);
taosMemoryFree(sendInfo);
tsem_destroy(&pParam->sem);
@@ -2763,10 +2792,10 @@ int64_t getCommittedFromServer(tmq_t *tmq, char* tname, int32_t vgId, SEpSet* ep
tsem_wait(&pParam->sem);
code = pParam->code;
- if(code == TSDB_CODE_SUCCESS){
- if(pParam->vgOffset.offset.val.type == TMQ_OFFSET__LOG){
+ if (code == TSDB_CODE_SUCCESS) {
+ if (pParam->vgOffset.offset.val.type == TMQ_OFFSET__LOG) {
code = pParam->vgOffset.offset.val.version;
- }else{
+ } else {
code = TSDB_CODE_TMQ_SNAPSHOT_ERROR;
}
}
@@ -2776,27 +2805,27 @@ int64_t getCommittedFromServer(tmq_t *tmq, char* tname, int32_t vgId, SEpSet* ep
return code;
}
-int64_t tmq_position(tmq_t *tmq, const char *pTopicName, int32_t vgId){
+int64_t tmq_position(tmq_t* tmq, const char* pTopicName, int32_t vgId) {
if (tmq == NULL || pTopicName == NULL) {
tscError("invalid tmq handle, null");
return TSDB_CODE_INVALID_PARA;
}
int32_t accId = tmq->pTscObj->acctId;
- char tname[TSDB_TOPIC_FNAME_LEN] = {0};
+ char tname[TSDB_TOPIC_FNAME_LEN] = {0};
sprintf(tname, "%d.%s", accId, pTopicName);
taosWLockLatch(&tmq->lock);
SMqClientVg* pVg = NULL;
- int32_t code = getClientVg(tmq, tname, vgId, &pVg);
- if(code != 0){
+ int32_t code = getClientVg(tmq, tname, vgId, &pVg);
+ if (code != 0) {
taosWUnLockLatch(&tmq->lock);
return code;
}
SVgOffsetInfo* pOffsetInfo = &pVg->offsetInfo;
- int32_t type = pOffsetInfo->endOffset.type;
+ int32_t type = pOffsetInfo->endOffset.type;
if (isInSnapshotMode(type, tmq->useSnapshot)) {
tscError("consumer:0x%" PRIx64 " offset type:%d not wal version, position error", tmq->consumerId, type);
taosWUnLockLatch(&tmq->lock);
@@ -2808,26 +2837,26 @@ int64_t tmq_position(tmq_t *tmq, const char *pTopicName, int32_t vgId){
taosWUnLockLatch(&tmq->lock);
return code;
}
- SEpSet epSet = pVg->epSet;
+ SEpSet epSet = pVg->epSet;
int64_t begin = pVg->offsetInfo.walVerBegin;
int64_t end = pVg->offsetInfo.walVerEnd;
taosWUnLockLatch(&tmq->lock);
int64_t position = 0;
- if(type == TMQ_OFFSET__LOG){
+ if (type == TMQ_OFFSET__LOG) {
position = pOffsetInfo->endOffset.version;
- }else if(type == TMQ_OFFSET__RESET_EARLIEST || type == TMQ_OFFSET__RESET_LATEST){
+ } else if (type == TMQ_OFFSET__RESET_EARLIEST || type == TMQ_OFFSET__RESET_LATEST) {
code = getCommittedFromServer(tmq, tname, vgId, &epSet);
- if(code == TSDB_CODE_TMQ_NO_COMMITTED){
- if(type == TMQ_OFFSET__RESET_EARLIEST){
+ if (code == TSDB_CODE_TMQ_NO_COMMITTED) {
+ if (type == TMQ_OFFSET__RESET_EARLIEST) {
position = begin;
- } else if(type == TMQ_OFFSET__RESET_LATEST){
+ } else if (type == TMQ_OFFSET__RESET_LATEST) {
position = end;
}
- }else{
+ } else {
position = code;
}
- }else{
+ } else {
tscError("consumer:0x%" PRIx64 " offset type:%d can not be reach here", tmq->consumerId, type);
}
@@ -2835,40 +2864,42 @@ int64_t tmq_position(tmq_t *tmq, const char *pTopicName, int32_t vgId){
return position;
}
-int64_t tmq_committed(tmq_t *tmq, const char *pTopicName, int32_t vgId){
+int64_t tmq_committed(tmq_t* tmq, const char* pTopicName, int32_t vgId) {
if (tmq == NULL || pTopicName == NULL) {
tscError("invalid tmq handle, null");
return TSDB_CODE_INVALID_PARA;
}
int32_t accId = tmq->pTscObj->acctId;
- char tname[TSDB_TOPIC_FNAME_LEN] = {0};
+ char tname[TSDB_TOPIC_FNAME_LEN] = {0};
sprintf(tname, "%d.%s", accId, pTopicName);
taosWLockLatch(&tmq->lock);
SMqClientVg* pVg = NULL;
- int32_t code = getClientVg(tmq, tname, vgId, &pVg);
- if(code != 0){
+ int32_t code = getClientVg(tmq, tname, vgId, &pVg);
+ if (code != 0) {
taosWUnLockLatch(&tmq->lock);
return code;
}
SVgOffsetInfo* pOffsetInfo = &pVg->offsetInfo;
if (isInSnapshotMode(pOffsetInfo->endOffset.type, tmq->useSnapshot)) {
- tscError("consumer:0x%" PRIx64 " offset type:%d not wal version, committed error", tmq->consumerId, pOffsetInfo->endOffset.type);
+ tscError("consumer:0x%" PRIx64 " offset type:%d not wal version, committed error", tmq->consumerId,
+ pOffsetInfo->endOffset.type);
taosWUnLockLatch(&tmq->lock);
return TSDB_CODE_TMQ_SNAPSHOT_ERROR;
}
if (isInSnapshotMode(pOffsetInfo->committedOffset.type, tmq->useSnapshot)) {
- tscError("consumer:0x%" PRIx64 " offset type:%d not wal version, committed error", tmq->consumerId, pOffsetInfo->committedOffset.type);
+ tscError("consumer:0x%" PRIx64 " offset type:%d not wal version, committed error", tmq->consumerId,
+ pOffsetInfo->committedOffset.type);
taosWUnLockLatch(&tmq->lock);
return TSDB_CODE_TMQ_SNAPSHOT_ERROR;
}
int64_t committed = 0;
- if(pOffsetInfo->committedOffset.type == TMQ_OFFSET__LOG){
+ if (pOffsetInfo->committedOffset.type == TMQ_OFFSET__LOG) {
committed = pOffsetInfo->committedOffset.version;
taosWUnLockLatch(&tmq->lock);
goto end;
@@ -2885,7 +2916,7 @@ end:
int32_t tmq_get_topic_assignment(tmq_t* tmq, const char* pTopicName, tmq_topic_assignment** assignment,
int32_t* numOfAssignment) {
- if(tmq == NULL || pTopicName == NULL || assignment == NULL || numOfAssignment == NULL){
+ if (tmq == NULL || pTopicName == NULL || assignment == NULL || numOfAssignment == NULL) {
tscError("invalid tmq handle, null");
return TSDB_CODE_INVALID_PARA;
}
@@ -2909,7 +2940,7 @@ int32_t tmq_get_topic_assignment(tmq_t* tmq, const char* pTopicName, tmq_topic_a
*numOfAssignment = taosArrayGetSize(pTopic->vgs);
for (int32_t j = 0; j < (*numOfAssignment); ++j) {
SMqClientVg* pClientVg = taosArrayGet(pTopic->vgs, j);
- int32_t type = pClientVg->offsetInfo.beginOffset.type;
+ int32_t type = pClientVg->offsetInfo.beginOffset.type;
if (isInSnapshotMode(type, tmq->useSnapshot)) {
tscError("consumer:0x%" PRIx64 " offset type:%d not wal version, assignment not allowed", tmq->consumerId, type);
code = TSDB_CODE_TMQ_SNAPSHOT_ERROR;
@@ -2939,8 +2970,8 @@ int32_t tmq_get_topic_assignment(tmq_t* tmq, const char* pTopicName, tmq_topic_a
pAssignment->begin = pClientVg->offsetInfo.walVerBegin;
pAssignment->end = pClientVg->offsetInfo.walVerEnd;
pAssignment->vgId = pClientVg->vgId;
- tscInfo("consumer:0x%" PRIx64 " get assignment from local:%d->%" PRId64, tmq->consumerId,
- pAssignment->vgId, pAssignment->currentOffset);
+ tscInfo("consumer:0x%" PRIx64 " get assignment from local:%d->%" PRId64, tmq->consumerId, pAssignment->vgId,
+ pAssignment->currentOffset);
}
if (needFetch) {
@@ -2951,7 +2982,7 @@ int32_t tmq_get_topic_assignment(tmq_t* tmq, const char* pTopicName, tmq_topic_a
goto end;
}
- pCommon->pList= taosArrayInit(4, sizeof(tmq_topic_assignment));
+ pCommon->pList = taosArrayInit(4, sizeof(tmq_topic_assignment));
tsem_init(&pCommon->rsp, 0, 0);
taosThreadMutexInit(&pCommon->mutex, 0);
pCommon->pTopicName = taosStrdup(pTopic->topicName);
@@ -3019,7 +3050,7 @@ int32_t tmq_get_topic_assignment(tmq_t* tmq, const char* pTopicName, tmq_topic_a
tscInfo("consumer:0x%" PRIx64 " %s retrieve wal info vgId:%d, epoch %d, req:%s, reqId:0x%" PRIx64,
tmq->consumerId, pTopic->topicName, pClientVg->vgId, tmq->epoch, offsetFormatBuf, req.reqId);
code = asyncSendMsgToServer(tmq->pTscObj->pAppInfo->pTransporter, &pClientVg->epSet, &transporterId, sendInfo);
- if(code != 0){
+ if (code != 0) {
taosMemoryFree(pParam);
taosMemoryFree(msg);
goto end;
@@ -3034,7 +3065,7 @@ int32_t tmq_get_topic_assignment(tmq_t* tmq, const char* pTopicName, tmq_topic_a
goto end;
}
int32_t num = taosArrayGetSize(pCommon->pList);
- for(int32_t i = 0; i < num; ++i) {
+ for (int32_t i = 0; i < num; ++i) {
(*assignment)[i] = *(tmq_topic_assignment*)taosArrayGet(pCommon->pList, i);
}
*numOfAssignment = num;
@@ -3042,14 +3073,15 @@ int32_t tmq_get_topic_assignment(tmq_t* tmq, const char* pTopicName, tmq_topic_a
for (int32_t j = 0; j < (*numOfAssignment); ++j) {
tmq_topic_assignment* p = &(*assignment)[j];
- for(int32_t i = 0; i < taosArrayGetSize(pTopic->vgs); ++i) {
+ for (int32_t i = 0; i < taosArrayGetSize(pTopic->vgs); ++i) {
SMqClientVg* pClientVg = taosArrayGet(pTopic->vgs, i);
if (pClientVg->vgId != p->vgId) {
continue;
}
SVgOffsetInfo* pOffsetInfo = &pClientVg->offsetInfo;
- tscInfo("consumer:0x%" PRIx64 " %s vgId:%d offset is update to:%"PRId64, tmq->consumerId, pTopic->topicName, p->vgId, p->currentOffset);
+ tscInfo("consumer:0x%" PRIx64 " %s vgId:%d offset is update to:%" PRId64, tmq->consumerId, pTopic->topicName,
+ p->vgId, p->currentOffset);
pOffsetInfo->walVerBegin = p->begin;
pOffsetInfo->walVerEnd = p->end;
@@ -3058,7 +3090,7 @@ int32_t tmq_get_topic_assignment(tmq_t* tmq, const char* pTopicName, tmq_topic_a
}
end:
- if(code != TSDB_CODE_SUCCESS){
+ if (code != TSDB_CODE_SUCCESS) {
taosMemoryFree(*assignment);
*assignment = NULL;
*numOfAssignment = 0;
@@ -3069,11 +3101,11 @@ end:
}
void tmq_free_assignment(tmq_topic_assignment* pAssignment) {
- if (pAssignment == NULL) {
- return;
- }
+ if (pAssignment == NULL) {
+ return;
+ }
- taosMemoryFree(pAssignment);
+ taosMemoryFree(pAssignment);
}
static int32_t tmqSeekCb(void* param, SDataBuf* pMsg, int32_t code) {
@@ -3087,7 +3119,8 @@ static int32_t tmqSeekCb(void* param, SDataBuf* pMsg, int32_t code) {
return 0;
}
-// seek interface have to send msg to server to cancel push handle if needed, because consumer may be in wait status if there is no data to poll
+// seek interface have to send msg to server to cancel push handle if needed, because consumer may be in wait status if
+// there is no data to poll
int32_t tmq_offset_seek(tmq_t* tmq, const char* pTopicName, int32_t vgId, int64_t offset) {
if (tmq == NULL || pTopicName == NULL) {
tscError("invalid tmq handle, null");
@@ -3095,14 +3128,14 @@ int32_t tmq_offset_seek(tmq_t* tmq, const char* pTopicName, int32_t vgId, int64_
}
int32_t accId = tmq->pTscObj->acctId;
- char tname[TSDB_TOPIC_FNAME_LEN] = {0};
+ char tname[TSDB_TOPIC_FNAME_LEN] = {0};
sprintf(tname, "%d.%s", accId, pTopicName);
taosWLockLatch(&tmq->lock);
SMqClientVg* pVg = NULL;
- int32_t code = getClientVg(tmq, tname, vgId, &pVg);
- if(code != 0){
+ int32_t code = getClientVg(tmq, tname, vgId, &pVg);
+ if (code != 0) {
taosWUnLockLatch(&tmq->lock);
return code;
}
@@ -3174,7 +3207,7 @@ int32_t tmq_offset_seek(tmq_t* tmq, const char* pTopicName, int32_t vgId, int64_
int64_t transporterId = 0;
code = asyncSendMsgToServer(tmq->pTscObj->pAppInfo->pTransporter, &epSet, &transporterId, sendInfo);
- if(code != 0){
+ if (code != 0) {
taosMemoryFree(msg);
taosMemoryFree(sendInfo);
tsem_destroy(&pParam->sem);
@@ -3192,9 +3225,9 @@ int32_t tmq_offset_seek(tmq_t* tmq, const char* pTopicName, int32_t vgId, int64_
return code;
}
-TAOS *tmq_get_connect(tmq_t *tmq){
+TAOS* tmq_get_connect(tmq_t* tmq) {
if (tmq && tmq->pTscObj) {
- return (TAOS *)(&(tmq->pTscObj->id));
+ return (TAOS*)(&(tmq->pTscObj->id));
}
return NULL;
}
diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h
index e27dbce282..fc58fabad5 100644
--- a/source/dnode/mnode/impl/inc/mndDef.h
+++ b/source/dnode/mnode/impl/inc/mndDef.h
@@ -699,6 +699,7 @@ typedef struct {
int64_t checkpointId;
int32_t indexForMultiAggBalance;
+ int8_t subTableWithoutMd5;
char reserve[256];
} SStreamObj;
diff --git a/source/dnode/mnode/impl/inc/mndStream.h b/source/dnode/mnode/impl/inc/mndStream.h
index 4d1125a340..1084340dc2 100644
--- a/source/dnode/mnode/impl/inc/mndStream.h
+++ b/source/dnode/mnode/impl/inc/mndStream.h
@@ -24,7 +24,7 @@ extern "C" {
#endif
#define MND_STREAM_RESERVE_SIZE 64
-#define MND_STREAM_VER_NUMBER 4
+#define MND_STREAM_VER_NUMBER 5
#define MND_STREAM_CREATE_NAME "stream-create"
#define MND_STREAM_CHECKPOINT_NAME "stream-checkpoint"
diff --git a/source/dnode/mnode/impl/src/mndConsumer.c b/source/dnode/mnode/impl/src/mndConsumer.c
index c7ae36b02c..da0c8c9333 100644
--- a/source/dnode/mnode/impl/src/mndConsumer.c
+++ b/source/dnode/mnode/impl/src/mndConsumer.c
@@ -15,20 +15,20 @@
#define _DEFAULT_SOURCE
#include "mndConsumer.h"
-#include "mndPrivilege.h"
-#include "mndVgroup.h"
-#include "mndShow.h"
#include "mndDb.h"
+#include "mndPrivilege.h"
+#include "mndShow.h"
#include "mndSubscribe.h"
#include "mndTopic.h"
#include "mndTrans.h"
+#include "mndVgroup.h"
#include "tcompare.h"
#include "tname.h"
#define MND_CONSUMER_VER_NUMBER 2
#define MND_CONSUMER_RESERVE_SIZE 64
-#define MND_MAX_GROUP_PER_TOPIC 100
+#define MND_MAX_GROUP_PER_TOPIC 100
static int32_t mndConsumerActionInsert(SSdb *pSdb, SMqConsumerObj *pConsumer);
static int32_t mndConsumerActionDelete(SSdb *pSdb, SMqConsumerObj *pConsumer);
@@ -56,7 +56,7 @@ int32_t mndInitConsumer(SMnode *pMnode) {
mndSetMsgHandle(pMnode, TDMT_MND_TMQ_SUBSCRIBE, mndProcessSubscribeReq);
mndSetMsgHandle(pMnode, TDMT_MND_TMQ_HB, mndProcessMqHbReq);
mndSetMsgHandle(pMnode, TDMT_MND_TMQ_ASK_EP, mndProcessAskEpReq);
-// mndSetMsgHandle(pMnode, TDMT_MND_TMQ_TIMER, mndProcessMqTimerMsg);
+ // mndSetMsgHandle(pMnode, TDMT_MND_TMQ_TIMER, mndProcessMqTimerMsg);
mndSetMsgHandle(pMnode, TDMT_MND_TMQ_CONSUMER_RECOVER, mndProcessConsumerRecoverMsg);
mndSetMsgHandle(pMnode, TDMT_MND_TMQ_LOST_CONSUMER_CLEAR, mndProcessConsumerClearMsg);
@@ -68,10 +68,11 @@ int32_t mndInitConsumer(SMnode *pMnode) {
void mndCleanupConsumer(SMnode *pMnode) {}
-void mndDropConsumerFromSdb(SMnode *pMnode, int64_t consumerId, SRpcHandleInfo* info){
+void mndDropConsumerFromSdb(SMnode *pMnode, int64_t consumerId, SRpcHandleInfo *info) {
SMqConsumerClearMsg *pClearMsg = rpcMallocCont(sizeof(SMqConsumerClearMsg));
if (pClearMsg == NULL) {
- mError("consumer:0x%"PRIx64" failed to clear consumer due to out of memory. alloc size:%d", consumerId, (int32_t)sizeof(SMqConsumerClearMsg));
+ mError("consumer:0x%" PRIx64 " failed to clear consumer due to out of memory. alloc size:%d", consumerId,
+ (int32_t)sizeof(SMqConsumerClearMsg));
return;
}
@@ -88,13 +89,14 @@ void mndDropConsumerFromSdb(SMnode *pMnode, int64_t consumerId, SRpcHandleInfo*
return;
}
-static int32_t validateTopics(STrans *pTrans, const SArray *pTopicList, SMnode *pMnode, const char *pUser, bool enableReplay) {
+static int32_t validateTopics(STrans *pTrans, const SArray *pTopicList, SMnode *pMnode, const char *pUser,
+ bool enableReplay) {
SMqTopicObj *pTopic = NULL;
- int32_t code = 0;
+ int32_t code = 0;
int32_t numOfTopics = taosArrayGetSize(pTopicList);
for (int32_t i = 0; i < numOfTopics; i++) {
- char *pOneTopic = taosArrayGetP(pTopicList, i);
+ char *pOneTopic = taosArrayGetP(pTopicList, i);
pTopic = mndAcquireTopic(pMnode, pOneTopic);
if (pTopic == NULL) { // terrno has been set by callee function
code = -1;
@@ -112,11 +114,11 @@ static int32_t validateTopics(STrans *pTrans, const SArray *pTopicList, SMnode *
goto FAILED;
}
- if(enableReplay){
- if(pTopic->subType != TOPIC_SUB_TYPE__COLUMN){
+ if (enableReplay) {
+ if (pTopic->subType != TOPIC_SUB_TYPE__COLUMN) {
code = TSDB_CODE_TMQ_REPLAY_NOT_SUPPORT;
goto FAILED;
- }else if(pTopic->ntbUid == 0 && pTopic->ctbStbUid == 0) {
+ } else if (pTopic->ntbUid == 0 && pTopic->ctbStbUid == 0) {
SDbObj *pDb = mndAcquireDb(pMnode, pTopic->db);
if (pDb == NULL) {
code = -1;
@@ -132,7 +134,7 @@ static int32_t validateTopics(STrans *pTrans, const SArray *pTopicList, SMnode *
}
mndTransSetDbName(pTrans, pOneTopic, NULL);
- if(mndTransCheckConflict(pMnode, pTrans) != 0){
+ if (mndTransCheckConflict(pMnode, pTrans) != 0) {
code = -1;
goto FAILED;
}
@@ -172,7 +174,7 @@ static int32_t mndProcessConsumerRecoverMsg(SRpcMsg *pMsg) {
if (pTrans == NULL) {
goto FAIL;
}
- if(validateTopics(pTrans, pConsumer->assignedTopics, pMnode, pMsg->info.conn.user, false) != 0){
+ if (validateTopics(pTrans, pConsumer->assignedTopics, pMnode, pMsg->info.conn.user, false) != 0) {
goto FAIL;
}
@@ -197,7 +199,7 @@ static int32_t mndProcessConsumerClearMsg(SRpcMsg *pMsg) {
SMqConsumerObj *pConsumer = mndAcquireConsumer(pMnode, pClearMsg->consumerId);
if (pConsumer == NULL) {
- mError("consumer:0x%"PRIx64" failed to be found to clear it", pClearMsg->consumerId);
+ mError("consumer:0x%" PRIx64 " failed to be found to clear it", pClearMsg->consumerId);
return 0;
}
@@ -226,15 +228,15 @@ FAIL:
return -1;
}
-static int32_t checkPrivilege(SMnode *pMnode, SMqConsumerObj *pConsumer, SMqHbRsp *rsp, char* user){
+static int32_t checkPrivilege(SMnode *pMnode, SMqConsumerObj *pConsumer, SMqHbRsp *rsp, char *user) {
rsp->topicPrivileges = taosArrayInit(taosArrayGetSize(pConsumer->currentTopics), sizeof(STopicPrivilege));
- if(rsp->topicPrivileges == NULL){
+ if (rsp->topicPrivileges == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
return terrno;
}
- for(int32_t i = 0; i < taosArrayGetSize(pConsumer->currentTopics); i++){
- char *topic = taosArrayGetP(pConsumer->currentTopics, i);
- SMqTopicObj* pTopic = mndAcquireTopic(pMnode, topic);
+ for (int32_t i = 0; i < taosArrayGetSize(pConsumer->currentTopics); i++) {
+ char *topic = taosArrayGetP(pConsumer->currentTopics, i);
+ SMqTopicObj *pTopic = mndAcquireTopic(pMnode, topic);
if (pTopic == NULL) { // terrno has been set by callee function
continue;
}
@@ -252,10 +254,10 @@ static int32_t checkPrivilege(SMnode *pMnode, SMqConsumerObj *pConsumer, SMqHbR
}
static int32_t mndProcessMqHbReq(SRpcMsg *pMsg) {
- int32_t code = 0;
- SMnode *pMnode = pMsg->info.node;
- SMqHbReq req = {0};
- SMqHbRsp rsp = {0};
+ int32_t code = 0;
+ SMnode *pMnode = pMsg->info.node;
+ SMqHbReq req = {0};
+ SMqHbRsp rsp = {0};
SMqConsumerObj *pConsumer = NULL;
if (tDeserializeSMqHbReq(pMsg->pCont, pMsg->contLen, &req) < 0) {
@@ -264,7 +266,7 @@ static int32_t mndProcessMqHbReq(SRpcMsg *pMsg) {
goto end;
}
- int64_t consumerId = req.consumerId;
+ int64_t consumerId = req.consumerId;
pConsumer = mndAcquireConsumer(pMnode, consumerId);
if (pConsumer == NULL) {
mError("consumer:0x%" PRIx64 " not exist", consumerId);
@@ -273,7 +275,7 @@ static int32_t mndProcessMqHbReq(SRpcMsg *pMsg) {
goto end;
}
code = checkPrivilege(pMnode, pConsumer, &rsp, pMsg->info.conn.user);
- if(code != 0){
+ if (code != 0) {
goto end;
}
@@ -295,12 +297,12 @@ static int32_t mndProcessMqHbReq(SRpcMsg *pMsg) {
tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &pRpcMsg);
}
- for(int i = 0; i < taosArrayGetSize(req.topics); i++){
- TopicOffsetRows* data = taosArrayGet(req.topics, i);
+ for (int i = 0; i < taosArrayGetSize(req.topics); i++) {
+ TopicOffsetRows *data = taosArrayGet(req.topics, i);
mInfo("heartbeat report offset rows.%s:%s", pConsumer->cgroup, data->topicName);
SMqSubscribeObj *pSub = mndAcquireSubscribe(pMnode, pConsumer->cgroup, data->topicName);
- if(pSub == NULL){
+ if (pSub == NULL) {
#ifdef TMQ_DEBUG
ASSERT(0);
#endif
@@ -308,7 +310,7 @@ static int32_t mndProcessMqHbReq(SRpcMsg *pMsg) {
}
taosWLockLatch(&pSub->lock);
SMqConsumerEp *pConsumerEp = taosHashGet(pSub->consumerHash, &consumerId, sizeof(int64_t));
- if(pConsumerEp){
+ if (pConsumerEp) {
taosArrayDestroy(pConsumerEp->offsetRows);
pConsumerEp->offsetRows = data->offsetRows;
data->offsetRows = NULL;
@@ -413,7 +415,7 @@ static int32_t mndProcessAskEpReq(SRpcMsg *pMsg) {
char *topic = taosArrayGetP(pConsumer->currentTopics, i);
SMqSubscribeObj *pSub = mndAcquireSubscribe(pMnode, pConsumer->cgroup, topic);
// txn guarantees pSub is created
- if(pSub == NULL) {
+ if (pSub == NULL) {
#ifdef TMQ_DEBUG
ASSERT(0);
#endif
@@ -426,7 +428,7 @@ static int32_t mndProcessAskEpReq(SRpcMsg *pMsg) {
// 2.1 fetch topic schema
SMqTopicObj *pTopic = mndAcquireTopic(pMnode, topic);
- if(pTopic == NULL) {
+ if (pTopic == NULL) {
#ifdef TMQ_DEBUG
ASSERT(0);
#endif
@@ -460,12 +462,12 @@ static int32_t mndProcessAskEpReq(SRpcMsg *pMsg) {
for (int32_t j = 0; j < vgNum; j++) {
SMqVgEp *pVgEp = taosArrayGetP(pConsumerEp->vgs, j);
-// char offsetKey[TSDB_PARTITION_KEY_LEN];
-// mndMakePartitionKey(offsetKey, pConsumer->cgroup, topic, pVgEp->vgId);
+ // char offsetKey[TSDB_PARTITION_KEY_LEN];
+ // mndMakePartitionKey(offsetKey, pConsumer->cgroup, topic, pVgEp->vgId);
- if(epoch == -1){
+ if (epoch == -1) {
SVgObj *pVgroup = mndAcquireVgroup(pMnode, pVgEp->vgId);
- if(pVgroup){
+ if (pVgroup) {
pVgEp->epSet = mndGetVgroupEpset(pMnode, pVgroup);
mndReleaseVgroup(pMnode, pVgroup);
}
@@ -495,7 +497,7 @@ static int32_t mndProcessAskEpReq(SRpcMsg *pMsg) {
goto FAIL;
}
- SMqRspHead* pHead = buf;
+ SMqRspHead *pHead = buf;
pHead->mqMsgType = TMQ_MSG_TYPE__EP_RSP;
pHead->epoch = serverEpoch;
@@ -503,7 +505,6 @@ static int32_t mndProcessAskEpReq(SRpcMsg *pMsg) {
pHead->walsver = 0;
pHead->walever = 0;
-
void *abuf = POINTER_SHIFT(buf, sizeof(SMqRspHead));
tEncodeSMqAskEpRsp(&abuf, &rsp);
@@ -560,21 +561,20 @@ int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
SCMSubscribeReq subscribe = {0};
tDeserializeSCMSubscribeReq(msgStr, &subscribe);
- int64_t consumerId = subscribe.consumerId;
+ int64_t consumerId = subscribe.consumerId;
char *cgroup = subscribe.cgroup;
SMqConsumerObj *pExistedConsumer = NULL;
SMqConsumerObj *pConsumerNew = NULL;
- STrans *pTrans = NULL;
+ STrans *pTrans = NULL;
-
SArray *pTopicList = subscribe.topicNames;
taosArraySort(pTopicList, taosArrayCompareString);
taosArrayRemoveDuplicate(pTopicList, taosArrayCompareString, freeItem);
int32_t newTopicNum = taosArrayGetSize(pTopicList);
- for(int i = 0; i < newTopicNum; i++){
- int32_t gNum = mndGetGroupNumByTopic(pMnode, (const char*)taosArrayGetP(pTopicList, i));
- if(gNum >= MND_MAX_GROUP_PER_TOPIC){
+ for (int i = 0; i < newTopicNum; i++) {
+ int32_t gNum = mndGetGroupNumByTopic(pMnode, (const char *)taosArrayGetP(pTopicList, i));
+ if (gNum >= MND_MAX_GROUP_PER_TOPIC) {
terrno = TSDB_CODE_TMQ_GROUP_OUT_OF_RANGE;
code = terrno;
goto _over;
@@ -605,7 +605,7 @@ int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
pConsumerNew->autoCommitInterval = subscribe.autoCommitInterval;
pConsumerNew->resetOffsetCfg = subscribe.resetOffsetCfg;
-// pConsumerNew->updateType = CONSUMER_UPDATE_SUB; // use insert logic
+ // pConsumerNew->updateType = CONSUMER_UPDATE_SUB; // use insert logic
taosArrayDestroy(pConsumerNew->assignedTopics);
pConsumerNew->assignedTopics = taosArrayDup(pTopicList, topicNameDup);
@@ -792,16 +792,15 @@ CM_DECODE_OVER:
}
static int32_t mndConsumerActionInsert(SSdb *pSdb, SMqConsumerObj *pConsumer) {
- mInfo("consumer:0x%" PRIx64 " sub insert, cgroup:%s status:%d(%s) epoch:%d",
- pConsumer->consumerId, pConsumer->cgroup, pConsumer->status, mndConsumerStatusName(pConsumer->status),
- pConsumer->epoch);
+ mInfo("consumer:0x%" PRIx64 " sub insert, cgroup:%s status:%d(%s) epoch:%d", pConsumer->consumerId, pConsumer->cgroup,
+ pConsumer->status, mndConsumerStatusName(pConsumer->status), pConsumer->epoch);
pConsumer->subscribeTime = pConsumer->createTime;
return 0;
}
static int32_t mndConsumerActionDelete(SSdb *pSdb, SMqConsumerObj *pConsumer) {
mInfo("consumer:0x%" PRIx64 " perform delete action, status:(%d)%s", pConsumer->consumerId, pConsumer->status,
- mndConsumerStatusName(pConsumer->status));
+ mndConsumerStatusName(pConsumer->status));
tDeleteSMqConsumerObj(pConsumer, false);
return 0;
}
@@ -828,7 +827,7 @@ static void removeFromNewTopicList(SMqConsumerObj *pConsumer, const char *pTopic
taosMemoryFree(p);
mInfo("consumer:0x%" PRIx64 " remove new topic:%s in the topic list, remain newTopics:%d", pConsumer->consumerId,
- pTopic, (int)taosArrayGetSize(pConsumer->rebNewTopics));
+ pTopic, (int)taosArrayGetSize(pConsumer->rebNewTopics));
break;
}
}
@@ -844,7 +843,7 @@ static void removeFromRemoveTopicList(SMqConsumerObj *pConsumer, const char *pTo
taosMemoryFree(p);
mInfo("consumer:0x%" PRIx64 " remove topic:%s in the removed topic list, remain removedTopics:%d",
- pConsumer->consumerId, pTopic, (int)taosArrayGetSize(pConsumer->rebRemovedTopics));
+ pConsumer->consumerId, pTopic, (int)taosArrayGetSize(pConsumer->rebRemovedTopics));
break;
}
}
@@ -859,13 +858,13 @@ static void removeFromCurrentTopicList(SMqConsumerObj *pConsumer, const char *pT
taosMemoryFree(topic);
mInfo("consumer:0x%" PRIx64 " remove topic:%s in the current topic list, remain currentTopics:%d",
- pConsumer->consumerId, pTopic, (int)taosArrayGetSize(pConsumer->currentTopics));
+ pConsumer->consumerId, pTopic, (int)taosArrayGetSize(pConsumer->currentTopics));
break;
}
}
}
-static bool existInCurrentTopicList(const SMqConsumerObj* pConsumer, const char* pTopic) {
+static bool existInCurrentTopicList(const SMqConsumerObj *pConsumer, const char *pTopic) {
bool existing = false;
int32_t size = taosArrayGetSize(pConsumer->currentTopics);
for (int32_t i = 0; i < size; i++) {
@@ -882,7 +881,7 @@ static bool existInCurrentTopicList(const SMqConsumerObj* pConsumer, const char*
static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer, SMqConsumerObj *pNewConsumer) {
mInfo("consumer:0x%" PRIx64 " perform update action, update type:%d, subscribe-time:%" PRId64 ", createTime:%" PRId64,
- pOldConsumer->consumerId, pNewConsumer->updateType, pOldConsumer->subscribeTime, pOldConsumer->createTime);
+ pOldConsumer->consumerId, pNewConsumer->updateType, pOldConsumer->subscribeTime, pOldConsumer->createTime);
taosWLockLatch(&pOldConsumer->lock);
@@ -893,19 +892,21 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
pOldConsumer->subscribeTime = taosGetTimestampMs();
pOldConsumer->status = MQ_CONSUMER_STATUS_REBALANCE;
- mInfo("consumer:0x%" PRIx64 " sub update, modify existed consumer",pOldConsumer->consumerId);
-// } else if (pNewConsumer->updateType == CONSUMER_UPDATE_TIMER_LOST) {
-// int32_t sz = taosArrayGetSize(pOldConsumer->currentTopics);
-// for (int32_t i = 0; i < sz; i++) {
-// char *topic = taosStrdup(taosArrayGetP(pOldConsumer->currentTopics, i));
-// taosArrayPush(pOldConsumer->rebRemovedTopics, &topic);
-// }
-//
-// int32_t prevStatus = pOldConsumer->status;
-// pOldConsumer->status = MQ_CONSUMER_STATUS_LOST;
-// mInfo("consumer:0x%" PRIx64 " timer update, timer lost. state %s -> %s, reb-time:%" PRId64 ", reb-removed-topics:%d",
-// pOldConsumer->consumerId, mndConsumerStatusName(prevStatus), mndConsumerStatusName(pOldConsumer->status),
-// pOldConsumer->rebalanceTime, (int)taosArrayGetSize(pOldConsumer->rebRemovedTopics));
+ mInfo("consumer:0x%" PRIx64 " sub update, modify existed consumer", pOldConsumer->consumerId);
+ // } else if (pNewConsumer->updateType == CONSUMER_UPDATE_TIMER_LOST) {
+ // int32_t sz = taosArrayGetSize(pOldConsumer->currentTopics);
+ // for (int32_t i = 0; i < sz; i++) {
+ // char *topic = taosStrdup(taosArrayGetP(pOldConsumer->currentTopics, i));
+ // taosArrayPush(pOldConsumer->rebRemovedTopics, &topic);
+ // }
+ //
+ // int32_t prevStatus = pOldConsumer->status;
+ // pOldConsumer->status = MQ_CONSUMER_STATUS_LOST;
+ // mInfo("consumer:0x%" PRIx64 " timer update, timer lost. state %s -> %s, reb-time:%" PRId64 ",
+ // reb-removed-topics:%d",
+ // pOldConsumer->consumerId, mndConsumerStatusName(prevStatus),
+ // mndConsumerStatusName(pOldConsumer->status), pOldConsumer->rebalanceTime,
+ // (int)taosArrayGetSize(pOldConsumer->rebRemovedTopics));
} else if (pNewConsumer->updateType == CONSUMER_UPDATE_REC) {
int32_t sz = taosArrayGetSize(pOldConsumer->assignedTopics);
for (int32_t i = 0; i < sz; i++) {
@@ -914,7 +915,7 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
}
pOldConsumer->status = MQ_CONSUMER_STATUS_REBALANCE;
- mInfo("consumer:0x%" PRIx64 " timer update, timer recover",pOldConsumer->consumerId);
+ mInfo("consumer:0x%" PRIx64 " timer update, timer recover", pOldConsumer->consumerId);
} else if (pNewConsumer->updateType == CONSUMER_UPDATE_REB) {
atomic_add_fetch_32(&pOldConsumer->epoch, 1);
@@ -945,11 +946,11 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
atomic_add_fetch_32(&pOldConsumer->epoch, 1);
mInfo("consumer:0x%" PRIx64 " reb update add, state (%d)%s -> (%d)%s, new epoch:%d, reb-time:%" PRId64
- ", current topics:%d, newTopics:%d, removeTopics:%d",
- pOldConsumer->consumerId, status, mndConsumerStatusName(status), pOldConsumer->status,
- mndConsumerStatusName(pOldConsumer->status), pOldConsumer->epoch, pOldConsumer->rebalanceTime,
- (int)taosArrayGetSize(pOldConsumer->currentTopics), (int)taosArrayGetSize(pOldConsumer->rebNewTopics),
- (int)taosArrayGetSize(pOldConsumer->rebRemovedTopics));
+ ", current topics:%d, newTopics:%d, removeTopics:%d",
+ pOldConsumer->consumerId, status, mndConsumerStatusName(status), pOldConsumer->status,
+ mndConsumerStatusName(pOldConsumer->status), pOldConsumer->epoch, pOldConsumer->rebalanceTime,
+ (int)taosArrayGetSize(pOldConsumer->currentTopics), (int)taosArrayGetSize(pOldConsumer->rebNewTopics),
+ (int)taosArrayGetSize(pOldConsumer->rebRemovedTopics));
} else if (pNewConsumer->updateType == CONSUMER_REMOVE_REB) {
char *removedTopic = taosArrayGetP(pNewConsumer->rebRemovedTopics, 0);
@@ -968,11 +969,11 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer,
atomic_add_fetch_32(&pOldConsumer->epoch, 1);
mInfo("consumer:0x%" PRIx64 " reb update remove, state (%d)%s -> (%d)%s, new epoch:%d, reb-time:%" PRId64
- ", current topics:%d, newTopics:%d, removeTopics:%d",
- pOldConsumer->consumerId, status, mndConsumerStatusName(status), pOldConsumer->status,
- mndConsumerStatusName(pOldConsumer->status), pOldConsumer->epoch, pOldConsumer->rebalanceTime,
- (int)taosArrayGetSize(pOldConsumer->currentTopics), (int)taosArrayGetSize(pOldConsumer->rebNewTopics),
- (int)taosArrayGetSize(pOldConsumer->rebRemovedTopics));
+ ", current topics:%d, newTopics:%d, removeTopics:%d",
+ pOldConsumer->consumerId, status, mndConsumerStatusName(status), pOldConsumer->status,
+ mndConsumerStatusName(pOldConsumer->status), pOldConsumer->epoch, pOldConsumer->rebalanceTime,
+ (int)taosArrayGetSize(pOldConsumer->currentTopics), (int)taosArrayGetSize(pOldConsumer->rebNewTopics),
+ (int)taosArrayGetSize(pOldConsumer->rebRemovedTopics));
}
taosWUnLockLatch(&pOldConsumer->lock);
@@ -1030,8 +1031,8 @@ static int32_t mndRetrieveConsumer(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *
int32_t cols = 0;
// consumer id
- char consumerIdHex[32] = {0};
- sprintf(varDataVal(consumerIdHex), "0x%"PRIx64, pConsumer->consumerId);
+ char consumerIdHex[32] = {0};
+ sprintf(varDataVal(consumerIdHex), "0x%" PRIx64, pConsumer->consumerId);
varDataSetLen(consumerIdHex, strlen(varDataVal(consumerIdHex)));
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
@@ -1086,12 +1087,13 @@ static int32_t mndRetrieveConsumer(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
colDataSetVal(pColInfo, numOfRows, (const char *)&pConsumer->rebalanceTime, pConsumer->rebalanceTime == 0);
- char buf[TSDB_OFFSET_LEN] = {0};
+ char buf[TSDB_OFFSET_LEN] = {0};
STqOffsetVal pVal = {.type = pConsumer->resetOffsetCfg};
tFormatOffset(buf, TSDB_OFFSET_LEN, &pVal);
char parasStr[64 + TSDB_OFFSET_LEN + VARSTR_HEADER_SIZE] = {0};
- sprintf(varDataVal(parasStr), "tbname:%d,commit:%d,interval:%dms,reset:%s", pConsumer->withTbName, pConsumer->autoCommit, pConsumer->autoCommitInterval, buf);
+ sprintf(varDataVal(parasStr), "tbname:%d,commit:%d,interval:%dms,reset:%s", pConsumer->withTbName,
+ pConsumer->autoCommit, pConsumer->autoCommitInterval, buf);
varDataSetLen(parasStr, strlen(varDataVal(parasStr)));
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
diff --git a/source/dnode/mnode/impl/src/mndDef.c b/source/dnode/mnode/impl/src/mndDef.c
index d59354286d..5be641d1c2 100644
--- a/source/dnode/mnode/impl/src/mndDef.c
+++ b/source/dnode/mnode/impl/src/mndDef.c
@@ -85,6 +85,7 @@ int32_t tEncodeSStreamObj(SEncoder *pEncoder, const SStreamObj *pObj) {
// 3.0.50 ver = 3
if (tEncodeI64(pEncoder, pObj->checkpointId) < 0) return -1;
+ if (tEncodeI8(pEncoder, pObj->subTableWithoutMd5) < 0) return -1;
if (tEncodeCStrWithLen(pEncoder, pObj->reserve, sizeof(pObj->reserve) - 1) < 0) return -1;
@@ -168,6 +169,10 @@ int32_t tDecodeSStreamObj(SDecoder *pDecoder, SStreamObj *pObj, int32_t sver) {
if (sver >= 3) {
if (tDecodeI64(pDecoder, &pObj->checkpointId) < 0) return -1;
}
+
+ if (sver >= 5) {
+ if (tDecodeI8(pDecoder, &pObj->subTableWithoutMd5) < 0) return -1;
+ }
if (tDecodeCStrTo(pDecoder, pObj->reserve) < 0) return -1;
tEndDecode(pDecoder);
diff --git a/source/dnode/mnode/impl/src/mndScheduler.c b/source/dnode/mnode/impl/src/mndScheduler.c
index 8fedd35894..a8eaf7c711 100644
--- a/source/dnode/mnode/impl/src/mndScheduler.c
+++ b/source/dnode/mnode/impl/src/mndScheduler.c
@@ -221,8 +221,8 @@ static int32_t doAddSinkTask(SStreamObj* pStream, SMnode* pMnode, SVgObj* pVgrou
int64_t uid = (isFillhistory) ? pStream->hTaskUid : pStream->uid;
SArray** pTaskList = (isFillhistory) ? taosArrayGetLast(pStream->pHTasksList) : taosArrayGetLast(pStream->tasks);
- SStreamTask* pTask =
- tNewStreamTask(uid, TASK_LEVEL__SINK, pEpset, isFillhistory, 0, *pTaskList, pStream->conf.fillHistory);
+ SStreamTask* pTask = tNewStreamTask(uid, TASK_LEVEL__SINK, pEpset, isFillhistory, 0, *pTaskList,
+ pStream->conf.fillHistory, pStream->subTableWithoutMd5);
if (pTask == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
return terrno;
@@ -326,7 +326,7 @@ static SStreamTask* buildSourceTask(SStreamObj* pStream, SEpSet* pEpset, bool is
SStreamTask* pTask =
tNewStreamTask(uid, TASK_LEVEL__SOURCE, pEpset, isFillhistory, useTriggerParam ? pStream->conf.triggerParam : 0,
- *pTaskList, pStream->conf.fillHistory);
+ *pTaskList, pStream->conf.fillHistory, pStream->subTableWithoutMd5);
if (pTask == NULL) {
return NULL;
}
@@ -463,7 +463,7 @@ static SStreamTask* buildAggTask(SStreamObj* pStream, SEpSet* pEpset, bool isFil
SStreamTask* pAggTask =
tNewStreamTask(uid, TASK_LEVEL__AGG, pEpset, isFillhistory, useTriggerParam ? pStream->conf.triggerParam : 0,
- *pTaskList, pStream->conf.fillHistory);
+ *pTaskList, pStream->conf.fillHistory, pStream->subTableWithoutMd5);
if (pAggTask == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
return NULL;
diff --git a/source/dnode/mnode/impl/src/mndSma.c b/source/dnode/mnode/impl/src/mndSma.c
index 9b4a50b553..05189d5a53 100644
--- a/source/dnode/mnode/impl/src/mndSma.c
+++ b/source/dnode/mnode/impl/src/mndSma.c
@@ -567,6 +567,7 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea
streamObj.conf.triggerParam = pCreate->maxDelay;
streamObj.ast = taosStrdup(smaObj.ast);
streamObj.indexForMultiAggBalance = -1;
+ streamObj.subTableWithoutMd5 = 1;
// check the maxDelay
if (streamObj.conf.triggerParam < TSDB_MIN_ROLLUP_MAX_DELAY) {
diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c
index bde6889ecd..2e6242aec3 100644
--- a/source/dnode/vnode/src/tq/tq.c
+++ b/source/dnode/vnode/src/tq/tq.c
@@ -14,8 +14,8 @@
*/
#include "tq.h"
-#include "vnd.h"
#include "tqCommon.h"
+#include "vnd.h"
// 0: not init
// 1: already inited
@@ -862,9 +862,7 @@ int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t nextProcessVer) {
return 0;
}
-int32_t tqProcessTaskCheckReq(STQ* pTq, SRpcMsg* pMsg) {
- return tqStreamTaskProcessCheckReq(pTq->pStreamMeta, pMsg);
-}
+int32_t tqProcessTaskCheckReq(STQ* pTq, SRpcMsg* pMsg) { return tqStreamTaskProcessCheckReq(pTq->pStreamMeta, pMsg); }
int32_t tqProcessTaskCheckRsp(STQ* pTq, SRpcMsg* pMsg) {
return tqStreamTaskProcessCheckRsp(pTq->pStreamMeta, pMsg, vnodeIsRoleLeader(pTq->pVnode));
@@ -988,7 +986,7 @@ int32_t tqProcessTaskScanHistory(STQ* pTq, SRpcMsg* pMsg) {
streamReExecScanHistoryFuture(pTask, retInfo.idleTime);
} else {
SStreamTaskState* p = streamTaskGetStatus(pTask);
- ETaskStatus s = p->state;
+ ETaskStatus s = p->state;
if (s == TASK_STATUS__PAUSE) {
tqDebug("s-task:%s is paused in the step1, elapsed time:%.2fs total:%.2fs, sched-status:%d", pTask->id.idStr,
@@ -1062,7 +1060,7 @@ int32_t tqProcessTaskRunReq(STQ* pTq, SRpcMsg* pMsg) {
}
int32_t tqProcessTaskDispatchReq(STQ* pTq, SRpcMsg* pMsg) {
- return tqStreamTaskProcessDispatchReq(pTq->pStreamMeta, pMsg);
+ return tqStreamTaskProcessDispatchReq(pTq->pStreamMeta, pMsg);
}
int32_t tqProcessTaskDispatchRsp(STQ* pTq, SRpcMsg* pMsg) {
@@ -1101,7 +1099,7 @@ int32_t tqProcessTaskCheckPointSourceReq(STQ* pTq, SRpcMsg* pMsg, SRpcMsg* pRsp)
pRsp->info.handle = NULL;
SStreamCheckpointSourceReq req = {0};
- SDecoder decoder;
+ SDecoder decoder;
tDecoderInit(&decoder, (uint8_t*)msg, len);
if (tDecodeStreamCheckpointSourceReq(&decoder, &req) < 0) {
code = TSDB_CODE_MSG_DECODE_ERROR;
@@ -1192,8 +1190,8 @@ int32_t tqProcessTaskCheckPointSourceReq(STQ* pTq, SRpcMsg* pMsg, SRpcMsg* pRsp)
streamProcessCheckpointSourceReq(pTask, &req);
taosThreadMutexUnlock(&pTask->lock);
- qInfo("s-task:%s (vgId:%d) level:%d receive checkpoint-source msg chkpt:%" PRId64 ", transId:%d",
- pTask->id.idStr, vgId, pTask->info.taskLevel, req.checkpointId, req.transId);
+ qInfo("s-task:%s (vgId:%d) level:%d receive checkpoint-source msg chkpt:%" PRId64 ", transId:%d", pTask->id.idStr,
+ vgId, pTask->info.taskLevel, req.checkpointId, req.transId);
code = streamAddCheckpointSourceRspMsg(&req, &pMsg->info, pTask, 1);
if (code != TSDB_CODE_SUCCESS) {
diff --git a/source/dnode/vnode/src/tq/tqHandleSnapshot.c b/source/dnode/vnode/src/tq/tqHandleSnapshot.c
index 3ce838ce8b..28fd315eb6 100644
--- a/source/dnode/vnode/src/tq/tqHandleSnapshot.c
+++ b/source/dnode/vnode/src/tq/tqHandleSnapshot.c
@@ -74,11 +74,11 @@ int32_t tqSnapReaderClose(STqSnapReader** ppReader) {
}
int32_t tqSnapRead(STqSnapReader* pReader, uint8_t** ppData) {
- int32_t code = 0;
- void* pKey = NULL;
- void* pVal = NULL;
- int32_t kLen = 0;
- int32_t vLen = 0;
+ int32_t code = 0;
+ void* pKey = NULL;
+ void* pVal = NULL;
+ int32_t kLen = 0;
+ int32_t vLen = 0;
if (tdbTbcNext(pReader->pCur, &pKey, &kLen, &pVal, &vLen)) {
goto _exit;
diff --git a/source/dnode/vnode/src/tq/tqRead.c b/source/dnode/vnode/src/tq/tqRead.c
index 3ae007ce34..727157a2f8 100644
--- a/source/dnode/vnode/src/tq/tqRead.c
+++ b/source/dnode/vnode/src/tq/tqRead.c
@@ -207,8 +207,8 @@ int32_t tqFetchLog(STQ* pTq, STqHandle* pHandle, int64_t* fetchOffset, uint64_t
goto END;
}
- tqDebug("vgId:%d, consumer:0x%" PRIx64 " taosx get msg ver %" PRId64 ", type: %s, reqId:0x%" PRIx64" 0x%"PRIx64, vgId,
- pHandle->consumerId, offset, TMSG_INFO(pHandle->pWalReader->pHead->head.msgType), reqId, id);
+ tqDebug("vgId:%d, consumer:0x%" PRIx64 " taosx get msg ver %" PRId64 ", type: %s, reqId:0x%" PRIx64 " 0x%" PRIx64,
+ vgId, pHandle->consumerId, offset, TMSG_INFO(pHandle->pWalReader->pHead->head.msgType), reqId, id);
if (pHandle->pWalReader->pHead->head.msgType == TDMT_VND_SUBMIT) {
code = walFetchBody(pHandle->pWalReader);
@@ -303,7 +303,7 @@ int32_t tqReaderSeek(STqReader* pReader, int64_t ver, const char* id) {
int32_t extractMsgFromWal(SWalReader* pReader, void** pItem, int64_t maxVer, const char* id) {
int32_t code = 0;
- while(1) {
+ while (1) {
code = walNextValidMsg(pReader);
if (code != TSDB_CODE_SUCCESS) {
return code;
@@ -322,7 +322,8 @@ int32_t extractMsgFromWal(SWalReader* pReader, void** pItem, int64_t maxVer, con
void* data = taosMemoryMalloc(len);
if (data == NULL) {
- // todo: for all stream in this vnode, keep this offset in the offset files, and wait for a moment, and then retry
+ // todo: for all stream in this vnode, keep this offset in the offset files, and wait for a moment, and then
+ // retry
code = TSDB_CODE_OUT_OF_MEMORY;
terrno = code;
@@ -369,7 +370,7 @@ int32_t extractMsgFromWal(SWalReader* pReader, void** pItem, int64_t maxVer, con
// todo ignore the error in wal?
bool tqNextBlockInWal(STqReader* pReader, const char* id, int sourceExcluded) {
- SWalReader* pWalReader = pReader->pWalReader;
+ SWalReader* pWalReader = pReader->pWalReader;
SSDataBlock* pDataBlock = NULL;
uint64_t st = taosGetTimestampMs();
@@ -387,22 +388,22 @@ bool tqNextBlockInWal(STqReader* pReader, const char* id, int sourceExcluded) {
pReader->nextBlk = 0;
int32_t numOfBlocks = taosArrayGetSize(pReader->submit.aSubmitTbData);
while (pReader->nextBlk < numOfBlocks) {
- tqTrace("tq reader next data block %d/%d, len:%d %" PRId64, pReader->nextBlk,
- numOfBlocks, pReader->msg.msgLen, pReader->msg.ver);
+ tqTrace("tq reader next data block %d/%d, len:%d %" PRId64, pReader->nextBlk, numOfBlocks, pReader->msg.msgLen,
+ pReader->msg.ver);
SSubmitTbData* pSubmitTbData = taosArrayGet(pReader->submit.aSubmitTbData, pReader->nextBlk);
- if ((pSubmitTbData->source & sourceExcluded) != 0){
+ if ((pSubmitTbData->source & sourceExcluded) != 0) {
pReader->nextBlk += 1;
continue;
}
if (pReader->tbIdHash == NULL || taosHashGet(pReader->tbIdHash, &pSubmitTbData->uid, sizeof(int64_t)) != NULL) {
tqTrace("tq reader return submit block, uid:%" PRId64, pSubmitTbData->uid);
SSDataBlock* pRes = NULL;
- int32_t code = tqRetrieveDataBlock(pReader, &pRes, NULL);
+ int32_t code = tqRetrieveDataBlock(pReader, &pRes, NULL);
if (code == TSDB_CODE_SUCCESS && pRes->info.rows > 0) {
- if(pDataBlock == NULL){
+ if (pDataBlock == NULL) {
pDataBlock = createOneDataBlock(pRes, true);
- }else{
+ } else {
blockDataMerge(pDataBlock, pRes);
}
}
@@ -414,16 +415,16 @@ bool tqNextBlockInWal(STqReader* pReader, const char* id, int sourceExcluded) {
tDestroySubmitReq(&pReader->submit, TSDB_MSG_FLG_DECODE);
pReader->msg.msgStr = NULL;
- if(pDataBlock != NULL){
+ if (pDataBlock != NULL) {
blockDataCleanup(pReader->pResBlock);
copyDataBlock(pReader->pResBlock, pDataBlock);
blockDataDestroy(pDataBlock);
return true;
- }else{
+ } else {
qTrace("stream scan return empty, all %d submit blocks consumed, %s", numOfBlocks, id);
}
- if(taosGetTimestampMs() - st > 1000){
+ if (taosGetTimestampMs() - st > 1000) {
return false;
}
}
@@ -448,17 +449,11 @@ int32_t tqReaderSetSubmitMsg(STqReader* pReader, void* msgStr, int32_t msgLen, i
return 0;
}
-SWalReader* tqGetWalReader(STqReader* pReader) {
- return pReader->pWalReader;
-}
+SWalReader* tqGetWalReader(STqReader* pReader) { return pReader->pWalReader; }
-SSDataBlock* tqGetResultBlock (STqReader* pReader) {
- return pReader->pResBlock;
-}
+SSDataBlock* tqGetResultBlock(STqReader* pReader) { return pReader->pResBlock; }
-int64_t tqGetResultBlockTime(STqReader *pReader){
- return pReader->lastTs;
-}
+int64_t tqGetResultBlockTime(STqReader* pReader) { return pReader->lastTs; }
bool tqNextBlockImpl(STqReader* pReader, const char* idstr) {
if (pReader->msg.msgStr == NULL) {
@@ -599,7 +594,7 @@ static int32_t doSetVal(SColumnInfoData* pColumnInfoData, int32_t rowIndex, SCol
if (IS_STR_DATA_TYPE(pColVal->type)) {
char val[65535 + 2] = {0};
- if(COL_VAL_IS_VALUE(pColVal)){
+ if (COL_VAL_IS_VALUE(pColVal)) {
if (pColVal->value.pData != NULL) {
memcpy(varDataVal(val), pColVal->value.pData, pColVal->value.nData);
}
@@ -874,7 +869,7 @@ int32_t tqRetrieveTaosxBlock(STqReader* pReader, SArray* blocks, SArray* schemas
sourceIdx++;
} else if (pCol->cid == pColData->info.colId) {
tColDataGetValue(pCol, i, &colVal);
- if(doSetVal(pColData, curRow - lastRow, &colVal) != TDB_CODE_SUCCESS){
+ if (doSetVal(pColData, curRow - lastRow, &colVal) != TDB_CODE_SUCCESS) {
goto FAIL;
}
sourceIdx++;
@@ -958,10 +953,10 @@ int32_t tqRetrieveTaosxBlock(STqReader* pReader, SArray* blocks, SArray* schemas
if (colVal.cid < pColData->info.colId) {
sourceIdx++;
} else if (colVal.cid == pColData->info.colId) {
- if(doSetVal(pColData, curRow - lastRow, &colVal) != TDB_CODE_SUCCESS){
+ if (doSetVal(pColData, curRow - lastRow, &colVal) != TDB_CODE_SUCCESS) {
goto FAIL;
}
- sourceIdx++;
+ sourceIdx++;
targetIdx++;
}
}
@@ -1001,7 +996,7 @@ int tqReaderSetTbUidList(STqReader* pReader, const SArray* tbUidList, const char
taosHashPut(pReader->tbIdHash, pKey, sizeof(int64_t), NULL, 0);
}
- tqDebug("s-task:%s %d tables are set to be queried target table", id, (int32_t) taosArrayGetSize(tbUidList));
+ tqDebug("s-task:%s %d tables are set to be queried target table", id, (int32_t)taosArrayGetSize(tbUidList));
return 0;
}
@@ -1027,9 +1022,7 @@ bool tqReaderIsQueriedTable(STqReader* pReader, uint64_t uid) {
return taosHashGet(pReader->tbIdHash, &uid, sizeof(uint64_t));
}
-bool tqCurrentBlockConsumed(const STqReader* pReader) {
- return pReader->msg.msgStr == NULL;
-}
+bool tqCurrentBlockConsumed(const STqReader* pReader) { return pReader->msg.msgStr == NULL; }
int tqReaderRemoveTbUidList(STqReader* pReader, const SArray* tbUidList) {
for (int32_t i = 0; i < taosArrayGetSize(tbUidList); i++) {
@@ -1071,9 +1064,11 @@ int32_t tqUpdateTbUidList(STQ* pTq, const SArray* tbUidList, bool isAdd) {
} else if (pTqHandle->execHandle.subType == TOPIC_SUB_TYPE__TABLE) {
if (isAdd) {
SArray* list = NULL;
- int ret = qGetTableList(pTqHandle->execHandle.execTb.suid, pTq->pVnode, pTqHandle->execHandle.execTb.node, &list, pTqHandle->execHandle.task);
- if(ret != TDB_CODE_SUCCESS) {
- tqError("qGetTableList in tqUpdateTbUidList error:%d handle %s consumer:0x%" PRIx64, ret, pTqHandle->subKey, pTqHandle->consumerId);
+ int ret = qGetTableList(pTqHandle->execHandle.execTb.suid, pTq->pVnode, pTqHandle->execHandle.execTb.node,
+ &list, pTqHandle->execHandle.task);
+ if (ret != TDB_CODE_SUCCESS) {
+ tqError("qGetTableList in tqUpdateTbUidList error:%d handle %s consumer:0x%" PRIx64, ret, pTqHandle->subKey,
+ pTqHandle->consumerId);
taosArrayDestroy(list);
taosHashCancelIterate(pTq->pHandle, pIter);
taosWUnLockLatch(&pTq->lock);
diff --git a/source/dnode/vnode/src/tq/tqScan.c b/source/dnode/vnode/src/tq/tqScan.c
index d86c0a0474..f108cedcf5 100644
--- a/source/dnode/vnode/src/tq/tqScan.c
+++ b/source/dnode/vnode/src/tq/tqScan.c
@@ -63,8 +63,8 @@ static int32_t tqAddTbNameToRsp(const STQ* pTq, int64_t uid, STaosxRsp* pRsp, in
return 0;
}
-int32_t getDataBlock(qTaskInfo_t task, const STqHandle* pHandle, int32_t vgId, SSDataBlock** res){
- uint64_t ts = 0;
+int32_t getDataBlock(qTaskInfo_t task, const STqHandle* pHandle, int32_t vgId, SSDataBlock** res) {
+ uint64_t ts = 0;
qStreamSetOpen(task);
tqDebug("consumer:0x%" PRIx64 " vgId:%d, tmq one task start execute", pHandle->consumerId, vgId);
@@ -97,27 +97,27 @@ int32_t tqScanData(STQ* pTq, STqHandle* pHandle, SMqDataRsp* pRsp, STqOffsetVal*
while (1) {
SSDataBlock* pDataBlock = NULL;
code = getDataBlock(task, pHandle, vgId, &pDataBlock);
- if (code != 0){
+ if (code != 0) {
return code;
}
- if(pRequest->enableReplay){
- if(IS_OFFSET_RESET_TYPE(pRequest->reqOffset.type) && pHandle->block != NULL){
+ if (pRequest->enableReplay) {
+ if (IS_OFFSET_RESET_TYPE(pRequest->reqOffset.type) && pHandle->block != NULL) {
blockDataDestroy(pHandle->block);
pHandle->block = NULL;
}
- if(pHandle->block == NULL){
+ if (pHandle->block == NULL) {
if (pDataBlock == NULL) {
break;
}
STqOffsetVal offset = {0};
qStreamExtractOffset(task, &offset);
pHandle->block = createOneDataBlock(pDataBlock, true);
-// pHandle->block = createDataBlock();
-// copyDataBlock(pHandle->block, pDataBlock);
+ // pHandle->block = createDataBlock();
+ // copyDataBlock(pHandle->block, pDataBlock);
pHandle->blockTime = offset.ts;
code = getDataBlock(task, pHandle, vgId, &pDataBlock);
- if (code != 0){
+ if (code != 0) {
return code;
}
}
@@ -132,7 +132,7 @@ int32_t tqScanData(STQ* pTq, STqHandle* pHandle, SMqDataRsp* pRsp, STqOffsetVal*
if (pDataBlock == NULL) {
blockDataDestroy(pHandle->block);
pHandle->block = NULL;
- }else{
+ } else {
copyDataBlock(pHandle->block, pDataBlock);
STqOffsetVal offset = {0};
@@ -141,7 +141,7 @@ int32_t tqScanData(STQ* pTq, STqHandle* pHandle, SMqDataRsp* pRsp, STqOffsetVal*
pHandle->blockTime = offset.ts;
}
break;
- }else{
+ } else {
if (pDataBlock == NULL) {
break;
}
@@ -250,7 +250,8 @@ int32_t tqScanTaosx(STQ* pTq, const STqHandle* pHandle, STaosxRsp* pRsp, SMqMeta
return 0;
}
-int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SPackedData submit, STaosxRsp* pRsp, int32_t* totalRows, int8_t sourceExcluded) {
+int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SPackedData submit, STaosxRsp* pRsp, int32_t* totalRows,
+ int8_t sourceExcluded) {
STqExecHandle* pExec = &pHandle->execHandle;
SArray* pBlocks = taosArrayInit(0, sizeof(SSDataBlock));
SArray* pSchemas = taosArrayInit(0, sizeof(void*));
@@ -266,7 +267,7 @@ int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SPackedData submit, STaosxR
if (terrno == TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND) goto loop_table;
}
- if ((pSubmitTbDataRet->source & sourceExcluded) != 0){
+ if ((pSubmitTbDataRet->source & sourceExcluded) != 0) {
goto loop_table;
}
if (pRsp->withTbName) {
@@ -303,7 +304,7 @@ int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SPackedData submit, STaosxR
tEncoderClear(&encoder);
}
- if (pHandle->fetchMeta == ONLY_META && pSubmitTbDataRet->pCreateTbReq == NULL){
+ if (pHandle->fetchMeta == ONLY_META && pSubmitTbDataRet->pCreateTbReq == NULL) {
goto loop_table;
}
for (int32_t i = 0; i < taosArrayGetSize(pBlocks); i++) {
@@ -334,7 +335,7 @@ int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SPackedData submit, STaosxR
if (terrno == TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND) goto loop_db;
}
- if ((pSubmitTbDataRet->source & sourceExcluded) != 0){
+ if ((pSubmitTbDataRet->source & sourceExcluded) != 0) {
goto loop_db;
}
if (pRsp->withTbName) {
@@ -371,7 +372,7 @@ int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SPackedData submit, STaosxR
tEncoderClear(&encoder);
}
- if (pHandle->fetchMeta == ONLY_META && pSubmitTbDataRet->pCreateTbReq == NULL){
+ if (pHandle->fetchMeta == ONLY_META && pSubmitTbDataRet->pCreateTbReq == NULL) {
goto loop_db;
}
for (int32_t i = 0; i < taosArrayGetSize(pBlocks); i++) {
diff --git a/source/dnode/vnode/src/tq/tqSink.c b/source/dnode/vnode/src/tq/tqSink.c
index f07e5eb883..b56bf3e0fe 100644
--- a/source/dnode/vnode/src/tq/tqSink.c
+++ b/source/dnode/vnode/src/tq/tqSink.c
@@ -262,7 +262,7 @@ static int32_t doBuildAndSendCreateTableMsg(SVnode* pVnode, char* stbFullName, S
}
setCreateTableMsgTableName(pCreateTbReq, pDataBlock, stbFullName, gid,
- pTask->ver >= SSTREAM_TASK_SUBTABLE_CHANGED_VER);
+ pTask->ver >= SSTREAM_TASK_SUBTABLE_CHANGED_VER && pTask->subtableWithoutMd5 != 1);
taosArrayPush(reqs.pArray, pCreateTbReq);
tqDebug("s-task:%s build create table:%s msg complete", pTask->id.idStr, pCreateTbReq->name);
@@ -374,7 +374,7 @@ int32_t doBuildAndSendDeleteMsg(SVnode* pVnode, char* stbFullName, SSDataBlock*
SBatchDeleteReq deleteReq = {.suid = suid, .deleteReqs = taosArrayInit(0, sizeof(SSingleDeleteReq))};
int32_t code = tqBuildDeleteReq(pVnode->pTq, stbFullName, pDataBlock, &deleteReq, pTask->id.idStr,
- pTask->ver >= SSTREAM_TASK_SUBTABLE_CHANGED_VER);
+ pTask->ver >= SSTREAM_TASK_SUBTABLE_CHANGED_VER && pTask->subtableWithoutMd5 != 1);
if (code != TSDB_CODE_SUCCESS) {
return code;
}
@@ -668,8 +668,8 @@ int32_t setDstTableDataUid(SVnode* pVnode, SStreamTask* pTask, SSDataBlock* pDat
memset(dstTableName, 0, TSDB_TABLE_NAME_LEN);
buildCtbNameByGroupIdImpl(stbFullName, groupId, dstTableName);
} else {
- if (pTask->ver >= SSTREAM_TASK_SUBTABLE_CHANGED_VER && !isAutoTableName(dstTableName) &&
- !alreadyAddGroupId(dstTableName) && groupId != 0) {
+ if (pTask->ver >= SSTREAM_TASK_SUBTABLE_CHANGED_VER && pTask->subtableWithoutMd5 != 1 &&
+ !isAutoTableName(dstTableName) && !alreadyAddGroupId(dstTableName) && groupId != 0) {
buildCtbNameAddGruopId(dstTableName, groupId);
}
}
@@ -712,8 +712,9 @@ int32_t setDstTableDataUid(SVnode* pVnode, SStreamTask* pTask, SSDataBlock* pDat
SArray* pTagArray = taosArrayInit(pTSchema->numOfCols + 1, sizeof(STagVal));
pTableData->flags = SUBMIT_REQ_AUTO_CREATE_TABLE;
- pTableData->pCreateTbReq = buildAutoCreateTableReq(stbFullName, suid, pTSchema->numOfCols + 1, pDataBlock,
- pTagArray, pTask->ver >= SSTREAM_TASK_SUBTABLE_CHANGED_VER);
+ pTableData->pCreateTbReq =
+ buildAutoCreateTableReq(stbFullName, suid, pTSchema->numOfCols + 1, pDataBlock, pTagArray,
+ pTask->ver >= SSTREAM_TASK_SUBTABLE_CHANGED_VER && pTask->subtableWithoutMd5 != 1);
taosArrayDestroy(pTagArray);
if (pTableData->pCreateTbReq == NULL) {
diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y
index d2d120fa93..d607287af3 100755
--- a/source/libs/parser/inc/sql.y
+++ b/source/libs/parser/inc/sql.y
@@ -516,7 +516,7 @@ cmd ::= SHOW VNODES.
// show alive
cmd ::= SHOW db_name_cond_opt(A) ALIVE. { pCxt->pRootNode = createShowAliveStmt(pCxt, A, QUERY_NODE_SHOW_DB_ALIVE_STMT); }
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 db_name_cond_opt(A) VIEWS like_pattern_opt(B). { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, A, B, 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)); }
diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c
index 960796d345..c4c4b0824a 100644
--- a/source/libs/parser/src/parTranslater.c
+++ b/source/libs/parser/src/parTranslater.c
@@ -9399,7 +9399,20 @@ static int32_t createOperatorNode(EOperatorType opType, const char* pColName, SN
}
static const char* getTbNameColName(ENodeType type) {
- return (QUERY_NODE_SHOW_STABLES_STMT == type ? "stable_name" : "table_name");
+ const char* colName;
+ switch (type)
+ {
+ case QUERY_NODE_SHOW_VIEWS_STMT:
+ colName = "view_name";
+ break;
+ case QUERY_NODE_SHOW_STABLES_STMT:
+ colName = "stable_name";
+ break;
+ default:
+ colName = "table_name";
+ break;
+ }
+ return colName;
}
static int32_t createLogicCondNode(SNode* pCond1, SNode* pCond2, SNode** pCond, ELogicConditionType logicCondType) {
diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c
index 25862bb079..63159a10ae 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,362 @@
#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_CLUSTER 58
+#define TK_LOCAL 59
+#define TK_QNODE 60
+#define TK_BNODE 61
+#define TK_SNODE 62
+#define TK_MNODE 63
+#define TK_VNODE 64
+#define TK_DATABASE 65
+#define TK_USE 66
+#define TK_FLUSH 67
+#define TK_TRIM 68
+#define TK_COMPACT 69
+#define TK_IF 70
+#define TK_NOT 71
+#define TK_EXISTS 72
+#define TK_BUFFER 73
+#define TK_CACHEMODEL 74
+#define TK_CACHESIZE 75
+#define TK_COMP 76
+#define TK_DURATION 77
+#define TK_NK_VARIABLE 78
+#define TK_MAXROWS 79
+#define TK_MINROWS 80
+#define TK_KEEP 81
+#define TK_PAGES 82
+#define TK_PAGESIZE 83
+#define TK_TSDB_PAGESIZE 84
+#define TK_PRECISION 85
+#define TK_REPLICA 86
+#define TK_VGROUPS 87
+#define TK_SINGLE_STABLE 88
+#define TK_RETENTIONS 89
+#define TK_SCHEMALESS 90
+#define TK_WAL_LEVEL 91
+#define TK_WAL_FSYNC_PERIOD 92
+#define TK_WAL_RETENTION_PERIOD 93
+#define TK_WAL_RETENTION_SIZE 94
+#define TK_WAL_ROLL_PERIOD 95
+#define TK_WAL_SEGMENT_SIZE 96
+#define TK_STT_TRIGGER 97
+#define TK_TABLE_PREFIX 98
+#define TK_TABLE_SUFFIX 99
+#define TK_KEEP_TIME_OFFSET 100
+#define TK_NK_COLON 101
+#define TK_BWLIMIT 102
+#define TK_START 103
+#define TK_TIMESTAMP 104
+#define TK_END 105
+#define TK_TABLE 106
+#define TK_NK_LP 107
+#define TK_NK_RP 108
+#define TK_STABLE 109
+#define TK_COLUMN 110
+#define TK_MODIFY 111
+#define TK_RENAME 112
+#define TK_TAG 113
+#define TK_SET 114
+#define TK_NK_EQ 115
+#define TK_USING 116
+#define TK_TAGS 117
+#define TK_BOOL 118
+#define TK_TINYINT 119
+#define TK_SMALLINT 120
+#define TK_INT 121
+#define TK_INTEGER 122
+#define TK_BIGINT 123
+#define TK_FLOAT 124
+#define TK_DOUBLE 125
+#define TK_BINARY 126
+#define TK_NCHAR 127
+#define TK_UNSIGNED 128
+#define TK_JSON 129
+#define TK_VARCHAR 130
+#define TK_MEDIUMBLOB 131
+#define TK_BLOB 132
+#define TK_VARBINARY 133
+#define TK_GEOMETRY 134
+#define TK_DECIMAL 135
+#define TK_COMMENT 136
+#define TK_MAX_DELAY 137
+#define TK_WATERMARK 138
+#define TK_ROLLUP 139
+#define TK_TTL 140
+#define TK_SMA 141
+#define TK_DELETE_MARK 142
+#define TK_FIRST 143
+#define TK_LAST 144
+#define TK_SHOW 145
+#define TK_PRIVILEGES 146
+#define TK_DATABASES 147
+#define TK_TABLES 148
+#define TK_STABLES 149
+#define TK_MNODES 150
+#define TK_QNODES 151
+#define TK_FUNCTIONS 152
+#define TK_INDEXES 153
+#define TK_ACCOUNTS 154
+#define TK_APPS 155
+#define TK_CONNECTIONS 156
+#define TK_LICENCES 157
+#define TK_GRANTS 158
+#define TK_FULL 159
+#define TK_LOGS 160
+#define TK_MACHINES 161
+#define TK_QUERIES 162
+#define TK_SCORES 163
+#define TK_TOPICS 164
+#define TK_VARIABLES 165
+#define TK_BNODES 166
+#define TK_SNODES 167
+#define TK_TRANSACTIONS 168
+#define TK_DISTRIBUTED 169
+#define TK_CONSUMERS 170
+#define TK_SUBSCRIPTIONS 171
+#define TK_VNODES 172
+#define TK_ALIVE 173
+#define TK_VIEWS 174
+#define TK_VIEW 175
+#define TK_COMPACTS 176
+#define TK_NORMAL 177
+#define TK_CHILD 178
+#define TK_LIKE 179
+#define TK_TBNAME 180
+#define TK_QTAGS 181
+#define TK_AS 182
+#define TK_SYSTEM 183
+#define TK_INDEX 184
+#define TK_FUNCTION 185
+#define TK_INTERVAL 186
+#define TK_COUNT 187
+#define TK_LAST_ROW 188
+#define TK_META 189
+#define TK_ONLY 190
+#define TK_TOPIC 191
+#define TK_CONSUMER 192
+#define TK_GROUP 193
+#define TK_DESC 194
+#define TK_DESCRIBE 195
+#define TK_RESET 196
+#define TK_QUERY 197
+#define TK_CACHE 198
+#define TK_EXPLAIN 199
+#define TK_ANALYZE 200
+#define TK_VERBOSE 201
+#define TK_NK_BOOL 202
+#define TK_RATIO 203
+#define TK_NK_FLOAT 204
+#define TK_OUTPUTTYPE 205
+#define TK_AGGREGATE 206
+#define TK_BUFSIZE 207
+#define TK_LANGUAGE 208
+#define TK_REPLACE 209
+#define TK_STREAM 210
+#define TK_INTO 211
+#define TK_PAUSE 212
+#define TK_RESUME 213
+#define TK_TRIGGER 214
+#define TK_AT_ONCE 215
+#define TK_WINDOW_CLOSE 216
+#define TK_IGNORE 217
+#define TK_EXPIRED 218
+#define TK_FILL_HISTORY 219
+#define TK_UPDATE 220
+#define TK_SUBTABLE 221
+#define TK_UNTREATED 222
+#define TK_KILL 223
+#define TK_CONNECTION 224
+#define TK_TRANSACTION 225
+#define TK_BALANCE 226
+#define TK_VGROUP 227
+#define TK_LEADER 228
+#define TK_MERGE 229
+#define TK_REDISTRIBUTE 230
+#define TK_SPLIT 231
+#define TK_DELETE 232
+#define TK_INSERT 233
+#define TK_NULL 234
+#define TK_NK_QUESTION 235
+#define TK_NK_ALIAS 236
+#define TK_NK_ARROW 237
+#define TK_ROWTS 238
+#define TK_QSTART 239
+#define TK_QEND 240
+#define TK_QDURATION 241
+#define TK_WSTART 242
+#define TK_WEND 243
+#define TK_WDURATION 244
+#define TK_IROWTS 245
+#define TK_ISFILLED 246
+#define TK_CAST 247
+#define TK_NOW 248
+#define TK_TODAY 249
+#define TK_TIMEZONE 250
+#define TK_CLIENT_VERSION 251
+#define TK_SERVER_VERSION 252
+#define TK_SERVER_STATUS 253
+#define TK_CURRENT_USER 254
+#define TK_CASE 255
+#define TK_WHEN 256
+#define TK_THEN 257
+#define TK_ELSE 258
+#define TK_BETWEEN 259
+#define TK_IS 260
+#define TK_NK_LT 261
+#define TK_NK_GT 262
+#define TK_NK_LE 263
+#define TK_NK_GE 264
+#define TK_NK_NE 265
+#define TK_MATCH 266
+#define TK_NMATCH 267
+#define TK_CONTAINS 268
+#define TK_IN 269
+#define TK_JOIN 270
+#define TK_INNER 271
+#define TK_SELECT 272
+#define TK_NK_HINT 273
+#define TK_DISTINCT 274
+#define TK_WHERE 275
+#define TK_PARTITION 276
+#define TK_BY 277
+#define TK_SESSION 278
+#define TK_STATE_WINDOW 279
+#define TK_EVENT_WINDOW 280
+#define TK_SLIDING 281
+#define TK_FILL 282
+#define TK_VALUE 283
+#define TK_VALUE_F 284
+#define TK_NONE 285
+#define TK_PREV 286
+#define TK_NULL_F 287
+#define TK_LINEAR 288
+#define TK_NEXT 289
+#define TK_HAVING 290
+#define TK_RANGE 291
+#define TK_EVERY 292
+#define TK_ORDER 293
+#define TK_SLIMIT 294
+#define TK_SOFFSET 295
+#define TK_LIMIT 296
+#define TK_OFFSET 297
+#define TK_ASC 298
+#define TK_NULLS 299
+#define TK_ABORT 300
+#define TK_AFTER 301
+#define TK_ATTACH 302
+#define TK_BEFORE 303
+#define TK_BEGIN 304
+#define TK_BITAND 305
+#define TK_BITNOT 306
+#define TK_BITOR 307
+#define TK_BLOCKS 308
+#define TK_CHANGE 309
+#define TK_COMMA 310
+#define TK_CONCAT 311
+#define TK_CONFLICT 312
+#define TK_COPY 313
+#define TK_DEFERRED 314
+#define TK_DELIMITERS 315
+#define TK_DETACH 316
+#define TK_DIVIDE 317
+#define TK_DOT 318
+#define TK_EACH 319
+#define TK_FAIL 320
+#define TK_FILE 321
+#define TK_FOR 322
+#define TK_GLOB 323
+#define TK_ID 324
+#define TK_IMMEDIATE 325
+#define TK_IMPORT 326
+#define TK_INITIALLY 327
+#define TK_INSTEAD 328
+#define TK_ISNULL 329
+#define TK_KEY 330
+#define TK_MODULES 331
+#define TK_NK_BITNOT 332
+#define TK_NK_SEMI 333
+#define TK_NOTNULL 334
+#define TK_OF 335
+#define TK_PLUS 336
+#define TK_PRIVILEGE 337
+#define TK_RAISE 338
+#define TK_RESTRICT 339
+#define TK_ROW 340
+#define TK_SEMI 341
+#define TK_STAR 342
+#define TK_STATEMENT 343
+#define TK_STRICT 344
+#define TK_STRING 345
+#define TK_TIMES 346
+#define TK_VALUES 347
+#define TK_VARIABLE 348
+#define TK_WAL 349
+#endif
+/**************** End token definitions ***************************************/
/* The next sections is a series of control #defines.
** various aspects of the generated parser.
@@ -142,18 +493,18 @@ typedef union {
#define ParseCTX_FETCH
#define ParseCTX_STORE
#define YYFALLBACK 1
-#define YYNSTATE 846
+#define YYNSTATE 847
#define YYNRULE 647
#define YYNRULE_WITH_ACTION 647
#define YYNTOKEN 350
-#define YY_MAX_SHIFT 845
-#define YY_MIN_SHIFTREDUCE 1248
-#define YY_MAX_SHIFTREDUCE 1894
-#define YY_ERROR_ACTION 1895
-#define YY_ACCEPT_ACTION 1896
-#define YY_NO_ACTION 1897
-#define YY_MIN_REDUCE 1898
-#define YY_MAX_REDUCE 2544
+#define YY_MAX_SHIFT 846
+#define YY_MIN_SHIFTREDUCE 1249
+#define YY_MAX_SHIFTREDUCE 1895
+#define YY_ERROR_ACTION 1896
+#define YY_ACCEPT_ACTION 1897
+#define YY_NO_ACTION 1898
+#define YY_MIN_REDUCE 1899
+#define YY_MAX_REDUCE 2545
/************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
@@ -222,315 +573,315 @@ typedef union {
*********** Begin parsing tables **********************************************/
#define YY_ACTTAB_COUNT (3083)
static const YYACTIONTYPE yy_action[] = {
- /* 0 */ 1921, 2322, 565, 2077, 466, 566, 1941, 14, 13, 465,
- /* 10 */ 2175, 2305, 48, 46, 1818, 2330, 2520, 34, 411, 2515,
- /* 20 */ 417, 1684, 1659, 41, 40, 2326, 171, 47, 45, 44,
- /* 30 */ 43, 42, 2073, 645, 2090, 1744, 1984, 1657, 2519, 731,
- /* 40 */ 2088, 698, 2516, 2518, 2515, 2346, 38, 320, 643, 582,
- /* 50 */ 641, 269, 268, 2312, 673, 710, 146, 2515, 713, 137,
- /* 60 */ 112, 673, 697, 203, 2515, 1739, 608, 2516, 699, 2328,
- /* 70 */ 414, 19, 174, 2226, 1910, 2521, 203, 147, 1665, 741,
- /* 80 */ 2516, 699, 2521, 203, 2226, 2080, 2364, 2516, 699, 41,
- /* 90 */ 40, 2224, 718, 47, 45, 44, 43, 42, 2312, 410,
- /* 100 */ 747, 585, 2223, 718, 842, 583, 2219, 15, 473, 817,
- /* 110 */ 816, 815, 814, 429, 1787, 813, 812, 151, 807, 806,
- /* 120 */ 805, 804, 803, 802, 801, 150, 795, 794, 793, 428,
- /* 130 */ 427, 790, 789, 788, 183, 182, 787, 2064, 1314, 2345,
- /* 140 */ 1313, 63, 2383, 1746, 1747, 114, 2347, 751, 2349, 2350,
- /* 150 */ 746, 730, 741, 532, 530, 142, 366, 186, 573, 2436,
- /* 160 */ 217, 566, 1941, 413, 2432, 300, 2444, 709, 570, 138,
- /* 170 */ 708, 509, 2515, 1315, 567, 508, 184, 2141, 205, 2520,
- /* 180 */ 1719, 1729, 2515, 507, 382, 656, 2466, 1745, 1748, 1860,
- /* 190 */ 697, 203, 2139, 710, 146, 2516, 699, 1898, 384, 688,
- /* 200 */ 2206, 2519, 1660, 63, 1658, 2516, 2517, 786, 196, 710,
- /* 210 */ 146, 41, 40, 731, 2088, 47, 45, 44, 43, 42,
- /* 220 */ 2128, 136, 135, 134, 133, 132, 131, 130, 129, 128,
- /* 230 */ 730, 482, 2202, 208, 1663, 1664, 1716, 52, 1718, 1721,
- /* 240 */ 1722, 1723, 1724, 1725, 1726, 1727, 1728, 743, 739, 1737,
- /* 250 */ 1738, 1740, 1741, 1742, 1743, 2, 48, 46, 581, 2520,
- /* 260 */ 1685, 364, 698, 1682, 417, 2515, 1659, 731, 2088, 99,
- /* 270 */ 516, 237, 2346, 535, 376, 568, 1687, 1949, 534, 1744,
- /* 280 */ 219, 1657, 692, 697, 203, 745, 272, 56, 2516, 699,
- /* 290 */ 271, 694, 689, 682, 496, 450, 536, 464, 1687, 463,
- /* 300 */ 1606, 365, 498, 202, 2444, 2445, 304, 144, 2449, 1739,
- /* 310 */ 2364, 657, 476, 2364, 1684, 19, 1452, 51, 1773, 204,
- /* 320 */ 2444, 2445, 1665, 144, 2449, 2312, 68, 747, 3, 462,
- /* 330 */ 1443, 776, 775, 774, 1447, 773, 1449, 1450, 772, 769,
- /* 340 */ 54, 1458, 766, 1460, 1461, 763, 760, 757, 842, 385,
- /* 350 */ 1684, 15, 784, 161, 160, 781, 780, 779, 158, 98,
- /* 360 */ 484, 1987, 371, 2451, 1884, 397, 2345, 647, 304, 2383,
- /* 370 */ 2185, 691, 356, 2347, 751, 2349, 2350, 746, 744, 741,
- /* 380 */ 732, 2401, 1774, 1578, 1579, 575, 2265, 1746, 1747, 2448,
- /* 390 */ 2213, 2192, 1920, 523, 522, 521, 520, 515, 514, 513,
- /* 400 */ 512, 368, 304, 710, 146, 502, 501, 500, 499, 493,
- /* 410 */ 492, 491, 480, 486, 485, 383, 797, 731, 2088, 477,
- /* 420 */ 1546, 1547, 173, 454, 1719, 1729, 1565, 1577, 1580, 63,
- /* 430 */ 2027, 1745, 1748, 1297, 627, 626, 625, 137, 302, 1683,
- /* 440 */ 730, 617, 143, 621, 613, 2312, 1660, 620, 1658, 184,
- /* 450 */ 456, 452, 619, 624, 392, 391, 488, 2202, 618, 1684,
- /* 460 */ 302, 614, 37, 415, 1768, 1769, 1770, 1771, 1772, 1776,
- /* 470 */ 1777, 1778, 1779, 2207, 1558, 1559, 390, 389, 1663, 1664,
- /* 480 */ 1716, 799, 1718, 1721, 1722, 1723, 1724, 1725, 1726, 1727,
- /* 490 */ 1728, 743, 739, 1737, 1738, 1740, 1741, 1742, 1743, 2,
- /* 500 */ 12, 48, 46, 2346, 738, 221, 2135, 2136, 2322, 417,
- /* 510 */ 1720, 1659, 712, 201, 2444, 2445, 748, 144, 2449, 239,
- /* 520 */ 159, 1685, 2079, 568, 1744, 1949, 1657, 51, 12, 36,
- /* 530 */ 10, 2322, 2326, 95, 2346, 41, 40, 731, 2088, 47,
- /* 540 */ 45, 44, 43, 42, 2364, 2331, 63, 713, 388, 387,
- /* 550 */ 386, 610, 731, 2088, 1739, 2326, 2312, 470, 747, 2083,
- /* 560 */ 19, 627, 626, 625, 731, 2088, 1717, 1665, 617, 143,
- /* 570 */ 621, 693, 471, 612, 620, 2364, 2328, 611, 2519, 619,
- /* 580 */ 624, 392, 391, 2141, 490, 618, 741, 2312, 614, 747,
- /* 590 */ 398, 604, 603, 842, 304, 55, 15, 2345, 2139, 2328,
- /* 600 */ 2383, 2346, 786, 114, 2347, 751, 2349, 2350, 746, 741,
- /* 610 */ 741, 1317, 1318, 149, 748, 156, 2407, 2436, 9, 41,
- /* 620 */ 40, 413, 2432, 47, 45, 44, 43, 42, 2345, 654,
- /* 630 */ 1896, 2383, 1746, 1747, 114, 2347, 751, 2349, 2350, 746,
- /* 640 */ 2274, 741, 2364, 1822, 1487, 1488, 186, 657, 2436, 1684,
- /* 650 */ 518, 2202, 413, 2432, 2312, 127, 747, 1899, 126, 125,
- /* 660 */ 124, 123, 122, 121, 120, 119, 118, 1765, 422, 1719,
- /* 670 */ 1729, 2134, 2136, 1754, 2451, 2467, 1745, 1748, 127, 1684,
+ /* 0 */ 1922, 2323, 566, 2078, 467, 567, 1942, 14, 13, 466,
+ /* 10 */ 2176, 2306, 48, 46, 1819, 2331, 2521, 34, 412, 2516,
+ /* 20 */ 418, 1685, 1660, 41, 40, 2327, 171, 47, 45, 44,
+ /* 30 */ 43, 42, 2074, 646, 2091, 1745, 1985, 1658, 2520, 732,
+ /* 40 */ 2089, 699, 2517, 2519, 2516, 2347, 38, 321, 644, 583,
+ /* 50 */ 642, 270, 269, 2313, 674, 711, 146, 2516, 714, 137,
+ /* 60 */ 112, 674, 698, 203, 2516, 1740, 609, 2517, 700, 2329,
+ /* 70 */ 415, 19, 174, 2227, 1911, 2522, 203, 147, 1666, 742,
+ /* 80 */ 2517, 700, 2522, 203, 2227, 2081, 2365, 2517, 700, 41,
+ /* 90 */ 40, 2225, 719, 47, 45, 44, 43, 42, 2313, 411,
+ /* 100 */ 748, 586, 2224, 719, 843, 584, 2220, 15, 474, 818,
+ /* 110 */ 817, 816, 815, 430, 1788, 814, 813, 151, 808, 807,
+ /* 120 */ 806, 805, 804, 803, 802, 150, 796, 795, 794, 429,
+ /* 130 */ 428, 791, 790, 789, 183, 182, 788, 2065, 1315, 2346,
+ /* 140 */ 1314, 63, 2384, 1747, 1748, 114, 2348, 752, 2350, 2351,
+ /* 150 */ 747, 731, 742, 533, 531, 142, 367, 186, 574, 2437,
+ /* 160 */ 217, 567, 1942, 414, 2433, 301, 2445, 710, 571, 138,
+ /* 170 */ 709, 510, 2516, 1316, 568, 509, 184, 2142, 205, 2521,
+ /* 180 */ 1720, 1730, 2516, 508, 383, 657, 2467, 1746, 1749, 1861,
+ /* 190 */ 698, 203, 2140, 711, 146, 2517, 700, 1899, 385, 689,
+ /* 200 */ 2207, 2520, 1661, 63, 1659, 2517, 2518, 787, 196, 711,
+ /* 210 */ 146, 41, 40, 732, 2089, 47, 45, 44, 43, 42,
+ /* 220 */ 2129, 136, 135, 134, 133, 132, 131, 130, 129, 128,
+ /* 230 */ 731, 483, 2203, 208, 1664, 1665, 1717, 52, 1719, 1722,
+ /* 240 */ 1723, 1724, 1725, 1726, 1727, 1728, 1729, 744, 740, 1738,
+ /* 250 */ 1739, 1741, 1742, 1743, 1744, 2, 48, 46, 582, 2521,
+ /* 260 */ 1686, 365, 699, 1683, 418, 2516, 1660, 732, 2089, 99,
+ /* 270 */ 517, 238, 2347, 536, 377, 569, 1688, 1950, 535, 1745,
+ /* 280 */ 219, 1658, 693, 698, 203, 746, 273, 56, 2517, 700,
+ /* 290 */ 272, 695, 690, 683, 497, 451, 537, 465, 1688, 464,
+ /* 300 */ 1607, 366, 499, 202, 2445, 2446, 305, 144, 2450, 1740,
+ /* 310 */ 2365, 658, 477, 2365, 1685, 19, 1453, 51, 1774, 204,
+ /* 320 */ 2445, 2446, 1666, 144, 2450, 2313, 68, 748, 3, 463,
+ /* 330 */ 1444, 777, 776, 775, 1448, 774, 1450, 1451, 773, 770,
+ /* 340 */ 54, 1459, 767, 1461, 1462, 764, 761, 758, 843, 386,
+ /* 350 */ 1685, 15, 785, 161, 160, 782, 781, 780, 158, 98,
+ /* 360 */ 485, 1988, 372, 2452, 1885, 398, 2346, 648, 305, 2384,
+ /* 370 */ 2186, 692, 357, 2348, 752, 2350, 2351, 747, 745, 742,
+ /* 380 */ 733, 2402, 1775, 1579, 1580, 576, 2266, 1747, 1748, 2449,
+ /* 390 */ 2214, 2193, 1921, 524, 523, 522, 521, 516, 515, 514,
+ /* 400 */ 513, 369, 305, 711, 146, 503, 502, 501, 500, 494,
+ /* 410 */ 493, 492, 481, 487, 486, 384, 798, 732, 2089, 478,
+ /* 420 */ 1547, 1548, 173, 455, 1720, 1730, 1566, 1578, 1581, 63,
+ /* 430 */ 2028, 1746, 1749, 1298, 628, 627, 626, 137, 303, 1684,
+ /* 440 */ 731, 618, 143, 622, 614, 2313, 1661, 621, 1659, 184,
+ /* 450 */ 457, 453, 620, 625, 393, 392, 489, 2203, 619, 1685,
+ /* 460 */ 303, 615, 37, 416, 1769, 1770, 1771, 1772, 1773, 1777,
+ /* 470 */ 1778, 1779, 1780, 2208, 1559, 1560, 391, 390, 1664, 1665,
+ /* 480 */ 1717, 800, 1719, 1722, 1723, 1724, 1725, 1726, 1727, 1728,
+ /* 490 */ 1729, 744, 740, 1738, 1739, 1741, 1742, 1743, 1744, 2,
+ /* 500 */ 12, 48, 46, 2347, 739, 221, 2136, 2137, 2323, 418,
+ /* 510 */ 1721, 1660, 713, 201, 2445, 2446, 749, 144, 2450, 240,
+ /* 520 */ 159, 1686, 2080, 569, 1745, 1950, 1658, 51, 12, 36,
+ /* 530 */ 10, 2323, 2327, 95, 2347, 41, 40, 732, 2089, 47,
+ /* 540 */ 45, 44, 43, 42, 2365, 2332, 63, 714, 389, 388,
+ /* 550 */ 387, 611, 732, 2089, 1740, 2327, 2313, 471, 748, 2084,
+ /* 560 */ 19, 628, 627, 626, 732, 2089, 1718, 1666, 618, 143,
+ /* 570 */ 622, 694, 472, 613, 621, 2365, 2329, 612, 2520, 620,
+ /* 580 */ 625, 393, 392, 2142, 491, 619, 742, 2313, 615, 748,
+ /* 590 */ 399, 605, 604, 843, 305, 55, 15, 2346, 2140, 2329,
+ /* 600 */ 2384, 2347, 787, 114, 2348, 752, 2350, 2351, 747, 742,
+ /* 610 */ 742, 1318, 1319, 149, 749, 156, 2408, 2437, 9, 41,
+ /* 620 */ 40, 414, 2433, 47, 45, 44, 43, 42, 2346, 655,
+ /* 630 */ 1897, 2384, 1747, 1748, 114, 2348, 752, 2350, 2351, 747,
+ /* 640 */ 2275, 742, 2365, 1823, 1488, 1489, 186, 658, 2437, 1685,
+ /* 650 */ 519, 2203, 414, 2433, 2313, 127, 748, 1900, 126, 125,
+ /* 660 */ 124, 123, 122, 121, 120, 119, 118, 1766, 423, 1720,
+ /* 670 */ 1730, 2135, 2137, 1755, 2452, 2468, 1746, 1749, 127, 1685,
/* 680 */ 12, 126, 125, 124, 123, 122, 121, 120, 119, 118,
- /* 690 */ 672, 1660, 304, 1658, 274, 2345, 731, 2088, 2383, 226,
- /* 700 */ 2447, 114, 2347, 751, 2349, 2350, 746, 1919, 741, 432,
- /* 710 */ 420, 304, 777, 2411, 431, 2436, 503, 159, 171, 413,
- /* 720 */ 2432, 659, 2265, 1663, 1664, 1716, 2090, 1718, 1721, 1722,
- /* 730 */ 1723, 1724, 1725, 1726, 1727, 1728, 743, 739, 1737, 1738,
- /* 740 */ 1740, 1741, 1742, 1743, 2, 48, 46, 1749, 2346, 420,
- /* 750 */ 426, 425, 634, 417, 1407, 1659, 1841, 168, 423, 673,
- /* 760 */ 2312, 748, 2515, 1951, 399, 2090, 171, 646, 1744, 1406,
- /* 770 */ 1657, 1842, 2139, 2159, 2090, 1666, 731, 2088, 2346, 106,
- /* 780 */ 2521, 203, 95, 270, 1775, 2516, 699, 1716, 1314, 2364,
- /* 790 */ 1313, 748, 1622, 2474, 223, 2141, 504, 1688, 1739, 637,
- /* 800 */ 1395, 2312, 407, 747, 2081, 1891, 631, 629, 2084, 1720,
- /* 810 */ 2139, 1665, 1840, 267, 47, 45, 44, 43, 42, 2364,
- /* 820 */ 41, 40, 61, 1315, 47, 45, 44, 43, 42, 526,
- /* 830 */ 670, 2312, 1688, 747, 1688, 90, 537, 842, 89, 1720,
- /* 840 */ 49, 1397, 2345, 731, 2088, 2383, 2346, 1807, 114, 2347,
- /* 850 */ 751, 2349, 2350, 746, 72, 741, 1659, 71, 1665, 748,
- /* 860 */ 2535, 2487, 2436, 505, 35, 1717, 413, 2432, 701, 731,
- /* 870 */ 2088, 1657, 2345, 1849, 1780, 2383, 1746, 1747, 114, 2347,
- /* 880 */ 751, 2349, 2350, 746, 273, 741, 1918, 2364, 2065, 584,
- /* 890 */ 2535, 227, 2436, 2141, 562, 1717, 413, 2432, 1815, 2312,
- /* 900 */ 412, 747, 334, 560, 88, 2118, 556, 552, 2139, 1890,
- /* 910 */ 731, 2088, 1665, 1719, 1729, 525, 524, 1917, 325, 1411,
- /* 920 */ 1745, 1748, 685, 684, 1847, 1848, 1850, 1851, 1852, 2141,
- /* 930 */ 2085, 1295, 511, 510, 1410, 1660, 421, 1658, 842, 2312,
- /* 940 */ 2345, 612, 1669, 2383, 2139, 611, 114, 2347, 751, 2349,
- /* 950 */ 2350, 746, 1916, 741, 1915, 1293, 1294, 1914, 2535, 194,
- /* 960 */ 2436, 2075, 1627, 1628, 413, 2432, 2071, 1663, 1664, 1716,
- /* 970 */ 2312, 1718, 1721, 1722, 1723, 1724, 1725, 1726, 1727, 1728,
- /* 980 */ 743, 739, 1737, 1738, 1740, 1741, 1742, 1743, 2, 48,
- /* 990 */ 46, 2346, 606, 605, 199, 2063, 198, 417, 733, 1659,
- /* 1000 */ 2408, 539, 623, 622, 748, 2312, 680, 2312, 800, 2092,
- /* 1010 */ 2312, 2049, 1744, 1689, 1657, 41, 40, 731, 2088, 47,
- /* 1020 */ 45, 44, 43, 42, 784, 161, 160, 781, 780, 779,
- /* 1030 */ 158, 171, 2364, 44, 43, 42, 1660, 275, 1658, 2091,
- /* 1040 */ 30, 2451, 1739, 280, 2312, 1688, 747, 1913, 1689, 1684,
- /* 1050 */ 1689, 311, 312, 41, 40, 1665, 310, 47, 45, 44,
- /* 1060 */ 43, 42, 731, 2088, 1288, 1912, 2293, 2446, 1663, 1664,
- /* 1070 */ 41, 40, 1909, 2346, 47, 45, 44, 43, 42, 731,
- /* 1080 */ 2088, 842, 283, 1295, 49, 2345, 748, 148, 2383, 2346,
- /* 1090 */ 2407, 114, 2347, 751, 2349, 2350, 746, 2141, 741, 716,
- /* 1100 */ 2312, 702, 748, 2535, 2508, 2436, 1290, 1293, 1294, 413,
- /* 1110 */ 2432, 735, 717, 2408, 2364, 1861, 811, 809, 2312, 401,
- /* 1120 */ 1746, 1747, 2066, 731, 2088, 2312, 2312, 197, 747, 1908,
- /* 1130 */ 2364, 784, 161, 160, 781, 780, 779, 158, 742, 2141,
- /* 1140 */ 731, 2088, 2312, 315, 747, 76, 731, 2088, 2141, 731,
- /* 1150 */ 2088, 731, 2088, 1834, 726, 152, 1907, 1719, 1729, 778,
- /* 1160 */ 424, 1906, 2132, 2140, 1745, 1748, 728, 2345, 1814, 729,
- /* 1170 */ 2383, 321, 2028, 357, 2347, 751, 2349, 2350, 746, 1660,
- /* 1180 */ 741, 1658, 2312, 2345, 1905, 1904, 2383, 2456, 1807, 114,
- /* 1190 */ 2347, 751, 2349, 2350, 746, 1911, 741, 87, 2306, 1903,
- /* 1200 */ 652, 2535, 782, 2436, 1902, 2132, 1901, 413, 2432, 2312,
- /* 1210 */ 284, 1663, 1664, 1716, 2312, 1718, 1721, 1722, 1723, 1724,
- /* 1220 */ 1725, 1726, 1727, 1728, 743, 739, 1737, 1738, 1740, 1741,
- /* 1230 */ 1742, 1743, 2, 48, 46, 139, 783, 2312, 2312, 2132,
- /* 1240 */ 1971, 417, 615, 1659, 170, 1926, 837, 86, 673, 2296,
- /* 1250 */ 673, 2515, 2312, 2515, 100, 2346, 1744, 2312, 1657, 2312,
- /* 1260 */ 616, 1689, 628, 255, 260, 1717, 1392, 258, 748, 2521,
- /* 1270 */ 203, 2521, 203, 1969, 2516, 699, 2516, 699, 262, 178,
- /* 1280 */ 264, 261, 266, 263, 1390, 265, 1739, 1960, 602, 598,
- /* 1290 */ 594, 590, 1958, 254, 210, 630, 2364, 41, 40, 1665,
- /* 1300 */ 439, 47, 45, 44, 43, 42, 2480, 159, 2312, 632,
- /* 1310 */ 747, 649, 705, 648, 635, 50, 50, 2333, 172, 187,
- /* 1320 */ 1893, 1894, 1668, 340, 159, 842, 14, 13, 15, 50,
- /* 1330 */ 309, 75, 2346, 297, 96, 686, 1667, 252, 1350, 658,
- /* 1340 */ 338, 74, 157, 159, 73, 748, 66, 2455, 791, 2345,
- /* 1350 */ 792, 141, 2383, 50, 367, 175, 2347, 751, 2349, 2350,
- /* 1360 */ 746, 111, 741, 703, 1746, 1747, 235, 547, 545, 542,
- /* 1370 */ 108, 291, 1369, 2364, 1367, 2335, 2025, 714, 2365, 1351,
- /* 1380 */ 2024, 2211, 1625, 50, 1942, 2312, 2470, 747, 683, 673,
- /* 1390 */ 1846, 1845, 2515, 403, 289, 690, 400, 674, 2477, 715,
- /* 1400 */ 720, 1719, 1729, 242, 1575, 313, 723, 63, 1745, 1748,
- /* 1410 */ 2521, 203, 251, 244, 1948, 2516, 699, 317, 1437, 249,
- /* 1420 */ 579, 1781, 430, 1660, 2212, 1658, 2345, 673, 1730, 2383,
- /* 1430 */ 2515, 1952, 114, 2347, 751, 2349, 2350, 746, 241, 741,
- /* 1440 */ 755, 157, 2129, 159, 2535, 64, 2436, 140, 2521, 203,
- /* 1450 */ 413, 2432, 157, 2516, 699, 1663, 1664, 1716, 333, 1718,
- /* 1460 */ 1721, 1722, 1723, 1724, 1725, 1726, 1727, 1728, 743, 739,
- /* 1470 */ 1737, 1738, 1740, 1741, 1742, 1743, 2, 666, 2471, 296,
- /* 1480 */ 2481, 426, 425, 835, 2346, 711, 303, 299, 2050, 1671,
- /* 1490 */ 5, 1673, 438, 433, 84, 83, 469, 748, 380, 216,
- /* 1500 */ 446, 1692, 447, 1670, 1744, 458, 1666, 457, 212, 214,
- /* 1510 */ 460, 2346, 461, 459, 1599, 1465, 1469, 211, 1476, 328,
- /* 1520 */ 1682, 474, 1474, 363, 748, 2364, 448, 162, 1683, 445,
- /* 1530 */ 441, 437, 434, 462, 1739, 481, 225, 2312, 483, 747,
- /* 1540 */ 487, 489, 528, 506, 494, 517, 2204, 1665, 519, 527,
- /* 1550 */ 529, 540, 2364, 541, 538, 230, 543, 229, 544, 232,
- /* 1560 */ 546, 548, 1690, 563, 2312, 4, 747, 571, 564, 572,
- /* 1570 */ 574, 240, 304, 737, 92, 1685, 706, 243, 2345, 576,
- /* 1580 */ 2346, 2383, 1691, 577, 114, 2347, 751, 2349, 2350, 746,
- /* 1590 */ 1693, 741, 578, 748, 246, 1694, 2409, 580, 2436, 248,
- /* 1600 */ 93, 586, 413, 2432, 607, 2345, 2220, 94, 2383, 253,
- /* 1610 */ 360, 114, 2347, 751, 2349, 2350, 746, 609, 741, 638,
- /* 1620 */ 116, 2364, 639, 734, 2283, 2436, 2078, 651, 257, 413,
- /* 1630 */ 2432, 2074, 259, 2312, 653, 747, 164, 165, 2076, 2072,
- /* 1640 */ 97, 153, 166, 276, 167, 2280, 1686, 2279, 661, 329,
- /* 1650 */ 2266, 662, 660, 281, 279, 687, 2486, 721, 668, 665,
- /* 1660 */ 8, 667, 677, 2485, 696, 675, 404, 678, 676, 2458,
- /* 1670 */ 2538, 1674, 294, 1669, 2345, 290, 179, 2383, 707, 293,
- /* 1680 */ 115, 2347, 751, 2349, 2350, 746, 286, 741, 288, 295,
- /* 1690 */ 292, 2514, 704, 1807, 2436, 2346, 655, 145, 2435, 2432,
- /* 1700 */ 1687, 1812, 298, 1677, 1679, 2452, 1810, 1, 748, 719,
- /* 1710 */ 190, 305, 154, 2234, 845, 724, 155, 739, 1737, 1738,
- /* 1720 */ 1740, 1741, 1742, 1743, 2233, 2232, 330, 2346, 331, 409,
- /* 1730 */ 327, 725, 105, 2133, 2089, 332, 2364, 62, 107, 2417,
- /* 1740 */ 748, 206, 1272, 335, 753, 839, 193, 836, 2312, 841,
- /* 1750 */ 747, 323, 163, 372, 53, 833, 829, 825, 821, 359,
- /* 1760 */ 324, 373, 2346, 339, 2304, 337, 2303, 2302, 2364, 344,
- /* 1770 */ 81, 358, 348, 2297, 435, 748, 436, 1650, 1651, 209,
- /* 1780 */ 2312, 440, 747, 2295, 442, 443, 444, 1649, 2294, 2345,
- /* 1790 */ 381, 2292, 2383, 449, 2291, 115, 2347, 751, 2349, 2350,
- /* 1800 */ 746, 113, 741, 2364, 318, 451, 2290, 453, 2289, 2436,
- /* 1810 */ 1638, 455, 2270, 736, 2432, 2312, 213, 747, 2269, 215,
- /* 1820 */ 1602, 749, 82, 1601, 2383, 2247, 2246, 115, 2347, 751,
- /* 1830 */ 2349, 2350, 746, 2245, 741, 2346, 727, 467, 468, 2244,
- /* 1840 */ 2243, 2436, 2194, 2191, 472, 375, 2432, 1545, 748, 2190,
- /* 1850 */ 475, 2184, 479, 478, 2181, 2180, 2345, 2179, 2346, 2383,
- /* 1860 */ 218, 2178, 176, 2347, 751, 2349, 2350, 746, 85, 741,
- /* 1870 */ 2183, 748, 2182, 220, 2177, 2176, 2364, 2174, 2346, 307,
- /* 1880 */ 222, 495, 2171, 497, 2169, 2168, 306, 2173, 2312, 2172,
- /* 1890 */ 747, 748, 2167, 2346, 2166, 2189, 2165, 2164, 2163, 2364,
- /* 1900 */ 2187, 2170, 2162, 2161, 2160, 277, 748, 2158, 2157, 2156,
- /* 1910 */ 2155, 2312, 2154, 747, 224, 2152, 700, 2536, 2153, 2364,
- /* 1920 */ 2151, 91, 2150, 2149, 402, 2188, 2186, 2148, 2147, 2345,
- /* 1930 */ 2146, 2312, 2383, 747, 2364, 115, 2347, 751, 2349, 2350,
- /* 1940 */ 746, 1551, 741, 2145, 228, 2144, 2312, 531, 747, 2436,
- /* 1950 */ 533, 2143, 2345, 2142, 2433, 2383, 1408, 1412, 175, 2347,
- /* 1960 */ 751, 2349, 2350, 746, 1990, 741, 369, 370, 1404, 1989,
- /* 1970 */ 231, 233, 2345, 1988, 1986, 2383, 234, 1983, 357, 2347,
- /* 1980 */ 751, 2349, 2350, 746, 549, 741, 551, 2345, 1982, 2346,
- /* 1990 */ 2383, 550, 553, 350, 2347, 751, 2349, 2350, 746, 554,
- /* 2000 */ 741, 2478, 748, 555, 1975, 557, 1962, 558, 559, 561,
- /* 2010 */ 1937, 185, 236, 78, 2332, 1296, 1936, 2268, 79, 195,
- /* 2020 */ 2264, 2254, 238, 2242, 569, 2346, 245, 247, 2241, 250,
- /* 2030 */ 2364, 2218, 2067, 1985, 1343, 1981, 587, 588, 748, 695,
- /* 2040 */ 589, 1979, 2312, 592, 747, 591, 1977, 593, 595, 597,
- /* 2050 */ 1974, 596, 599, 600, 601, 1957, 1955, 2346, 1956, 1954,
- /* 2060 */ 1933, 2069, 1481, 256, 65, 1480, 2364, 1394, 1972, 1380,
- /* 2070 */ 745, 408, 2068, 1393, 1391, 1389, 1388, 1387, 2312, 1386,
- /* 2080 */ 747, 1385, 808, 2345, 810, 1382, 2383, 393, 1970, 176,
- /* 2090 */ 2347, 751, 2349, 2350, 746, 394, 741, 1961, 2364, 1381,
- /* 2100 */ 1379, 395, 1959, 396, 1932, 633, 636, 1931, 1930, 1929,
- /* 2110 */ 2312, 640, 747, 642, 1928, 644, 117, 1632, 2267, 2345,
- /* 2120 */ 1634, 1631, 2383, 57, 278, 357, 2347, 751, 2349, 2350,
- /* 2130 */ 746, 29, 741, 69, 2346, 1636, 2263, 1608, 1612, 58,
- /* 2140 */ 2253, 1610, 663, 169, 2537, 664, 2240, 748, 2239, 669,
- /* 2150 */ 2346, 2345, 2520, 1863, 2383, 20, 17, 356, 2347, 751,
- /* 2160 */ 2349, 2350, 746, 748, 741, 1587, 2402, 282, 2346, 1586,
- /* 2170 */ 671, 31, 21, 285, 6, 2364, 679, 7, 287, 200,
- /* 2180 */ 416, 748, 2333, 22, 177, 681, 1844, 2312, 189, 747,
- /* 2190 */ 33, 2364, 188, 32, 67, 24, 418, 1833, 80, 2238,
- /* 2200 */ 1883, 23, 1884, 2312, 1878, 747, 1877, 405, 1882, 2364,
- /* 2210 */ 18, 1881, 406, 1804, 1803, 301, 59, 60, 2217, 101,
- /* 2220 */ 102, 2312, 180, 747, 25, 2216, 108, 103, 2345, 308,
- /* 2230 */ 191, 2383, 314, 2346, 357, 2347, 751, 2349, 2350, 746,
- /* 2240 */ 1839, 741, 70, 722, 2345, 104, 748, 2383, 26, 319,
- /* 2250 */ 357, 2347, 751, 2349, 2350, 746, 1756, 741, 1755, 13,
- /* 2260 */ 11, 1675, 650, 1766, 1734, 2383, 2386, 2346, 352, 2347,
- /* 2270 */ 751, 2349, 2350, 746, 2364, 741, 1732, 181, 192, 316,
- /* 2280 */ 748, 1709, 752, 740, 39, 754, 2312, 1731, 747, 1701,
- /* 2290 */ 2346, 750, 1457, 16, 27, 28, 1341, 1466, 419, 756,
- /* 2300 */ 758, 1463, 759, 748, 1462, 761, 1459, 764, 2364, 762,
- /* 2310 */ 765, 767, 1453, 768, 770, 1451, 771, 109, 1456, 322,
- /* 2320 */ 2312, 110, 747, 77, 1475, 1455, 1471, 2345, 1376, 1454,
- /* 2330 */ 2383, 2364, 1373, 342, 2347, 751, 2349, 2350, 746, 1372,
- /* 2340 */ 741, 207, 785, 2312, 1371, 747, 1370, 2346, 1368, 1366,
- /* 2350 */ 1365, 1364, 796, 798, 1402, 1362, 1401, 1361, 1360, 1359,
- /* 2360 */ 748, 2345, 1358, 1357, 2383, 1356, 1398, 341, 2347, 751,
- /* 2370 */ 2349, 2350, 746, 1396, 741, 1353, 1352, 1349, 1348, 1347,
- /* 2380 */ 1346, 1980, 818, 819, 2345, 823, 820, 2383, 2364, 1978,
- /* 2390 */ 343, 2347, 751, 2349, 2350, 746, 822, 741, 824, 1976,
- /* 2400 */ 2312, 826, 747, 827, 828, 1973, 830, 832, 1953, 831,
- /* 2410 */ 834, 1285, 1927, 1273, 326, 838, 840, 1897, 1661, 336,
- /* 2420 */ 2346, 843, 844, 1897, 1897, 1897, 1897, 1897, 1897, 1897,
- /* 2430 */ 1897, 1897, 1897, 748, 1897, 1897, 1897, 1897, 1897, 1897,
- /* 2440 */ 2346, 2345, 1897, 1897, 2383, 1897, 1897, 349, 2347, 751,
- /* 2450 */ 2349, 2350, 746, 748, 741, 1897, 1897, 1897, 1897, 1897,
- /* 2460 */ 1897, 2364, 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897,
- /* 2470 */ 1897, 1897, 1897, 2312, 1897, 747, 1897, 1897, 1897, 1897,
- /* 2480 */ 1897, 2364, 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897,
- /* 2490 */ 1897, 1897, 1897, 2312, 1897, 747, 1897, 1897, 2346, 1897,
- /* 2500 */ 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897,
- /* 2510 */ 1897, 748, 1897, 2346, 2345, 1897, 1897, 2383, 1897, 1897,
- /* 2520 */ 353, 2347, 751, 2349, 2350, 746, 748, 741, 1897, 1897,
- /* 2530 */ 1897, 1897, 1897, 1897, 2345, 2346, 1897, 2383, 1897, 2364,
- /* 2540 */ 345, 2347, 751, 2349, 2350, 746, 1897, 741, 748, 1897,
- /* 2550 */ 1897, 2312, 1897, 747, 2364, 1897, 1897, 1897, 1897, 1897,
- /* 2560 */ 1897, 1897, 1897, 1897, 1897, 1897, 2312, 1897, 747, 1897,
- /* 2570 */ 1897, 1897, 1897, 1897, 1897, 1897, 2364, 1897, 1897, 1897,
- /* 2580 */ 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897, 2312, 1897,
- /* 2590 */ 747, 1897, 2345, 2346, 1897, 2383, 1897, 1897, 354, 2347,
- /* 2600 */ 751, 2349, 2350, 746, 1897, 741, 748, 2345, 2346, 1897,
- /* 2610 */ 2383, 1897, 1897, 346, 2347, 751, 2349, 2350, 746, 1897,
- /* 2620 */ 741, 748, 1897, 1897, 1897, 1897, 1897, 1897, 2346, 2345,
- /* 2630 */ 1897, 1897, 2383, 1897, 2364, 355, 2347, 751, 2349, 2350,
- /* 2640 */ 746, 748, 741, 1897, 1897, 1897, 2312, 1897, 747, 2364,
- /* 2650 */ 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897,
- /* 2660 */ 1897, 2312, 1897, 747, 1897, 1897, 1897, 1897, 1897, 2364,
- /* 2670 */ 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897,
- /* 2680 */ 1897, 2312, 1897, 747, 1897, 1897, 1897, 2345, 1897, 1897,
- /* 2690 */ 2383, 1897, 1897, 347, 2347, 751, 2349, 2350, 746, 1897,
- /* 2700 */ 741, 2346, 2345, 1897, 1897, 2383, 1897, 1897, 361, 2347,
- /* 2710 */ 751, 2349, 2350, 746, 748, 741, 1897, 1897, 1897, 1897,
- /* 2720 */ 1897, 2346, 2345, 1897, 1897, 2383, 1897, 1897, 362, 2347,
- /* 2730 */ 751, 2349, 2350, 746, 748, 741, 1897, 1897, 2346, 1897,
- /* 2740 */ 1897, 1897, 2364, 1897, 1897, 1897, 1897, 1897, 1897, 1897,
- /* 2750 */ 1897, 748, 1897, 1897, 2312, 1897, 747, 1897, 1897, 1897,
- /* 2760 */ 1897, 1897, 2364, 1897, 1897, 1897, 1897, 1897, 1897, 1897,
- /* 2770 */ 1897, 1897, 1897, 1897, 2312, 1897, 747, 1897, 1897, 2364,
- /* 2780 */ 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897,
- /* 2790 */ 1897, 2312, 1897, 747, 1897, 2345, 1897, 1897, 2383, 1897,
- /* 2800 */ 1897, 2358, 2347, 751, 2349, 2350, 746, 2346, 741, 1897,
- /* 2810 */ 1897, 1897, 1897, 1897, 1897, 2345, 1897, 1897, 2383, 1897,
- /* 2820 */ 748, 2357, 2347, 751, 2349, 2350, 746, 1897, 741, 1897,
- /* 2830 */ 1897, 1897, 2345, 1897, 1897, 2383, 1897, 1897, 2356, 2347,
- /* 2840 */ 751, 2349, 2350, 746, 1897, 741, 1897, 1897, 2364, 1897,
- /* 2850 */ 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897,
- /* 2860 */ 2312, 1897, 747, 1897, 1897, 2346, 1897, 1897, 1897, 1897,
- /* 2870 */ 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897, 748, 1897,
- /* 2880 */ 2346, 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897,
- /* 2890 */ 1897, 1897, 1897, 748, 1897, 1897, 1897, 1897, 1897, 1897,
- /* 2900 */ 1897, 2345, 2346, 1897, 2383, 1897, 2364, 377, 2347, 751,
- /* 2910 */ 2349, 2350, 746, 1897, 741, 748, 1897, 1897, 2312, 1897,
- /* 2920 */ 747, 2364, 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897,
- /* 2930 */ 1897, 1897, 1897, 2312, 1897, 747, 1897, 1897, 1897, 1897,
- /* 2940 */ 1897, 1897, 1897, 2364, 1897, 1897, 1897, 1897, 1897, 1897,
- /* 2950 */ 1897, 1897, 1897, 1897, 1897, 2312, 1897, 747, 1897, 2345,
- /* 2960 */ 2346, 1897, 2383, 1897, 1897, 378, 2347, 751, 2349, 2350,
- /* 2970 */ 746, 1897, 741, 748, 2345, 2346, 1897, 2383, 1897, 1897,
- /* 2980 */ 374, 2347, 751, 2349, 2350, 746, 1897, 741, 748, 1897,
- /* 2990 */ 1897, 1897, 1897, 1897, 1897, 1897, 2345, 1897, 1897, 2383,
- /* 3000 */ 1897, 2364, 379, 2347, 751, 2349, 2350, 746, 1897, 741,
- /* 3010 */ 1897, 1897, 1897, 2312, 1897, 747, 2364, 1897, 1897, 1897,
- /* 3020 */ 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897, 2312, 1897,
- /* 3030 */ 747, 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897,
- /* 3040 */ 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897, 1897,
- /* 3050 */ 1897, 1897, 1897, 1897, 749, 1897, 1897, 2383, 1897, 1897,
- /* 3060 */ 352, 2347, 751, 2349, 2350, 746, 1897, 741, 1897, 2345,
- /* 3070 */ 1897, 1897, 2383, 1897, 1897, 351, 2347, 751, 2349, 2350,
- /* 3080 */ 746, 1897, 741,
+ /* 690 */ 673, 1661, 305, 1659, 275, 2346, 732, 2089, 2384, 226,
+ /* 700 */ 2448, 114, 2348, 752, 2350, 2351, 747, 1920, 742, 433,
+ /* 710 */ 421, 305, 778, 2412, 432, 2437, 504, 159, 171, 414,
+ /* 720 */ 2433, 660, 2266, 1664, 1665, 1717, 2091, 1719, 1722, 1723,
+ /* 730 */ 1724, 1725, 1726, 1727, 1728, 1729, 744, 740, 1738, 1739,
+ /* 740 */ 1741, 1742, 1743, 1744, 2, 48, 46, 1750, 2347, 421,
+ /* 750 */ 427, 426, 635, 418, 1408, 1660, 1842, 168, 424, 674,
+ /* 760 */ 2313, 749, 2516, 1952, 400, 2091, 171, 647, 1745, 1407,
+ /* 770 */ 1658, 1843, 2140, 2160, 2091, 1667, 732, 2089, 2347, 106,
+ /* 780 */ 2522, 203, 95, 271, 1776, 2517, 700, 1717, 1315, 2365,
+ /* 790 */ 1314, 749, 1623, 2475, 223, 2142, 505, 1689, 1740, 638,
+ /* 800 */ 1396, 2313, 408, 748, 2082, 1892, 632, 630, 2085, 1721,
+ /* 810 */ 2140, 1666, 1841, 268, 47, 45, 44, 43, 42, 2365,
+ /* 820 */ 41, 40, 61, 1316, 47, 45, 44, 43, 42, 527,
+ /* 830 */ 671, 2313, 1689, 748, 1689, 90, 538, 843, 89, 1721,
+ /* 840 */ 49, 1398, 2346, 732, 2089, 2384, 2347, 1808, 114, 2348,
+ /* 850 */ 752, 2350, 2351, 747, 72, 742, 1660, 71, 1666, 749,
+ /* 860 */ 2536, 2488, 2437, 506, 35, 1718, 414, 2433, 702, 732,
+ /* 870 */ 2089, 1658, 2346, 1850, 1781, 2384, 1747, 1748, 114, 2348,
+ /* 880 */ 752, 2350, 2351, 747, 274, 742, 1919, 2365, 2066, 585,
+ /* 890 */ 2536, 228, 2437, 2142, 563, 1718, 414, 2433, 1816, 2313,
+ /* 900 */ 413, 748, 335, 561, 88, 2119, 557, 553, 2140, 1891,
+ /* 910 */ 732, 2089, 1666, 1720, 1730, 526, 227, 1918, 326, 1412,
+ /* 920 */ 1746, 1749, 686, 685, 1848, 1849, 1851, 1852, 1853, 2142,
+ /* 930 */ 2086, 1296, 512, 511, 1411, 1661, 422, 1659, 843, 2313,
+ /* 940 */ 2346, 613, 1670, 2384, 2140, 612, 114, 2348, 752, 2350,
+ /* 950 */ 2351, 747, 1917, 742, 1916, 1294, 1295, 1915, 2536, 194,
+ /* 960 */ 2437, 2076, 1628, 1629, 414, 2433, 2072, 1664, 1665, 1717,
+ /* 970 */ 2313, 1719, 1722, 1723, 1724, 1725, 1726, 1727, 1728, 1729,
+ /* 980 */ 744, 740, 1738, 1739, 1741, 1742, 1743, 1744, 2, 48,
+ /* 990 */ 46, 2347, 607, 606, 199, 2064, 198, 418, 734, 1660,
+ /* 1000 */ 2409, 540, 624, 623, 749, 2313, 681, 2313, 801, 2093,
+ /* 1010 */ 2313, 2050, 1745, 1690, 1658, 41, 40, 732, 2089, 47,
+ /* 1020 */ 45, 44, 43, 42, 785, 161, 160, 782, 781, 780,
+ /* 1030 */ 158, 171, 2365, 44, 43, 42, 1661, 276, 1659, 2092,
+ /* 1040 */ 30, 2452, 1740, 281, 2313, 1689, 748, 1914, 1690, 1685,
+ /* 1050 */ 1690, 312, 313, 41, 40, 1666, 311, 47, 45, 44,
+ /* 1060 */ 43, 42, 732, 2089, 1289, 1913, 2294, 2447, 1664, 1665,
+ /* 1070 */ 41, 40, 1910, 2347, 47, 45, 44, 43, 42, 732,
+ /* 1080 */ 2089, 843, 284, 1296, 49, 2346, 749, 148, 2384, 2347,
+ /* 1090 */ 2408, 114, 2348, 752, 2350, 2351, 747, 2142, 742, 717,
+ /* 1100 */ 2313, 703, 749, 2536, 2509, 2437, 1291, 1294, 1295, 414,
+ /* 1110 */ 2433, 736, 718, 2409, 2365, 1862, 812, 810, 2313, 402,
+ /* 1120 */ 1747, 1748, 2067, 732, 2089, 2313, 2313, 197, 748, 1909,
+ /* 1130 */ 2365, 785, 161, 160, 782, 781, 780, 158, 743, 2142,
+ /* 1140 */ 732, 2089, 2313, 316, 748, 76, 732, 2089, 2142, 732,
+ /* 1150 */ 2089, 732, 2089, 1835, 727, 152, 1908, 1720, 1730, 779,
+ /* 1160 */ 425, 1907, 2133, 2141, 1746, 1749, 729, 2346, 1815, 730,
+ /* 1170 */ 2384, 322, 2029, 358, 2348, 752, 2350, 2351, 747, 1661,
+ /* 1180 */ 742, 1659, 2313, 2346, 1906, 1905, 2384, 2457, 1808, 114,
+ /* 1190 */ 2348, 752, 2350, 2351, 747, 1912, 742, 87, 2307, 1904,
+ /* 1200 */ 653, 2536, 783, 2437, 1903, 2133, 1902, 414, 2433, 2313,
+ /* 1210 */ 285, 1664, 1665, 1717, 2313, 1719, 1722, 1723, 1724, 1725,
+ /* 1220 */ 1726, 1727, 1728, 1729, 744, 740, 1738, 1739, 1741, 1742,
+ /* 1230 */ 1743, 1744, 2, 48, 46, 139, 784, 2313, 2313, 2133,
+ /* 1240 */ 1972, 418, 616, 1660, 170, 1927, 838, 86, 674, 2297,
+ /* 1250 */ 674, 2516, 2313, 2516, 100, 2347, 1745, 2313, 1658, 2313,
+ /* 1260 */ 617, 1690, 629, 256, 261, 1718, 1393, 259, 749, 2522,
+ /* 1270 */ 203, 2522, 203, 1970, 2517, 700, 2517, 700, 263, 178,
+ /* 1280 */ 265, 262, 267, 264, 1391, 266, 1740, 1961, 603, 599,
+ /* 1290 */ 595, 591, 1959, 255, 210, 631, 2365, 41, 40, 1666,
+ /* 1300 */ 440, 47, 45, 44, 43, 42, 2481, 159, 2313, 633,
+ /* 1310 */ 748, 650, 706, 649, 636, 50, 50, 2334, 172, 187,
+ /* 1320 */ 1894, 1895, 1669, 341, 159, 843, 14, 13, 15, 50,
+ /* 1330 */ 310, 75, 2347, 298, 96, 687, 1668, 253, 1351, 659,
+ /* 1340 */ 339, 74, 157, 159, 73, 749, 66, 2456, 792, 2346,
+ /* 1350 */ 793, 141, 2384, 50, 368, 175, 2348, 752, 2350, 2351,
+ /* 1360 */ 747, 111, 742, 704, 1747, 1748, 236, 548, 546, 543,
+ /* 1370 */ 108, 292, 1370, 2365, 1368, 2336, 2026, 715, 2366, 1352,
+ /* 1380 */ 2025, 2212, 1626, 50, 1943, 2313, 2471, 748, 684, 674,
+ /* 1390 */ 1847, 1846, 2516, 404, 290, 691, 401, 675, 2478, 716,
+ /* 1400 */ 721, 1720, 1730, 243, 1576, 314, 724, 63, 1746, 1749,
+ /* 1410 */ 2522, 203, 252, 245, 1949, 2517, 700, 318, 1438, 250,
+ /* 1420 */ 580, 1782, 431, 1661, 2213, 1659, 2346, 674, 1731, 2384,
+ /* 1430 */ 2516, 1953, 114, 2348, 752, 2350, 2351, 747, 242, 742,
+ /* 1440 */ 756, 157, 2130, 159, 2536, 64, 2437, 140, 2522, 203,
+ /* 1450 */ 414, 2433, 157, 2517, 700, 1664, 1665, 1717, 334, 1719,
+ /* 1460 */ 1722, 1723, 1724, 1725, 1726, 1727, 1728, 1729, 744, 740,
+ /* 1470 */ 1738, 1739, 1741, 1742, 1743, 1744, 2, 667, 2472, 297,
+ /* 1480 */ 2482, 427, 426, 836, 2347, 712, 304, 300, 2051, 1672,
+ /* 1490 */ 5, 1674, 439, 434, 84, 83, 470, 749, 381, 216,
+ /* 1500 */ 447, 1693, 448, 1671, 1745, 459, 1667, 458, 212, 214,
+ /* 1510 */ 461, 2347, 462, 460, 1600, 1466, 1470, 211, 1477, 329,
+ /* 1520 */ 1683, 475, 1475, 364, 749, 2365, 449, 162, 1684, 446,
+ /* 1530 */ 442, 438, 435, 463, 1740, 482, 225, 2313, 484, 748,
+ /* 1540 */ 488, 490, 529, 507, 495, 518, 2205, 1666, 520, 525,
+ /* 1550 */ 528, 530, 2365, 541, 542, 539, 231, 230, 544, 545,
+ /* 1560 */ 233, 547, 549, 1691, 2313, 564, 748, 4, 565, 572,
+ /* 1570 */ 573, 575, 305, 738, 241, 92, 707, 1686, 2346, 577,
+ /* 1580 */ 2347, 2384, 1692, 244, 114, 2348, 752, 2350, 2351, 747,
+ /* 1590 */ 578, 742, 1694, 749, 579, 1695, 2410, 581, 2437, 247,
+ /* 1600 */ 249, 587, 414, 2433, 2221, 2346, 93, 94, 2384, 254,
+ /* 1610 */ 608, 114, 2348, 752, 2350, 2351, 747, 639, 742, 640,
+ /* 1620 */ 116, 2365, 361, 735, 2284, 2437, 2281, 652, 610, 414,
+ /* 1630 */ 2433, 2079, 258, 2313, 654, 748, 2075, 260, 164, 165,
+ /* 1640 */ 2077, 97, 2073, 277, 166, 167, 153, 2280, 1687, 282,
+ /* 1650 */ 662, 330, 2267, 661, 663, 688, 280, 2487, 669, 722,
+ /* 1660 */ 8, 666, 678, 2486, 697, 676, 405, 679, 2459, 668,
+ /* 1670 */ 677, 1675, 2539, 1670, 2346, 179, 291, 2384, 708, 293,
+ /* 1680 */ 115, 2348, 752, 2350, 2351, 747, 287, 742, 296, 289,
+ /* 1690 */ 2515, 705, 294, 1808, 2437, 2347, 656, 299, 2436, 2433,
+ /* 1700 */ 295, 1688, 145, 1678, 1680, 1813, 1811, 1, 749, 2453,
+ /* 1710 */ 190, 306, 154, 720, 846, 725, 155, 740, 1738, 1739,
+ /* 1720 */ 1741, 1742, 1743, 1744, 2235, 2234, 331, 2347, 2233, 332,
+ /* 1730 */ 328, 726, 410, 105, 2090, 333, 2365, 62, 107, 2418,
+ /* 1740 */ 749, 336, 206, 324, 754, 1273, 193, 2134, 2313, 840,
+ /* 1750 */ 748, 837, 163, 842, 53, 834, 830, 826, 822, 360,
+ /* 1760 */ 325, 338, 2347, 373, 340, 345, 2305, 2304, 2365, 359,
+ /* 1770 */ 2303, 349, 374, 81, 2298, 749, 436, 437, 1651, 1652,
+ /* 1780 */ 2313, 209, 748, 441, 2296, 443, 444, 445, 1650, 2346,
+ /* 1790 */ 2295, 382, 2384, 2293, 450, 115, 2348, 752, 2350, 2351,
+ /* 1800 */ 747, 113, 742, 2365, 319, 2292, 452, 2291, 454, 2437,
+ /* 1810 */ 2290, 1639, 456, 737, 2433, 2313, 2271, 748, 213, 2270,
+ /* 1820 */ 215, 750, 82, 1603, 2384, 1602, 2248, 115, 2348, 752,
+ /* 1830 */ 2350, 2351, 747, 2247, 742, 2347, 728, 2246, 468, 469,
+ /* 1840 */ 2245, 2437, 2244, 473, 2195, 376, 2433, 1546, 749, 2192,
+ /* 1850 */ 476, 2191, 2185, 480, 479, 2182, 2346, 218, 2347, 2384,
+ /* 1860 */ 2181, 2180, 176, 2348, 752, 2350, 2351, 747, 85, 742,
+ /* 1870 */ 2179, 749, 2184, 220, 2183, 2178, 2365, 2177, 2347, 308,
+ /* 1880 */ 222, 496, 2172, 498, 2170, 2169, 307, 2175, 2313, 2174,
+ /* 1890 */ 748, 749, 2173, 2347, 2168, 2167, 2190, 2166, 2165, 2365,
+ /* 1900 */ 2164, 2188, 2171, 2163, 2162, 278, 749, 2161, 2159, 2158,
+ /* 1910 */ 2157, 2313, 2156, 748, 224, 2153, 701, 2537, 2155, 2365,
+ /* 1920 */ 2154, 91, 2152, 2151, 403, 2150, 2189, 2187, 2149, 2346,
+ /* 1930 */ 2148, 2313, 2384, 748, 2365, 115, 2348, 752, 2350, 2351,
+ /* 1940 */ 747, 1552, 742, 2147, 229, 2146, 2313, 532, 748, 2437,
+ /* 1950 */ 2145, 2144, 2346, 2143, 2434, 2384, 1409, 534, 175, 2348,
+ /* 1960 */ 752, 2350, 2351, 747, 1413, 742, 370, 371, 1991, 1405,
+ /* 1970 */ 232, 1990, 2346, 1989, 1987, 2384, 234, 1984, 358, 2348,
+ /* 1980 */ 752, 2350, 2351, 747, 550, 742, 235, 2346, 552, 2347,
+ /* 1990 */ 2384, 551, 1983, 351, 2348, 752, 2350, 2351, 747, 554,
+ /* 2000 */ 742, 2479, 749, 555, 1976, 556, 558, 559, 560, 1963,
+ /* 2010 */ 1938, 185, 562, 2333, 78, 237, 195, 1297, 1937, 239,
+ /* 2020 */ 2269, 2265, 79, 2255, 2243, 2347, 246, 248, 570, 2242,
+ /* 2030 */ 2365, 251, 2219, 2068, 1986, 1982, 588, 1344, 749, 696,
+ /* 2040 */ 589, 1980, 2313, 590, 748, 592, 593, 594, 1978, 596,
+ /* 2050 */ 1975, 597, 600, 598, 1958, 602, 1956, 2347, 601, 1957,
+ /* 2060 */ 1955, 1934, 2070, 65, 1482, 1481, 2365, 257, 2069, 1381,
+ /* 2070 */ 746, 409, 1973, 1395, 1394, 1392, 1390, 1389, 2313, 1388,
+ /* 2080 */ 748, 1387, 1386, 2346, 809, 811, 2384, 394, 1971, 176,
+ /* 2090 */ 2348, 752, 2350, 2351, 747, 1383, 742, 395, 2365, 1962,
+ /* 2100 */ 1382, 1380, 396, 1960, 397, 1933, 634, 637, 1932, 1931,
+ /* 2110 */ 2313, 641, 748, 1930, 643, 1929, 645, 117, 1633, 2346,
+ /* 2120 */ 1635, 1632, 2384, 2268, 1637, 358, 2348, 752, 2350, 2351,
+ /* 2130 */ 747, 57, 742, 29, 2347, 69, 2264, 58, 1613, 279,
+ /* 2140 */ 1611, 1609, 2254, 169, 2538, 283, 664, 749, 2241, 2240,
+ /* 2150 */ 2347, 2346, 20, 2521, 2384, 17, 31, 357, 2348, 752,
+ /* 2160 */ 2350, 2351, 747, 749, 742, 665, 2403, 1588, 2347, 1587,
+ /* 2170 */ 670, 6, 7, 21, 1864, 2365, 286, 672, 680, 682,
+ /* 2180 */ 417, 749, 200, 2334, 22, 189, 288, 2313, 33, 748,
+ /* 2190 */ 23, 2365, 67, 1845, 1834, 24, 419, 1884, 177, 188,
+ /* 2200 */ 32, 18, 80, 2313, 1885, 748, 1879, 1878, 406, 2365,
+ /* 2210 */ 1883, 1882, 407, 302, 1805, 1804, 60, 180, 2239, 2218,
+ /* 2220 */ 102, 2313, 309, 748, 101, 2217, 103, 59, 2346, 320,
+ /* 2230 */ 317, 2384, 25, 2347, 358, 2348, 752, 2350, 2351, 747,
+ /* 2240 */ 1840, 742, 191, 723, 2346, 315, 749, 2384, 70, 26,
+ /* 2250 */ 358, 2348, 752, 2350, 2351, 747, 13, 742, 1676, 108,
+ /* 2260 */ 104, 1757, 651, 11, 1756, 2384, 1735, 2347, 353, 2348,
+ /* 2270 */ 752, 2350, 2351, 747, 2365, 742, 181, 192, 1710, 2387,
+ /* 2280 */ 749, 755, 753, 741, 420, 1733, 2313, 1732, 748, 1767,
+ /* 2290 */ 2347, 1458, 39, 16, 27, 759, 1702, 28, 762, 1467,
+ /* 2300 */ 757, 765, 1464, 749, 760, 768, 1463, 763, 2365, 1460,
+ /* 2310 */ 766, 771, 1454, 769, 323, 1452, 751, 772, 1472, 109,
+ /* 2320 */ 2313, 110, 748, 1457, 1456, 1476, 1377, 2346, 77, 1342,
+ /* 2330 */ 2384, 2365, 1374, 343, 2348, 752, 2350, 2351, 747, 1455,
+ /* 2340 */ 742, 786, 1373, 2313, 1372, 748, 1371, 2347, 1369, 1367,
+ /* 2350 */ 1366, 1365, 797, 799, 1403, 1402, 207, 1363, 1362, 1361,
+ /* 2360 */ 749, 2346, 1360, 1359, 2384, 1358, 1357, 342, 2348, 752,
+ /* 2370 */ 2350, 2351, 747, 1397, 742, 1399, 1354, 1348, 1353, 1350,
+ /* 2380 */ 1349, 1347, 1981, 819, 2346, 820, 1979, 2384, 2365, 821,
+ /* 2390 */ 344, 2348, 752, 2350, 2351, 747, 823, 742, 825, 1977,
+ /* 2400 */ 2313, 824, 748, 827, 828, 829, 1974, 831, 832, 833,
+ /* 2410 */ 1954, 835, 1286, 1928, 1274, 327, 839, 841, 845, 1662,
+ /* 2420 */ 2347, 1898, 337, 844, 1898, 1898, 1898, 1898, 1898, 1898,
+ /* 2430 */ 1898, 1898, 1898, 749, 1898, 1898, 1898, 1898, 1898, 1898,
+ /* 2440 */ 2347, 2346, 1898, 1898, 2384, 1898, 1898, 350, 2348, 752,
+ /* 2450 */ 2350, 2351, 747, 749, 742, 1898, 1898, 1898, 1898, 1898,
+ /* 2460 */ 1898, 2365, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898,
+ /* 2470 */ 1898, 1898, 1898, 2313, 1898, 748, 1898, 1898, 1898, 1898,
+ /* 2480 */ 1898, 2365, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898,
+ /* 2490 */ 1898, 1898, 1898, 2313, 1898, 748, 1898, 1898, 2347, 1898,
+ /* 2500 */ 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898,
+ /* 2510 */ 1898, 749, 1898, 2347, 2346, 1898, 1898, 2384, 1898, 1898,
+ /* 2520 */ 354, 2348, 752, 2350, 2351, 747, 749, 742, 1898, 1898,
+ /* 2530 */ 1898, 1898, 1898, 1898, 2346, 2347, 1898, 2384, 1898, 2365,
+ /* 2540 */ 346, 2348, 752, 2350, 2351, 747, 1898, 742, 749, 1898,
+ /* 2550 */ 1898, 2313, 1898, 748, 2365, 1898, 1898, 1898, 1898, 1898,
+ /* 2560 */ 1898, 1898, 1898, 1898, 1898, 1898, 2313, 1898, 748, 1898,
+ /* 2570 */ 1898, 1898, 1898, 1898, 1898, 1898, 2365, 1898, 1898, 1898,
+ /* 2580 */ 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 2313, 1898,
+ /* 2590 */ 748, 1898, 2346, 2347, 1898, 2384, 1898, 1898, 355, 2348,
+ /* 2600 */ 752, 2350, 2351, 747, 1898, 742, 749, 2346, 2347, 1898,
+ /* 2610 */ 2384, 1898, 1898, 347, 2348, 752, 2350, 2351, 747, 1898,
+ /* 2620 */ 742, 749, 1898, 1898, 1898, 1898, 1898, 1898, 2347, 2346,
+ /* 2630 */ 1898, 1898, 2384, 1898, 2365, 356, 2348, 752, 2350, 2351,
+ /* 2640 */ 747, 749, 742, 1898, 1898, 1898, 2313, 1898, 748, 2365,
+ /* 2650 */ 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898,
+ /* 2660 */ 1898, 2313, 1898, 748, 1898, 1898, 1898, 1898, 1898, 2365,
+ /* 2670 */ 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898,
+ /* 2680 */ 1898, 2313, 1898, 748, 1898, 1898, 1898, 2346, 1898, 1898,
+ /* 2690 */ 2384, 1898, 1898, 348, 2348, 752, 2350, 2351, 747, 1898,
+ /* 2700 */ 742, 2347, 2346, 1898, 1898, 2384, 1898, 1898, 362, 2348,
+ /* 2710 */ 752, 2350, 2351, 747, 749, 742, 1898, 1898, 1898, 1898,
+ /* 2720 */ 1898, 2347, 2346, 1898, 1898, 2384, 1898, 1898, 363, 2348,
+ /* 2730 */ 752, 2350, 2351, 747, 749, 742, 1898, 1898, 2347, 1898,
+ /* 2740 */ 1898, 1898, 2365, 1898, 1898, 1898, 1898, 1898, 1898, 1898,
+ /* 2750 */ 1898, 749, 1898, 1898, 2313, 1898, 748, 1898, 1898, 1898,
+ /* 2760 */ 1898, 1898, 2365, 1898, 1898, 1898, 1898, 1898, 1898, 1898,
+ /* 2770 */ 1898, 1898, 1898, 1898, 2313, 1898, 748, 1898, 1898, 2365,
+ /* 2780 */ 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898,
+ /* 2790 */ 1898, 2313, 1898, 748, 1898, 2346, 1898, 1898, 2384, 1898,
+ /* 2800 */ 1898, 2359, 2348, 752, 2350, 2351, 747, 2347, 742, 1898,
+ /* 2810 */ 1898, 1898, 1898, 1898, 1898, 2346, 1898, 1898, 2384, 1898,
+ /* 2820 */ 749, 2358, 2348, 752, 2350, 2351, 747, 1898, 742, 1898,
+ /* 2830 */ 1898, 1898, 2346, 1898, 1898, 2384, 1898, 1898, 2357, 2348,
+ /* 2840 */ 752, 2350, 2351, 747, 1898, 742, 1898, 1898, 2365, 1898,
+ /* 2850 */ 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898,
+ /* 2860 */ 2313, 1898, 748, 1898, 1898, 2347, 1898, 1898, 1898, 1898,
+ /* 2870 */ 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 749, 1898,
+ /* 2880 */ 2347, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898,
+ /* 2890 */ 1898, 1898, 1898, 749, 1898, 1898, 1898, 1898, 1898, 1898,
+ /* 2900 */ 1898, 2346, 2347, 1898, 2384, 1898, 2365, 378, 2348, 752,
+ /* 2910 */ 2350, 2351, 747, 1898, 742, 749, 1898, 1898, 2313, 1898,
+ /* 2920 */ 748, 2365, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898,
+ /* 2930 */ 1898, 1898, 1898, 2313, 1898, 748, 1898, 1898, 1898, 1898,
+ /* 2940 */ 1898, 1898, 1898, 2365, 1898, 1898, 1898, 1898, 1898, 1898,
+ /* 2950 */ 1898, 1898, 1898, 1898, 1898, 2313, 1898, 748, 1898, 2346,
+ /* 2960 */ 2347, 1898, 2384, 1898, 1898, 379, 2348, 752, 2350, 2351,
+ /* 2970 */ 747, 1898, 742, 749, 2346, 2347, 1898, 2384, 1898, 1898,
+ /* 2980 */ 375, 2348, 752, 2350, 2351, 747, 1898, 742, 749, 1898,
+ /* 2990 */ 1898, 1898, 1898, 1898, 1898, 1898, 2346, 1898, 1898, 2384,
+ /* 3000 */ 1898, 2365, 380, 2348, 752, 2350, 2351, 747, 1898, 742,
+ /* 3010 */ 1898, 1898, 1898, 2313, 1898, 748, 2365, 1898, 1898, 1898,
+ /* 3020 */ 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 2313, 1898,
+ /* 3030 */ 748, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898,
+ /* 3040 */ 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898, 1898,
+ /* 3050 */ 1898, 1898, 1898, 1898, 750, 1898, 1898, 2384, 1898, 1898,
+ /* 3060 */ 353, 2348, 752, 2350, 2351, 747, 1898, 742, 1898, 2346,
+ /* 3070 */ 1898, 1898, 2384, 1898, 1898, 352, 2348, 752, 2350, 2351,
+ /* 3080 */ 747, 1898, 742,
};
static const YYCODETYPE yy_lookahead[] = {
/* 0 */ 353, 382, 360, 395, 429, 363, 364, 1, 2, 434,
@@ -688,38 +1039,38 @@ static const YYCODETYPE yy_lookahead[] = {
/* 1520 */ 20, 365, 108, 223, 366, 394, 226, 108, 20, 229,
/* 1530 */ 230, 231, 232, 233, 65, 366, 45, 406, 415, 408,
/* 1540 */ 366, 415, 179, 365, 412, 366, 365, 78, 415, 412,
- /* 1550 */ 412, 105, 394, 378, 103, 365, 102, 377, 376, 365,
- /* 1560 */ 365, 365, 20, 358, 406, 50, 408, 358, 362, 362,
- /* 1570 */ 441, 374, 272, 104, 374, 20, 297, 374, 447, 408,
- /* 1580 */ 353, 450, 20, 367, 453, 454, 455, 456, 457, 458,
- /* 1590 */ 20, 460, 431, 366, 374, 20, 465, 367, 467, 374,
- /* 1600 */ 374, 365, 471, 472, 358, 447, 422, 374, 450, 374,
- /* 1610 */ 358, 453, 454, 455, 456, 457, 458, 394, 460, 356,
- /* 1620 */ 365, 394, 356, 465, 406, 467, 394, 221, 394, 471,
+ /* 1550 */ 412, 412, 394, 105, 378, 103, 365, 377, 102, 376,
+ /* 1560 */ 365, 365, 365, 20, 406, 358, 408, 50, 362, 358,
+ /* 1570 */ 362, 441, 272, 104, 374, 374, 297, 20, 447, 408,
+ /* 1580 */ 353, 450, 20, 374, 453, 454, 455, 456, 457, 458,
+ /* 1590 */ 367, 460, 20, 366, 431, 20, 465, 367, 467, 374,
+ /* 1600 */ 374, 365, 471, 472, 422, 447, 374, 374, 450, 374,
+ /* 1610 */ 358, 453, 454, 455, 456, 457, 458, 356, 460, 356,
+ /* 1620 */ 365, 394, 358, 465, 406, 467, 406, 221, 394, 471,
/* 1630 */ 472, 394, 394, 406, 445, 408, 394, 394, 394, 394,
- /* 1640 */ 107, 443, 394, 372, 394, 406, 20, 406, 208, 441,
- /* 1650 */ 440, 438, 207, 372, 437, 282, 490, 281, 365, 408,
- /* 1660 */ 290, 430, 406, 490, 193, 276, 299, 292, 291, 493,
- /* 1670 */ 510, 202, 487, 204, 447, 492, 490, 450, 296, 488,
- /* 1680 */ 453, 454, 455, 456, 457, 458, 424, 460, 424, 430,
- /* 1690 */ 489, 504, 294, 271, 467, 353, 1, 366, 471, 472,
- /* 1700 */ 20, 117, 503, 234, 235, 452, 273, 485, 366, 406,
+ /* 1640 */ 394, 107, 394, 372, 394, 394, 443, 406, 20, 372,
+ /* 1650 */ 208, 441, 440, 207, 438, 282, 437, 490, 365, 281,
+ /* 1660 */ 290, 408, 406, 490, 193, 276, 299, 292, 493, 430,
+ /* 1670 */ 291, 202, 510, 204, 447, 490, 492, 450, 296, 489,
+ /* 1680 */ 453, 454, 455, 456, 457, 458, 424, 460, 430, 424,
+ /* 1690 */ 504, 294, 488, 271, 467, 353, 1, 503, 471, 472,
+ /* 1700 */ 487, 20, 366, 234, 235, 117, 273, 485, 366, 452,
/* 1710 */ 367, 372, 372, 406, 19, 185, 372, 248, 249, 250,
- /* 1720 */ 251, 252, 253, 254, 406, 406, 424, 353, 424, 406,
- /* 1730 */ 35, 420, 372, 406, 366, 390, 394, 107, 107, 470,
- /* 1740 */ 366, 483, 22, 365, 398, 355, 51, 38, 406, 358,
- /* 1750 */ 408, 372, 359, 425, 433, 60, 61, 62, 63, 442,
- /* 1760 */ 65, 425, 353, 351, 0, 373, 0, 0, 394, 388,
- /* 1770 */ 45, 388, 388, 0, 37, 366, 227, 37, 37, 37,
- /* 1780 */ 406, 227, 408, 0, 37, 37, 227, 37, 0, 447,
- /* 1790 */ 227, 0, 450, 37, 0, 453, 454, 455, 456, 457,
- /* 1800 */ 458, 106, 460, 394, 109, 37, 0, 22, 0, 467,
- /* 1810 */ 222, 37, 0, 471, 472, 406, 210, 408, 0, 210,
- /* 1820 */ 204, 447, 211, 202, 450, 0, 0, 453, 454, 455,
- /* 1830 */ 456, 457, 458, 0, 460, 353, 141, 198, 197, 0,
- /* 1840 */ 0, 467, 148, 0, 49, 471, 472, 49, 366, 0,
- /* 1850 */ 37, 0, 51, 37, 0, 0, 447, 0, 353, 450,
- /* 1860 */ 49, 0, 453, 454, 455, 456, 457, 458, 45, 460,
+ /* 1720 */ 251, 252, 253, 254, 406, 406, 424, 353, 406, 424,
+ /* 1730 */ 35, 420, 406, 372, 366, 390, 394, 107, 107, 470,
+ /* 1740 */ 366, 365, 483, 372, 398, 22, 51, 406, 406, 355,
+ /* 1750 */ 408, 38, 359, 358, 433, 60, 61, 62, 63, 442,
+ /* 1760 */ 65, 373, 353, 425, 351, 388, 0, 0, 394, 388,
+ /* 1770 */ 0, 388, 425, 45, 0, 366, 37, 227, 37, 37,
+ /* 1780 */ 406, 37, 408, 227, 0, 37, 37, 227, 37, 447,
+ /* 1790 */ 0, 227, 450, 0, 37, 453, 454, 455, 456, 457,
+ /* 1800 */ 458, 106, 460, 394, 109, 0, 37, 0, 22, 467,
+ /* 1810 */ 0, 222, 37, 471, 472, 406, 0, 408, 210, 0,
+ /* 1820 */ 210, 447, 211, 204, 450, 202, 0, 453, 454, 455,
+ /* 1830 */ 456, 457, 458, 0, 460, 353, 141, 0, 198, 197,
+ /* 1840 */ 0, 467, 0, 49, 148, 471, 472, 49, 366, 0,
+ /* 1850 */ 37, 0, 0, 51, 37, 0, 447, 49, 353, 450,
+ /* 1860 */ 0, 0, 453, 454, 455, 456, 457, 458, 45, 460,
/* 1870 */ 0, 366, 0, 49, 0, 0, 394, 0, 353, 184,
/* 1880 */ 165, 37, 0, 165, 0, 0, 191, 0, 406, 0,
/* 1890 */ 408, 366, 0, 353, 0, 0, 0, 0, 0, 394,
@@ -728,54 +1079,54 @@ static const YYCODETYPE yy_lookahead[] = {
/* 1920 */ 0, 45, 0, 0, 399, 0, 0, 0, 0, 447,
/* 1930 */ 0, 406, 450, 408, 394, 453, 454, 455, 456, 457,
/* 1940 */ 458, 22, 460, 0, 148, 0, 406, 147, 408, 467,
- /* 1950 */ 146, 0, 447, 0, 472, 450, 22, 22, 453, 454,
- /* 1960 */ 455, 456, 457, 458, 0, 460, 50, 50, 37, 0,
- /* 1970 */ 65, 65, 447, 0, 0, 450, 65, 0, 453, 454,
- /* 1980 */ 455, 456, 457, 458, 37, 460, 42, 447, 0, 353,
- /* 1990 */ 450, 51, 37, 453, 454, 455, 456, 457, 458, 51,
- /* 2000 */ 460, 496, 366, 42, 0, 37, 0, 51, 42, 37,
- /* 2010 */ 0, 33, 45, 42, 49, 14, 0, 0, 42, 49,
- /* 2020 */ 0, 0, 43, 0, 49, 353, 42, 193, 0, 49,
- /* 2030 */ 394, 0, 0, 0, 72, 0, 37, 51, 366, 499,
- /* 2040 */ 42, 0, 406, 51, 408, 37, 0, 42, 37, 42,
- /* 2050 */ 0, 51, 37, 51, 42, 0, 0, 353, 0, 0,
- /* 2060 */ 0, 0, 37, 113, 115, 22, 394, 37, 0, 22,
+ /* 1950 */ 0, 0, 447, 0, 472, 450, 22, 146, 453, 454,
+ /* 1960 */ 455, 456, 457, 458, 22, 460, 50, 50, 0, 37,
+ /* 1970 */ 65, 0, 447, 0, 0, 450, 65, 0, 453, 454,
+ /* 1980 */ 455, 456, 457, 458, 37, 460, 65, 447, 42, 353,
+ /* 1990 */ 450, 51, 0, 453, 454, 455, 456, 457, 458, 37,
+ /* 2000 */ 460, 496, 366, 51, 0, 42, 37, 51, 42, 0,
+ /* 2010 */ 0, 33, 37, 49, 42, 45, 49, 14, 0, 43,
+ /* 2020 */ 0, 0, 42, 0, 0, 353, 42, 193, 49, 0,
+ /* 2030 */ 394, 49, 0, 0, 0, 0, 37, 72, 366, 499,
+ /* 2040 */ 51, 0, 406, 42, 408, 37, 51, 42, 0, 37,
+ /* 2050 */ 0, 51, 37, 42, 0, 42, 0, 353, 51, 0,
+ /* 2060 */ 0, 0, 0, 115, 37, 22, 394, 113, 0, 22,
/* 2070 */ 366, 399, 0, 37, 37, 37, 37, 37, 406, 37,
- /* 2080 */ 408, 37, 33, 447, 33, 37, 450, 22, 0, 453,
- /* 2090 */ 454, 455, 456, 457, 458, 22, 460, 0, 394, 37,
- /* 2100 */ 37, 22, 0, 22, 0, 53, 37, 0, 0, 0,
- /* 2110 */ 406, 37, 408, 37, 0, 22, 20, 37, 0, 447,
- /* 2120 */ 37, 37, 450, 182, 49, 453, 454, 455, 456, 457,
- /* 2130 */ 458, 107, 460, 107, 353, 108, 0, 37, 209, 182,
- /* 2140 */ 0, 22, 22, 205, 508, 182, 0, 366, 0, 189,
- /* 2150 */ 353, 447, 3, 108, 450, 33, 277, 453, 454, 455,
- /* 2160 */ 456, 457, 458, 366, 460, 182, 462, 185, 353, 182,
- /* 2170 */ 189, 107, 33, 107, 50, 394, 105, 50, 108, 49,
- /* 2180 */ 399, 366, 49, 33, 107, 103, 108, 406, 33, 408,
- /* 2190 */ 33, 394, 107, 107, 3, 33, 399, 108, 107, 0,
- /* 2200 */ 108, 277, 108, 406, 37, 408, 37, 37, 37, 394,
- /* 2210 */ 277, 37, 37, 108, 108, 49, 270, 33, 0, 107,
- /* 2220 */ 42, 406, 49, 408, 107, 0, 116, 42, 447, 108,
- /* 2230 */ 107, 450, 107, 353, 453, 454, 455, 456, 457, 458,
- /* 2240 */ 108, 460, 107, 186, 447, 107, 366, 450, 33, 49,
- /* 2250 */ 453, 454, 455, 456, 457, 458, 105, 460, 105, 2,
- /* 2260 */ 257, 22, 447, 234, 108, 450, 107, 353, 453, 454,
- /* 2270 */ 455, 456, 457, 458, 394, 460, 108, 49, 49, 184,
- /* 2280 */ 366, 22, 117, 107, 107, 37, 406, 108, 408, 108,
- /* 2290 */ 353, 237, 128, 107, 107, 107, 72, 108, 37, 107,
- /* 2300 */ 37, 108, 107, 366, 108, 37, 108, 37, 394, 107,
- /* 2310 */ 107, 37, 108, 107, 37, 108, 107, 107, 128, 33,
- /* 2320 */ 406, 107, 408, 107, 37, 128, 22, 447, 37, 128,
- /* 2330 */ 450, 394, 37, 453, 454, 455, 456, 457, 458, 37,
- /* 2340 */ 460, 33, 71, 406, 37, 408, 37, 353, 37, 37,
- /* 2350 */ 37, 37, 101, 101, 78, 37, 78, 37, 37, 22,
- /* 2360 */ 366, 447, 37, 37, 450, 37, 78, 453, 454, 455,
- /* 2370 */ 456, 457, 458, 37, 460, 37, 37, 37, 37, 22,
- /* 2380 */ 37, 0, 37, 51, 447, 51, 42, 450, 394, 0,
+ /* 2080 */ 408, 37, 37, 447, 33, 33, 450, 22, 0, 453,
+ /* 2090 */ 454, 455, 456, 457, 458, 37, 460, 22, 394, 0,
+ /* 2100 */ 37, 37, 22, 0, 22, 0, 53, 37, 0, 0,
+ /* 2110 */ 406, 37, 408, 0, 37, 0, 22, 20, 37, 447,
+ /* 2120 */ 37, 37, 450, 0, 108, 453, 454, 455, 456, 457,
+ /* 2130 */ 458, 182, 460, 107, 353, 107, 0, 182, 209, 49,
+ /* 2140 */ 22, 37, 0, 205, 508, 185, 22, 366, 0, 0,
+ /* 2150 */ 353, 447, 33, 3, 450, 277, 107, 453, 454, 455,
+ /* 2160 */ 456, 457, 458, 366, 460, 182, 462, 182, 353, 182,
+ /* 2170 */ 189, 50, 50, 33, 108, 394, 107, 189, 105, 103,
+ /* 2180 */ 399, 366, 49, 49, 33, 33, 108, 406, 33, 408,
+ /* 2190 */ 277, 394, 3, 108, 108, 33, 399, 108, 107, 107,
+ /* 2200 */ 107, 277, 107, 406, 108, 408, 37, 37, 37, 394,
+ /* 2210 */ 37, 37, 37, 49, 108, 108, 33, 49, 0, 0,
+ /* 2220 */ 42, 406, 108, 408, 107, 0, 42, 270, 447, 49,
+ /* 2230 */ 184, 450, 107, 353, 453, 454, 455, 456, 457, 458,
+ /* 2240 */ 108, 460, 107, 186, 447, 107, 366, 450, 107, 33,
+ /* 2250 */ 453, 454, 455, 456, 457, 458, 2, 460, 22, 116,
+ /* 2260 */ 107, 105, 447, 257, 105, 450, 108, 353, 453, 454,
+ /* 2270 */ 455, 456, 457, 458, 394, 460, 49, 49, 22, 107,
+ /* 2280 */ 366, 37, 117, 107, 37, 108, 406, 108, 408, 234,
+ /* 2290 */ 353, 128, 107, 107, 107, 37, 108, 107, 37, 108,
+ /* 2300 */ 107, 37, 108, 366, 107, 37, 108, 107, 394, 108,
+ /* 2310 */ 107, 37, 108, 107, 33, 108, 237, 107, 22, 107,
+ /* 2320 */ 406, 107, 408, 128, 128, 37, 37, 447, 107, 72,
+ /* 2330 */ 450, 394, 37, 453, 454, 455, 456, 457, 458, 128,
+ /* 2340 */ 460, 71, 37, 406, 37, 408, 37, 353, 37, 37,
+ /* 2350 */ 37, 37, 101, 101, 78, 78, 33, 37, 37, 37,
+ /* 2360 */ 366, 447, 22, 37, 450, 37, 37, 453, 454, 455,
+ /* 2370 */ 456, 457, 458, 37, 460, 78, 37, 22, 37, 37,
+ /* 2380 */ 37, 37, 0, 37, 447, 51, 0, 450, 394, 42,
/* 2390 */ 453, 454, 455, 456, 457, 458, 37, 460, 42, 0,
- /* 2400 */ 406, 37, 408, 51, 42, 0, 37, 42, 0, 51,
- /* 2410 */ 37, 37, 0, 22, 22, 33, 21, 511, 22, 22,
- /* 2420 */ 353, 21, 20, 511, 511, 511, 511, 511, 511, 511,
+ /* 2400 */ 406, 51, 408, 37, 51, 42, 0, 37, 51, 42,
+ /* 2410 */ 0, 37, 37, 0, 22, 22, 33, 21, 20, 22,
+ /* 2420 */ 353, 511, 22, 21, 511, 511, 511, 511, 511, 511,
/* 2430 */ 511, 511, 511, 366, 511, 511, 511, 511, 511, 511,
/* 2440 */ 353, 447, 511, 511, 450, 511, 511, 453, 454, 455,
/* 2450 */ 456, 457, 458, 366, 460, 511, 511, 511, 511, 511,
@@ -878,9 +1229,9 @@ static const YYCODETYPE yy_lookahead[] = {
/* 3420 */ 350, 350, 350, 350, 350, 350, 350, 350, 350, 350,
/* 3430 */ 350, 350, 350,
};
-#define YY_SHIFT_COUNT (845)
+#define YY_SHIFT_COUNT (846)
#define YY_SHIFT_MIN (0)
-#define YY_SHIFT_MAX (2412)
+#define YY_SHIFT_MAX (2413)
static const unsigned short int yy_shift_ofst[] = {
/* 0 */ 1300, 0, 244, 0, 489, 489, 489, 489, 489, 489,
/* 10 */ 489, 489, 489, 489, 489, 489, 733, 977, 977, 1221,
@@ -904,71 +1255,71 @@ static const unsigned short int yy_shift_ofst[] = {
/* 190 */ 640, 734, 330, 768, 1025, 419, 805, 94, 1025, 1025,
/* 200 */ 1029, 917, 576, 575, 917, 295, 894, 403, 1215, 1441,
/* 210 */ 1458, 1481, 1290, 31, 1481, 31, 1314, 1500, 1508, 1491,
- /* 220 */ 1508, 1491, 1363, 1500, 1508, 1500, 1491, 1363, 1363, 1446,
- /* 230 */ 1451, 1500, 1454, 1500, 1500, 1500, 1542, 1515, 1542, 1515,
- /* 240 */ 1481, 31, 31, 1555, 31, 1562, 1570, 31, 1562, 31,
- /* 250 */ 1575, 31, 31, 1500, 31, 1542, 1, 1, 1, 1,
- /* 260 */ 1, 1, 1, 1, 1, 1, 1, 1500, 884, 884,
- /* 270 */ 1542, 780, 780, 780, 1406, 1533, 1481, 532, 1626, 1440,
- /* 280 */ 1445, 1555, 532, 1215, 1500, 780, 1373, 1376, 1373, 1376,
- /* 290 */ 1370, 1471, 1373, 1375, 1377, 1389, 1215, 1367, 1382, 1398,
- /* 300 */ 1422, 1508, 1680, 1584, 1433, 1562, 532, 532, 1376, 780,
- /* 310 */ 780, 780, 780, 1376, 780, 1530, 532, 595, 532, 1508,
- /* 320 */ 1630, 1631, 780, 1500, 532, 1720, 1709, 1542, 3083, 3083,
- /* 330 */ 3083, 3083, 3083, 3083, 3083, 3083, 3083, 36, 1228, 197,
- /* 340 */ 748, 1007, 81, 1045, 888, 15, 527, 1062, 995, 1289,
- /* 350 */ 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 216, 148,
- /* 360 */ 12, 802, 802, 226, 729, 10, 742, 843, 773, 732,
- /* 370 */ 897, 747, 914, 914, 1019, 6, 605, 1019, 1019, 1019,
- /* 380 */ 1249, 1066, 487, 370, 1202, 1028, 1122, 1154, 1168, 1170,
- /* 390 */ 1172, 1229, 1247, 1240, 1273, 1287, 1292, 1093, 684, 1274,
- /* 400 */ 1145, 1282, 1283, 1286, 1177, 1068, 1279, 1291, 1296, 1297,
- /* 410 */ 1298, 1309, 1310, 1325, 1313, 433, 1320, 1268, 1350, 1407,
- /* 420 */ 1408, 1410, 1414, 1419, 1254, 1285, 1299, 1335, 1337, 1301,
- /* 430 */ 1431, 1764, 1766, 1767, 1725, 1773, 1737, 1549, 1740, 1741,
- /* 440 */ 1742, 1554, 1783, 1747, 1748, 1559, 1750, 1788, 1563, 1791,
- /* 450 */ 1756, 1794, 1768, 1806, 1785, 1808, 1774, 1588, 1812, 1606,
- /* 460 */ 1818, 1609, 1611, 1616, 1621, 1825, 1826, 1833, 1639, 1641,
- /* 470 */ 1839, 1840, 1694, 1795, 1798, 1843, 1813, 1849, 1851, 1816,
- /* 480 */ 1801, 1854, 1811, 1855, 1823, 1857, 1861, 1870, 1824, 1872,
- /* 490 */ 1874, 1875, 1877, 1887, 1889, 1715, 1844, 1882, 1718, 1884,
- /* 500 */ 1885, 1892, 1894, 1895, 1896, 1897, 1898, 1900, 1901, 1902,
- /* 510 */ 1903, 1904, 1907, 1908, 1909, 1910, 1912, 1918, 1865, 1915,
- /* 520 */ 1876, 1920, 1922, 1923, 1925, 1926, 1927, 1928, 1919, 1930,
- /* 530 */ 1796, 1943, 1800, 1945, 1804, 1951, 1953, 1934, 1916, 1935,
- /* 540 */ 1917, 1964, 1905, 1931, 1969, 1906, 1973, 1911, 1974, 1977,
- /* 550 */ 1947, 1940, 1944, 1988, 1955, 1948, 1961, 2004, 1968, 1956,
- /* 560 */ 1966, 2006, 1972, 2010, 1967, 1971, 1978, 1965, 1970, 2001,
- /* 570 */ 1975, 2016, 1979, 1976, 2017, 2020, 2021, 2023, 1984, 1834,
- /* 580 */ 2028, 1965, 1980, 2031, 2032, 1962, 2033, 2035, 1999, 1986,
- /* 590 */ 1998, 2041, 2008, 1992, 2005, 2046, 2011, 2000, 2007, 2050,
- /* 600 */ 2015, 2002, 2012, 2055, 2056, 2058, 2059, 2060, 2061, 1949,
- /* 610 */ 1950, 2025, 2043, 2072, 2030, 2036, 2037, 2038, 2039, 2040,
- /* 620 */ 2042, 2044, 2049, 2051, 2048, 2062, 2047, 2063, 2068, 2065,
- /* 630 */ 2088, 2073, 2097, 2079, 2052, 2102, 2081, 2069, 2104, 2107,
- /* 640 */ 2108, 2074, 2109, 2076, 2114, 2093, 2096, 2080, 2083, 2084,
- /* 650 */ 2027, 2024, 2118, 1941, 2026, 1929, 1965, 2075, 2136, 1957,
- /* 660 */ 2100, 2119, 2140, 1938, 2120, 1963, 1982, 2146, 2148, 1983,
- /* 670 */ 1960, 1987, 1981, 2149, 2122, 1879, 2064, 2045, 2066, 2124,
- /* 680 */ 2071, 2127, 2082, 2070, 2139, 2150, 2078, 2077, 2085, 2086,
- /* 690 */ 2089, 2155, 2130, 2133, 2091, 2157, 1924, 2092, 2094, 2191,
- /* 700 */ 2162, 1933, 2167, 2169, 2170, 2171, 2174, 2175, 2105, 2106,
- /* 710 */ 2166, 1946, 2184, 2173, 2199, 2218, 2112, 2178, 2117, 2121,
- /* 720 */ 2132, 2123, 2125, 2057, 2135, 2225, 2185, 2095, 2138, 2110,
- /* 730 */ 1965, 2200, 2215, 2151, 2003, 2153, 2257, 2239, 2029, 2159,
- /* 740 */ 2156, 2176, 2168, 2177, 2179, 2228, 2186, 2187, 2229, 2181,
- /* 750 */ 2259, 2054, 2188, 2165, 2189, 2248, 2261, 2192, 2193, 2263,
- /* 760 */ 2195, 2196, 2268, 2202, 2198, 2270, 2203, 2204, 2274, 2206,
- /* 770 */ 2207, 2277, 2209, 2164, 2190, 2197, 2201, 2210, 2286, 2214,
- /* 780 */ 2287, 2216, 2286, 2286, 2304, 2224, 2271, 2291, 2295, 2302,
- /* 790 */ 2307, 2309, 2311, 2312, 2313, 2314, 2276, 2251, 2278, 2252,
- /* 800 */ 2308, 2318, 2320, 2321, 2337, 2325, 2326, 2328, 2288, 2049,
- /* 810 */ 2336, 2051, 2338, 2339, 2340, 2341, 2357, 2343, 2381, 2345,
- /* 820 */ 2332, 2344, 2389, 2359, 2334, 2356, 2399, 2364, 2352, 2362,
- /* 830 */ 2405, 2369, 2358, 2365, 2408, 2373, 2374, 2412, 2391, 2382,
- /* 840 */ 2392, 2395, 2396, 2397, 2400, 2402,
+ /* 220 */ 1508, 1491, 1363, 1500, 1508, 1500, 1491, 1363, 1363, 1363,
+ /* 230 */ 1448, 1452, 1500, 1456, 1500, 1500, 1500, 1543, 1517, 1543,
+ /* 240 */ 1517, 1481, 31, 31, 1557, 31, 1562, 1572, 31, 1562,
+ /* 250 */ 31, 1575, 31, 31, 1500, 31, 1543, 1, 1, 1,
+ /* 260 */ 1, 1, 1, 1, 1, 1, 1, 1, 1500, 884,
+ /* 270 */ 884, 1543, 780, 780, 780, 1406, 1534, 1481, 532, 1628,
+ /* 280 */ 1442, 1446, 1557, 532, 1215, 1500, 780, 1373, 1378, 1373,
+ /* 290 */ 1378, 1370, 1471, 1373, 1375, 1379, 1389, 1215, 1367, 1382,
+ /* 300 */ 1397, 1422, 1508, 1681, 1588, 1433, 1562, 532, 532, 1378,
+ /* 310 */ 780, 780, 780, 780, 1378, 780, 1530, 532, 595, 532,
+ /* 320 */ 1508, 1630, 1631, 780, 1500, 532, 1723, 1713, 1543, 3083,
+ /* 330 */ 3083, 3083, 3083, 3083, 3083, 3083, 3083, 3083, 36, 1228,
+ /* 340 */ 197, 748, 1007, 81, 1045, 888, 15, 527, 1062, 995,
+ /* 350 */ 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 1289, 216,
+ /* 360 */ 148, 12, 802, 802, 226, 729, 10, 742, 843, 773,
+ /* 370 */ 732, 897, 747, 914, 914, 1019, 6, 605, 1019, 1019,
+ /* 380 */ 1019, 1249, 1066, 487, 370, 1202, 1028, 1122, 1154, 1168,
+ /* 390 */ 1170, 1172, 1229, 1247, 1240, 1273, 1287, 1292, 1093, 684,
+ /* 400 */ 1274, 1145, 1282, 1283, 1286, 1177, 1068, 1279, 1291, 1296,
+ /* 410 */ 1297, 1298, 1309, 1310, 1325, 1313, 433, 1320, 1268, 1350,
+ /* 420 */ 1407, 1408, 1410, 1414, 1419, 1254, 1285, 1299, 1335, 1337,
+ /* 430 */ 1301, 1431, 1766, 1767, 1770, 1728, 1774, 1739, 1550, 1741,
+ /* 440 */ 1742, 1744, 1556, 1784, 1748, 1749, 1560, 1751, 1790, 1564,
+ /* 450 */ 1793, 1757, 1805, 1769, 1807, 1786, 1810, 1775, 1589, 1816,
+ /* 460 */ 1608, 1819, 1610, 1611, 1619, 1623, 1826, 1833, 1837, 1640,
+ /* 470 */ 1642, 1840, 1842, 1696, 1794, 1798, 1849, 1813, 1851, 1852,
+ /* 480 */ 1817, 1802, 1855, 1808, 1860, 1823, 1861, 1870, 1872, 1824,
+ /* 490 */ 1874, 1875, 1877, 1887, 1889, 1892, 1715, 1844, 1882, 1718,
+ /* 500 */ 1884, 1885, 1894, 1895, 1896, 1897, 1898, 1900, 1901, 1902,
+ /* 510 */ 1903, 1904, 1907, 1908, 1909, 1910, 1912, 1918, 1920, 1865,
+ /* 520 */ 1915, 1876, 1922, 1923, 1925, 1926, 1927, 1928, 1930, 1919,
+ /* 530 */ 1943, 1796, 1945, 1800, 1950, 1811, 1951, 1953, 1934, 1916,
+ /* 540 */ 1942, 1917, 1968, 1905, 1932, 1971, 1911, 1973, 1921, 1974,
+ /* 550 */ 1977, 1947, 1940, 1946, 1992, 1962, 1952, 1963, 2004, 1969,
+ /* 560 */ 1956, 1966, 2009, 1975, 2010, 1970, 1972, 1978, 1964, 1967,
+ /* 570 */ 2003, 1979, 2018, 1976, 1980, 2020, 2021, 2023, 2024, 1984,
+ /* 580 */ 1834, 2029, 1964, 1982, 2032, 2033, 1965, 2034, 2035, 1999,
+ /* 590 */ 1989, 2001, 2041, 2008, 1995, 2005, 2048, 2012, 2000, 2011,
+ /* 600 */ 2050, 2015, 2007, 2013, 2054, 2056, 2059, 2060, 2061, 2062,
+ /* 610 */ 1948, 1954, 2027, 2043, 2068, 2036, 2037, 2038, 2039, 2040,
+ /* 620 */ 2042, 2044, 2045, 2051, 2052, 2058, 2063, 2047, 2064, 2072,
+ /* 630 */ 2065, 2088, 2075, 2099, 2080, 2053, 2103, 2082, 2070, 2105,
+ /* 640 */ 2108, 2109, 2074, 2113, 2077, 2115, 2094, 2097, 2081, 2083,
+ /* 650 */ 2084, 2016, 2026, 2123, 1949, 2028, 1929, 1964, 2090, 2136,
+ /* 660 */ 1955, 2104, 2118, 2142, 1938, 2124, 1983, 1960, 2148, 2149,
+ /* 670 */ 1985, 1981, 1987, 1988, 2150, 2119, 1878, 2049, 2066, 2069,
+ /* 680 */ 2121, 2073, 2122, 2076, 2078, 2140, 2151, 2085, 2091, 2092,
+ /* 690 */ 2093, 2086, 2152, 2133, 2134, 2095, 2155, 1913, 2089, 2096,
+ /* 700 */ 2189, 2162, 1924, 2169, 2170, 2171, 2173, 2174, 2175, 2106,
+ /* 710 */ 2107, 2164, 1957, 2183, 2168, 2218, 2219, 2117, 2178, 2125,
+ /* 720 */ 2114, 2132, 2135, 2138, 2057, 2141, 2225, 2184, 2046, 2153,
+ /* 730 */ 2143, 1964, 2180, 2216, 2156, 2006, 2159, 2254, 2236, 2055,
+ /* 740 */ 2172, 2158, 2176, 2177, 2185, 2179, 2227, 2186, 2187, 2228,
+ /* 750 */ 2188, 2256, 2079, 2190, 2165, 2191, 2244, 2247, 2193, 2194,
+ /* 760 */ 2258, 2197, 2198, 2261, 2200, 2201, 2264, 2203, 2204, 2268,
+ /* 770 */ 2206, 2207, 2274, 2210, 2163, 2195, 2196, 2211, 2212, 2281,
+ /* 780 */ 2214, 2288, 2221, 2281, 2281, 2296, 2257, 2270, 2289, 2295,
+ /* 790 */ 2305, 2307, 2309, 2311, 2312, 2313, 2314, 2276, 2251, 2277,
+ /* 800 */ 2252, 2323, 2320, 2321, 2322, 2340, 2326, 2328, 2329, 2297,
+ /* 810 */ 2051, 2336, 2052, 2339, 2341, 2342, 2343, 2355, 2344, 2382,
+ /* 820 */ 2346, 2334, 2347, 2386, 2359, 2350, 2356, 2399, 2366, 2353,
+ /* 830 */ 2363, 2406, 2370, 2357, 2367, 2410, 2374, 2375, 2413, 2392,
+ /* 840 */ 2383, 2393, 2396, 2397, 2400, 2402, 2398,
};
-#define YY_REDUCE_COUNT (336)
+#define YY_REDUCE_COUNT (337)
#define YY_REDUCE_MIN (-463)
#define YY_REDUCE_MAX (2622)
static const short yy_reduce_ofst[] = {
@@ -994,105 +1345,105 @@ static const short yy_reduce_ofst[] = {
/* 190 */ 968, 903, 984, 1053, 1005, 1048, 1037, 1041, 1059, 1061,
/* 200 */ 984, 1004, 1004, 985, 1004, 1006, 1002, 1104, 1063, 1049,
/* 210 */ 1054, 1064, 1071, 1134, 1069, 1135, 1087, 1156, 1169, 1123,
- /* 220 */ 1174, 1126, 1132, 1178, 1179, 1181, 1133, 1137, 1138, 1175,
- /* 230 */ 1180, 1190, 1182, 1194, 1195, 1196, 1205, 1206, 1209, 1207,
- /* 240 */ 1129, 1197, 1200, 1171, 1203, 1216, 1161, 1220, 1230, 1225,
- /* 250 */ 1184, 1226, 1233, 1236, 1235, 1246, 1223, 1232, 1234, 1237,
- /* 260 */ 1238, 1242, 1243, 1244, 1245, 1248, 1250, 1255, 1263, 1266,
- /* 270 */ 1252, 1218, 1239, 1241, 1189, 1198, 1208, 1271, 1210, 1213,
- /* 280 */ 1217, 1251, 1281, 1231, 1293, 1256, 1166, 1262, 1173, 1264,
- /* 290 */ 1176, 1183, 1186, 1201, 1191, 1185, 1259, 1160, 1187, 1199,
- /* 300 */ 1004, 1331, 1253, 1222, 1258, 1343, 1339, 1340, 1302, 1303,
- /* 310 */ 1307, 1318, 1319, 1304, 1323, 1311, 1344, 1345, 1360, 1368,
- /* 320 */ 1269, 1346, 1327, 1378, 1379, 1390, 1393, 1391, 1321, 1317,
- /* 330 */ 1328, 1336, 1381, 1383, 1384, 1392, 1412,
+ /* 220 */ 1174, 1126, 1132, 1178, 1179, 1181, 1133, 1137, 1138, 1139,
+ /* 230 */ 1176, 1180, 1191, 1183, 1195, 1196, 1197, 1207, 1206, 1211,
+ /* 240 */ 1208, 1130, 1200, 1201, 1171, 1209, 1223, 1163, 1225, 1230,
+ /* 250 */ 1226, 1182, 1232, 1233, 1236, 1235, 1252, 1234, 1237, 1238,
+ /* 260 */ 1242, 1243, 1244, 1245, 1246, 1248, 1250, 1251, 1255, 1261,
+ /* 270 */ 1263, 1264, 1218, 1220, 1241, 1189, 1203, 1210, 1271, 1212,
+ /* 280 */ 1216, 1219, 1253, 1277, 1239, 1293, 1256, 1167, 1262, 1173,
+ /* 290 */ 1265, 1175, 1184, 1185, 1190, 1204, 1213, 1258, 1162, 1186,
+ /* 300 */ 1194, 1004, 1336, 1257, 1222, 1259, 1343, 1339, 1340, 1302,
+ /* 310 */ 1307, 1318, 1319, 1322, 1305, 1326, 1311, 1344, 1345, 1361,
+ /* 320 */ 1368, 1269, 1346, 1341, 1376, 1371, 1394, 1393, 1395, 1321,
+ /* 330 */ 1317, 1338, 1347, 1377, 1381, 1383, 1388, 1413,
};
static const YYACTIONTYPE yy_default[] = {
- /* 0 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 10 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 20 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 30 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 40 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 50 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 60 */ 1895, 2235, 1895, 1895, 2198, 1895, 1895, 1895, 1895, 1895,
- /* 70 */ 1895, 1895, 1895, 1895, 1895, 1895, 2205, 1895, 1895, 1895,
- /* 80 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 90 */ 1895, 1895, 1895, 1895, 1895, 1895, 1994, 1895, 1895, 1895,
- /* 100 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 110 */ 1895, 1895, 1895, 1992, 2438, 1895, 1895, 1895, 1895, 1895,
- /* 120 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 130 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 2450, 1895,
- /* 140 */ 1895, 1966, 1966, 1895, 2450, 2450, 2450, 1992, 2410, 2410,
- /* 150 */ 1895, 1895, 1994, 2273, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 160 */ 1895, 1895, 2117, 1925, 1895, 1895, 1895, 1895, 2141, 1895,
- /* 170 */ 1895, 1895, 2261, 1895, 1895, 2479, 2539, 1895, 1895, 2482,
- /* 180 */ 1895, 1895, 1895, 1895, 2210, 1895, 2469, 1895, 1895, 1895,
- /* 190 */ 1895, 1895, 1895, 1895, 1895, 1895, 2070, 2255, 1895, 1895,
- /* 200 */ 1895, 2442, 2456, 2523, 2443, 2440, 2463, 1895, 2473, 1895,
- /* 210 */ 2298, 1895, 2287, 1994, 1895, 1994, 2248, 2193, 1895, 2203,
- /* 220 */ 1895, 2203, 2200, 1895, 1895, 1895, 2203, 2200, 2200, 2059,
- /* 230 */ 2055, 1895, 2053, 1895, 1895, 1895, 1895, 1950, 1895, 1950,
- /* 240 */ 1895, 1994, 1994, 1895, 1994, 1895, 1895, 1994, 1895, 1994,
- /* 250 */ 1895, 1994, 1994, 1895, 1994, 1895, 1895, 1895, 1895, 1895,
- /* 260 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 270 */ 1895, 1895, 1895, 1895, 2285, 2271, 1895, 1992, 1895, 2259,
- /* 280 */ 2257, 1895, 1992, 2473, 1895, 1895, 2493, 2488, 2493, 2488,
- /* 290 */ 2507, 2503, 2493, 2512, 2509, 2475, 2473, 2542, 2529, 2525,
- /* 300 */ 2456, 1895, 1895, 2461, 2459, 1895, 1992, 1992, 2488, 1895,
- /* 310 */ 1895, 1895, 1895, 2488, 1895, 1895, 1992, 1895, 1992, 1895,
- /* 320 */ 1895, 2086, 1895, 1895, 1992, 1895, 1934, 1895, 2250, 2276,
- /* 330 */ 2231, 2231, 2120, 2120, 2120, 1995, 1900, 1895, 1895, 1895,
- /* 340 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 2506,
- /* 350 */ 2505, 2363, 1895, 2414, 2413, 2412, 2403, 2362, 2082, 1895,
- /* 360 */ 1895, 2361, 2360, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 370 */ 1895, 1895, 2222, 2221, 2354, 1895, 1895, 2355, 2353, 2352,
- /* 380 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 390 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 400 */ 1895, 1895, 1895, 1895, 1895, 2526, 2530, 1895, 1895, 1895,
- /* 410 */ 1895, 1895, 1895, 2439, 1895, 1895, 1895, 2334, 1895, 1895,
- /* 420 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 430 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 440 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 450 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 460 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 470 */ 1895, 1895, 2199, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 480 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 490 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 500 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 510 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 520 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 530 */ 1895, 1895, 1895, 1895, 2214, 1895, 1895, 1895, 1895, 1895,
- /* 540 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 550 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 560 */ 1895, 1895, 1895, 1895, 1895, 1895, 1939, 2341, 1895, 1895,
- /* 570 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 580 */ 1895, 2344, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 590 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 600 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 610 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 620 */ 1895, 1895, 2034, 2033, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 630 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 640 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 650 */ 2345, 1895, 1895, 1895, 1895, 1895, 2336, 1895, 1895, 1895,
- /* 660 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 670 */ 1895, 1895, 1895, 2522, 2476, 1895, 1895, 1895, 1895, 1895,
- /* 680 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 690 */ 1895, 1895, 1895, 2334, 1895, 2504, 1895, 1895, 2520, 1895,
- /* 700 */ 2524, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 2449, 2445,
- /* 710 */ 1895, 1895, 2441, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 720 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 730 */ 2333, 1895, 2400, 1895, 1895, 1895, 2434, 1895, 1895, 2385,
- /* 740 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 2345,
- /* 750 */ 1895, 2348, 1895, 1895, 1895, 1895, 1895, 2114, 1895, 1895,
- /* 760 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 770 */ 1895, 1895, 1895, 2098, 2096, 2095, 2094, 1895, 2127, 1895,
- /* 780 */ 1895, 1895, 2123, 2122, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 790 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 800 */ 2013, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 2005,
- /* 810 */ 1895, 2004, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 820 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895,
- /* 830 */ 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1895, 1924,
- /* 840 */ 1895, 1895, 1895, 1895, 1895, 1895,
+ /* 0 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 10 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 20 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 30 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 40 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 50 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 60 */ 1896, 2236, 1896, 1896, 2199, 1896, 1896, 1896, 1896, 1896,
+ /* 70 */ 1896, 1896, 1896, 1896, 1896, 1896, 2206, 1896, 1896, 1896,
+ /* 80 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 90 */ 1896, 1896, 1896, 1896, 1896, 1896, 1995, 1896, 1896, 1896,
+ /* 100 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 110 */ 1896, 1896, 1896, 1993, 2439, 1896, 1896, 1896, 1896, 1896,
+ /* 120 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 130 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 2451, 1896,
+ /* 140 */ 1896, 1967, 1967, 1896, 2451, 2451, 2451, 1993, 2411, 2411,
+ /* 150 */ 1896, 1896, 1995, 2274, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 160 */ 1896, 1896, 2118, 1926, 1896, 1896, 1896, 1896, 2142, 1896,
+ /* 170 */ 1896, 1896, 2262, 1896, 1896, 2480, 2540, 1896, 1896, 2483,
+ /* 180 */ 1896, 1896, 1896, 1896, 2211, 1896, 2470, 1896, 1896, 1896,
+ /* 190 */ 1896, 1896, 1896, 1896, 1896, 1896, 2071, 2256, 1896, 1896,
+ /* 200 */ 1896, 2443, 2457, 2524, 2444, 2441, 2464, 1896, 2474, 1896,
+ /* 210 */ 2299, 1896, 2288, 1995, 1896, 1995, 2249, 2194, 1896, 2204,
+ /* 220 */ 1896, 2204, 2201, 1896, 1896, 1896, 2204, 2201, 2201, 2201,
+ /* 230 */ 2060, 2056, 1896, 2054, 1896, 1896, 1896, 1896, 1951, 1896,
+ /* 240 */ 1951, 1896, 1995, 1995, 1896, 1995, 1896, 1896, 1995, 1896,
+ /* 250 */ 1995, 1896, 1995, 1995, 1896, 1995, 1896, 1896, 1896, 1896,
+ /* 260 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 270 */ 1896, 1896, 1896, 1896, 1896, 2286, 2272, 1896, 1993, 1896,
+ /* 280 */ 2260, 2258, 1896, 1993, 2474, 1896, 1896, 2494, 2489, 2494,
+ /* 290 */ 2489, 2508, 2504, 2494, 2513, 2510, 2476, 2474, 2543, 2530,
+ /* 300 */ 2526, 2457, 1896, 1896, 2462, 2460, 1896, 1993, 1993, 2489,
+ /* 310 */ 1896, 1896, 1896, 1896, 2489, 1896, 1896, 1993, 1896, 1993,
+ /* 320 */ 1896, 1896, 2087, 1896, 1896, 1993, 1896, 1935, 1896, 2251,
+ /* 330 */ 2277, 2232, 2232, 2121, 2121, 2121, 1996, 1901, 1896, 1896,
+ /* 340 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 350 */ 2507, 2506, 2364, 1896, 2415, 2414, 2413, 2404, 2363, 2083,
+ /* 360 */ 1896, 1896, 2362, 2361, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 370 */ 1896, 1896, 1896, 2223, 2222, 2355, 1896, 1896, 2356, 2354,
+ /* 380 */ 2353, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 390 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 400 */ 1896, 1896, 1896, 1896, 1896, 1896, 2527, 2531, 1896, 1896,
+ /* 410 */ 1896, 1896, 1896, 1896, 2440, 1896, 1896, 1896, 2335, 1896,
+ /* 420 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 430 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 440 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 450 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 460 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 470 */ 1896, 1896, 1896, 2200, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 480 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 490 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 500 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 510 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 520 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 530 */ 1896, 1896, 1896, 1896, 1896, 2215, 1896, 1896, 1896, 1896,
+ /* 540 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 550 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 560 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1940, 2342, 1896,
+ /* 570 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 580 */ 1896, 1896, 2345, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 590 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 600 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 610 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 620 */ 1896, 1896, 1896, 2035, 2034, 1896, 1896, 1896, 1896, 1896,
+ /* 630 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 640 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 650 */ 1896, 2346, 1896, 1896, 1896, 1896, 1896, 2337, 1896, 1896,
+ /* 660 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 670 */ 1896, 1896, 1896, 1896, 2523, 2477, 1896, 1896, 1896, 1896,
+ /* 680 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 690 */ 1896, 1896, 1896, 1896, 2335, 1896, 2505, 1896, 1896, 2521,
+ /* 700 */ 1896, 2525, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 2450,
+ /* 710 */ 2446, 1896, 1896, 2442, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 720 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 730 */ 1896, 2334, 1896, 2401, 1896, 1896, 1896, 2435, 1896, 1896,
+ /* 740 */ 2386, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 750 */ 2346, 1896, 2349, 1896, 1896, 1896, 1896, 1896, 2115, 1896,
+ /* 760 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 770 */ 1896, 1896, 1896, 1896, 2099, 2097, 2096, 2095, 1896, 2128,
+ /* 780 */ 1896, 1896, 1896, 2124, 2123, 1896, 1896, 1896, 1896, 1896,
+ /* 790 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 800 */ 1896, 2014, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 810 */ 2006, 1896, 2005, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 820 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 830 */ 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
+ /* 840 */ 1925, 1896, 1896, 1896, 1896, 1896, 1896,
};
/********** End of lemon-generated parsing tables *****************************/
@@ -1513,6 +1864,7 @@ struct yyParser {
};
typedef struct yyParser yyParser;
+#include
#ifndef NDEBUG
#include
static FILE *yyTraceFILE = 0;
@@ -2357,7 +2709,7 @@ static const char *const yyRuleName[] = {
/* 287 */ "cmd ::= SHOW VNODES",
/* 288 */ "cmd ::= SHOW db_name_cond_opt ALIVE",
/* 289 */ "cmd ::= SHOW CLUSTER ALIVE",
- /* 290 */ "cmd ::= SHOW db_name_cond_opt VIEWS",
+ /* 290 */ "cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt",
/* 291 */ "cmd ::= SHOW CREATE VIEW full_table_name",
/* 292 */ "cmd ::= SHOW COMPACTS",
/* 293 */ "cmd ::= SHOW COMPACT NK_INTEGER",
@@ -2917,7 +3269,9 @@ static void yy_destructor(
case 506: /* query_simple_or_subquery */
case 508: /* sort_specification */
{
+#line 7 "sql.y"
nodesDestroyNode((yypminor->yy490));
+#line 3274 "sql.c"
}
break;
case 351: /* account_options */
@@ -2927,7 +3281,9 @@ static void yy_destructor(
case 428: /* with_meta */
case 437: /* bufsize_opt */
{
+#line 54 "sql.y"
+#line 3286 "sql.c"
}
break;
case 355: /* ip_range_list */
@@ -2964,7 +3320,9 @@ static void yy_destructor(
case 502: /* order_by_clause_opt */
case 507: /* sort_specification_list */
{
+#line 85 "sql.y"
nodesDestroyList((yypminor->yy502));
+#line 3325 "sql.c"
}
break;
case 358: /* user_name */
@@ -2987,24 +3345,32 @@ static void yy_destructor(
case 460: /* noarg_func */
case 478: /* alias_opt */
{
+#line 819 "sql.y"
+#line 3350 "sql.c"
}
break;
case 359: /* sysinfo_opt */
{
+#line 112 "sql.y"
+#line 3357 "sql.c"
}
break;
case 360: /* privileges */
case 363: /* priv_type_list */
case 364: /* priv_type */
{
+#line 121 "sql.y"
+#line 3366 "sql.c"
}
break;
case 361: /* priv_level */
{
+#line 138 "sql.y"
+#line 3373 "sql.c"
}
break;
case 370: /* force_opt */
@@ -3018,55 +3384,75 @@ static void yy_destructor(
case 484: /* set_quantifier_opt */
case 485: /* tag_mode_opt */
{
+#line 167 "sql.y"
+#line 3389 "sql.c"
}
break;
case 383: /* alter_db_option */
case 405: /* alter_table_option */
{
+#line 269 "sql.y"
+#line 3397 "sql.c"
}
break;
case 395: /* type_name */
{
+#line 392 "sql.y"
+#line 3404 "sql.c"
}
break;
case 410: /* db_kind_opt */
case 417: /* table_kind */
{
+#line 560 "sql.y"
+#line 3412 "sql.c"
}
break;
case 411: /* table_kind_db_name_cond_opt */
{
+#line 525 "sql.y"
+#line 3419 "sql.c"
}
break;
case 468: /* compare_op */
case 469: /* in_op */
{
+#line 1009 "sql.y"
+#line 3427 "sql.c"
}
break;
case 481: /* join_type */
{
+#line 1085 "sql.y"
+#line 3434 "sql.c"
}
break;
case 498: /* fill_mode */
{
+#line 1176 "sql.y"
+#line 3441 "sql.c"
}
break;
case 509: /* ordering_specification_opt */
{
+#line 1261 "sql.y"
+#line 3448 "sql.c"
}
break;
case 510: /* null_ordering_opt */
{
+#line 1267 "sql.y"
+#line 3455 "sql.c"
}
break;
/********* End destructor definitions *****************************************/
@@ -3233,7 +3619,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);
@@ -3645,7 +4031,7 @@ static const YYCODETYPE yyRuleInfoLhs[] = {
350, /* (287) cmd ::= SHOW VNODES */
350, /* (288) cmd ::= SHOW db_name_cond_opt ALIVE */
350, /* (289) cmd ::= SHOW CLUSTER ALIVE */
- 350, /* (290) cmd ::= SHOW db_name_cond_opt VIEWS */
+ 350, /* (290) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */
350, /* (291) cmd ::= SHOW CREATE VIEW full_table_name */
350, /* (292) cmd ::= SHOW COMPACTS */
350, /* (293) cmd ::= SHOW COMPACT NK_INTEGER */
@@ -4297,7 +4683,7 @@ static const signed char yyRuleInfoNRhs[] = {
-2, /* (287) cmd ::= SHOW VNODES */
-3, /* (288) cmd ::= SHOW db_name_cond_opt ALIVE */
-3, /* (289) cmd ::= SHOW CLUSTER ALIVE */
- -3, /* (290) cmd ::= SHOW db_name_cond_opt VIEWS */
+ -4, /* (290) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */
-4, /* (291) cmd ::= SHOW CREATE VIEW full_table_name */
-2, /* (292) cmd ::= SHOW COMPACTS */
-3, /* (293) cmd ::= SHOW COMPACT NK_INTEGER */
@@ -4683,54 +5069,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
@@ -4744,15 +5082,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); }
+#line 5087 "sql.c"
yy_destructor(yypParser,351,&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 5093 "sql.c"
yy_destructor(yypParser,352,&yymsp[0].minor);
break;
case 2: /* account_options ::= */
+#line 55 "sql.y"
{ }
+#line 5099 "sql.c"
break;
case 3: /* account_options ::= account_options PPS literal */
case 4: /* account_options ::= account_options TSERIES literal */ yytestcase(yyruleno==4);
@@ -4764,18 +5108,24 @@ static YYACTIONTYPE yy_reduce(
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,351,&yymsp[-2].minor);
+#line 56 "sql.y"
{ }
+#line 5113 "sql.c"
yy_destructor(yypParser,353,&yymsp[0].minor);
}
break;
case 12: /* alter_account_options ::= alter_account_option */
{ yy_destructor(yypParser,354,&yymsp[0].minor);
+#line 68 "sql.y"
{ }
+#line 5121 "sql.c"
}
break;
case 13: /* alter_account_options ::= alter_account_options alter_account_option */
{ yy_destructor(yypParser,352,&yymsp[-1].minor);
+#line 69 "sql.y"
{ }
+#line 5128 "sql.c"
yy_destructor(yypParser,354,&yymsp[0].minor);
}
break;
@@ -4789,19 +5139,27 @@ 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"
{ }
+#line 5144 "sql.c"
yy_destructor(yypParser,353,&yymsp[0].minor);
break;
case 24: /* ip_range_list ::= NK_STRING */
+#line 86 "sql.y"
{ yylhsminor.yy502 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
+#line 5150 "sql.c"
yymsp[0].minor.yy502 = yylhsminor.yy502;
break;
case 25: /* ip_range_list ::= ip_range_list NK_COMMA NK_STRING */
+#line 87 "sql.y"
{ yylhsminor.yy502 = addNodeToList(pCxt, yymsp[-2].minor.yy502, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
+#line 5156 "sql.c"
yymsp[-2].minor.yy502 = yylhsminor.yy502;
break;
case 26: /* white_list ::= HOST ip_range_list */
+#line 91 "sql.y"
{ yymsp[-1].minor.yy502 = yymsp[0].minor.yy502; }
+#line 5162 "sql.c"
break;
case 27: /* white_list_opt ::= */
case 188: /* specific_cols_opt ::= */ yytestcase(yyruleno==188);
@@ -4812,89 +5170,137 @@ static YYACTIONTYPE yy_reduce(
case 577: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==577);
case 605: /* group_by_clause_opt ::= */ yytestcase(yyruleno==605);
case 625: /* order_by_clause_opt ::= */ yytestcase(yyruleno==625);
+#line 95 "sql.y"
{ yymsp[1].minor.yy502 = NULL; }
+#line 5175 "sql.c"
break;
case 28: /* white_list_opt ::= white_list */
case 220: /* tags_def_opt ::= tags_def */ yytestcase(yyruleno==220);
case 376: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==376);
case 502: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==502);
+#line 96 "sql.y"
{ yylhsminor.yy502 = yymsp[0].minor.yy502; }
+#line 5183 "sql.c"
yymsp[0].minor.yy502 = yylhsminor.yy502;
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.yy561, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy1013);
pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy502);
}
+#line 5192 "sql.c"
break;
case 30: /* cmd ::= ALTER USER user_name PASS NK_STRING */
+#line 104 "sql.y"
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy561, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); }
+#line 5197 "sql.c"
break;
case 31: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */
+#line 105 "sql.y"
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy561, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); }
+#line 5202 "sql.c"
break;
case 32: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */
+#line 106 "sql.y"
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy561, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); }
+#line 5207 "sql.c"
break;
case 33: /* cmd ::= ALTER USER user_name ADD white_list */
+#line 107 "sql.y"
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy561, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy502); }
+#line 5212 "sql.c"
break;
case 34: /* cmd ::= ALTER USER user_name DROP white_list */
+#line 108 "sql.y"
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy561, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy502); }
+#line 5217 "sql.c"
break;
case 35: /* cmd ::= DROP USER user_name */
+#line 109 "sql.y"
{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy561); }
+#line 5222 "sql.c"
break;
case 36: /* sysinfo_opt ::= */
+#line 113 "sql.y"
{ yymsp[1].minor.yy1013 = 1; }
+#line 5227 "sql.c"
break;
case 37: /* sysinfo_opt ::= SYSINFO NK_INTEGER */
+#line 114 "sql.y"
{ yymsp[-1].minor.yy1013 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); }
+#line 5232 "sql.c"
break;
case 38: /* cmd ::= GRANT privileges ON priv_level with_opt TO user_name */
+#line 117 "sql.y"
{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy277, &yymsp[-3].minor.yy483, &yymsp[0].minor.yy561, yymsp[-2].minor.yy490); }
+#line 5237 "sql.c"
break;
case 39: /* cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */
+#line 118 "sql.y"
{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy277, &yymsp[-3].minor.yy483, &yymsp[0].minor.yy561, yymsp[-2].minor.yy490); }
+#line 5242 "sql.c"
break;
case 40: /* privileges ::= ALL */
+#line 122 "sql.y"
{ yymsp[0].minor.yy277 = PRIVILEGE_TYPE_ALL; }
+#line 5247 "sql.c"
break;
case 41: /* privileges ::= priv_type_list */
case 43: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==43);
+#line 123 "sql.y"
{ yylhsminor.yy277 = yymsp[0].minor.yy277; }
+#line 5253 "sql.c"
yymsp[0].minor.yy277 = yylhsminor.yy277;
break;
case 42: /* privileges ::= SUBSCRIBE */
+#line 124 "sql.y"
{ yymsp[0].minor.yy277 = PRIVILEGE_TYPE_SUBSCRIBE; }
+#line 5259 "sql.c"
break;
case 44: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */
+#line 129 "sql.y"
{ yylhsminor.yy277 = yymsp[-2].minor.yy277 | yymsp[0].minor.yy277; }
+#line 5264 "sql.c"
yymsp[-2].minor.yy277 = yylhsminor.yy277;
break;
case 45: /* priv_type ::= READ */
+#line 133 "sql.y"
{ yymsp[0].minor.yy277 = PRIVILEGE_TYPE_READ; }
+#line 5270 "sql.c"
break;
case 46: /* priv_type ::= WRITE */
+#line 134 "sql.y"
{ yymsp[0].minor.yy277 = PRIVILEGE_TYPE_WRITE; }
+#line 5275 "sql.c"
break;
case 47: /* priv_type ::= ALTER */
+#line 135 "sql.y"
{ yymsp[0].minor.yy277 = PRIVILEGE_TYPE_ALTER; }
+#line 5280 "sql.c"
break;
case 48: /* priv_level ::= NK_STAR NK_DOT NK_STAR */
+#line 139 "sql.y"
{ yylhsminor.yy483.first = yymsp[-2].minor.yy0; yylhsminor.yy483.second = yymsp[0].minor.yy0; }
+#line 5285 "sql.c"
yymsp[-2].minor.yy483 = yylhsminor.yy483;
break;
case 49: /* priv_level ::= db_name NK_DOT NK_STAR */
+#line 140 "sql.y"
{ yylhsminor.yy483.first = yymsp[-2].minor.yy561; yylhsminor.yy483.second = yymsp[0].minor.yy0; }
+#line 5291 "sql.c"
yymsp[-2].minor.yy483 = yylhsminor.yy483;
break;
case 50: /* priv_level ::= db_name NK_DOT table_name */
+#line 141 "sql.y"
{ yylhsminor.yy483.first = yymsp[-2].minor.yy561; yylhsminor.yy483.second = yymsp[0].minor.yy561; }
+#line 5297 "sql.c"
yymsp[-2].minor.yy483 = yylhsminor.yy483;
break;
case 51: /* priv_level ::= topic_name */
+#line 142 "sql.y"
{ yylhsminor.yy483.first = yymsp[0].minor.yy561; yylhsminor.yy483.second = nil_token; }
+#line 5303 "sql.c"
yymsp[0].minor.yy483 = yylhsminor.yy483;
break;
case 52: /* with_opt ::= */
@@ -4913,46 +5319,72 @@ static YYACTIONTYPE yy_reduce(
case 614: /* every_opt ::= */ yytestcase(yyruleno==614);
case 627: /* slimit_clause_opt ::= */ yytestcase(yyruleno==627);
case 631: /* limit_clause_opt ::= */ yytestcase(yyruleno==631);
+#line 144 "sql.y"
{ yymsp[1].minor.yy490 = NULL; }
+#line 5324 "sql.c"
break;
case 53: /* with_opt ::= WITH search_condition */
case 543: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==543);
case 576: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==576);
case 610: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==610);
+#line 145 "sql.y"
{ yymsp[-1].minor.yy490 = yymsp[0].minor.yy490; }
+#line 5332 "sql.c"
break;
case 54: /* cmd ::= CREATE DNODE dnode_endpoint */
+#line 148 "sql.y"
{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy561, NULL); }
+#line 5337 "sql.c"
break;
case 55: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */
+#line 149 "sql.y"
{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy0); }
+#line 5342 "sql.c"
break;
case 56: /* cmd ::= DROP DNODE NK_INTEGER force_opt */
+#line 150 "sql.y"
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy845, false); }
+#line 5347 "sql.c"
break;
case 57: /* cmd ::= DROP DNODE dnode_endpoint force_opt */
+#line 151 "sql.y"
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy561, yymsp[0].minor.yy845, false); }
+#line 5352 "sql.c"
break;
case 58: /* cmd ::= DROP DNODE NK_INTEGER unsafe_opt */
+#line 152 "sql.y"
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy845); }
+#line 5357 "sql.c"
break;
case 59: /* cmd ::= DROP DNODE dnode_endpoint unsafe_opt */
+#line 153 "sql.y"
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy561, false, yymsp[0].minor.yy845); }
+#line 5362 "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 5367 "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 5372 "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 5377 "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 5382 "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 5387 "sql.c"
break;
case 65: /* dnode_endpoint ::= NK_STRING */
case 66: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==66);
@@ -4987,7 +5419,9 @@ static YYACTIONTYPE yy_reduce(
case 498: /* star_func ::= FIRST */ yytestcase(yyruleno==498);
case 499: /* star_func ::= LAST */ yytestcase(yyruleno==499);
case 500: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==500);
+#line 162 "sql.y"
{ yylhsminor.yy561 = yymsp[0].minor.yy0; }
+#line 5424 "sql.c"
yymsp[0].minor.yy561 = yylhsminor.yy561;
break;
case 68: /* force_opt ::= */
@@ -4999,7 +5433,9 @@ static YYACTIONTYPE yy_reduce(
case 389: /* ignore_opt ::= */ yytestcase(yyruleno==389);
case 563: /* tag_mode_opt ::= */ yytestcase(yyruleno==563);
case 565: /* set_quantifier_opt ::= */ yytestcase(yyruleno==565);
+#line 168 "sql.y"
{ yymsp[1].minor.yy845 = false; }
+#line 5438 "sql.c"
break;
case 69: /* force_opt ::= FORCE */
case 70: /* unsafe_opt ::= UNSAFE */ yytestcase(yyruleno==70);
@@ -5007,288 +5443,440 @@ static YYACTIONTYPE yy_reduce(
case 358: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==358);
case 564: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==564);
case 566: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==566);
+#line 169 "sql.y"
{ yymsp[0].minor.yy845 = true; }
+#line 5448 "sql.c"
break;
case 71: /* cmd ::= ALTER CLUSTER NK_STRING */
+#line 176 "sql.y"
{ pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[0].minor.yy0, NULL); }
+#line 5453 "sql.c"
break;
case 72: /* cmd ::= ALTER CLUSTER NK_STRING NK_STRING */
+#line 177 "sql.y"
{ pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
+#line 5458 "sql.c"
break;
case 73: /* cmd ::= ALTER LOCAL NK_STRING */
+#line 180 "sql.y"
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); }
+#line 5463 "sql.c"
break;
case 74: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */
+#line 181 "sql.y"
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
+#line 5468 "sql.c"
break;
case 75: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
+#line 184 "sql.y"
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_QNODE_STMT, &yymsp[0].minor.yy0); }
+#line 5473 "sql.c"
break;
case 76: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */
+#line 185 "sql.y"
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_QNODE_STMT, &yymsp[0].minor.yy0); }
+#line 5478 "sql.c"
break;
case 77: /* cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */
+#line 186 "sql.y"
{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_QNODE_STMT, &yymsp[0].minor.yy0); }
+#line 5483 "sql.c"
break;
case 78: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */
+#line 189 "sql.y"
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_BNODE_STMT, &yymsp[0].minor.yy0); }
+#line 5488 "sql.c"
break;
case 79: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */
+#line 190 "sql.y"
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_BNODE_STMT, &yymsp[0].minor.yy0); }
+#line 5493 "sql.c"
break;
case 80: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */
+#line 193 "sql.y"
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_SNODE_STMT, &yymsp[0].minor.yy0); }
+#line 5498 "sql.c"
break;
case 81: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */
+#line 194 "sql.y"
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_SNODE_STMT, &yymsp[0].minor.yy0); }
+#line 5503 "sql.c"
break;
case 82: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */
+#line 197 "sql.y"
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_MNODE_STMT, &yymsp[0].minor.yy0); }
+#line 5508 "sql.c"
break;
case 83: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */
+#line 198 "sql.y"
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); }
+#line 5513 "sql.c"
break;
case 84: /* cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */
+#line 199 "sql.y"
{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_MNODE_STMT, &yymsp[0].minor.yy0); }
+#line 5518 "sql.c"
break;
case 85: /* cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */
+#line 202 "sql.y"
{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_VNODE_STMT, &yymsp[0].minor.yy0); }
+#line 5523 "sql.c"
break;
case 86: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
+#line 205 "sql.y"
{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy845, &yymsp[-1].minor.yy561, yymsp[0].minor.yy490); }
+#line 5528 "sql.c"
break;
case 87: /* cmd ::= DROP DATABASE exists_opt db_name */
+#line 206 "sql.y"
{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy845, &yymsp[0].minor.yy561); }
+#line 5533 "sql.c"
break;
case 88: /* cmd ::= USE db_name */
+#line 207 "sql.y"
{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy561); }
+#line 5538 "sql.c"
break;
case 89: /* cmd ::= ALTER DATABASE db_name alter_db_options */
+#line 208 "sql.y"
{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy561, yymsp[0].minor.yy490); }
+#line 5543 "sql.c"
break;
case 90: /* cmd ::= FLUSH DATABASE db_name */
+#line 209 "sql.y"
{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy561); }
+#line 5548 "sql.c"
break;
case 91: /* cmd ::= TRIM DATABASE db_name speed_opt */
+#line 210 "sql.y"
{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy561, yymsp[0].minor.yy774); }
+#line 5553 "sql.c"
break;
case 92: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */
+#line 211 "sql.y"
{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy561, yymsp[-1].minor.yy490, yymsp[0].minor.yy490); }
+#line 5558 "sql.c"
break;
case 93: /* not_exists_opt ::= IF NOT EXISTS */
+#line 215 "sql.y"
{ yymsp[-2].minor.yy845 = true; }
+#line 5563 "sql.c"
break;
case 95: /* exists_opt ::= IF EXISTS */
case 364: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==364);
case 390: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==390);
+#line 220 "sql.y"
{ yymsp[-1].minor.yy845 = true; }
+#line 5570 "sql.c"
break;
case 97: /* db_options ::= */
+#line 223 "sql.y"
{ yymsp[1].minor.yy490 = createDefaultDatabaseOptions(pCxt); }
+#line 5575 "sql.c"
break;
case 98: /* db_options ::= db_options BUFFER NK_INTEGER */
+#line 224 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); }
+#line 5580 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 99: /* db_options ::= db_options CACHEMODEL NK_STRING */
+#line 225 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); }
+#line 5586 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 100: /* db_options ::= db_options CACHESIZE NK_INTEGER */
+#line 226 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); }
+#line 5592 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 101: /* db_options ::= db_options COMP NK_INTEGER */
+#line 227 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_COMP, &yymsp[0].minor.yy0); }
+#line 5598 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 102: /* db_options ::= db_options DURATION NK_INTEGER */
case 103: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==103);
+#line 228 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_DAYS, &yymsp[0].minor.yy0); }
+#line 5605 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 104: /* db_options ::= db_options MAXROWS NK_INTEGER */
+#line 230 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); }
+#line 5611 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 105: /* db_options ::= db_options MINROWS NK_INTEGER */
+#line 231 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); }
+#line 5617 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 106: /* db_options ::= db_options KEEP integer_list */
case 107: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==107);
+#line 232 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_KEEP, yymsp[0].minor.yy502); }
+#line 5624 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 108: /* db_options ::= db_options PAGES NK_INTEGER */
+#line 234 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_PAGES, &yymsp[0].minor.yy0); }
+#line 5630 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 109: /* db_options ::= db_options PAGESIZE NK_INTEGER */
+#line 235 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); }
+#line 5636 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 110: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */
+#line 236 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); }
+#line 5642 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 111: /* db_options ::= db_options PRECISION NK_STRING */
+#line 237 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); }
+#line 5648 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 112: /* db_options ::= db_options REPLICA NK_INTEGER */
+#line 238 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); }
+#line 5654 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 113: /* db_options ::= db_options VGROUPS NK_INTEGER */
+#line 240 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); }
+#line 5660 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 114: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */
+#line 241 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); }
+#line 5666 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 115: /* db_options ::= db_options RETENTIONS retention_list */
+#line 242 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_RETENTIONS, yymsp[0].minor.yy502); }
+#line 5672 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 116: /* db_options ::= db_options SCHEMALESS NK_INTEGER */
+#line 243 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); }
+#line 5678 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 117: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */
+#line 244 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_WAL, &yymsp[0].minor.yy0); }
+#line 5684 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 118: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */
+#line 245 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); }
+#line 5690 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 119: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */
+#line 246 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); }
+#line 5696 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 120: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */
+#line 247 "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.yy490 = setDatabaseOption(pCxt, yymsp[-3].minor.yy490, DB_OPTION_WAL_RETENTION_PERIOD, &t);
}
+#line 5706 "sql.c"
yymsp[-3].minor.yy490 = yylhsminor.yy490;
break;
case 121: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */
+#line 252 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); }
+#line 5712 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 122: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */
+#line 253 "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.yy490 = setDatabaseOption(pCxt, yymsp[-3].minor.yy490, DB_OPTION_WAL_RETENTION_SIZE, &t);
}
+#line 5722 "sql.c"
yymsp[-3].minor.yy490 = yylhsminor.yy490;
break;
case 123: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */
+#line 258 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); }
+#line 5728 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 124: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */
+#line 259 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); }
+#line 5734 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 125: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */
+#line 260 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); }
+#line 5740 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 126: /* db_options ::= db_options TABLE_PREFIX signed */
+#line 261 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy490); }
+#line 5746 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 127: /* db_options ::= db_options TABLE_SUFFIX signed */
+#line 262 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy490); }
+#line 5752 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 128: /* db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */
+#line 263 "sql.y"
{ yylhsminor.yy490 = setDatabaseOption(pCxt, yymsp[-2].minor.yy490, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); }
+#line 5758 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 129: /* alter_db_options ::= alter_db_option */
+#line 265 "sql.y"
{ yylhsminor.yy490 = createAlterDatabaseOptions(pCxt); yylhsminor.yy490 = setAlterDatabaseOption(pCxt, yylhsminor.yy490, &yymsp[0].minor.yy529); }
+#line 5764 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 130: /* alter_db_options ::= alter_db_options alter_db_option */
+#line 266 "sql.y"
{ yylhsminor.yy490 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy490, &yymsp[0].minor.yy529); }
+#line 5770 "sql.c"
yymsp[-1].minor.yy490 = yylhsminor.yy490;
break;
case 131: /* alter_db_option ::= BUFFER NK_INTEGER */
+#line 270 "sql.y"
{ yymsp[-1].minor.yy529.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; }
+#line 5776 "sql.c"
break;
case 132: /* alter_db_option ::= CACHEMODEL NK_STRING */
+#line 271 "sql.y"
{ yymsp[-1].minor.yy529.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; }
+#line 5781 "sql.c"
break;
case 133: /* alter_db_option ::= CACHESIZE NK_INTEGER */
+#line 272 "sql.y"
{ yymsp[-1].minor.yy529.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; }
+#line 5786 "sql.c"
break;
case 134: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */
+#line 273 "sql.y"
{ yymsp[-1].minor.yy529.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; }
+#line 5791 "sql.c"
break;
case 135: /* alter_db_option ::= KEEP integer_list */
case 136: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==136);
+#line 274 "sql.y"
{ yymsp[-1].minor.yy529.type = DB_OPTION_KEEP; yymsp[-1].minor.yy529.pList = yymsp[0].minor.yy502; }
+#line 5797 "sql.c"
break;
case 137: /* alter_db_option ::= PAGES NK_INTEGER */
+#line 276 "sql.y"
{ yymsp[-1].minor.yy529.type = DB_OPTION_PAGES; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; }
+#line 5802 "sql.c"
break;
case 138: /* alter_db_option ::= REPLICA NK_INTEGER */
+#line 277 "sql.y"
{ yymsp[-1].minor.yy529.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; }
+#line 5807 "sql.c"
break;
case 139: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */
+#line 279 "sql.y"
{ yymsp[-1].minor.yy529.type = DB_OPTION_WAL; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; }
+#line 5812 "sql.c"
break;
case 140: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */
+#line 280 "sql.y"
{ yymsp[-1].minor.yy529.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; }
+#line 5817 "sql.c"
break;
case 141: /* alter_db_option ::= MINROWS NK_INTEGER */
+#line 281 "sql.y"
{ yymsp[-1].minor.yy529.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; }
+#line 5822 "sql.c"
break;
case 142: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */
+#line 282 "sql.y"
{ yymsp[-1].minor.yy529.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; }
+#line 5827 "sql.c"
break;
case 143: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */
+#line 283 "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.yy529.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy529.val = t;
}
+#line 5836 "sql.c"
break;
case 144: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */
+#line 288 "sql.y"
{ yymsp[-1].minor.yy529.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; }
+#line 5841 "sql.c"
break;
case 145: /* alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */
+#line 289 "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.yy529.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy529.val = t;
}
+#line 5850 "sql.c"
break;
case 146: /* alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */
+#line 294 "sql.y"
{ yymsp[-1].minor.yy529.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; }
+#line 5855 "sql.c"
break;
case 147: /* integer_list ::= NK_INTEGER */
+#line 298 "sql.y"
{ yylhsminor.yy502 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
+#line 5860 "sql.c"
yymsp[0].minor.yy502 = yylhsminor.yy502;
break;
case 148: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */
case 403: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==403);
+#line 299 "sql.y"
{ yylhsminor.yy502 = addNodeToList(pCxt, yymsp[-2].minor.yy502, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
+#line 5867 "sql.c"
yymsp[-2].minor.yy502 = yylhsminor.yy502;
break;
case 149: /* variable_list ::= NK_VARIABLE */
+#line 303 "sql.y"
{ yylhsminor.yy502 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+#line 5873 "sql.c"
yymsp[0].minor.yy502 = yylhsminor.yy502;
break;
case 150: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */
+#line 304 "sql.y"
{ yylhsminor.yy502 = addNodeToList(pCxt, yymsp[-2].minor.yy502, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+#line 5879 "sql.c"
yymsp[-2].minor.yy502 = yylhsminor.yy502;
break;
case 151: /* retention_list ::= retention */
@@ -5305,7 +5893,9 @@ static YYACTIONTYPE yy_reduce(
case 568: /* select_list ::= select_item */ yytestcase(yyruleno==568);
case 579: /* partition_list ::= partition_item */ yytestcase(yyruleno==579);
case 638: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==638);
+#line 308 "sql.y"
{ yylhsminor.yy502 = createNodeList(pCxt, yymsp[0].minor.yy490); }
+#line 5898 "sql.c"
yymsp[0].minor.yy502 = yylhsminor.yy502;
break;
case 152: /* retention_list ::= retention_list NK_COMMA retention */
@@ -5320,704 +5910,1106 @@ static YYACTIONTYPE yy_reduce(
case 569: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==569);
case 580: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==580);
case 639: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==639);
+#line 309 "sql.y"
{ yylhsminor.yy502 = addNodeToList(pCxt, yymsp[-2].minor.yy502, yymsp[0].minor.yy490); }
+#line 5915 "sql.c"
yymsp[-2].minor.yy502 = yylhsminor.yy502;
break;
case 153: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
case 154: /* retention ::= NK_MINUS NK_COLON NK_VARIABLE */ yytestcase(yyruleno==154);
+#line 311 "sql.y"
{ yylhsminor.yy490 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+#line 5922 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 155: /* speed_opt ::= */
case 359: /* bufsize_opt ::= */ yytestcase(yyruleno==359);
+#line 316 "sql.y"
{ yymsp[1].minor.yy774 = 0; }
+#line 5929 "sql.c"
break;
case 156: /* speed_opt ::= BWLIMIT NK_INTEGER */
case 360: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==360);
+#line 317 "sql.y"
{ yymsp[-1].minor.yy774 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); }
+#line 5935 "sql.c"
break;
case 158: /* start_opt ::= START WITH NK_INTEGER */
case 162: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==162);
+#line 320 "sql.y"
{ yymsp[-2].minor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
+#line 5941 "sql.c"
break;
case 159: /* start_opt ::= START WITH NK_STRING */
case 163: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==163);
+#line 321 "sql.y"
{ yymsp[-2].minor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
+#line 5947 "sql.c"
break;
case 160: /* start_opt ::= START WITH TIMESTAMP NK_STRING */
case 164: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==164);
+#line 322 "sql.y"
{ yymsp[-3].minor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
+#line 5953 "sql.c"
break;
case 165: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
case 167: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==167);
+#line 331 "sql.y"
{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy845, yymsp[-5].minor.yy490, yymsp[-3].minor.yy502, yymsp[-1].minor.yy502, yymsp[0].minor.yy490); }
+#line 5959 "sql.c"
break;
case 166: /* cmd ::= CREATE TABLE multi_create_clause */
+#line 332 "sql.y"
{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy502); }
+#line 5964 "sql.c"
break;
case 168: /* cmd ::= DROP TABLE multi_drop_clause */
+#line 335 "sql.y"
{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy502); }
+#line 5969 "sql.c"
break;
case 169: /* cmd ::= DROP STABLE exists_opt full_table_name */
+#line 336 "sql.y"
{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy845, yymsp[0].minor.yy490); }
+#line 5974 "sql.c"
break;
case 170: /* cmd ::= ALTER TABLE alter_table_clause */
case 405: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==405);
case 406: /* cmd ::= insert_query */ yytestcase(yyruleno==406);
+#line 338 "sql.y"
{ pCxt->pRootNode = yymsp[0].minor.yy490; }
+#line 5981 "sql.c"
break;
case 171: /* cmd ::= ALTER STABLE alter_table_clause */
+#line 339 "sql.y"
{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy490); }
+#line 5986 "sql.c"
break;
case 172: /* alter_table_clause ::= full_table_name alter_table_options */
+#line 341 "sql.y"
{ yylhsminor.yy490 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy490, yymsp[0].minor.yy490); }
+#line 5991 "sql.c"
yymsp[-1].minor.yy490 = yylhsminor.yy490;
break;
case 173: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
+#line 343 "sql.y"
{ yylhsminor.yy490 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy490, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy561, yymsp[0].minor.yy826); }
+#line 5997 "sql.c"
yymsp[-4].minor.yy490 = yylhsminor.yy490;
break;
case 174: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */
+#line 344 "sql.y"
{ yylhsminor.yy490 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy490, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy561); }
+#line 6003 "sql.c"
yymsp[-3].minor.yy490 = yylhsminor.yy490;
break;
case 175: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
+#line 346 "sql.y"
{ yylhsminor.yy490 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy490, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy561, yymsp[0].minor.yy826); }
+#line 6009 "sql.c"
yymsp[-4].minor.yy490 = yylhsminor.yy490;
break;
case 176: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
+#line 348 "sql.y"
{ yylhsminor.yy490 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy490, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy561, &yymsp[0].minor.yy561); }
+#line 6015 "sql.c"
yymsp[-4].minor.yy490 = yylhsminor.yy490;
break;
case 177: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */
+#line 350 "sql.y"
{ yylhsminor.yy490 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy490, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy561, yymsp[0].minor.yy826); }
+#line 6021 "sql.c"
yymsp[-4].minor.yy490 = yylhsminor.yy490;
break;
case 178: /* alter_table_clause ::= full_table_name DROP TAG column_name */
+#line 351 "sql.y"
{ yylhsminor.yy490 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy490, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy561); }
+#line 6027 "sql.c"
yymsp[-3].minor.yy490 = yylhsminor.yy490;
break;
case 179: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
+#line 353 "sql.y"
{ yylhsminor.yy490 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy490, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy561, yymsp[0].minor.yy826); }
+#line 6033 "sql.c"
yymsp[-4].minor.yy490 = yylhsminor.yy490;
break;
case 180: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
+#line 355 "sql.y"
{ yylhsminor.yy490 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy490, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy561, &yymsp[0].minor.yy561); }
+#line 6039 "sql.c"
yymsp[-4].minor.yy490 = yylhsminor.yy490;
break;
case 181: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */
+#line 357 "sql.y"
{ yylhsminor.yy490 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy490, &yymsp[-2].minor.yy561, yymsp[0].minor.yy490); }
+#line 6045 "sql.c"
yymsp[-5].minor.yy490 = yylhsminor.yy490;
break;
case 183: /* multi_create_clause ::= multi_create_clause create_subtable_clause */
case 510: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==510);
+#line 362 "sql.y"
{ yylhsminor.yy502 = addNodeToList(pCxt, yymsp[-1].minor.yy502, yymsp[0].minor.yy490); }
+#line 6052 "sql.c"
yymsp[-1].minor.yy502 = yylhsminor.yy502;
break;
case 184: /* 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 */
+#line 366 "sql.y"
{ yylhsminor.yy490 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy845, yymsp[-8].minor.yy490, yymsp[-6].minor.yy490, yymsp[-5].minor.yy502, yymsp[-2].minor.yy502, yymsp[0].minor.yy490); }
+#line 6058 "sql.c"
yymsp[-9].minor.yy490 = yylhsminor.yy490;
break;
case 187: /* drop_table_clause ::= exists_opt full_table_name */
+#line 373 "sql.y"
{ yylhsminor.yy490 = createDropTableClause(pCxt, yymsp[-1].minor.yy845, yymsp[0].minor.yy490); }
+#line 6064 "sql.c"
yymsp[-1].minor.yy490 = yylhsminor.yy490;
break;
case 189: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */
case 374: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==374);
+#line 378 "sql.y"
{ yymsp[-2].minor.yy502 = yymsp[-1].minor.yy502; }
+#line 6071 "sql.c"
break;
case 190: /* full_table_name ::= table_name */
+#line 380 "sql.y"
{ yylhsminor.yy490 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy561, NULL); }
+#line 6076 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 191: /* full_table_name ::= db_name NK_DOT table_name */
+#line 381 "sql.y"
{ yylhsminor.yy490 = createRealTableNode(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy561, NULL); }
+#line 6082 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 194: /* column_def ::= column_name type_name */
+#line 388 "sql.y"
{ yylhsminor.yy490 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy561, yymsp[0].minor.yy826, NULL); }
+#line 6088 "sql.c"
yymsp[-1].minor.yy490 = yylhsminor.yy490;
break;
case 195: /* type_name ::= BOOL */
+#line 393 "sql.y"
{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_BOOL); }
+#line 6094 "sql.c"
break;
case 196: /* type_name ::= TINYINT */
+#line 394 "sql.y"
{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_TINYINT); }
+#line 6099 "sql.c"
break;
case 197: /* type_name ::= SMALLINT */
+#line 395 "sql.y"
{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
+#line 6104 "sql.c"
break;
case 198: /* type_name ::= INT */
case 199: /* type_name ::= INTEGER */ yytestcase(yyruleno==199);
+#line 396 "sql.y"
{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_INT); }
+#line 6110 "sql.c"
break;
case 200: /* type_name ::= BIGINT */
+#line 398 "sql.y"
{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_BIGINT); }
+#line 6115 "sql.c"
break;
case 201: /* type_name ::= FLOAT */
+#line 399 "sql.y"
{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_FLOAT); }
+#line 6120 "sql.c"
break;
case 202: /* type_name ::= DOUBLE */
+#line 400 "sql.y"
{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
+#line 6125 "sql.c"
break;
case 203: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
+#line 401 "sql.y"
{ yymsp[-3].minor.yy826 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
+#line 6130 "sql.c"
break;
case 204: /* type_name ::= TIMESTAMP */
+#line 402 "sql.y"
{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
+#line 6135 "sql.c"
break;
case 205: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
+#line 403 "sql.y"
{ yymsp[-3].minor.yy826 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
+#line 6140 "sql.c"
break;
case 206: /* type_name ::= TINYINT UNSIGNED */
+#line 404 "sql.y"
{ yymsp[-1].minor.yy826 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
+#line 6145 "sql.c"
break;
case 207: /* type_name ::= SMALLINT UNSIGNED */
+#line 405 "sql.y"
{ yymsp[-1].minor.yy826 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
+#line 6150 "sql.c"
break;
case 208: /* type_name ::= INT UNSIGNED */
+#line 406 "sql.y"
{ yymsp[-1].minor.yy826 = createDataType(TSDB_DATA_TYPE_UINT); }
+#line 6155 "sql.c"
break;
case 209: /* type_name ::= BIGINT UNSIGNED */
+#line 407 "sql.y"
{ yymsp[-1].minor.yy826 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
+#line 6160 "sql.c"
break;
case 210: /* type_name ::= JSON */
+#line 408 "sql.y"
{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_JSON); }
+#line 6165 "sql.c"
break;
case 211: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
+#line 409 "sql.y"
{ yymsp[-3].minor.yy826 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
+#line 6170 "sql.c"
break;
case 212: /* type_name ::= MEDIUMBLOB */
+#line 410 "sql.y"
{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
+#line 6175 "sql.c"
break;
case 213: /* type_name ::= BLOB */
+#line 411 "sql.y"
{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_BLOB); }
+#line 6180 "sql.c"
break;
case 214: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
+#line 412 "sql.y"
{ yymsp[-3].minor.yy826 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
+#line 6185 "sql.c"
break;
case 215: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */
+#line 413 "sql.y"
{ yymsp[-3].minor.yy826 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); }
+#line 6190 "sql.c"
break;
case 216: /* type_name ::= DECIMAL */
+#line 414 "sql.y"
{ yymsp[0].minor.yy826 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
+#line 6195 "sql.c"
break;
case 217: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
+#line 415 "sql.y"
{ yymsp[-3].minor.yy826 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
+#line 6200 "sql.c"
break;
case 218: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
+#line 416 "sql.y"
{ yymsp[-5].minor.yy826 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
+#line 6205 "sql.c"
break;
case 221: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */
case 377: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==377);
+#line 425 "sql.y"
{ yymsp[-3].minor.yy502 = yymsp[-1].minor.yy502; }
+#line 6211 "sql.c"
break;
case 222: /* table_options ::= */
+#line 427 "sql.y"
{ yymsp[1].minor.yy490 = createDefaultTableOptions(pCxt); }
+#line 6216 "sql.c"
break;
case 223: /* table_options ::= table_options COMMENT NK_STRING */
+#line 428 "sql.y"
{ yylhsminor.yy490 = setTableOption(pCxt, yymsp[-2].minor.yy490, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); }
+#line 6221 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 224: /* table_options ::= table_options MAX_DELAY duration_list */
+#line 429 "sql.y"
{ yylhsminor.yy490 = setTableOption(pCxt, yymsp[-2].minor.yy490, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy502); }
+#line 6227 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 225: /* table_options ::= table_options WATERMARK duration_list */
+#line 430 "sql.y"
{ yylhsminor.yy490 = setTableOption(pCxt, yymsp[-2].minor.yy490, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy502); }
+#line 6233 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 226: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */
+#line 431 "sql.y"
{ yylhsminor.yy490 = setTableOption(pCxt, yymsp[-4].minor.yy490, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy502); }
+#line 6239 "sql.c"
yymsp[-4].minor.yy490 = yylhsminor.yy490;
break;
case 227: /* table_options ::= table_options TTL NK_INTEGER */
+#line 432 "sql.y"
{ yylhsminor.yy490 = setTableOption(pCxt, yymsp[-2].minor.yy490, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); }
+#line 6245 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 228: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */
+#line 433 "sql.y"
{ yylhsminor.yy490 = setTableOption(pCxt, yymsp[-4].minor.yy490, TABLE_OPTION_SMA, yymsp[-1].minor.yy502); }
+#line 6251 "sql.c"
yymsp[-4].minor.yy490 = yylhsminor.yy490;
break;
case 229: /* table_options ::= table_options DELETE_MARK duration_list */
+#line 434 "sql.y"
{ yylhsminor.yy490 = setTableOption(pCxt, yymsp[-2].minor.yy490, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy502); }
+#line 6257 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 230: /* alter_table_options ::= alter_table_option */
+#line 436 "sql.y"
{ yylhsminor.yy490 = createAlterTableOptions(pCxt); yylhsminor.yy490 = setTableOption(pCxt, yylhsminor.yy490, yymsp[0].minor.yy529.type, &yymsp[0].minor.yy529.val); }
+#line 6263 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 231: /* alter_table_options ::= alter_table_options alter_table_option */
+#line 437 "sql.y"
{ yylhsminor.yy490 = setTableOption(pCxt, yymsp[-1].minor.yy490, yymsp[0].minor.yy529.type, &yymsp[0].minor.yy529.val); }
+#line 6269 "sql.c"
yymsp[-1].minor.yy490 = yylhsminor.yy490;
break;
case 232: /* alter_table_option ::= COMMENT NK_STRING */
+#line 441 "sql.y"
{ yymsp[-1].minor.yy529.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; }
+#line 6275 "sql.c"
break;
case 233: /* alter_table_option ::= TTL NK_INTEGER */
+#line 442 "sql.y"
{ yymsp[-1].minor.yy529.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy529.val = yymsp[0].minor.yy0; }
+#line 6280 "sql.c"
break;
case 234: /* duration_list ::= duration_literal */
case 464: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==464);
+#line 446 "sql.y"
{ yylhsminor.yy502 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy490)); }
+#line 6286 "sql.c"
yymsp[0].minor.yy502 = yylhsminor.yy502;
break;
case 235: /* duration_list ::= duration_list NK_COMMA duration_literal */
case 465: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==465);
+#line 447 "sql.y"
{ yylhsminor.yy502 = addNodeToList(pCxt, yymsp[-2].minor.yy502, releaseRawExprNode(pCxt, yymsp[0].minor.yy490)); }
+#line 6293 "sql.c"
yymsp[-2].minor.yy502 = yylhsminor.yy502;
break;
case 238: /* rollup_func_name ::= function_name */
+#line 454 "sql.y"
{ yylhsminor.yy490 = createFunctionNode(pCxt, &yymsp[0].minor.yy561, NULL); }
+#line 6299 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 239: /* rollup_func_name ::= FIRST */
case 240: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==240);
case 311: /* tag_item ::= QTAGS */ yytestcase(yyruleno==311);
+#line 455 "sql.y"
{ yylhsminor.yy490 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); }
+#line 6307 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 243: /* col_name ::= column_name */
case 312: /* tag_item ::= column_name */ yytestcase(yyruleno==312);
+#line 463 "sql.y"
{ yylhsminor.yy490 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy561); }
+#line 6314 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 244: /* cmd ::= SHOW DNODES */
+#line 466 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); }
+#line 6320 "sql.c"
break;
case 245: /* cmd ::= SHOW USERS */
+#line 467 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); }
+#line 6325 "sql.c"
break;
case 246: /* cmd ::= SHOW USER PRIVILEGES */
+#line 468 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); }
+#line 6330 "sql.c"
break;
case 247: /* cmd ::= SHOW db_kind_opt DATABASES */
+#line 469 "sql.y"
{
pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT);
setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy579);
}
+#line 6338 "sql.c"
break;
case 248: /* cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */
+#line 473 "sql.y"
{
pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy961, yymsp[0].minor.yy490, OP_TYPE_LIKE);
}
+#line 6345 "sql.c"
break;
case 249: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
+#line 476 "sql.y"
{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy490, yymsp[0].minor.yy490, OP_TYPE_LIKE); }
+#line 6350 "sql.c"
break;
case 250: /* cmd ::= SHOW db_name_cond_opt VGROUPS */
+#line 477 "sql.y"
{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy490, NULL, OP_TYPE_LIKE); }
+#line 6355 "sql.c"
break;
case 251: /* cmd ::= SHOW MNODES */
+#line 478 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); }
+#line 6360 "sql.c"
break;
case 252: /* cmd ::= SHOW QNODES */
+#line 480 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); }
+#line 6365 "sql.c"
break;
case 253: /* cmd ::= SHOW FUNCTIONS */
+#line 481 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); }
+#line 6370 "sql.c"
break;
case 254: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
+#line 482 "sql.y"
{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy490, yymsp[-1].minor.yy490, OP_TYPE_EQUAL); }
+#line 6375 "sql.c"
break;
case 255: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */
+#line 483 "sql.y"
{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy561), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy561), OP_TYPE_EQUAL); }
+#line 6380 "sql.c"
break;
case 256: /* cmd ::= SHOW STREAMS */
+#line 484 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); }
+#line 6385 "sql.c"
break;
case 257: /* cmd ::= SHOW ACCOUNTS */
+#line 485 "sql.y"
{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
+#line 6390 "sql.c"
break;
case 258: /* cmd ::= SHOW APPS */
+#line 486 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); }
+#line 6395 "sql.c"
break;
case 259: /* cmd ::= SHOW CONNECTIONS */
+#line 487 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); }
+#line 6400 "sql.c"
break;
case 260: /* cmd ::= SHOW LICENCES */
case 261: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==261);
+#line 488 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); }
+#line 6406 "sql.c"
break;
case 262: /* cmd ::= SHOW GRANTS FULL */
+#line 490 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_FULL_STMT); }
+#line 6411 "sql.c"
break;
case 263: /* cmd ::= SHOW GRANTS LOGS */
+#line 491 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_LOGS_STMT); }
+#line 6416 "sql.c"
break;
case 264: /* cmd ::= SHOW CLUSTER MACHINES */
+#line 492 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_MACHINES_STMT); }
+#line 6421 "sql.c"
break;
case 265: /* cmd ::= SHOW CREATE DATABASE db_name */
+#line 493 "sql.y"
{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy561); }
+#line 6426 "sql.c"
break;
case 266: /* cmd ::= SHOW CREATE TABLE full_table_name */
+#line 494 "sql.y"
{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy490); }
+#line 6431 "sql.c"
break;
case 267: /* cmd ::= SHOW CREATE STABLE full_table_name */
+#line 495 "sql.y"
{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy490); }
+#line 6436 "sql.c"
break;
case 268: /* cmd ::= SHOW QUERIES */
+#line 496 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); }
+#line 6441 "sql.c"
break;
case 269: /* cmd ::= SHOW SCORES */
+#line 497 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); }
+#line 6446 "sql.c"
break;
case 270: /* cmd ::= SHOW TOPICS */
+#line 498 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); }
+#line 6451 "sql.c"
break;
case 271: /* cmd ::= SHOW VARIABLES */
case 272: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==272);
+#line 499 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); }
+#line 6457 "sql.c"
break;
case 273: /* cmd ::= SHOW LOCAL VARIABLES */
+#line 501 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); }
+#line 6462 "sql.c"
break;
case 274: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */
+#line 502 "sql.y"
{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy490); }
+#line 6467 "sql.c"
break;
case 275: /* cmd ::= SHOW BNODES */
+#line 503 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); }
+#line 6472 "sql.c"
break;
case 276: /* cmd ::= SHOW SNODES */
+#line 504 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); }
+#line 6477 "sql.c"
break;
case 277: /* cmd ::= SHOW CLUSTER */
+#line 505 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); }
+#line 6482 "sql.c"
break;
case 278: /* cmd ::= SHOW TRANSACTIONS */
+#line 506 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); }
+#line 6487 "sql.c"
break;
case 279: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */
+#line 507 "sql.y"
{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy490); }
+#line 6492 "sql.c"
break;
case 280: /* cmd ::= SHOW CONSUMERS */
+#line 508 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); }
+#line 6497 "sql.c"
break;
case 281: /* cmd ::= SHOW SUBSCRIPTIONS */
+#line 509 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); }
+#line 6502 "sql.c"
break;
case 282: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */
+#line 510 "sql.y"
{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy490, yymsp[-1].minor.yy490, OP_TYPE_EQUAL); }
+#line 6507 "sql.c"
break;
case 283: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */
+#line 511 "sql.y"
{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy561), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy561), OP_TYPE_EQUAL); }
+#line 6512 "sql.c"
break;
case 284: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */
+#line 512 "sql.y"
{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy490, yymsp[0].minor.yy490, yymsp[-3].minor.yy502); }
+#line 6517 "sql.c"
break;
case 285: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */
+#line 513 "sql.y"
{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy561), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy561), yymsp[-4].minor.yy502); }
+#line 6522 "sql.c"
break;
case 286: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */
+#line 514 "sql.y"
{ pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); }
+#line 6527 "sql.c"
break;
case 287: /* cmd ::= SHOW VNODES */
+#line 515 "sql.y"
{ pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, NULL); }
+#line 6532 "sql.c"
break;
case 288: /* cmd ::= SHOW db_name_cond_opt ALIVE */
+#line 517 "sql.y"
{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy490, QUERY_NODE_SHOW_DB_ALIVE_STMT); }
+#line 6537 "sql.c"
break;
case 289: /* cmd ::= SHOW CLUSTER ALIVE */
+#line 518 "sql.y"
{ pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); }
+#line 6542 "sql.c"
break;
- case 290: /* cmd ::= SHOW db_name_cond_opt VIEWS */
-{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-1].minor.yy490, NULL, OP_TYPE_LIKE); }
+ case 290: /* cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */
+#line 519 "sql.y"
+{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-2].minor.yy490, yymsp[0].minor.yy490, OP_TYPE_LIKE); }
+#line 6547 "sql.c"
break;
case 291: /* cmd ::= SHOW CREATE VIEW full_table_name */
+#line 520 "sql.y"
{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy490); }
+#line 6552 "sql.c"
break;
case 292: /* cmd ::= SHOW COMPACTS */
+#line 521 "sql.y"
{ pCxt->pRootNode = createShowCompactsStmt(pCxt, QUERY_NODE_SHOW_COMPACTS_STMT); }
+#line 6557 "sql.c"
break;
case 293: /* cmd ::= SHOW COMPACT NK_INTEGER */
+#line 522 "sql.y"
{ pCxt->pRootNode = createShowCompactDetailsStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
+#line 6562 "sql.c"
break;
case 294: /* table_kind_db_name_cond_opt ::= */
+#line 526 "sql.y"
{ yymsp[1].minor.yy961.kind = SHOW_KIND_ALL; yymsp[1].minor.yy961.dbName = nil_token; }
+#line 6567 "sql.c"
break;
case 295: /* table_kind_db_name_cond_opt ::= table_kind */
+#line 527 "sql.y"
{ yylhsminor.yy961.kind = yymsp[0].minor.yy579; yylhsminor.yy961.dbName = nil_token; }
+#line 6572 "sql.c"
yymsp[0].minor.yy961 = yylhsminor.yy961;
break;
case 296: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */
+#line 528 "sql.y"
{ yylhsminor.yy961.kind = SHOW_KIND_ALL; yylhsminor.yy961.dbName = yymsp[-1].minor.yy561; }
+#line 6578 "sql.c"
yymsp[-1].minor.yy961 = yylhsminor.yy961;
break;
case 297: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */
+#line 529 "sql.y"
{ yylhsminor.yy961.kind = yymsp[-2].minor.yy579; yylhsminor.yy961.dbName = yymsp[-1].minor.yy561; }
+#line 6584 "sql.c"
yymsp[-2].minor.yy961 = yylhsminor.yy961;
break;
case 298: /* table_kind ::= NORMAL */
+#line 533 "sql.y"
{ yymsp[0].minor.yy579 = SHOW_KIND_TABLES_NORMAL; }
+#line 6590 "sql.c"
break;
case 299: /* table_kind ::= CHILD */
+#line 534 "sql.y"
{ yymsp[0].minor.yy579 = SHOW_KIND_TABLES_CHILD; }
+#line 6595 "sql.c"
break;
case 300: /* db_name_cond_opt ::= */
case 305: /* from_db_opt ::= */ yytestcase(yyruleno==305);
+#line 536 "sql.y"
{ yymsp[1].minor.yy490 = createDefaultDatabaseCondValue(pCxt); }
+#line 6601 "sql.c"
break;
case 301: /* db_name_cond_opt ::= db_name NK_DOT */
+#line 537 "sql.y"
{ yylhsminor.yy490 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy561); }
+#line 6606 "sql.c"
yymsp[-1].minor.yy490 = yylhsminor.yy490;
break;
case 303: /* like_pattern_opt ::= LIKE NK_STRING */
+#line 540 "sql.y"
{ yymsp[-1].minor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
+#line 6612 "sql.c"
break;
case 304: /* table_name_cond ::= table_name */
+#line 542 "sql.y"
{ yylhsminor.yy490 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy561); }
+#line 6617 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 306: /* from_db_opt ::= FROM db_name */
+#line 545 "sql.y"
{ yymsp[-1].minor.yy490 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy561); }
+#line 6623 "sql.c"
break;
case 310: /* tag_item ::= TBNAME */
+#line 553 "sql.y"
{ yylhsminor.yy490 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); }
+#line 6628 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 313: /* tag_item ::= column_name column_alias */
+#line 556 "sql.y"
{ yylhsminor.yy490 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy561), &yymsp[0].minor.yy561); }
+#line 6634 "sql.c"
yymsp[-1].minor.yy490 = yylhsminor.yy490;
break;
case 314: /* tag_item ::= column_name AS column_alias */
+#line 557 "sql.y"
{ yylhsminor.yy490 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy561), &yymsp[0].minor.yy561); }
+#line 6640 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 315: /* db_kind_opt ::= */
+#line 561 "sql.y"
{ yymsp[1].minor.yy579 = SHOW_KIND_ALL; }
+#line 6646 "sql.c"
break;
case 316: /* db_kind_opt ::= USER */
+#line 562 "sql.y"
{ yymsp[0].minor.yy579 = SHOW_KIND_DATABASES_USER; }
+#line 6651 "sql.c"
break;
case 317: /* db_kind_opt ::= SYSTEM */
+#line 563 "sql.y"
{ yymsp[0].minor.yy579 = SHOW_KIND_DATABASES_SYSTEM; }
+#line 6656 "sql.c"
break;
case 318: /* cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */
+#line 567 "sql.y"
{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy845, yymsp[-3].minor.yy490, yymsp[-1].minor.yy490, NULL, yymsp[0].minor.yy490); }
+#line 6661 "sql.c"
break;
case 319: /* cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */
+#line 569 "sql.y"
{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy845, yymsp[-5].minor.yy490, yymsp[-3].minor.yy490, yymsp[-1].minor.yy502, NULL); }
+#line 6666 "sql.c"
break;
case 320: /* cmd ::= DROP INDEX exists_opt full_index_name */
+#line 570 "sql.y"
{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy845, yymsp[0].minor.yy490); }
+#line 6671 "sql.c"
break;
case 321: /* full_index_name ::= index_name */
+#line 572 "sql.y"
{ yylhsminor.yy490 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy561); }
+#line 6676 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 322: /* full_index_name ::= db_name NK_DOT index_name */
+#line 573 "sql.y"
{ yylhsminor.yy490 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy561); }
+#line 6682 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 323: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */
+#line 576 "sql.y"
{ yymsp[-9].minor.yy490 = createIndexOption(pCxt, yymsp[-7].minor.yy502, releaseRawExprNode(pCxt, yymsp[-3].minor.yy490), NULL, yymsp[-1].minor.yy490, yymsp[0].minor.yy490); }
+#line 6688 "sql.c"
break;
case 324: /* 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 579 "sql.y"
{ yymsp[-11].minor.yy490 = createIndexOption(pCxt, yymsp[-9].minor.yy502, releaseRawExprNode(pCxt, yymsp[-5].minor.yy490), releaseRawExprNode(pCxt, yymsp[-3].minor.yy490), yymsp[-1].minor.yy490, yymsp[0].minor.yy490); }
+#line 6693 "sql.c"
break;
case 327: /* func ::= sma_func_name NK_LP expression_list NK_RP */
+#line 586 "sql.y"
{ yylhsminor.yy490 = createFunctionNode(pCxt, &yymsp[-3].minor.yy561, yymsp[-1].minor.yy502); }
+#line 6698 "sql.c"
yymsp[-3].minor.yy490 = yylhsminor.yy490;
break;
case 328: /* sma_func_name ::= function_name */
case 553: /* alias_opt ::= table_alias */ yytestcase(yyruleno==553);
+#line 590 "sql.y"
{ yylhsminor.yy561 = yymsp[0].minor.yy561; }
+#line 6705 "sql.c"
yymsp[0].minor.yy561 = yylhsminor.yy561;
break;
case 333: /* sma_stream_opt ::= */
case 378: /* stream_options ::= */ yytestcase(yyruleno==378);
+#line 596 "sql.y"
{ yymsp[1].minor.yy490 = createStreamOptions(pCxt); }
+#line 6712 "sql.c"
break;
case 334: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */
+#line 597 "sql.y"
{ ((SStreamOptions*)yymsp[-2].minor.yy490)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy490); yylhsminor.yy490 = yymsp[-2].minor.yy490; }
+#line 6717 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 335: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */
+#line 598 "sql.y"
{ ((SStreamOptions*)yymsp[-2].minor.yy490)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy490); yylhsminor.yy490 = yymsp[-2].minor.yy490; }
+#line 6723 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 336: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */
+#line 599 "sql.y"
{ ((SStreamOptions*)yymsp[-2].minor.yy490)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy490); yylhsminor.yy490 = yymsp[-2].minor.yy490; }
+#line 6729 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 337: /* with_meta ::= AS */
+#line 604 "sql.y"
{ yymsp[0].minor.yy774 = 0; }
+#line 6735 "sql.c"
break;
case 338: /* with_meta ::= WITH META AS */
+#line 605 "sql.y"
{ yymsp[-2].minor.yy774 = 1; }
+#line 6740 "sql.c"
break;
case 339: /* with_meta ::= ONLY META AS */
+#line 606 "sql.y"
{ yymsp[-2].minor.yy774 = 2; }
+#line 6745 "sql.c"
break;
case 340: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */
+#line 608 "sql.y"
{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy845, &yymsp[-2].minor.yy561, yymsp[0].minor.yy490); }
+#line 6750 "sql.c"
break;
case 341: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */
+#line 610 "sql.y"
{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy845, &yymsp[-3].minor.yy561, &yymsp[0].minor.yy561, yymsp[-2].minor.yy774); }
+#line 6755 "sql.c"
break;
case 342: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */
+#line 612 "sql.y"
{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy845, &yymsp[-4].minor.yy561, yymsp[-1].minor.yy490, yymsp[-3].minor.yy774, yymsp[0].minor.yy490); }
+#line 6760 "sql.c"
break;
case 343: /* cmd ::= DROP TOPIC exists_opt topic_name */
+#line 614 "sql.y"
{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy845, &yymsp[0].minor.yy561); }
+#line 6765 "sql.c"
break;
case 344: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */
+#line 615 "sql.y"
{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy845, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy561); }
+#line 6770 "sql.c"
break;
case 345: /* cmd ::= DESC full_table_name */
case 346: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==346);
+#line 618 "sql.y"
{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy490); }
+#line 6776 "sql.c"
break;
case 347: /* cmd ::= RESET QUERY CACHE */
+#line 622 "sql.y"
{ pCxt->pRootNode = createResetQueryCacheStmt(pCxt); }
+#line 6781 "sql.c"
break;
case 348: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */
case 349: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==349);
+#line 625 "sql.y"
{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy845, yymsp[-1].minor.yy490, yymsp[0].minor.yy490); }
+#line 6787 "sql.c"
break;
case 352: /* explain_options ::= */
+#line 633 "sql.y"
{ yymsp[1].minor.yy490 = createDefaultExplainOptions(pCxt); }
+#line 6792 "sql.c"
break;
case 353: /* explain_options ::= explain_options VERBOSE NK_BOOL */
+#line 634 "sql.y"
{ yylhsminor.yy490 = setExplainVerbose(pCxt, yymsp[-2].minor.yy490, &yymsp[0].minor.yy0); }
+#line 6797 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 354: /* explain_options ::= explain_options RATIO NK_FLOAT */
+#line 635 "sql.y"
{ yylhsminor.yy490 = setExplainRatio(pCxt, yymsp[-2].minor.yy490, &yymsp[0].minor.yy0); }
+#line 6803 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 355: /* 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 640 "sql.y"
{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy845, yymsp[-9].minor.yy845, &yymsp[-6].minor.yy561, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy826, yymsp[-1].minor.yy774, &yymsp[0].minor.yy561, yymsp[-10].minor.yy845); }
+#line 6809 "sql.c"
break;
case 356: /* cmd ::= DROP FUNCTION exists_opt function_name */
+#line 641 "sql.y"
{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy845, &yymsp[0].minor.yy561); }
+#line 6814 "sql.c"
break;
case 361: /* language_opt ::= */
case 400: /* on_vgroup_id ::= */ yytestcase(yyruleno==400);
+#line 655 "sql.y"
{ yymsp[1].minor.yy561 = nil_token; }
+#line 6820 "sql.c"
break;
case 362: /* language_opt ::= LANGUAGE NK_STRING */
case 401: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==401);
+#line 656 "sql.y"
{ yymsp[-1].minor.yy561 = yymsp[0].minor.yy0; }
+#line 6826 "sql.c"
break;
case 365: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */
+#line 665 "sql.y"
{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy845, yymsp[-2].minor.yy490, &yymsp[-1].minor.yy0, yymsp[0].minor.yy490); }
+#line 6831 "sql.c"
break;
case 366: /* cmd ::= DROP VIEW exists_opt full_view_name */
+#line 666 "sql.y"
{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy845, yymsp[0].minor.yy490); }
+#line 6836 "sql.c"
break;
case 367: /* full_view_name ::= view_name */
+#line 668 "sql.y"
{ yylhsminor.yy490 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy561); }
+#line 6841 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 368: /* full_view_name ::= db_name NK_DOT view_name */
+#line 669 "sql.y"
{ yylhsminor.yy490 = createViewNode(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy561); }
+#line 6847 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 369: /* 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 674 "sql.y"
{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy845, &yymsp[-8].minor.yy561, yymsp[-5].minor.yy490, yymsp[-7].minor.yy490, yymsp[-3].minor.yy502, yymsp[-2].minor.yy490, yymsp[0].minor.yy490, yymsp[-4].minor.yy502); }
+#line 6853 "sql.c"
break;
case 370: /* cmd ::= DROP STREAM exists_opt stream_name */
+#line 675 "sql.y"
{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy845, &yymsp[0].minor.yy561); }
+#line 6858 "sql.c"
break;
case 371: /* cmd ::= PAUSE STREAM exists_opt stream_name */
+#line 676 "sql.y"
{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy845, &yymsp[0].minor.yy561); }
+#line 6863 "sql.c"
break;
case 372: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */
+#line 677 "sql.y"
{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy845, yymsp[-1].minor.yy845, &yymsp[0].minor.yy561); }
+#line 6868 "sql.c"
break;
case 379: /* stream_options ::= stream_options TRIGGER AT_ONCE */
case 380: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==380);
+#line 691 "sql.y"
{ yylhsminor.yy490 = setStreamOptions(pCxt, yymsp[-2].minor.yy490, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); }
+#line 6874 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 381: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */
+#line 693 "sql.y"
{ yylhsminor.yy490 = setStreamOptions(pCxt, yymsp[-3].minor.yy490, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy490)); }
+#line 6880 "sql.c"
yymsp[-3].minor.yy490 = yylhsminor.yy490;
break;
case 382: /* stream_options ::= stream_options WATERMARK duration_literal */
+#line 694 "sql.y"
{ yylhsminor.yy490 = setStreamOptions(pCxt, yymsp[-2].minor.yy490, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy490)); }
+#line 6886 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 383: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */
+#line 695 "sql.y"
{ yylhsminor.yy490 = setStreamOptions(pCxt, yymsp[-3].minor.yy490, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); }
+#line 6892 "sql.c"
yymsp[-3].minor.yy490 = yylhsminor.yy490;
break;
case 384: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */
+#line 696 "sql.y"
{ yylhsminor.yy490 = setStreamOptions(pCxt, yymsp[-2].minor.yy490, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); }
+#line 6898 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 385: /* stream_options ::= stream_options DELETE_MARK duration_literal */
+#line 697 "sql.y"
{ yylhsminor.yy490 = setStreamOptions(pCxt, yymsp[-2].minor.yy490, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy490)); }
+#line 6904 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 386: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */
+#line 698 "sql.y"
{ yylhsminor.yy490 = setStreamOptions(pCxt, yymsp[-3].minor.yy490, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); }
+#line 6910 "sql.c"
yymsp[-3].minor.yy490 = yylhsminor.yy490;
break;
case 388: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */
case 591: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==591);
case 615: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==615);
+#line 701 "sql.y"
{ yymsp[-3].minor.yy490 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy490); }
+#line 6918 "sql.c"
break;
case 391: /* cmd ::= KILL CONNECTION NK_INTEGER */
+#line 709 "sql.y"
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); }
+#line 6923 "sql.c"
break;
case 392: /* cmd ::= KILL QUERY NK_STRING */
+#line 710 "sql.y"
{ pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); }
+#line 6928 "sql.c"
break;
case 393: /* cmd ::= KILL TRANSACTION NK_INTEGER */
+#line 711 "sql.y"
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); }
+#line 6933 "sql.c"
break;
case 394: /* cmd ::= KILL COMPACT NK_INTEGER */
+#line 712 "sql.y"
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_COMPACT_STMT, &yymsp[0].minor.yy0); }
+#line 6938 "sql.c"
break;
case 395: /* cmd ::= BALANCE VGROUP */
+#line 715 "sql.y"
{ pCxt->pRootNode = createBalanceVgroupStmt(pCxt); }
+#line 6943 "sql.c"
break;
case 396: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */
+#line 716 "sql.y"
{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy561); }
+#line 6948 "sql.c"
break;
case 397: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
+#line 717 "sql.y"
{ pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
+#line 6953 "sql.c"
break;
case 398: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
+#line 718 "sql.y"
{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy502); }
+#line 6958 "sql.c"
break;
case 399: /* cmd ::= SPLIT VGROUP NK_INTEGER */
+#line 719 "sql.y"
{ pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); }
+#line 6963 "sql.c"
break;
case 402: /* dnode_list ::= DNODE NK_INTEGER */
+#line 728 "sql.y"
{ yymsp[-1].minor.yy502 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
+#line 6968 "sql.c"
break;
case 404: /* cmd ::= DELETE FROM full_table_name where_clause_opt */
+#line 735 "sql.y"
{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy490, yymsp[0].minor.yy490); }
+#line 6973 "sql.c"
break;
case 407: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */
+#line 744 "sql.y"
{ yymsp[-6].minor.yy490 = createInsertStmt(pCxt, yymsp[-4].minor.yy490, yymsp[-2].minor.yy502, yymsp[0].minor.yy490); }
+#line 6978 "sql.c"
break;
case 408: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */
+#line 745 "sql.y"
{ yymsp[-3].minor.yy490 = createInsertStmt(pCxt, yymsp[-1].minor.yy490, NULL, yymsp[0].minor.yy490); }
+#line 6983 "sql.c"
break;
case 409: /* literal ::= NK_INTEGER */
+#line 748 "sql.y"
{ yylhsminor.yy490 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); }
+#line 6988 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 410: /* literal ::= NK_FLOAT */
+#line 749 "sql.y"
{ yylhsminor.yy490 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
+#line 6994 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 411: /* literal ::= NK_STRING */
+#line 750 "sql.y"
{ yylhsminor.yy490 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
+#line 7000 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 412: /* literal ::= NK_BOOL */
+#line 751 "sql.y"
{ yylhsminor.yy490 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
+#line 7006 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 413: /* literal ::= TIMESTAMP NK_STRING */
+#line 752 "sql.y"
{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
+#line 7012 "sql.c"
yymsp[-1].minor.yy490 = yylhsminor.yy490;
break;
case 414: /* literal ::= duration_literal */
@@ -6040,64 +7032,90 @@ static YYACTIONTYPE yy_reduce(
case 618: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==618);
case 621: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==621);
case 623: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==623);
+#line 753 "sql.y"
{ yylhsminor.yy490 = yymsp[0].minor.yy490; }
+#line 7037 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 415: /* literal ::= NULL */
+#line 754 "sql.y"
{ yylhsminor.yy490 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); }
+#line 7043 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 416: /* literal ::= NK_QUESTION */
+#line 755 "sql.y"
{ yylhsminor.yy490 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); }
+#line 7049 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 417: /* duration_literal ::= NK_VARIABLE */
case 592: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==592);
case 593: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==593);
case 594: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==594);
+#line 757 "sql.y"
{ yylhsminor.yy490 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+#line 7058 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 418: /* signed ::= NK_INTEGER */
+#line 759 "sql.y"
{ yylhsminor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); }
+#line 7064 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 419: /* signed ::= NK_PLUS NK_INTEGER */
+#line 760 "sql.y"
{ yymsp[-1].minor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); }
+#line 7070 "sql.c"
break;
case 420: /* signed ::= NK_MINUS NK_INTEGER */
+#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.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t);
}
+#line 7079 "sql.c"
yymsp[-1].minor.yy490 = yylhsminor.yy490;
break;
case 421: /* signed ::= NK_FLOAT */
+#line 766 "sql.y"
{ yylhsminor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
+#line 7085 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 422: /* signed ::= NK_PLUS NK_FLOAT */
+#line 767 "sql.y"
{ yymsp[-1].minor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
+#line 7091 "sql.c"
break;
case 423: /* signed ::= NK_MINUS NK_FLOAT */
+#line 768 "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.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t);
}
+#line 7100 "sql.c"
yymsp[-1].minor.yy490 = yylhsminor.yy490;
break;
case 425: /* signed_literal ::= NK_STRING */
+#line 775 "sql.y"
{ yylhsminor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
+#line 7106 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 426: /* signed_literal ::= NK_BOOL */
+#line 776 "sql.y"
{ yylhsminor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); }
+#line 7112 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 427: /* signed_literal ::= TIMESTAMP NK_STRING */
+#line 777 "sql.y"
{ yymsp[-1].minor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
+#line 7118 "sql.c"
break;
case 428: /* signed_literal ::= duration_literal */
case 430: /* signed_literal ::= literal_func */ yytestcase(yyruleno==430);
@@ -6107,118 +7125,156 @@ static YYACTIONTYPE yy_reduce(
case 622: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==622);
case 624: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==624);
case 637: /* search_condition ::= common_expression */ yytestcase(yyruleno==637);
+#line 778 "sql.y"
{ yylhsminor.yy490 = releaseRawExprNode(pCxt, yymsp[0].minor.yy490); }
+#line 7130 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 429: /* signed_literal ::= NULL */
+#line 779 "sql.y"
{ yylhsminor.yy490 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); }
+#line 7136 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 431: /* signed_literal ::= NK_QUESTION */
+#line 781 "sql.y"
{ yylhsminor.yy490 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); }
+#line 7142 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 449: /* expression ::= pseudo_column */
+#line 843 "sql.y"
{ yylhsminor.yy490 = yymsp[0].minor.yy490; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy490, true); }
+#line 7148 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 453: /* expression ::= NK_LP expression NK_RP */
case 539: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==539);
case 636: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==636);
+#line 847 "sql.y"
{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy490)); }
+#line 7156 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 454: /* expression ::= NK_PLUS expr_or_subquery */
+#line 848 "sql.y"
{
SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490);
yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy490));
}
+#line 7165 "sql.c"
yymsp[-1].minor.yy490 = yylhsminor.yy490;
break;
case 455: /* expression ::= NK_MINUS expr_or_subquery */
+#line 852 "sql.y"
{
SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490);
yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy490), NULL));
}
+#line 7174 "sql.c"
yymsp[-1].minor.yy490 = yylhsminor.yy490;
break;
case 456: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */
+#line 856 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490);
yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490)));
}
+#line 7184 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 457: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */
+#line 861 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490);
yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490)));
}
+#line 7194 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 458: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */
+#line 866 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490);
yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490)));
}
+#line 7204 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 459: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */
+#line 871 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490);
yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490)));
}
+#line 7214 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 460: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */
+#line 876 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490);
yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490)));
}
+#line 7224 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 461: /* expression ::= column_reference NK_ARROW NK_STRING */
+#line 881 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490);
yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)));
}
+#line 7233 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 462: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */
+#line 885 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490);
yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490)));
}
+#line 7243 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 463: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */
+#line 890 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490);
yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490)));
}
+#line 7253 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 466: /* column_reference ::= column_name */
+#line 901 "sql.y"
{ yylhsminor.yy490 = createRawExprNode(pCxt, &yymsp[0].minor.yy561, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy561)); }
+#line 7259 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 467: /* column_reference ::= table_name NK_DOT column_name */
+#line 902 "sql.y"
{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy561, createColumnNode(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy561)); }
+#line 7265 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 468: /* column_reference ::= NK_ALIAS */
+#line 903 "sql.y"
{ yylhsminor.yy490 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); }
+#line 7271 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 469: /* column_reference ::= table_name NK_DOT NK_ALIAS */
+#line 904 "sql.y"
{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy0)); }
+#line 7277 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 470: /* pseudo_column ::= ROWTS */
@@ -6233,191 +7289,278 @@ static YYACTIONTYPE yy_reduce(
case 480: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==480);
case 481: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==481);
case 487: /* literal_func ::= NOW */ yytestcase(yyruleno==487);
+#line 906 "sql.y"
{ yylhsminor.yy490 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); }
+#line 7294 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 472: /* pseudo_column ::= table_name NK_DOT TBNAME */
+#line 908 "sql.y"
{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy561)))); }
+#line 7300 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 482: /* function_expression ::= function_name NK_LP expression_list NK_RP */
case 483: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==483);
+#line 919 "sql.y"
{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy561, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy561, yymsp[-1].minor.yy502)); }
+#line 7307 "sql.c"
yymsp[-3].minor.yy490 = yylhsminor.yy490;
break;
case 484: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */
+#line 922 "sql.y"
{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy490), yymsp[-1].minor.yy826)); }
+#line 7313 "sql.c"
yymsp[-5].minor.yy490 = yylhsminor.yy490;
break;
case 486: /* literal_func ::= noarg_func NK_LP NK_RP */
+#line 925 "sql.y"
{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy561, NULL)); }
+#line 7319 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 501: /* star_func_para_list ::= NK_STAR */
+#line 949 "sql.y"
{ yylhsminor.yy502 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); }
+#line 7325 "sql.c"
yymsp[0].minor.yy502 = yylhsminor.yy502;
break;
case 506: /* star_func_para ::= table_name NK_DOT NK_STAR */
case 574: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==574);
+#line 958 "sql.y"
{ yylhsminor.yy490 = createColumnNode(pCxt, &yymsp[-2].minor.yy561, &yymsp[0].minor.yy0); }
+#line 7332 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 507: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */
+#line 961 "sql.y"
{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy502, yymsp[-1].minor.yy490)); }
+#line 7338 "sql.c"
yymsp[-3].minor.yy490 = yylhsminor.yy490;
break;
case 508: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */
+#line 963 "sql.y"
{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy490), yymsp[-2].minor.yy502, yymsp[-1].minor.yy490)); }
+#line 7344 "sql.c"
yymsp[-4].minor.yy490 = yylhsminor.yy490;
break;
case 511: /* when_then_expr ::= WHEN common_expression THEN common_expression */
+#line 970 "sql.y"
{ yymsp[-3].minor.yy490 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490)); }
+#line 7350 "sql.c"
break;
case 513: /* case_when_else_opt ::= ELSE common_expression */
+#line 973 "sql.y"
{ yymsp[-1].minor.yy490 = releaseRawExprNode(pCxt, yymsp[0].minor.yy490); }
+#line 7355 "sql.c"
break;
case 514: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */
case 519: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==519);
+#line 976 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490);
yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy30, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490)));
}
+#line 7365 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 515: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */
+#line 983 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy490);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490);
yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy490), releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490)));
}
+#line 7375 "sql.c"
yymsp[-4].minor.yy490 = yylhsminor.yy490;
break;
case 516: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */
+#line 989 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy490);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490);
yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy490), releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490)));
}
+#line 7385 "sql.c"
yymsp[-5].minor.yy490 = yylhsminor.yy490;
break;
case 517: /* predicate ::= expr_or_subquery IS NULL */
+#line 994 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490);
yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), NULL));
}
+#line 7394 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 518: /* predicate ::= expr_or_subquery IS NOT NULL */
+#line 998 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy490);
yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy490), NULL));
}
+#line 7403 "sql.c"
yymsp[-3].minor.yy490 = yylhsminor.yy490;
break;
case 520: /* compare_op ::= NK_LT */
+#line 1010 "sql.y"
{ yymsp[0].minor.yy30 = OP_TYPE_LOWER_THAN; }
+#line 7409 "sql.c"
break;
case 521: /* compare_op ::= NK_GT */
+#line 1011 "sql.y"
{ yymsp[0].minor.yy30 = OP_TYPE_GREATER_THAN; }
+#line 7414 "sql.c"
break;
case 522: /* compare_op ::= NK_LE */
+#line 1012 "sql.y"
{ yymsp[0].minor.yy30 = OP_TYPE_LOWER_EQUAL; }
+#line 7419 "sql.c"
break;
case 523: /* compare_op ::= NK_GE */
+#line 1013 "sql.y"
{ yymsp[0].minor.yy30 = OP_TYPE_GREATER_EQUAL; }
+#line 7424 "sql.c"
break;
case 524: /* compare_op ::= NK_NE */
+#line 1014 "sql.y"
{ yymsp[0].minor.yy30 = OP_TYPE_NOT_EQUAL; }
+#line 7429 "sql.c"
break;
case 525: /* compare_op ::= NK_EQ */
+#line 1015 "sql.y"
{ yymsp[0].minor.yy30 = OP_TYPE_EQUAL; }
+#line 7434 "sql.c"
break;
case 526: /* compare_op ::= LIKE */
+#line 1016 "sql.y"
{ yymsp[0].minor.yy30 = OP_TYPE_LIKE; }
+#line 7439 "sql.c"
break;
case 527: /* compare_op ::= NOT LIKE */
+#line 1017 "sql.y"
{ yymsp[-1].minor.yy30 = OP_TYPE_NOT_LIKE; }
+#line 7444 "sql.c"
break;
case 528: /* compare_op ::= MATCH */
+#line 1018 "sql.y"
{ yymsp[0].minor.yy30 = OP_TYPE_MATCH; }
+#line 7449 "sql.c"
break;
case 529: /* compare_op ::= NMATCH */
+#line 1019 "sql.y"
{ yymsp[0].minor.yy30 = OP_TYPE_NMATCH; }
+#line 7454 "sql.c"
break;
case 530: /* compare_op ::= CONTAINS */
+#line 1020 "sql.y"
{ yymsp[0].minor.yy30 = OP_TYPE_JSON_CONTAINS; }
+#line 7459 "sql.c"
break;
case 531: /* in_op ::= IN */
+#line 1024 "sql.y"
{ yymsp[0].minor.yy30 = OP_TYPE_IN; }
+#line 7464 "sql.c"
break;
case 532: /* in_op ::= NOT IN */
+#line 1025 "sql.y"
{ yymsp[-1].minor.yy30 = OP_TYPE_NOT_IN; }
+#line 7469 "sql.c"
break;
case 533: /* in_predicate_value ::= NK_LP literal_list NK_RP */
+#line 1027 "sql.y"
{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy502)); }
+#line 7474 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 535: /* boolean_value_expression ::= NOT boolean_primary */
+#line 1031 "sql.y"
{
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490);
yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy490), NULL));
}
+#line 7483 "sql.c"
yymsp[-1].minor.yy490 = yylhsminor.yy490;
break;
case 536: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
+#line 1036 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490);
yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490)));
}
+#line 7493 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 537: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
+#line 1042 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy490);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy490);
yylhsminor.yy490 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), releaseRawExprNode(pCxt, yymsp[0].minor.yy490)));
}
+#line 7503 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 545: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
+#line 1060 "sql.y"
{ yylhsminor.yy490 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy490, yymsp[0].minor.yy490, NULL); }
+#line 7509 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 548: /* table_primary ::= table_name alias_opt */
+#line 1066 "sql.y"
{ yylhsminor.yy490 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy561, &yymsp[0].minor.yy561); }
+#line 7515 "sql.c"
yymsp[-1].minor.yy490 = yylhsminor.yy490;
break;
case 549: /* table_primary ::= db_name NK_DOT table_name alias_opt */
+#line 1067 "sql.y"
{ yylhsminor.yy490 = createRealTableNode(pCxt, &yymsp[-3].minor.yy561, &yymsp[-1].minor.yy561, &yymsp[0].minor.yy561); }
+#line 7521 "sql.c"
yymsp[-3].minor.yy490 = yylhsminor.yy490;
break;
case 550: /* table_primary ::= subquery alias_opt */
+#line 1068 "sql.y"
{ yylhsminor.yy490 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy490), &yymsp[0].minor.yy561); }
+#line 7527 "sql.c"
yymsp[-1].minor.yy490 = yylhsminor.yy490;
break;
case 552: /* alias_opt ::= */
+#line 1073 "sql.y"
{ yymsp[1].minor.yy561 = nil_token; }
+#line 7533 "sql.c"
break;
case 554: /* alias_opt ::= AS table_alias */
+#line 1075 "sql.y"
{ yymsp[-1].minor.yy561 = yymsp[0].minor.yy561; }
+#line 7538 "sql.c"
break;
case 555: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
case 556: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==556);
+#line 1077 "sql.y"
{ yymsp[-2].minor.yy490 = yymsp[-1].minor.yy490; }
+#line 7544 "sql.c"
break;
case 557: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
+#line 1082 "sql.y"
{ yylhsminor.yy490 = createJoinTableNode(pCxt, yymsp[-4].minor.yy246, yymsp[-5].minor.yy490, yymsp[-2].minor.yy490, yymsp[0].minor.yy490); }
+#line 7549 "sql.c"
yymsp[-5].minor.yy490 = yylhsminor.yy490;
break;
case 558: /* join_type ::= */
+#line 1086 "sql.y"
{ yymsp[1].minor.yy246 = JOIN_TYPE_INNER; }
+#line 7555 "sql.c"
break;
case 559: /* join_type ::= INNER */
+#line 1087 "sql.y"
{ yymsp[0].minor.yy246 = JOIN_TYPE_INNER; }
+#line 7560 "sql.c"
break;
case 560: /* 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 1093 "sql.y"
{
yymsp[-13].minor.yy490 = createSelectStmt(pCxt, yymsp[-11].minor.yy845, yymsp[-9].minor.yy502, yymsp[-8].minor.yy490, yymsp[-12].minor.yy502);
yymsp[-13].minor.yy490 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy490, yymsp[-10].minor.yy845);
@@ -6430,145 +7573,224 @@ static YYACTIONTYPE yy_reduce(
yymsp[-13].minor.yy490 = addEveryClause(pCxt, yymsp[-13].minor.yy490, yymsp[-4].minor.yy490);
yymsp[-13].minor.yy490 = addFillClause(pCxt, yymsp[-13].minor.yy490, yymsp[-3].minor.yy490);
}
+#line 7576 "sql.c"
break;
case 561: /* hint_list ::= */
+#line 1108 "sql.y"
{ yymsp[1].minor.yy502 = createHintNodeList(pCxt, NULL); }
+#line 7581 "sql.c"
break;
case 562: /* hint_list ::= NK_HINT */
+#line 1109 "sql.y"
{ yylhsminor.yy502 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); }
+#line 7586 "sql.c"
yymsp[0].minor.yy502 = yylhsminor.yy502;
break;
case 567: /* set_quantifier_opt ::= ALL */
+#line 1120 "sql.y"
{ yymsp[0].minor.yy845 = false; }
+#line 7592 "sql.c"
break;
case 570: /* select_item ::= NK_STAR */
+#line 1127 "sql.y"
{ yylhsminor.yy490 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); }
+#line 7597 "sql.c"
yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 572: /* select_item ::= common_expression column_alias */
case 582: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==582);
+#line 1129 "sql.y"
{ yylhsminor.yy490 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy490), &yymsp[0].minor.yy561); }
+#line 7604 "sql.c"
yymsp[-1].minor.yy490 = yylhsminor.yy490;
break;
case 573: /* select_item ::= common_expression AS column_alias */
case 583: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==583);
+#line 1130 "sql.y"
{ yylhsminor.yy490 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), &yymsp[0].minor.yy561); }
+#line 7611 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 578: /* partition_by_clause_opt ::= PARTITION BY partition_list */
case 606: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==606);
case 626: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==626);
+#line 1139 "sql.y"
{ yymsp[-2].minor.yy502 = yymsp[0].minor.yy502; }
+#line 7619 "sql.c"
break;
case 585: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */
+#line 1152 "sql.y"
{ yymsp[-5].minor.yy490 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy490), releaseRawExprNode(pCxt, yymsp[-1].minor.yy490)); }
+#line 7624 "sql.c"
break;
case 586: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */
+#line 1153 "sql.y"
{ yymsp[-3].minor.yy490 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy490)); }
+#line 7629 "sql.c"
break;
case 587: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */
+#line 1155 "sql.y"
{ yymsp[-5].minor.yy490 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy490), NULL, yymsp[-1].minor.yy490, yymsp[0].minor.yy490); }
+#line 7634 "sql.c"
break;
case 588: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */
+#line 1159 "sql.y"
{ yymsp[-7].minor.yy490 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy490), releaseRawExprNode(pCxt, yymsp[-3].minor.yy490), yymsp[-1].minor.yy490, yymsp[0].minor.yy490); }
+#line 7639 "sql.c"
break;
case 589: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */
+#line 1161 "sql.y"
{ yymsp[-6].minor.yy490 = createEventWindowNode(pCxt, yymsp[-3].minor.yy490, yymsp[0].minor.yy490); }
+#line 7644 "sql.c"
break;
case 596: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
+#line 1171 "sql.y"
{ yymsp[-3].minor.yy490 = createFillNode(pCxt, yymsp[-1].minor.yy718, NULL); }
+#line 7649 "sql.c"
break;
case 597: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */
+#line 1172 "sql.y"
{ yymsp[-5].minor.yy490 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy502)); }
+#line 7654 "sql.c"
break;
case 598: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */
+#line 1173 "sql.y"
{ yymsp[-5].minor.yy490 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy502)); }
+#line 7659 "sql.c"
break;
case 599: /* fill_mode ::= NONE */
+#line 1177 "sql.y"
{ yymsp[0].minor.yy718 = FILL_MODE_NONE; }
+#line 7664 "sql.c"
break;
case 600: /* fill_mode ::= PREV */
+#line 1178 "sql.y"
{ yymsp[0].minor.yy718 = FILL_MODE_PREV; }
+#line 7669 "sql.c"
break;
case 601: /* fill_mode ::= NULL */
+#line 1179 "sql.y"
{ yymsp[0].minor.yy718 = FILL_MODE_NULL; }
+#line 7674 "sql.c"
break;
case 602: /* fill_mode ::= NULL_F */
+#line 1180 "sql.y"
{ yymsp[0].minor.yy718 = FILL_MODE_NULL_F; }
+#line 7679 "sql.c"
break;
case 603: /* fill_mode ::= LINEAR */
+#line 1181 "sql.y"
{ yymsp[0].minor.yy718 = FILL_MODE_LINEAR; }
+#line 7684 "sql.c"
break;
case 604: /* fill_mode ::= NEXT */
+#line 1182 "sql.y"
{ yymsp[0].minor.yy718 = FILL_MODE_NEXT; }
+#line 7689 "sql.c"
break;
case 607: /* group_by_list ::= expr_or_subquery */
+#line 1191 "sql.y"
{ yylhsminor.yy502 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy490))); }
+#line 7694 "sql.c"
yymsp[0].minor.yy502 = yylhsminor.yy502;
break;
case 608: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */
+#line 1192 "sql.y"
{ yylhsminor.yy502 = addNodeToList(pCxt, yymsp[-2].minor.yy502, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy490))); }
+#line 7700 "sql.c"
yymsp[-2].minor.yy502 = yylhsminor.yy502;
break;
case 612: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */
+#line 1199 "sql.y"
{ yymsp[-5].minor.yy490 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy490), releaseRawExprNode(pCxt, yymsp[-1].minor.yy490)); }
+#line 7706 "sql.c"
break;
case 613: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */
+#line 1201 "sql.y"
{ yymsp[-3].minor.yy490 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy490)); }
+#line 7711 "sql.c"
break;
case 616: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */
+#line 1208 "sql.y"
{
yylhsminor.yy490 = addOrderByClause(pCxt, yymsp[-3].minor.yy490, yymsp[-2].minor.yy502);
yylhsminor.yy490 = addSlimitClause(pCxt, yylhsminor.yy490, yymsp[-1].minor.yy490);
yylhsminor.yy490 = addLimitClause(pCxt, yylhsminor.yy490, yymsp[0].minor.yy490);
}
+#line 7720 "sql.c"
yymsp[-3].minor.yy490 = yylhsminor.yy490;
break;
case 619: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */
+#line 1218 "sql.y"
{ yylhsminor.yy490 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy490, yymsp[0].minor.yy490); }
+#line 7726 "sql.c"
yymsp[-3].minor.yy490 = yylhsminor.yy490;
break;
case 620: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */
+#line 1220 "sql.y"
{ yylhsminor.yy490 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy490, yymsp[0].minor.yy490); }
+#line 7732 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 628: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */
case 632: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==632);
+#line 1234 "sql.y"
{ yymsp[-1].minor.yy490 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
+#line 7739 "sql.c"
break;
case 629: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
case 633: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==633);
+#line 1235 "sql.y"
{ yymsp[-3].minor.yy490 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
+#line 7745 "sql.c"
break;
case 630: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
case 634: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==634);
+#line 1236 "sql.y"
{ yymsp[-3].minor.yy490 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
+#line 7751 "sql.c"
break;
case 635: /* subquery ::= NK_LP query_expression NK_RP */
+#line 1244 "sql.y"
{ yylhsminor.yy490 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy490); }
+#line 7756 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 640: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */
+#line 1258 "sql.y"
{ yylhsminor.yy490 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy490), yymsp[-1].minor.yy876, yymsp[0].minor.yy361); }
+#line 7762 "sql.c"
yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 641: /* ordering_specification_opt ::= */
+#line 1262 "sql.y"
{ yymsp[1].minor.yy876 = ORDER_ASC; }
+#line 7768 "sql.c"
break;
case 642: /* ordering_specification_opt ::= ASC */
+#line 1263 "sql.y"
{ yymsp[0].minor.yy876 = ORDER_ASC; }
+#line 7773 "sql.c"
break;
case 643: /* ordering_specification_opt ::= DESC */
+#line 1264 "sql.y"
{ yymsp[0].minor.yy876 = ORDER_DESC; }
+#line 7778 "sql.c"
break;
case 644: /* null_ordering_opt ::= */
+#line 1268 "sql.y"
{ yymsp[1].minor.yy361 = NULL_ORDER_DEFAULT; }
+#line 7783 "sql.c"
break;
case 645: /* null_ordering_opt ::= NULLS FIRST */
+#line 1269 "sql.y"
{ yymsp[-1].minor.yy361 = NULL_ORDER_FIRST; }
+#line 7788 "sql.c"
break;
case 646: /* null_ordering_opt ::= NULLS LAST */
+#line 1270 "sql.y"
{ yymsp[-1].minor.yy361 = NULL_ORDER_LAST; }
+#line 7793 "sql.c"
break;
default:
break;
@@ -6630,6 +7852,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) {
@@ -6640,6 +7863,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 7866 "sql.c"
/************ End %syntax_error code ******************************************/
ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
ParseCTX_STORE
@@ -6725,12 +7949,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
@@ -6786,14 +8054,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
@@ -6843,7 +8110,7 @@ void Parse(
break;
#endif
}
- }while( yypParser->yytos>yypParser->yystack );
+ }
#ifndef NDEBUG
if( yyTraceFILE ){
yyStackEntry *i;
diff --git a/source/libs/scheduler/src/schJob.c b/source/libs/scheduler/src/schJob.c
index 6e312f0e6f..e50ec64d54 100644
--- a/source/libs/scheduler/src/schJob.c
+++ b/source/libs/scheduler/src/schJob.c
@@ -66,7 +66,7 @@ FORCE_INLINE bool schJobNeedToStop(SSchJob *pJob, int8_t *pStatus) {
return true;
}
- if ((*pJob->chkKillFp)(pJob->chkKillParam)) {
+ if (pJob->chkKillFp && (*pJob->chkKillFp)(pJob->chkKillParam)) {
schUpdateJobErrCode(pJob, TSDB_CODE_TSC_QUERY_KILLED);
return true;
}
diff --git a/source/libs/scheduler/test/schedulerTests.cpp b/source/libs/scheduler/test/schedulerTests.cpp
index 5605a4b842..fbb1f657b0 100644
--- a/source/libs/scheduler/test/schedulerTests.cpp
+++ b/source/libs/scheduler/test/schedulerTests.cpp
@@ -54,9 +54,8 @@
namespace {
-extern "C" int32_t schHandleResponseMsg(SSchJob *job, SSchTask *task, int32_t msgType, char *msg, int32_t msgSize,
- int32_t rspCode);
-extern "C" int32_t schHandleCallback(void *param, const SDataBuf *pMsg, int32_t msgType, int32_t rspCode);
+extern "C" int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t execId, SDataBuf *pMsg, int32_t rspCode);
+extern "C" int32_t schHandleCallback(void *param, const SDataBuf *pMsg, int32_t rspCode);
int64_t insertJobRefId = 0;
int64_t queryJobRefId = 0;
@@ -67,7 +66,7 @@ uint64_t schtQueryId = 1;
bool schtTestStop = false;
bool schtTestDeadLoop = false;
-int32_t schtTestMTRunSec = 10;
+int32_t schtTestMTRunSec = 1;
int32_t schtTestPrintNum = 1000;
int32_t schtStartFetch = 0;
@@ -85,10 +84,69 @@ void schtInitLogFile() {
}
void schtQueryCb(SExecResult *pResult, void *param, int32_t code) {
- assert(TSDB_CODE_SUCCESS == code);
*(int32_t *)param = 1;
}
+int32_t schtBuildQueryRspMsg(uint32_t *msize, void** rspMsg) {
+ SQueryTableRsp rsp = {0};
+ rsp.code = 0;
+ rsp.affectedRows = 0;
+ rsp.tbVerInfo = NULL;
+
+ int32_t msgSize = tSerializeSQueryTableRsp(NULL, 0, &rsp);
+ if (msgSize < 0) {
+ qError("tSerializeSQueryTableRsp failed");
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+
+ void *pRsp = taosMemoryCalloc(msgSize, 1);
+ if (NULL == pRsp) {
+ qError("rpcMallocCont %d failed", msgSize);
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+
+ if (tSerializeSQueryTableRsp(pRsp, msgSize, &rsp) < 0) {
+ qError("tSerializeSQueryTableRsp %d failed", msgSize);
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+
+ *rspMsg = pRsp;
+ *msize = msgSize;
+
+ return TSDB_CODE_SUCCESS;
+}
+
+
+int32_t schtBuildFetchRspMsg(uint32_t *msize, void** rspMsg) {
+ SRetrieveTableRsp* rsp = (SRetrieveTableRsp*)taosMemoryCalloc(sizeof(SRetrieveTableRsp), 1);
+ rsp->completed = 1;
+ rsp->numOfRows = 10;
+ rsp->compLen = 0;
+
+ *rspMsg = rsp;
+ *msize = sizeof(SRetrieveTableRsp);
+
+ return TSDB_CODE_SUCCESS;
+}
+
+int32_t schtBuildSubmitRspMsg(uint32_t *msize, void** rspMsg) {
+ SSubmitRsp2 submitRsp = {0};
+ int32_t msgSize = 0, ret = 0;
+ SEncoder ec = {0};
+
+ tEncodeSize(tEncodeSSubmitRsp2, &submitRsp, msgSize, ret);
+ void* msg = taosMemoryCalloc(1, msgSize);
+ tEncoderInit(&ec, (uint8_t*)msg, msgSize);
+ tEncodeSSubmitRsp2(&ec, &submitRsp);
+ tEncoderClear(&ec);
+
+ *rspMsg = msg;
+ *msize = msgSize;
+
+ return TSDB_CODE_SUCCESS;
+}
+
+
void schtBuildQueryDag(SQueryPlan *dag) {
uint64_t qId = schtQueryId;
@@ -98,8 +156,8 @@ void schtBuildQueryDag(SQueryPlan *dag) {
SNodeListNode *scan = (SNodeListNode *)nodesMakeNode(QUERY_NODE_NODE_LIST);
SNodeListNode *merge = (SNodeListNode *)nodesMakeNode(QUERY_NODE_NODE_LIST);
- SSubplan *scanPlan = (SSubplan *)taosMemoryCalloc(1, sizeof(SSubplan));
- SSubplan *mergePlan = (SSubplan *)taosMemoryCalloc(1, sizeof(SSubplan));
+ SSubplan *scanPlan = (SSubplan*)nodesMakeNode(QUERY_NODE_PHYSICAL_SUBPLAN);
+ SSubplan *mergePlan = (SSubplan*)nodesMakeNode(QUERY_NODE_PHYSICAL_SUBPLAN);
scanPlan->id.queryId = qId;
scanPlan->id.groupId = 0x0000000000000002;
@@ -113,7 +171,7 @@ void schtBuildQueryDag(SQueryPlan *dag) {
scanPlan->pChildren = NULL;
scanPlan->level = 1;
scanPlan->pParents = nodesMakeList();
- scanPlan->pNode = (SPhysiNode *)taosMemoryCalloc(1, sizeof(SPhysiNode));
+ scanPlan->pNode = (SPhysiNode *)nodesMakeNode(QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN);
scanPlan->msgType = TDMT_SCH_QUERY;
mergePlan->id.queryId = qId;
@@ -125,7 +183,7 @@ void schtBuildQueryDag(SQueryPlan *dag) {
mergePlan->pChildren = nodesMakeList();
mergePlan->pParents = NULL;
- mergePlan->pNode = (SPhysiNode *)taosMemoryCalloc(1, sizeof(SPhysiNode));
+ mergePlan->pNode = (SPhysiNode *)nodesMakeNode(QUERY_NODE_PHYSICAL_PLAN_MERGE);
mergePlan->msgType = TDMT_SCH_QUERY;
merge->pNodeList = nodesMakeList();
@@ -151,8 +209,7 @@ void schtBuildQueryFlowCtrlDag(SQueryPlan *dag) {
SNodeListNode *scan = (SNodeListNode *)nodesMakeNode(QUERY_NODE_NODE_LIST);
SNodeListNode *merge = (SNodeListNode *)nodesMakeNode(QUERY_NODE_NODE_LIST);
- SSubplan *scanPlan = (SSubplan *)taosMemoryCalloc(scanPlanNum, sizeof(SSubplan));
- SSubplan *mergePlan = (SSubplan *)taosMemoryCalloc(1, sizeof(SSubplan));
+ SSubplan *mergePlan = (SSubplan*)nodesMakeNode(QUERY_NODE_PHYSICAL_SUBPLAN);
merge->pNodeList = nodesMakeList();
scan->pNodeList = nodesMakeList();
@@ -160,29 +217,30 @@ void schtBuildQueryFlowCtrlDag(SQueryPlan *dag) {
mergePlan->pChildren = nodesMakeList();
for (int32_t i = 0; i < scanPlanNum; ++i) {
- scanPlan[i].id.queryId = qId;
- scanPlan[i].id.groupId = 0x0000000000000002;
- scanPlan[i].id.subplanId = 0x0000000000000003 + i;
- scanPlan[i].subplanType = SUBPLAN_TYPE_SCAN;
+ SSubplan *scanPlan = (SSubplan*)nodesMakeNode(QUERY_NODE_PHYSICAL_SUBPLAN);
+ scanPlan->id.queryId = qId;
+ scanPlan->id.groupId = 0x0000000000000002;
+ scanPlan->id.subplanId = 0x0000000000000003 + i;
+ scanPlan->subplanType = SUBPLAN_TYPE_SCAN;
- scanPlan[i].execNode.nodeId = 1 + i;
- scanPlan[i].execNode.epSet.inUse = 0;
- scanPlan[i].execNodeStat.tableNum = taosRand() % 30;
- addEpIntoEpSet(&scanPlan[i].execNode.epSet, "ep0", 6030);
- addEpIntoEpSet(&scanPlan[i].execNode.epSet, "ep1", 6030);
- addEpIntoEpSet(&scanPlan[i].execNode.epSet, "ep2", 6030);
- scanPlan[i].execNode.epSet.inUse = taosRand() % 3;
+ scanPlan->execNode.nodeId = 1 + i;
+ scanPlan->execNode.epSet.inUse = 0;
+ scanPlan->execNodeStat.tableNum = taosRand() % 30;
+ addEpIntoEpSet(&scanPlan->execNode.epSet, "ep0", 6030);
+ addEpIntoEpSet(&scanPlan->execNode.epSet, "ep1", 6030);
+ addEpIntoEpSet(&scanPlan->execNode.epSet, "ep2", 6030);
+ scanPlan->execNode.epSet.inUse = taosRand() % 3;
- scanPlan[i].pChildren = NULL;
- scanPlan[i].level = 1;
- scanPlan[i].pParents = nodesMakeList();
- scanPlan[i].pNode = (SPhysiNode *)taosMemoryCalloc(1, sizeof(SPhysiNode));
- scanPlan[i].msgType = TDMT_SCH_QUERY;
+ scanPlan->pChildren = NULL;
+ scanPlan->level = 1;
+ scanPlan->pParents = nodesMakeList();
+ scanPlan->pNode = (SPhysiNode *)nodesMakeNode(QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN);
+ scanPlan->msgType = TDMT_SCH_QUERY;
- nodesListAppend(scanPlan[i].pParents, (SNode *)mergePlan);
- nodesListAppend(mergePlan->pChildren, (SNode *)(scanPlan + i));
+ nodesListAppend(scanPlan->pParents, (SNode *)mergePlan);
+ nodesListAppend(mergePlan->pChildren, (SNode *)scanPlan);
- nodesListAppend(scan->pNodeList, (SNode *)(scanPlan + i));
+ nodesListAppend(scan->pNodeList, (SNode *)scanPlan);
}
mergePlan->id.queryId = qId;
@@ -193,7 +251,7 @@ void schtBuildQueryFlowCtrlDag(SQueryPlan *dag) {
mergePlan->execNode.epSet.numOfEps = 0;
mergePlan->pParents = NULL;
- mergePlan->pNode = (SPhysiNode *)taosMemoryCalloc(1, sizeof(SPhysiNode));
+ mergePlan->pNode = (SPhysiNode *)nodesMakeNode(QUERY_NODE_PHYSICAL_PLAN_MERGE);
mergePlan->msgType = TDMT_SCH_QUERY;
nodesListAppend(merge->pNodeList, (SNode *)mergePlan);
@@ -211,45 +269,50 @@ void schtBuildInsertDag(SQueryPlan *dag) {
dag->numOfSubplans = 2;
dag->pSubplans = nodesMakeList();
SNodeListNode *inserta = (SNodeListNode *)nodesMakeNode(QUERY_NODE_NODE_LIST);
-
- SSubplan *insertPlan = (SSubplan *)taosMemoryCalloc(2, sizeof(SSubplan));
-
- insertPlan[0].id.queryId = qId;
- insertPlan[0].id.groupId = 0x0000000000000003;
- insertPlan[0].id.subplanId = 0x0000000000000004;
- insertPlan[0].subplanType = SUBPLAN_TYPE_MODIFY;
- insertPlan[0].level = 0;
-
- insertPlan[0].execNode.nodeId = 1;
- insertPlan[0].execNode.epSet.inUse = 0;
- addEpIntoEpSet(&insertPlan[0].execNode.epSet, "ep0", 6030);
-
- insertPlan[0].pChildren = NULL;
- insertPlan[0].pParents = NULL;
- insertPlan[0].pNode = NULL;
- insertPlan[0].pDataSink = (SDataSinkNode *)taosMemoryCalloc(1, sizeof(SDataSinkNode));
- insertPlan[0].msgType = TDMT_VND_SUBMIT;
-
- insertPlan[1].id.queryId = qId;
- insertPlan[1].id.groupId = 0x0000000000000003;
- insertPlan[1].id.subplanId = 0x0000000000000005;
- insertPlan[1].subplanType = SUBPLAN_TYPE_MODIFY;
- insertPlan[1].level = 0;
-
- insertPlan[1].execNode.nodeId = 1;
- insertPlan[1].execNode.epSet.inUse = 0;
- addEpIntoEpSet(&insertPlan[1].execNode.epSet, "ep0", 6030);
-
- insertPlan[1].pChildren = NULL;
- insertPlan[1].pParents = NULL;
- insertPlan[1].pNode = NULL;
- insertPlan[1].pDataSink = (SDataSinkNode *)taosMemoryCalloc(1, sizeof(SDataSinkNode));
- insertPlan[1].msgType = TDMT_VND_SUBMIT;
-
inserta->pNodeList = nodesMakeList();
+ SSubplan *insertPlan = (SSubplan*)nodesMakeNode(QUERY_NODE_PHYSICAL_SUBPLAN);
+
+ insertPlan->id.queryId = qId;
+ insertPlan->id.groupId = 0x0000000000000003;
+ insertPlan->id.subplanId = 0x0000000000000004;
+ insertPlan->subplanType = SUBPLAN_TYPE_MODIFY;
+ insertPlan->level = 0;
+
+ insertPlan->execNode.nodeId = 1;
+ insertPlan->execNode.epSet.inUse = 0;
+ addEpIntoEpSet(&insertPlan->execNode.epSet, "ep0", 6030);
+
+ insertPlan->pChildren = NULL;
+ insertPlan->pParents = NULL;
+ insertPlan->pNode = NULL;
+ insertPlan->pDataSink = (SDataSinkNode*)nodesMakeNode(QUERY_NODE_PHYSICAL_PLAN_INSERT);
+ ((SDataInserterNode*)insertPlan->pDataSink)->size = 1;
+ ((SDataInserterNode*)insertPlan->pDataSink)->pData = taosMemoryCalloc(1, 1);
+ insertPlan->msgType = TDMT_VND_SUBMIT;
+
nodesListAppend(inserta->pNodeList, (SNode *)insertPlan);
- insertPlan += 1;
+
+ insertPlan = (SSubplan*)nodesMakeNode(QUERY_NODE_PHYSICAL_SUBPLAN);
+
+ insertPlan->id.queryId = qId;
+ insertPlan->id.groupId = 0x0000000000000003;
+ insertPlan->id.subplanId = 0x0000000000000005;
+ insertPlan->subplanType = SUBPLAN_TYPE_MODIFY;
+ insertPlan->level = 0;
+
+ insertPlan->execNode.nodeId = 1;
+ insertPlan->execNode.epSet.inUse = 0;
+ addEpIntoEpSet(&insertPlan->execNode.epSet, "ep0", 6030);
+
+ insertPlan->pChildren = NULL;
+ insertPlan->pParents = NULL;
+ insertPlan->pNode = NULL;
+ insertPlan->pDataSink = (SDataSinkNode*)nodesMakeNode(QUERY_NODE_PHYSICAL_PLAN_INSERT);
+ ((SDataInserterNode*)insertPlan->pDataSink)->size = 1;
+ ((SDataInserterNode*)insertPlan->pDataSink)->pData = taosMemoryCalloc(1, 1);
+ insertPlan->msgType = TDMT_VND_SUBMIT;
+
nodesListAppend(inserta->pNodeList, (SNode *)insertPlan);
nodesListAppend(dag->pSubplans, (SNode *)inserta);
@@ -325,7 +388,7 @@ void schtSetRpcSendRequest() {
}
}
-int32_t schtAsyncSendMsgToServer(void *pTransporter, SEpSet *epSet, int64_t *pTransporterId, SMsgSendInfo *pInfo) {
+int32_t schtAsyncSendMsgToServer(void *pTransporter, SEpSet *epSet, int64_t *pTransporterId, SMsgSendInfo *pInfo, bool persistHandle, void* rpcCtx) {
if (pInfo) {
taosMemoryFreeClear(pInfo->param);
taosMemoryFreeClear(pInfo->msgInfo.pData);
@@ -336,17 +399,17 @@ int32_t schtAsyncSendMsgToServer(void *pTransporter, SEpSet *epSet, int64_t *pTr
void schtSetAsyncSendMsgToServer() {
static Stub stub;
- stub.set(asyncSendMsgToServer, schtAsyncSendMsgToServer);
+ stub.set(asyncSendMsgToServerExt, schtAsyncSendMsgToServer);
{
#ifdef WINDOWS
AddrAny any;
std::map result;
- any.get_func_addr("asyncSendMsgToServer", result);
+ any.get_func_addr("asyncSendMsgToServerExt", result);
#endif
#ifdef LINUX
AddrAny any("libtransport.so");
std::map result;
- any.get_global_func_addr_dynsym("^asyncSendMsgToServer$", result);
+ any.get_global_func_addr_dynsym("^asyncSendMsgToServerExt$", result);
#endif
for (const auto &f : result) {
stub.set(f.second, schtAsyncSendMsgToServer);
@@ -374,9 +437,13 @@ void *schtSendRsp(void *param) {
while (pIter) {
SSchTask *task = *(SSchTask **)pIter;
- SSubmitRsp rsp = {0};
- rsp.affectedRows = 10;
- schHandleResponseMsg(pJob, task, TDMT_VND_SUBMIT_RSP, (char *)&rsp, sizeof(rsp), 0);
+ SDataBuf msg = {0};
+ void* rmsg = NULL;
+ schtBuildSubmitRspMsg(&msg.len, &rmsg);
+ msg.msgType = TDMT_VND_SUBMIT_RSP;
+ msg.pData = rmsg;
+
+ schHandleResponseMsg(pJob, task, task->execId, &msg, 0);
pIter = taosHashIterate(pJob->execTasks, pIter);
}
@@ -393,11 +460,13 @@ void *schtCreateFetchRspThread(void *param) {
taosSsleep(1);
int32_t code = 0;
- SRetrieveTableRsp *rsp = (SRetrieveTableRsp *)taosMemoryCalloc(1, sizeof(SRetrieveTableRsp));
- rsp->completed = 1;
- rsp->numOfRows = 10;
-
- code = schHandleResponseMsg(pJob, pJob->fetchTask, TDMT_SCH_FETCH_RSP, (char *)rsp, sizeof(*rsp), 0);
+ SDataBuf msg = {0};
+ void* rmsg = NULL;
+ schtBuildFetchRspMsg(&msg.len, &rmsg);
+ msg.msgType = TDMT_SCH_MERGE_FETCH_RSP;
+ msg.pData = rmsg;
+
+ code = schHandleResponseMsg(pJob, pJob->fetchTask, pJob->fetchTask->execId, &msg, 0);
schReleaseJob(job);
@@ -414,7 +483,7 @@ void *schtFetchRspThread(void *aa) {
continue;
}
- taosUsleep(1);
+ taosUsleep(100);
param = (SSchTaskCallbackParam *)taosMemoryCalloc(1, sizeof(*param));
@@ -426,10 +495,11 @@ void *schtFetchRspThread(void *aa) {
rsp->completed = 1;
rsp->numOfRows = 10;
+ dataBuf.msgType = TDMT_SCH_FETCH_RSP;
dataBuf.pData = rsp;
dataBuf.len = sizeof(*rsp);
- code = schHandleCallback(param, &dataBuf, TDMT_SCH_FETCH_RSP, 0);
+ code = schHandleCallback(param, &dataBuf, 0);
assert(code == 0 || code);
}
@@ -456,7 +526,7 @@ void *schtRunJobThread(void *aa) {
char *dbname = "1.db1";
char *tablename = "table1";
SVgroupInfo vgInfo = {0};
- SQueryPlan dag;
+ SQueryPlan* dag = (SQueryPlan*)nodesMakeNode(QUERY_NODE_PHYSICAL_PLAN);
schtInitLogFile();
@@ -470,19 +540,19 @@ void *schtRunJobThread(void *aa) {
SSchJob *pJob = NULL;
SSchTaskCallbackParam *param = NULL;
SHashObj *execTasks = NULL;
- SDataBuf dataBuf = {0};
uint32_t jobFinished = 0;
int32_t queryDone = 0;
while (!schtTestStop) {
- schtBuildQueryDag(&dag);
+ schtBuildQueryDag(dag);
- SArray *qnodeList = taosArrayInit(1, sizeof(SEp));
+ SArray *qnodeList = taosArrayInit(1, sizeof(SQueryNodeLoad));
- SEp qnodeAddr = {0};
- strcpy(qnodeAddr.fqdn, "qnode0.ep");
- qnodeAddr.port = 6031;
- taosArrayPush(qnodeList, &qnodeAddr);
+ SQueryNodeLoad load = {0};
+ load.addr.epSet.numOfEps = 1;
+ strcpy(load.addr.epSet.eps[0].fqdn, "qnode0.ep");
+ load.addr.epSet.eps[0].port = 6031;
+ taosArrayPush(qnodeList, &load);
queryDone = 0;
@@ -492,7 +562,7 @@ void *schtRunJobThread(void *aa) {
req.syncReq = false;
req.pConn = &conn;
req.pNodeList = qnodeList;
- req.pDag = &dag;
+ req.pDag = dag;
req.sql = "select * from tb";
req.execFp = schtQueryCb;
req.cbParam = &queryDone;
@@ -503,7 +573,7 @@ void *schtRunJobThread(void *aa) {
pJob = schAcquireJob(queryJobRefId);
if (NULL == pJob) {
taosArrayDestroy(qnodeList);
- schtFreeQueryDag(&dag);
+ schtFreeQueryDag(dag);
continue;
}
@@ -526,11 +596,14 @@ void *schtRunJobThread(void *aa) {
SSchTask *task = (SSchTask *)pIter;
param->taskId = task->taskId;
- SQueryTableRsp rsp = {0};
- dataBuf.pData = &rsp;
- dataBuf.len = sizeof(rsp);
- code = schHandleCallback(param, &dataBuf, TDMT_SCH_QUERY_RSP, 0);
+ SDataBuf msg = {0};
+ void* rmsg = NULL;
+ schtBuildQueryRspMsg(&msg.len, &rmsg);
+ msg.msgType = TDMT_SCH_QUERY_RSP;
+ msg.pData = rmsg;
+
+ code = schHandleCallback(param, &msg, 0);
assert(code == 0 || code);
pIter = taosHashIterate(execTasks, pIter);
@@ -545,11 +618,13 @@ void *schtRunJobThread(void *aa) {
SSchTask *task = (SSchTask *)pIter;
param->taskId = task->taskId - 1;
- SQueryTableRsp rsp = {0};
- dataBuf.pData = &rsp;
- dataBuf.len = sizeof(rsp);
+ SDataBuf msg = {0};
+ void* rmsg = NULL;
+ schtBuildQueryRspMsg(&msg.len, &rmsg);
+ msg.msgType = TDMT_SCH_QUERY_RSP;
+ msg.pData = rmsg;
- code = schHandleCallback(param, &dataBuf, TDMT_SCH_QUERY_RSP, 0);
+ code = schHandleCallback(param, &msg, 0);
assert(code == 0 || code);
pIter = taosHashIterate(execTasks, pIter);
@@ -575,7 +650,6 @@ void *schtRunJobThread(void *aa) {
if (0 == code) {
SRetrieveTableRsp *pRsp = (SRetrieveTableRsp *)data;
assert(pRsp->completed == 1);
- assert(pRsp->numOfRows == 10);
}
data = NULL;
@@ -587,7 +661,7 @@ void *schtRunJobThread(void *aa) {
taosHashCleanup(execTasks);
taosArrayDestroy(qnodeList);
- schtFreeQueryDag(&dag);
+ schtFreeQueryDag(dag);
if (++jobFinished % schtTestPrintNum == 0) {
printf("jobFinished:%d\n", jobFinished);
@@ -609,6 +683,7 @@ void *schtFreeJobThread(void *aa) {
return NULL;
}
+
} // namespace
TEST(queryTest, normalCase) {
@@ -618,21 +693,20 @@ TEST(queryTest, normalCase) {
char *tablename = "table1";
SVgroupInfo vgInfo = {0};
int64_t job = 0;
- SQueryPlan dag;
+ SQueryPlan* dag = (SQueryPlan*)nodesMakeNode(QUERY_NODE_PHYSICAL_PLAN);
- memset(&dag, 0, sizeof(dag));
+ SArray *qnodeList = taosArrayInit(1, sizeof(SQueryNodeLoad));
- SArray *qnodeList = taosArrayInit(1, sizeof(SEp));
-
- SEp qnodeAddr = {0};
- strcpy(qnodeAddr.fqdn, "qnode0.ep");
- qnodeAddr.port = 6031;
- taosArrayPush(qnodeList, &qnodeAddr);
+ SQueryNodeLoad load = {0};
+ load.addr.epSet.numOfEps = 1;
+ strcpy(load.addr.epSet.eps[0].fqdn, "qnode0.ep");
+ load.addr.epSet.eps[0].port = 6031;
+ taosArrayPush(qnodeList, &load);
int32_t code = schedulerInit();
ASSERT_EQ(code, 0);
- schtBuildQueryDag(&dag);
+ schtBuildQueryDag(dag);
schtSetPlanToString();
schtSetExecNode();
@@ -645,7 +719,7 @@ TEST(queryTest, normalCase) {
SSchedulerReq req = {0};
req.pConn = &conn;
req.pNodeList = qnodeList;
- req.pDag = &dag;
+ req.pDag = dag;
req.sql = "select * from tb";
req.execFp = schtQueryCb;
req.cbParam = &queryDone;
@@ -659,9 +733,14 @@ TEST(queryTest, normalCase) {
while (pIter) {
SSchTask *task = *(SSchTask **)pIter;
- SQueryTableRsp rsp = {0};
- code = schHandleResponseMsg(pJob, task, TDMT_SCH_QUERY_RSP, (char *)&rsp, sizeof(rsp), 0);
-
+ SDataBuf msg = {0};
+ void* rmsg = NULL;
+ schtBuildQueryRspMsg(&msg.len, &rmsg);
+ msg.msgType = TDMT_SCH_QUERY_RSP;
+ msg.pData = rmsg;
+
+ code = schHandleResponseMsg(pJob, task, task->execId, &msg, 0);
+
ASSERT_EQ(code, 0);
pIter = taosHashIterate(pJob->execTasks, pIter);
}
@@ -669,11 +748,18 @@ TEST(queryTest, normalCase) {
pIter = taosHashIterate(pJob->execTasks, NULL);
while (pIter) {
SSchTask *task = *(SSchTask **)pIter;
+ if (JOB_TASK_STATUS_EXEC == task->status) {
+ SDataBuf msg = {0};
+ void* rmsg = NULL;
+ schtBuildQueryRspMsg(&msg.len, &rmsg);
+ msg.msgType = TDMT_SCH_QUERY_RSP;
+ msg.pData = rmsg;
+
+ code = schHandleResponseMsg(pJob, task, task->execId, &msg, 0);
+
+ ASSERT_EQ(code, 0);
+ }
- SQueryTableRsp rsp = {0};
- code = schHandleResponseMsg(pJob, task, TDMT_SCH_QUERY_RSP, (char *)&rsp, sizeof(rsp), 0);
-
- ASSERT_EQ(code, 0);
pIter = taosHashIterate(pJob->execTasks, pIter);
}
@@ -703,18 +789,12 @@ TEST(queryTest, normalCase) {
ASSERT_EQ(pRsp->numOfRows, 10);
taosMemoryFreeClear(data);
- data = NULL;
- code = schedulerFetchRows(job, &req);
- ASSERT_EQ(code, 0);
- ASSERT_TRUE(data == NULL);
-
schReleaseJob(job);
+
+ schedulerDestroy();
schedulerFreeJob(&job, 0);
- schtFreeQueryDag(&dag);
-
- schedulerDestroy();
}
TEST(queryTest, readyFirstCase) {
@@ -724,21 +804,20 @@ TEST(queryTest, readyFirstCase) {
char *tablename = "table1";
SVgroupInfo vgInfo = {0};
int64_t job = 0;
- SQueryPlan dag;
+ SQueryPlan* dag = (SQueryPlan*)nodesMakeNode(QUERY_NODE_PHYSICAL_PLAN);
- memset(&dag, 0, sizeof(dag));
+ SArray *qnodeList = taosArrayInit(1, sizeof(SQueryNodeLoad));
- SArray *qnodeList = taosArrayInit(1, sizeof(SEp));
-
- SEp qnodeAddr = {0};
- strcpy(qnodeAddr.fqdn, "qnode0.ep");
- qnodeAddr.port = 6031;
- taosArrayPush(qnodeList, &qnodeAddr);
+ SQueryNodeLoad load = {0};
+ load.addr.epSet.numOfEps = 1;
+ strcpy(load.addr.epSet.eps[0].fqdn, "qnode0.ep");
+ load.addr.epSet.eps[0].port = 6031;
+ taosArrayPush(qnodeList, &load);
int32_t code = schedulerInit();
ASSERT_EQ(code, 0);
- schtBuildQueryDag(&dag);
+ schtBuildQueryDag(dag);
schtSetPlanToString();
schtSetExecNode();
@@ -751,7 +830,7 @@ TEST(queryTest, readyFirstCase) {
SSchedulerReq req = {0};
req.pConn = &conn;
req.pNodeList = qnodeList;
- req.pDag = &dag;
+ req.pDag = dag;
req.sql = "select * from tb";
req.execFp = schtQueryCb;
req.cbParam = &queryDone;
@@ -764,8 +843,13 @@ TEST(queryTest, readyFirstCase) {
while (pIter) {
SSchTask *task = *(SSchTask **)pIter;
- SQueryTableRsp rsp = {0};
- code = schHandleResponseMsg(pJob, task, TDMT_SCH_QUERY_RSP, (char *)&rsp, sizeof(rsp), 0);
+ SDataBuf msg = {0};
+ void* rmsg = NULL;
+ schtBuildQueryRspMsg(&msg.len, &rmsg);
+ msg.msgType = TDMT_SCH_QUERY_RSP;
+ msg.pData = rmsg;
+
+ code = schHandleResponseMsg(pJob, task, task->execId, &msg, 0);
ASSERT_EQ(code, 0);
pIter = taosHashIterate(pJob->execTasks, pIter);
@@ -775,10 +859,18 @@ TEST(queryTest, readyFirstCase) {
while (pIter) {
SSchTask *task = *(SSchTask **)pIter;
- SQueryTableRsp rsp = {0};
- code = schHandleResponseMsg(pJob, task, TDMT_SCH_QUERY_RSP, (char *)&rsp, sizeof(rsp), 0);
+ if (JOB_TASK_STATUS_EXEC == task->status) {
+ SDataBuf msg = {0};
+ void* rmsg = NULL;
+ schtBuildQueryRspMsg(&msg.len, &rmsg);
+ msg.msgType = TDMT_SCH_QUERY_RSP;
+ msg.pData = rmsg;
+
+ code = schHandleResponseMsg(pJob, task, task->execId, &msg, 0);
+
+ ASSERT_EQ(code, 0);
+ }
- ASSERT_EQ(code, 0);
pIter = taosHashIterate(pJob->execTasks, pIter);
}
@@ -807,18 +899,11 @@ TEST(queryTest, readyFirstCase) {
ASSERT_EQ(pRsp->numOfRows, 10);
taosMemoryFreeClear(data);
- data = NULL;
- code = schedulerFetchRows(job, &req);
- ASSERT_EQ(code, 0);
- ASSERT_TRUE(data == NULL);
-
schReleaseJob(job);
- schedulerFreeJob(&job, 0);
-
- schtFreeQueryDag(&dag);
-
schedulerDestroy();
+
+ schedulerFreeJob(&job, 0);
}
TEST(queryTest, flowCtrlCase) {
@@ -828,35 +913,39 @@ TEST(queryTest, flowCtrlCase) {
char *tablename = "table1";
SVgroupInfo vgInfo = {0};
int64_t job = 0;
- SQueryPlan dag;
+ SQueryPlan* dag = (SQueryPlan*)nodesMakeNode(QUERY_NODE_PHYSICAL_PLAN);
schtInitLogFile();
taosSeedRand(taosGetTimestampSec());
- SArray *qnodeList = taosArrayInit(1, sizeof(SEp));
+ SArray *qnodeList = taosArrayInit(1, sizeof(SQueryNodeLoad));
+
+ SQueryNodeLoad load = {0};
+ load.addr.epSet.numOfEps = 1;
+ strcpy(load.addr.epSet.eps[0].fqdn, "qnode0.ep");
+ load.addr.epSet.eps[0].port = 6031;
+ taosArrayPush(qnodeList, &load);
- SEp qnodeAddr = {0};
- strcpy(qnodeAddr.fqdn, "qnode0.ep");
- qnodeAddr.port = 6031;
- taosArrayPush(qnodeList, &qnodeAddr);
int32_t code = schedulerInit();
ASSERT_EQ(code, 0);
- schtBuildQueryFlowCtrlDag(&dag);
+ schtBuildQueryFlowCtrlDag(dag);
schtSetPlanToString();
schtSetExecNode();
schtSetAsyncSendMsgToServer();
+ initTaskQueue();
+
int32_t queryDone = 0;
SRequestConnInfo conn = {0};
conn.pTrans = mockPointer;
SSchedulerReq req = {0};
req.pConn = &conn;
req.pNodeList = qnodeList;
- req.pDag = &dag;
+ req.pDag = dag;
req.sql = "select * from tb";
req.execFp = schtQueryCb;
req.cbParam = &queryDone;
@@ -866,41 +955,27 @@ TEST(queryTest, flowCtrlCase) {
SSchJob *pJob = schAcquireJob(job);
- bool qDone = false;
-
- while (!qDone) {
+ while (!queryDone) {
void *pIter = taosHashIterate(pJob->execTasks, NULL);
- if (NULL == pIter) {
- break;
- }
-
while (pIter) {
SSchTask *task = *(SSchTask **)pIter;
- taosHashCancelIterate(pJob->execTasks, pIter);
-
- if (task->lastMsgType == TDMT_SCH_QUERY) {
- SQueryTableRsp rsp = {0};
- code = schHandleResponseMsg(pJob, task, TDMT_SCH_QUERY_RSP, (char *)&rsp, sizeof(rsp), 0);
-
+ if (JOB_TASK_STATUS_EXEC == task->status && 0 != task->lastMsgType) {
+ SDataBuf msg = {0};
+ void* rmsg = NULL;
+ schtBuildQueryRspMsg(&msg.len, &rmsg);
+ msg.msgType = TDMT_SCH_QUERY_RSP;
+ msg.pData = rmsg;
+
+ code = schHandleResponseMsg(pJob, task, task->execId, &msg, 0);
+
ASSERT_EQ(code, 0);
- } else {
- qDone = true;
- break;
}
- pIter = NULL;
+ pIter = taosHashIterate(pJob->execTasks, pIter);
}
}
- while (true) {
- if (queryDone) {
- break;
- }
-
- taosUsleep(10000);
- }
-
TdThreadAttr thattr;
taosThreadAttrInit(&thattr);
@@ -918,18 +993,11 @@ TEST(queryTest, flowCtrlCase) {
ASSERT_EQ(pRsp->numOfRows, 10);
taosMemoryFreeClear(data);
- data = NULL;
- code = schedulerFetchRows(job, &req);
- ASSERT_EQ(code, 0);
- ASSERT_TRUE(data == NULL);
-
schReleaseJob(job);
- schedulerFreeJob(&job, 0);
-
- schtFreeQueryDag(&dag);
-
schedulerDestroy();
+
+ schedulerFreeJob(&job, 0);
}
TEST(insertTest, normalCase) {
@@ -938,20 +1006,21 @@ TEST(insertTest, normalCase) {
char *dbname = "1.db1";
char *tablename = "table1";
SVgroupInfo vgInfo = {0};
- SQueryPlan dag;
+ SQueryPlan* dag = (SQueryPlan*)nodesMakeNode(QUERY_NODE_PHYSICAL_PLAN);
uint64_t numOfRows = 0;
- SArray *qnodeList = taosArrayInit(1, sizeof(SEp));
+ SArray *qnodeList = taosArrayInit(1, sizeof(SQueryNodeLoad));
- SEp qnodeAddr = {0};
- strcpy(qnodeAddr.fqdn, "qnode0.ep");
- qnodeAddr.port = 6031;
- taosArrayPush(qnodeList, &qnodeAddr);
+ SQueryNodeLoad load = {0};
+ load.addr.epSet.numOfEps = 1;
+ strcpy(load.addr.epSet.eps[0].fqdn, "qnode0.ep");
+ load.addr.epSet.eps[0].port = 6031;
+ taosArrayPush(qnodeList, &load);
int32_t code = schedulerInit();
ASSERT_EQ(code, 0);
- schtBuildInsertDag(&dag);
+ schtBuildInsertDag(dag);
schtSetPlanToString();
schtSetAsyncSendMsgToServer();
@@ -962,21 +1031,19 @@ TEST(insertTest, normalCase) {
TdThread thread1;
taosThreadCreate(&(thread1), &thattr, schtSendRsp, &insertJobRefId);
- SExecResult res = {0};
-
+ int32_t queryDone = 0;
SRequestConnInfo conn = {0};
conn.pTrans = mockPointer;
SSchedulerReq req = {0};
req.pConn = &conn;
req.pNodeList = qnodeList;
- req.pDag = &dag;
+ req.pDag = dag;
req.sql = "insert into tb values(now,1)";
req.execFp = schtQueryCb;
- req.cbParam = NULL;
+ req.cbParam = &queryDone;
code = schedulerExecJob(&req, &insertJobRefId);
ASSERT_EQ(code, 0);
- ASSERT_EQ(res.numOfRows, 20);
schedulerFreeJob(&insertJobRefId, 0);
@@ -989,7 +1056,7 @@ TEST(multiThread, forceFree) {
TdThread thread1, thread2, thread3;
taosThreadCreate(&(thread1), &thattr, schtRunJobThread, NULL);
- taosThreadCreate(&(thread2), &thattr, schtFreeJobThread, NULL);
+// taosThreadCreate(&(thread2), &thattr, schtFreeJobThread, NULL);
taosThreadCreate(&(thread3), &thattr, schtFetchRspThread, NULL);
while (true) {
@@ -1002,7 +1069,7 @@ TEST(multiThread, forceFree) {
}
schtTestStop = true;
- taosSsleep(3);
+ //taosSsleep(3);
}
int main(int argc, char **argv) {
diff --git a/source/libs/stream/src/streamDispatch.c b/source/libs/stream/src/streamDispatch.c
index 98d9a29c87..626f7fc161 100644
--- a/source/libs/stream/src/streamDispatch.c
+++ b/source/libs/stream/src/streamDispatch.c
@@ -569,6 +569,7 @@ int32_t streamSearchAndAddBlock(SStreamTask* pTask, SStreamDispatchReq* pReqs, S
char ctbName[TSDB_TABLE_FNAME_LEN] = {0};
if (pDataBlock->info.parTbName[0]) {
if(pTask->ver >= SSTREAM_TASK_SUBTABLE_CHANGED_VER &&
+ pTask->subtableWithoutMd5 != 1 &&
!isAutoTableName(pDataBlock->info.parTbName) &&
!alreadyAddGroupId(pDataBlock->info.parTbName) &&
groupId != 0){
diff --git a/source/libs/stream/src/streamTask.c b/source/libs/stream/src/streamTask.c
index 2f832f608e..db3d2729af 100644
--- a/source/libs/stream/src/streamTask.c
+++ b/source/libs/stream/src/streamTask.c
@@ -80,7 +80,7 @@ static SStreamChildEpInfo* createStreamTaskEpInfo(const SStreamTask* pTask) {
}
SStreamTask* tNewStreamTask(int64_t streamId, int8_t taskLevel, SEpSet* pEpset, bool fillHistory, int64_t triggerParam,
- SArray* pTaskList, bool hasFillhistory) {
+ SArray* pTaskList, bool hasFillhistory, int8_t subtableWithoutMd5) {
SStreamTask* pTask = (SStreamTask*)taosMemoryCalloc(1, sizeof(SStreamTask));
if (pTask == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
@@ -96,6 +96,7 @@ SStreamTask* tNewStreamTask(int64_t streamId, int8_t taskLevel, SEpSet* pEpset,
pTask->info.taskLevel = taskLevel;
pTask->info.fillHistory = fillHistory;
pTask->info.triggerParam = triggerParam;
+ pTask->subtableWithoutMd5 = subtableWithoutMd5;
pTask->status.pSM = streamCreateStateMachine(pTask);
if (pTask->status.pSM == NULL) {
@@ -205,6 +206,7 @@ int32_t tEncodeStreamTask(SEncoder* pEncoder, const SStreamTask* pTask) {
if (tEncodeCStr(pEncoder, pTask->outputInfo.shuffleDispatcher.stbFullName) < 0) return -1;
}
if (tEncodeI64(pEncoder, pTask->info.triggerParam) < 0) return -1;
+ if (tEncodeI8(pEncoder, pTask->subtableWithoutMd5) < 0) return -1;
if (tEncodeCStrWithLen(pEncoder, pTask->reserve, sizeof(pTask->reserve) - 1) < 0) return -1;
tEndEncode(pEncoder);
@@ -287,6 +289,7 @@ int32_t tDecodeStreamTask(SDecoder* pDecoder, SStreamTask* pTask) {
if (tDecodeCStrTo(pDecoder, pTask->outputInfo.shuffleDispatcher.stbFullName) < 0) return -1;
}
if (tDecodeI64(pDecoder, &pTask->info.triggerParam) < 0) return -1;
+ if (tDecodeI8(pDecoder, &pTask->subtableWithoutMd5) < 0) return -1;
if (tDecodeCStrTo(pDecoder, pTask->reserve) < 0) return -1;
tEndDecode(pDecoder);
diff --git a/source/libs/stream/src/streamUpdate.c b/source/libs/stream/src/streamUpdate.c
index d607f26de3..454ed4297c 100644
--- a/source/libs/stream/src/streamUpdate.c
+++ b/source/libs/stream/src/streamUpdate.c
@@ -261,6 +261,7 @@ void updateInfoDestroy(SUpdateInfo *pInfo) {
taosArrayDestroy(pInfo->pTsSBFs);
taosHashCleanup(pInfo->pMap);
+ updateInfoDestoryColseWinSBF(pInfo);
taosMemoryFree(pInfo);
}
diff --git a/source/libs/transport/src/trans.c b/source/libs/transport/src/trans.c
index 64302a78fc..f658947144 100644
--- a/source/libs/transport/src/trans.c
+++ b/source/libs/transport/src/trans.c
@@ -140,11 +140,7 @@ void* rpcMallocCont(int64_t contLen) {
return start + sizeof(STransMsgHead);
}
-void rpcFreeCont(void* cont) {
- if (cont == NULL) return;
- taosMemoryFree((char*)cont - TRANS_MSG_OVERHEAD);
- tTrace("rpc free cont:%p", (char*)cont - TRANS_MSG_OVERHEAD);
-}
+void rpcFreeCont(void* cont) { transFreeMsg(cont); }
void* rpcReallocCont(void* ptr, int64_t contLen) {
if (ptr == NULL) return rpcMallocCont(contLen);
diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c
index b6942655a9..798a5bf54f 100644
--- a/source/libs/transport/src/transCli.c
+++ b/source/libs/transport/src/transCli.c
@@ -218,7 +218,6 @@ static void (*cliAsyncHandle[])(SCliMsg* pMsg, SCliThrd* pThrd) = {cliHandleReq,
/// static void (*cliAsyncHandle[])(SCliMsg* pMsg, SCliThrd* pThrd) = {cliHandleReq, cliHandleQuit, cliHandleRelease,
/// NULL,cliHandleUpdate};
-static FORCE_INLINE void destroyUserdata(STransMsg* userdata);
static FORCE_INLINE void destroyCmsg(void* cmsg);
static FORCE_INLINE void destroyCmsgAndAhandle(void* cmsg);
static FORCE_INLINE int cliRBChoseIdx(STrans* pTransInst);
@@ -1950,14 +1949,6 @@ _err:
return NULL;
}
-static FORCE_INLINE void destroyUserdata(STransMsg* userdata) {
- if (userdata->pCont == NULL) {
- return;
- }
- transFreeMsg(userdata->pCont);
- userdata->pCont = NULL;
-}
-
static FORCE_INLINE void destroyCmsg(void* arg) {
SCliMsg* pMsg = arg;
if (pMsg == NULL) {
@@ -1965,7 +1956,7 @@ static FORCE_INLINE void destroyCmsg(void* arg) {
}
transDestroyConnCtx(pMsg->ctx);
- destroyUserdata(&pMsg->msg);
+ transFreeMsg(pMsg->msg.pCont);
taosMemoryFree(pMsg);
}
@@ -1984,7 +1975,7 @@ static FORCE_INLINE void destroyCmsgAndAhandle(void* param) {
tDebug("destroy Ahandle C");
transDestroyConnCtx(pMsg->ctx);
- destroyUserdata(&pMsg->msg);
+ transFreeMsg(pMsg->msg.pCont);
taosMemoryFree(pMsg);
}
diff --git a/source/libs/transport/src/transComm.c b/source/libs/transport/src/transComm.c
index b1fb9a2450..4619722743 100644
--- a/source/libs/transport/src/transComm.c
+++ b/source/libs/transport/src/transComm.c
@@ -87,6 +87,7 @@ void transFreeMsg(void* msg) {
if (msg == NULL) {
return;
}
+ tTrace("rpc free cont:%p", (char*)msg - TRANS_MSG_OVERHEAD);
taosMemoryFree((char*)msg - sizeof(STransMsgHead));
}
int transSockInfo2Str(struct sockaddr* sockname, char* dst) {
diff --git a/source/os/src/osFile.c b/source/os/src/osFile.c
index f4e35c5b7f..bab9ba0cea 100644
--- a/source/os/src/osFile.c
+++ b/source/os/src/osFile.c
@@ -632,6 +632,11 @@ int64_t taosFSendFile(TdFilePtr pFileOut, TdFilePtr pFileIn, int64_t *offset, in
return writeLen;
}
+bool lastErrorIsFileNotExist() {
+ DWORD dwError = GetLastError();
+ return dwError == ERROR_FILE_NOT_FOUND;
+}
+
#else
int taosOpenFileNotStream(const char *path, int32_t tdFileOptions) {
int access = O_BINARY;
@@ -1028,6 +1033,8 @@ int64_t taosFSendFile(TdFilePtr pFileOut, TdFilePtr pFileIn, int64_t *offset, in
#endif
}
+bool lastErrorIsFileNotExist() { return errno == ENOENT; }
+
#endif // WINDOWS
TdFilePtr taosOpenFile(const char *path, int32_t tdFileOptions) {
diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c
index 505ce61eca..eae02125d2 100644
--- a/source/util/src/tlog.c
+++ b/source/util/src/tlog.c
@@ -350,7 +350,7 @@ void taosResetLog() {
static bool taosCheckFileIsOpen(char *logFileName) {
TdFilePtr pFile = taosOpenFile(logFileName, TD_FILE_WRITE);
if (pFile == NULL) {
- if (errno == ENOENT) {
+ if (lastErrorIsFileNotExist()) {
return false;
} else {
printf("\nfailed to open log file:%s, reason:%s\n", logFileName, strerror(errno));
diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task
index d43a9a7ee6..19d08580a3 100644
--- a/tests/parallel_test/cases.task
+++ b/tests/parallel_test/cases.task
@@ -575,6 +575,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ts_3405_3398_3423.py -N 3 -n 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ts-4348-td-27939.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/backslash_g.py
+,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/test_ts4467.py
,,n,system-test,python3 ./test.py -f 2-query/queryQnode.py
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode1mnode.py
diff --git a/tests/script/tsim/parser/like.sim b/tests/script/tsim/parser/like.sim
index 5cac026b57..298dbce0e5 100644
--- a/tests/script/tsim/parser/like.sim
+++ b/tests/script/tsim/parser/like.sim
@@ -51,6 +51,22 @@ if $rows != 1 then
return -1
endi
+$view1 = view1_name
+$view2 = view2_name
+
+sql CREATE VIEW $view1 as select * from $table1
+sql CREATE VIEW $view2 AS select * from $table2
+
+sql show views like 'view%'
+if $rows != 2 then
+ return -1
+endi
+
+sql show views like 'view1%'
+if $rows != 1 then
+ return -1
+endi
+
system sh/exec.sh -n dnode1 -s stop -x SIGINT
diff --git a/tests/system-test/2-query/test_ts4467.py b/tests/system-test/2-query/test_ts4467.py
new file mode 100644
index 0000000000..4e09a9fbbe
--- /dev/null
+++ b/tests/system-test/2-query/test_ts4467.py
@@ -0,0 +1,63 @@
+import random
+import itertools
+from util.log import *
+from util.cases import *
+from util.sql import *
+from util.sqlset import *
+from util import constant
+from util.common import *
+
+
+class TDTestCase:
+ """Verify the jira TS-4467
+ """
+ def init(self, conn, logSql, replicaVar=1):
+ self.replicaVar = int(replicaVar)
+ tdLog.debug("start to execute %s" % __file__)
+ tdSql.init(conn.cursor())
+
+ def prepareData(self):
+ # db
+ tdSql.execute("create database if not exists db")
+ tdSql.execute("use db")
+
+ # table
+ tdSql.execute("create table t (ts timestamp, c1 varchar(16));")
+
+ # insert data
+ sql = "insert into t values"
+ for i in range(6):
+ sql += f"(now+{str(i+1)}s, '{'name' + str(i+1)}')"
+ sql += ";"
+ tdSql.execute(sql)
+ tdLog.debug("insert data successfully")
+
+ def run(self):
+ self.prepareData()
+
+ # join query with order by
+ sql = "select * from t t1, (select * from t order by ts limit 5) t2 where t1.ts = t2.ts;"
+ tdSql.query(sql)
+ tdSql.checkRows(5)
+
+ sql = "select * from t t1, (select * from t order by ts desc limit 5) t2 where t1.ts = t2.ts;"
+ tdSql.query(sql)
+ tdSql.checkRows(5)
+
+ sql = "select * from t t1, (select * from t order by ts limit 5) t2 where t1.ts = t2.ts order by t1.ts;"
+ tdSql.query(sql)
+ res1 = tdSql.queryResult
+ tdLog.debug("res1: %s" % str(res1))
+
+ sql = "select * from t t1, (select * from t order by ts limit 5) t2 where t1.ts = t2.ts order by t1.ts desc;"
+ tdSql.query(sql)
+ res2 = tdSql.queryResult
+ tdLog.debug("res2: %s" % str(res2))
+ assert(len(res1) == len(res2) and res1[0][0] == res2[4][0])
+
+ def stop(self):
+ tdSql.close()
+ tdLog.success("%s successfully executed" % __file__)
+
+tdCases.addWindows(__file__, TDTestCase())
+tdCases.addLinux(__file__, TDTestCase())