Merge branch 'develop' into feature/TD-2868

This commit is contained in:
zyyang 2021-02-25 17:19:27 +08:00 committed by GitHub
commit 2091df72c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
64 changed files with 5877 additions and 6943 deletions

17
Jenkinsfile vendored
View File

@ -174,14 +174,13 @@ pipeline {
./crash_gen.sh -a -p -t 4 -s 2000
'''
}
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh '''
cd ${WKC}/tests/pytest
rm -rf /var/lib/taos/*
rm -rf /var/log/taos/*
./handle_crash_gen_val_log.sh
'''
}
sh '''
cd ${WKC}/tests/pytest
rm -rf /var/lib/taos/*
rm -rf /var/log/taos/*
./handle_crash_gen_val_log.sh
'''
timeout(time: 45, unit: 'MINUTES'){
sh '''
date
@ -226,6 +225,8 @@ pipeline {
./test-all.sh b4fq
cd ${WKC}/tests
./test-all.sh p4
cd ${WKC}/tests
./test-all.sh full jdbc
date'''
}
}

BIN
deps/libcurl/lib/win64/libcurl_a.lib vendored Normal file

Binary file not shown.

View File

@ -16,7 +16,7 @@ TDengine面向的是物联网场景需要支持数据的实时复制来最
## 基本概念和定义
TDengine里存在vnode, mnode, vnode用来存储时序数据mnode用来存储元数据。但从同步数据复制的模块来看两者没有本质的区别因此本文里的虚拟节点不仅包括vnode, 也包括mnode, vgoup也指mnode group, 除非特别注明。
TDengine里存在vnode, mnode, vnode用来存储时序数据mnode用来存储元数据。但从同步数据复制的模块来看两者没有本质的区别因此本文里的虚拟节点不仅包括vnode, 也包括mnode, vgroup也指mnode group, 除非特别注明。
**版本(version)**

View File

@ -218,9 +218,9 @@ TDengine 分布式架构的逻辑结构图如下:
TDengine存储的数据包括采集的时序数据以及库、表相关的元数据、标签数据等这些数据具体分为三部分
- 时序数据存放于vnode里由data、head和last三个文件组成数据量大查询量取决于应用场景。容许乱序写入但暂时不支持删除更新操作。通过采用一个采集点一张表的模型,一个时间段的数据是连续存储,对单张表的写入是简单的追加操作,一次读,可以读到多条记录,这样保证对单个采集点的插入和查询操作,性能达到最优。
- 时序数据存放于vnode里由data、head和last三个文件组成数据量大查询量取决于应用场景。容许乱序写入但暂时不支持删除操作并且仅在update参数设置为1时允许更新操作。通过采用一个采集点一张表的模型,一个时间段的数据是连续存储,对单张表的写入是简单的追加操作,一次读,可以读到多条记录,这样保证对单个采集点的插入和查询操作,性能达到最优。
- 标签数据存放于vnode里的meta文件支持增删改查四个标准操作。数据量不大有N张表就有N条记录因此可以全内存存储。如果标签过滤操作很多查询将十分频繁因此TDengine支持多核多线程并发查询。只要计算资源足够即使有数千万张表过滤结果能毫秒级返回。
- 其他元数据存放于mnode里包含系统节点、用户、DB、Table Schema等,支持增删改查四个标准操作。这部分数据的量不大,可以全内存保存,而且由于客户端有缓存,查询量也不大。因此目前的设计虽是集中式存储管理,但不会构成性能瓶颈。
- 元数据存放于mnode里包含系统节点、用户、DB、Table Schema等信息,支持增删改查四个标准操作。这部分数据的量不大,可以全内存保存,而且由于客户端有缓存,查询量也不大。因此目前的设计虽是集中式存储管理,但不会构成性能瓶颈。
与典型的NoSQL存储模型相比TDengine将标签数据与时序数据完全分离存储它具有两大优势
@ -315,7 +315,7 @@ Vnode会保持一个数据版本号(Version),对内存数据进行持久化存
3. 在线的虚拟节点数过半而且有虚拟节点是slave的话该虚拟节点自动成为master
4. 对于2和3如果多个虚拟节点满足成为master的要求那么虚拟节点组的节点列表里最前面的选为master
更多的关于数据复制的流程,请见[TDengine 2.0数据复制模块设计](https://www.taosdata.com/cn/documentation/replica/)。
更多的关于数据复制的流程,请见[TDengine 2.0数据复制模块设计](https://www.taosdata.com/cn/documentation/architecture/replica/)。
### 同步复制

View File

@ -723,9 +723,9 @@ HTTP请求URL采用`sqlutc`时返回结果集的时间戳将采用UTC时间
### 重要配置项
下面仅列出一些与RESTFul接口有关的配置参数其他系统参数请看配置文件里的说明。注意配置修改后需要重启taosd服务才能生效
下面仅列出一些与RESTful接口有关的配置参数其他系统参数请看配置文件里的说明。注意配置修改后需要重启taosd服务才能生效
- httpPort: 对外提供RESTFul服务的端口号默认绑定到6041
- httpPort: 对外提供RESTful服务的端口号默认绑定到6041
- httpMaxThreads: 启动的线程数量默认为2
- restfulRowLimit: 返回结果集JSON格式的最大条数默认值为10240
- httpEnableCompress: 是否支持压缩默认不支持目前TDengine仅支持gzip压缩格式

View File

@ -152,3 +152,10 @@ TDengine客户端暂不支持如下函数
- dbListTables(conn):显示连接中的所有表
## <a class="anchor" id="datax"></a>DataX
[DataX](https://github.com/alibaba/DataX) 是阿里巴巴集团开源的一款通用离线数据采集/同步工具,能够简单、高效地接入 TDengine 进行数据写入和读取。
* 数据读取集成的方法请参见 [TSDBReader 插件文档](https://github.com/alibaba/DataX/blob/master/tsdbreader/doc/tsdbreader.md)
* 数据写入集成的方法请参见 [TSDBWriter 插件文档](https://github.com/alibaba/DataX/blob/master/tsdbwriter/doc/tsdbhttpwriter.md)

View File

@ -59,7 +59,7 @@ arbitrator ha.taosdata.com:6042
| 8 | charset | 字符集编码 |
| 9 | balance | 是否启动负载均衡 |
| 10 | maxTablesPerVnode | 每个vnode中能够创建的最大表个数 |
| 11 | maxVgroupsPerDb | 每个DB中 能够使用的最大vnode个数 |
| 11 | maxVgroupsPerDb | 每个DB中能够使用的最大vgroup个数 |

View File

@ -6,7 +6,7 @@
### 内存需求
每个DB可以创建固定数目的vnode默认与CPU核数相同可通过maxVgroupsPerDb配置每个vnode会占用固定大小的内存大小与数据库的配置参数blocks和cache有关)每个Table会占用与标签总长度有关的内存此外系统会有一些固定的内存开销。因此每个DB需要的系统内存可通过如下公式计算
每个DB可以创建固定数目的vgroup默认与CPU核数相同可通过maxVgroupsPerDb配置vgroup中的每个副本会是一个vnode每个vnode会占用固定大小的内存大小与数据库的配置参数blocks和cache有关)每个Table会占用与标签总长度有关的内存此外系统会有一些固定的内存开销。因此每个DB需要的系统内存可通过如下公式计算
```
Memory Size = maxVgroupsPerDb * (blocks * cache + 10Mb) + numOfTables * (tagSizePerTable + 0.5Kb)
@ -111,15 +111,16 @@ taosd -C
- days一个数据文件存储数据的时间跨度单位为天默认值10。
- keep数据库中数据保留的天数单位为天默认值3650。
- minRows: 文件块中记录的最小条数单位为条默认值100。
- maxRows: 文件块中记录的最大条数单位为条默认值4096。
- comp: 文件压缩标志位0关闭1:一阶段压缩2:两阶段压缩。默认值2。
- walLevelWAL级别。1写wal, 但不执行fsync; 2写wal, 而且执行fsync。默认值1。
- minRows文件块中记录的最小条数单位为条默认值100。
- maxRows文件块中记录的最大条数单位为条默认值4096。
- comp文件压缩标志位0关闭1一阶段压缩2两阶段压缩。默认值2。
- walLevelWAL级别。1写wal但不执行fsync2写wal, 而且执行fsync。默认值1。
- fsync当wal设置为2时执行fsync的周期。设置为0表示每次写入立即执行fsync。单位为毫秒默认值3000。
- cache: 内存块的大小单位为兆字节MB默认值16。
- blocks: 每个VNODETSDB中有多少cache大小的内存块。因此一个VNODE的用的内存大小粗略为cache * blocks。单位为块默认值4。
- cache内存块的大小单位为兆字节MB默认值16。
- blocks每个VNODETSDB中有多少cache大小的内存块。因此一个VNODE的用的内存大小粗略为cache * blocks。单位为块默认值4。
- replica副本个数取值范围1-3。单位为个默认值1
- precision时间戳精度标识ms表示毫秒us表示微秒。默认值ms
- cacheLast是否在内存中缓存子表 last_row0关闭1开启。默认值0。从 2.0.11 版本开始支持此参数)
对于一个应用场景可能有多种数据特征的数据并存最佳的设计是将具有相同数据特征的表放在一个库里这样一个应用有多个库而每个库可以配置不同的存储参数从而保证系统有最优的性能。TDengine允许应用在创建库时指定上述存储参数如果指定该参数就将覆盖对应的系统配置参数。举例有下述SQL
@ -137,7 +138,7 @@ TDengine集群中加入一个新的dnode时涉及集群相关的一些参数
- offlineThreshold: dnode离线阈值超过该时间将导致该dnode从集群中删除。单位为秒默认值86400*10即10天
- statusInterval: dnode向mnode报告状态时长。单位为秒默认值1。
- maxTablesPerVnode: 每个vnode中能够创建的最大表个数。默认值1000000。
- maxVgroupsPerDb: 每个数据库中能够使用的最大vnode个数。
- maxVgroupsPerDb: 每个数据库中能够使用的最大vgroup个数。
- arbitrator: 系统中裁决器的end point缺省为空。
- timezone、locale、charset 的配置见客户端配置。

View File

@ -42,17 +42,19 @@ TDengine缺省的时间戳是毫秒精度但通过修改配置参数enableMic
| | 类型 | Bytes | 说明 |
| ---- | :-------: | ------ | ------------------------------------------------------------ |
| 1 | TIMESTAMP | 8 | 时间戳。缺省精度毫秒,可支持微秒。从格林威治时间 1970-01-01 00:00:00.000 (UTC/GMT) 开始,计时不能早于该时间。 |
| 2 | INT | 4 | 整型,范围 [-2^31+1, 2^31-1], -2^31用作Null |
| 3 | BIGINT | 8 | 长整型,范围 [-2^63+1, 2^63-1], -2^63用于NULL |
| 4 | FLOAT | 4 | 浮点型有效位数6-7范围 [-3.4E38, 3.4E38] |
| 5 | DOUBLE | 8 | 双精度浮点型有效位数15-16范围 [-1.7E308, 1.7E308] |
| 6 | BINARY | 自定义 | 用于记录字符串理论上最长可以有16374字节但由于每行数据最多16K字节,实际上限一般小于理论值。 binary仅支持字符串输入字符串两端使用单引号引用否则英文全部自动转化为小写。使用时须指定大小binary(20)定义了最长为20个字符的字符串每个字符占1byte的存储空间。如果用户字符串超出20字节将会报错。对于字符串内的单引号,可以用转义字符反斜线加单引号来表示,**\**。 |
| 7 | SMALLINT | 2 | 短整型, 范围 [-32767, 32767], -32768用于NULL |
| 8 | TINYINT | 1 | 单字节整型,范围 [-127, 127], -128用于NULL |
| 9 | BOOL | 1 | 布尔型,{true, false} |
| 10 | NCHAR | 自定义 | 用于记录非ASCII字符串如中文字符。每个nchar字符占用4bytes的存储空间。字符串两端使用单引号引用字符串内的单引号需用转义字符 **\**。nchar使用时须指定字符串大小类型为nchar(10)的列表示此列的字符串最多存储10个nchar字符会固定占用40bytes的空间。如用户字符串长度超出声明长度将会报错。 |
| 2 | INT | 4 | 整型,范围 [-2^31+1, 2^31-1], -2^31 用作 NULL |
| 3 | BIGINT | 8 | 长整型,范围 [-2^63+1, 2^63-1], -2^63 用于 NULL |
| 4 | FLOAT | 4 | 浮点型,有效位数 6-7范围 [-3.4E38, 3.4E38] |
| 5 | DOUBLE | 8 | 双精度浮点型,有效位数 15-16范围 [-1.7E308, 1.7E308] |
| 6 | BINARY | 自定义 | 用于记录 ASCII 型字符串。理论上,最长可以有 16374 字节,但由于每行数据最多 16K 字节,实际上限一般小于理论值。 binary 仅支持字符串输入,字符串两端使用单引号引用,否则英文全部自动转化为小写。使用时须指定大小,如 binary(20) 定义了最长为 20 个字符的字符串,每个字符占 1 byte 的存储空间,此时如果用户字符串超出 20 字节将会报错。对于字符串内的单引号,可以用转义字符反斜线加单引号来表示,`\`。 |
| 7 | SMALLINT | 2 | 短整型, 范围 [-32767, 32767], -32768 用于 NULL |
| 8 | TINYINT | 1 | 单字节整型,范围 [-127, 127], -128 用于 NULL |
| 9 | BOOL | 1 | 布尔型,{true, false} |
| 10 | NCHAR | 自定义 | 用于记录非 ASCII字符串,如中文字符。每个 nchar 字符占用 4 bytes 的存储空间。字符串两端使用单引号引用,字符串内的单引号需用转义字符 `\`。nchar 使用时须指定字符串大小,类型为 nchar(10) 的列表示此列的字符串最多存储 10 个 nchar 字符,会固定占用 40 bytes 的空间。如果用户字符串长度超出声明长度,将会报错。 |
**Tips**: TDengine对SQL语句中的英文字符不区分大小写自动转化为小写执行。因此用户大小写敏感的字符串及密码需要使用单引号将字符串引起来。
**Tips**:
1. TDengine 对 SQL 语句中的英文字符不区分大小写,自动转化为小写执行。因此用户大小写敏感的字符串及密码,需要使用单引号将字符串引起来。
2. 应避免使用 BINARY 类型来保存非 ASCII 型的字符串,会很容易导致数据乱码等错误。正确的做法是使用 NCHAR 类型来保存中文字符。
## <a class="anchor" id="management"></a>数据库管理
@ -96,27 +98,32 @@ TDengine缺省的时间戳是毫秒精度但通过修改配置参数enableMic
```mysql
ALTER DATABASE db_name COMP 2;
```
COMP参数是指修改数据库文件压缩标志位,取值范围为[0, 2]. 0表示不压缩1表示一阶段压缩2表示两阶段压缩。
COMP 参数是指修改数据库文件压缩标志位,缺省值为 2取值范围为 [0, 2]。0 表示不压缩1 表示一阶段压缩2 表示两阶段压缩。
```mysql
ALTER DATABASE db_name REPLICA 2;
```
REPLICA参数是指修改数据库副本数取值范围[1, 3]。在集群中使用,副本数必须小于或等于dnode的数目。
REPLICA 参数是指修改数据库副本数,取值范围 [1, 3]。在集群中使用,副本数必须小于或等于 DNODE 的数目。
```mysql
ALTER DATABASE db_name KEEP 365;
```
KEEP参数是指修改数据文件保存的天数缺省值为3650取值范围[days, 365000]必须大于或等于days参数值。
KEEP 参数是指修改数据文件保存的天数,缺省值为 3650取值范围 [days, 365000],必须大于或等于 days 参数值。
```mysql
ALTER DATABASE db_name QUORUM 2;
```
QUORUM参数是指数据写入成功所需要的确认数。取值范围[1, 3]。对于异步复制quorum设为1具有master角色的虚拟节点自己确认即可。对于同步复制需要至少大于等于2。原则上Quorum >=1 并且 Quorum <= replica(副本数),这个参数在启动一个同步模块实例时需要提供。
QUORUM 参数是指数据写入成功所需要的确认数,取值范围 [1, 3]。对于异步复制quorum 设为 1具有 master 角色的虚拟节点自己确认即可。对于同步复制,需要至少大于等于 2。原则上Quorum >= 1 并且 Quorum <= replica(副本数),这个参数在启动一个同步模块实例时需要提供。
```mysql
ALTER DATABASE db_name BLOCKS 100;
```
BLOCKS参数是每个VNODE (TSDB) 中有多少cache大小的内存块因此一个VNODE的用的内存大小粗略为cache * blocks。取值范围[3, 1000]。
BLOCKS 参数是每个 VNODE (TSDB) 中有多少 cache 大小的内存块,因此一个 VNODE 的用的内存大小粗略为cache * blocks。取值范围 [3, 1000]。
```mysql
ALTER DATABASE db_name CACHELAST 0;
```
CACHELAST 参数控制是否在内存中缓存数据子表的 last_row。缺省值为 0取值范围 [0, 1]。其中 0 表示不启用、1 表示启用。(从 2.0.11 版本开始支持)
**Tips**: 以上所有参数修改后都可以用show databases来确认是否修改成功。
@ -344,9 +351,7 @@ TDengine缺省的时间戳是毫秒精度但通过修改配置参数enableMic
```
同时向表tb1_name和tb2_name中按列分别插入多条记录
注意:
1) 如果时间戳为0系统将自动使用服务器当前时间作为该记录的时间戳
2) 允许插入的最老记录的时间戳是相对于当前服务器时间减去配置的keep值数据保留的天数允许插入的最新记录的时间戳是相对于当前服务器时间加上配置的days值数据文件存储数据的时间跨度单位为天。keep和days都是可以在创建数据库时指定的缺省值分别是3650天和10天。
注意允许插入的最老记录的时间戳是相对于当前服务器时间减去配置的keep值数据保留的天数允许插入的最新记录的时间戳是相对于当前服务器时间加上配置的days值数据文件存储数据的时间跨度单位为天。keep和days都是可以在创建数据库时指定的缺省值分别是3650天和10天。
- <a class="anchor" id="auto_create_table"></a>**插入记录时自动建表**
```mysql

View File

@ -109,11 +109,8 @@ Properties properties = new Properties();
properties.setProperty(TSDBDriver.LOCALE_KEY, "UTF-8");
Connection = DriverManager.getConnection(url, properties);
```
## 12.TDengine GO windows驱动的如何编译
请看为此问题撰写的[技术博客](https://www.taosdata.com/blog/2020/01/06/tdengine-go-windows驱动的编译/)
## 13.JDBC报错 the excuted SQL is not a DML or a DDL
## 12.JDBC报错 the excuted SQL is not a DML or a DDL
请更新至最新的JDBC驱动
```JAVA
@ -124,15 +121,15 @@ Connection = DriverManager.getConnection(url, properties);
</dependency>
```
## 14. taos connect failed, reason: invalid timestamp
## 13. taos connect failed, reason: invalid timestamp
常见原因是服务器和客户端时间没有校准可以通过和时间服务器同步的方式Linux 下使用 ntpdate 命令Windows 在系统时间设置中选择自动同步)校准。
## 15. 表名显示不全
## 14. 表名显示不全
由于 taos shell 在终端中显示宽度有限,有可能比较长的表名显示不全,如果按照显示的不全的表名进行相关操作会发生 Table does not exist 错误。解决方法可以是通过修改 taos.cfg 文件中的设置项 maxBinaryDisplayWidth 或者直接输入命令 set max_binary_display_width 100。或者在命令结尾使用 \G 参数来调整结果的显示方式。
## 16. 如何进行数据迁移?
## 15. 如何进行数据迁移?
TDengine是根据hostname唯一标志一台机器的在数据文件从机器A移动机器B时注意如下两件事
@ -140,7 +137,7 @@ TDengine是根据hostname唯一标志一台机器的在数据文件从机器A
- 2.0.7.0 及以后的版本,到/var/lib/taos/dnode下修复dnodeEps.json的dnodeId对应的FQDN重启。确保机器内所有机器的此文件是完全相同的。
- 1.x 和 2.x 版本的存储结构不兼容,需要使用迁移工具或者自己开发应用导出导入数据。
## 17. 如何在命令行程序 taos 中临时调整日志级别
## 16. 如何在命令行程序 taos 中临时调整日志级别
为了调试方便,从 2.0.16 版本开始,命令行程序 taos 新增了与日志记录相关的两条指令:

View File

@ -26,7 +26,6 @@ else
${csudo} rm -f ${bin_link_dir}/taos || :
${csudo} rm -f ${bin_link_dir}/taosd || :
${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${bin_link_dir}/taosdemox || :
${csudo} rm -f ${bin_link_dir}/taosdump || :
${csudo} rm -f ${cfg_link_dir}/* || :
${csudo} rm -f ${inc_link_dir}/taos.h || :

View File

@ -51,7 +51,6 @@ cp ${compile_dir}/../packaging/tools/startPre.sh ${pkg_dir}${install_home_pat
cp ${compile_dir}/../packaging/tools/set_core.sh ${pkg_dir}${install_home_path}/bin
cp ${compile_dir}/../packaging/tools/taosd-dump-cfg.gdb ${pkg_dir}${install_home_path}/bin
cp ${compile_dir}/build/bin/taosdemo ${pkg_dir}${install_home_path}/bin
cp ${compile_dir}/build/bin/taosdemox ${pkg_dir}${install_home_path}/bin
cp ${compile_dir}/build/bin/taosdump ${pkg_dir}${install_home_path}/bin
cp ${compile_dir}/build/bin/taosd ${pkg_dir}${install_home_path}/bin
cp ${compile_dir}/build/bin/taos ${pkg_dir}${install_home_path}/bin

View File

@ -62,7 +62,6 @@ cp %{_compiledir}/../packaging/tools/taosd-dump-cfg.gdb %{buildroot}%{homepat
cp %{_compiledir}/build/bin/taos %{buildroot}%{homepath}/bin
cp %{_compiledir}/build/bin/taosd %{buildroot}%{homepath}/bin
cp %{_compiledir}/build/bin/taosdemo %{buildroot}%{homepath}/bin
cp %{_compiledir}/build/bin/taosdemox %{buildroot}%{homepath}/bin
cp %{_compiledir}/build/bin/taosdump %{buildroot}%{homepath}/bin
cp %{_compiledir}/build/lib/${libfile} %{buildroot}%{homepath}/driver
cp %{_compiledir}/../src/inc/taos.h %{buildroot}%{homepath}/include
@ -140,7 +139,6 @@ if [ $1 -eq 0 ];then
${csudo} rm -f ${bin_link_dir}/taos || :
${csudo} rm -f ${bin_link_dir}/taosd || :
${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${bin_link_dir}/taosdemox || :
${csudo} rm -f ${bin_link_dir}/taosdump || :
${csudo} rm -f ${cfg_link_dir}/* || :
${csudo} rm -f ${inc_link_dir}/taos.h || :

View File

@ -179,7 +179,6 @@ function install_bin() {
${csudo} rm -f ${bin_link_dir}/taos || :
${csudo} rm -f ${bin_link_dir}/taosd || :
${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${bin_link_dir}/taosdemox || :
${csudo} rm -f ${bin_link_dir}/taosdump || :
${csudo} rm -f ${bin_link_dir}/rmtaos || :
${csudo} rm -f ${bin_link_dir}/tarbitrator || :
@ -191,7 +190,6 @@ function install_bin() {
[ -x ${install_main_dir}/bin/taos ] && ${csudo} ln -s ${install_main_dir}/bin/taos ${bin_link_dir}/taos || :
[ -x ${install_main_dir}/bin/taosd ] && ${csudo} ln -s ${install_main_dir}/bin/taosd ${bin_link_dir}/taosd || :
[ -x ${install_main_dir}/bin/taosdemo ] && ${csudo} ln -s ${install_main_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || :
[ -x ${install_main_dir}/bin/taosdemox ] && ${csudo} ln -s ${install_main_dir}/bin/taosdemox ${bin_link_dir}/taosdemox || :
[ -x ${install_main_dir}/bin/taosdump ] && ${csudo} ln -s ${install_main_dir}/bin/taosdump ${bin_link_dir}/taosdump || :
[ -x ${install_main_dir}/bin/remove.sh ] && ${csudo} ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/rmtaos || :
[ -x ${install_main_dir}/bin/set_core.sh ] && ${csudo} ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || :

View File

@ -86,7 +86,6 @@ function install_bin() {
${csudo} rm -f ${bin_link_dir}/taos || :
if [ "$osType" != "Darwin" ]; then
${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${bin_link_dir}/taosdemox || :
${csudo} rm -f ${bin_link_dir}/taosdump || :
fi
${csudo} rm -f ${bin_link_dir}/rmtaos || :
@ -98,7 +97,6 @@ function install_bin() {
[ -x ${install_main_dir}/bin/taos ] && ${csudo} ln -s ${install_main_dir}/bin/taos ${bin_link_dir}/taos || :
if [ "$osType" != "Darwin" ]; then
[ -x ${install_main_dir}/bin/taosdemo ] && ${csudo} ln -s ${install_main_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || :
[ -x ${install_main_dir}/bin/taosdemox ] && ${csudo} ln -s ${install_main_dir}/bin/taosdemox ${bin_link_dir}/taosdemox || :
[ -x ${install_main_dir}/bin/taosdump ] && ${csudo} ln -s ${install_main_dir}/bin/taosdump ${bin_link_dir}/taosdump || :
fi
[ -x ${install_main_dir}/bin/remove_client.sh ] && ${csudo} ln -s ${install_main_dir}/bin/remove_client.sh ${bin_link_dir}/rmtaos || :

View File

@ -86,7 +86,6 @@ function install_bin() {
${csudo} rm -f ${bin_link_dir}/power || :
if [ "$osType" != "Darwin" ]; then
${csudo} rm -f ${bin_link_dir}/powerdemo || :
${csudo} rm -f ${bin_link_dir}/powerdemox || :
${csudo} rm -f ${bin_link_dir}/powerdump || :
fi
${csudo} rm -f ${bin_link_dir}/rmpower || :
@ -98,7 +97,6 @@ function install_bin() {
[ -x ${install_main_dir}/bin/power ] && ${csudo} ln -s ${install_main_dir}/bin/power ${bin_link_dir}/power || :
if [ "$osType" != "Darwin" ]; then
[ -x ${install_main_dir}/bin/powerdemo ] && ${csudo} ln -s ${install_main_dir}/bin/powerdemo ${bin_link_dir}/powerdemo || :
[ -x ${install_main_dir}/bin/powerdemox ] && ${csudo} ln -s ${install_main_dir}/bin/powerdemox ${bin_link_dir}/powerdemox || :
[ -x ${install_main_dir}/bin/powerdump ] && ${csudo} ln -s ${install_main_dir}/bin/powerdump ${bin_link_dir}/powerdump || :
fi
[ -x ${install_main_dir}/bin/remove_client_power.sh ] && ${csudo} ln -s ${install_main_dir}/bin/remove_client_power.sh ${bin_link_dir}/rmpower || :

View File

@ -174,7 +174,6 @@ function install_bin() {
${csudo} rm -f ${bin_link_dir}/power || :
${csudo} rm -f ${bin_link_dir}/powerd || :
${csudo} rm -f ${bin_link_dir}/powerdemo || :
${csudo} rm -f ${bin_link_dir}/powerdemox || :
${csudo} rm -f ${bin_link_dir}/rmpower || :
${csudo} rm -f ${bin_link_dir}/tarbitrator || :
${csudo} rm -f ${bin_link_dir}/set_core || :
@ -185,7 +184,6 @@ function install_bin() {
[ -x ${install_main_dir}/bin/power ] && ${csudo} ln -s ${install_main_dir}/bin/power ${bin_link_dir}/power || :
[ -x ${install_main_dir}/bin/powerd ] && ${csudo} ln -s ${install_main_dir}/bin/powerd ${bin_link_dir}/powerd || :
[ -x ${install_main_dir}/bin/powerdemo ] && ${csudo} ln -s ${install_main_dir}/bin/powerdemo ${bin_link_dir}/powerdemo || :
[ -x ${install_main_dir}/bin/powerdemox ] && ${csudo} ln -s ${install_main_dir}/bin/powerdemox ${bin_link_dir}/powerdemox || :
[ -x ${install_main_dir}/bin/remove_power.sh ] && ${csudo} ln -s ${install_main_dir}/bin/remove_power.sh ${bin_link_dir}/rmpower || :
[ -x ${install_main_dir}/bin/set_core.sh ] && ${csudo} ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || :
[ -x ${install_main_dir}/bin/tarbitrator ] && ${csudo} ln -s ${install_main_dir}/bin/tarbitrator ${bin_link_dir}/tarbitrator || :

View File

@ -45,7 +45,7 @@ if [ "$osType" != "Darwin" ]; then
strip ${build_dir}/bin/taos
bin_files="${build_dir}/bin/taos ${script_dir}/remove_client.sh"
else
bin_files="${build_dir}/bin/taos ${build_dir}/bin/taosdump ${build_dir}/bin/taosdemo ${build_dir}/bin/taosdemox\
bin_files="${build_dir}/bin/taos ${build_dir}/bin/taosdump ${build_dir}/bin/taosdemo \
${script_dir}/remove_client.sh ${script_dir}/set_core.sh ${script_dir}/get_client.sh ${script_dir}/taosd-dump-cfg.gdb"
fi
lib_files="${build_dir}/lib/libtaos.so.${version}"
@ -55,7 +55,11 @@ else
fi
header_files="${code_dir}/inc/taos.h ${code_dir}/inc/taoserror.h"
cfg_dir="${top_dir}/packaging/cfg"
if [ "$verMode" == "cluster" ]; then
cfg_dir="${top_dir}/../enterprise/packaging/cfg"
else
cfg_dir="${top_dir}/packaging/cfg"
fi
install_files="${script_dir}/install_client.sh"

View File

@ -54,7 +54,11 @@ else
fi
header_files="${code_dir}/inc/taos.h ${code_dir}/inc/taoserror.h"
cfg_dir="${top_dir}/packaging/cfg"
if [ "$verMode" == "cluster" ]; then
cfg_dir="${top_dir}/../enterprise/packaging/cfg"
else
cfg_dir="${top_dir}/packaging/cfg"
fi
install_files="${script_dir}/install_client_power.sh"
@ -77,7 +81,6 @@ if [ "$osType" != "Darwin" ]; then
cp ${build_dir}/bin/taos ${install_dir}/bin/power
cp ${script_dir}/remove_power.sh ${install_dir}/bin
cp ${build_dir}/bin/taosdemo ${install_dir}/bin/powerdemo
cp ${build_dir}/bin/taosdemox ${install_dir}/bin/powerdemox
cp ${build_dir}/bin/taosdump ${install_dir}/bin/powerdump
cp ${script_dir}/set_core.sh ${install_dir}/bin
cp ${script_dir}/get_client.sh ${install_dir}/bin

View File

@ -36,13 +36,18 @@ if [ "$pagMode" == "lite" ]; then
strip ${build_dir}/bin/taos
bin_files="${build_dir}/bin/taosd ${build_dir}/bin/taos ${script_dir}/remove.sh"
else
bin_files="${build_dir}/bin/taosd ${build_dir}/bin/taos ${build_dir}/bin/taosdump ${build_dir}/bin/taosdemo ${build_dir}/bin/taosdemox ${build_dir}/bin/tarbitrator\
bin_files="${build_dir}/bin/taosd ${build_dir}/bin/taos ${build_dir}/bin/taosdump ${build_dir}/bin/taosdemo ${build_dir}/bin/tarbitrator\
${script_dir}/remove.sh ${script_dir}/set_core.sh ${script_dir}/startPre.sh ${script_dir}/taosd-dump-cfg.gdb"
fi
lib_files="${build_dir}/lib/libtaos.so.${version}"
header_files="${code_dir}/inc/taos.h ${code_dir}/inc/taoserror.h"
cfg_dir="${top_dir}/packaging/cfg"
if [ "$verMode" == "cluster" ]; then
cfg_dir="${top_dir}/../enterprise/packaging/cfg"
else
cfg_dir="${top_dir}/packaging/cfg"
fi
install_files="${script_dir}/install.sh"
nginx_dir="${code_dir}/../../enterprise/src/plugins/web"

View File

@ -42,7 +42,11 @@ fi
lib_files="${build_dir}/lib/libtaos.so.${version}"
header_files="${code_dir}/inc/taos.h ${code_dir}/inc/taoserror.h"
cfg_dir="${top_dir}/packaging/cfg"
if [ "$verMode" == "cluster" ]; then
cfg_dir="${top_dir}/../enterprise/packaging/cfg"
else
cfg_dir="${top_dir}/packaging/cfg"
fi
install_files="${script_dir}/install_power.sh"
nginx_dir="${code_dir}/../../enterprise/src/plugins/web"
@ -78,7 +82,6 @@ else
cp ${build_dir}/bin/taosd ${install_dir}/bin/powerd
cp ${script_dir}/remove_power.sh ${install_dir}/bin
cp ${build_dir}/bin/taosdemo ${install_dir}/bin/powerdemo
cp ${build_dir}/bin/taosdemox ${install_dir}/bin/powerdemox
cp ${build_dir}/bin/taosdump ${install_dir}/bin/powerdump
cp ${build_dir}/bin/tarbitrator ${install_dir}/bin
cp ${script_dir}/set_core.sh ${install_dir}/bin

View File

@ -96,7 +96,6 @@ function install_bin() {
${csudo} rm -f ${bin_link_dir}/taos || :
${csudo} rm -f ${bin_link_dir}/taosd || :
${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${bin_link_dir}/taosdemox || :
${csudo} rm -f ${bin_link_dir}/taosdump || :
${csudo} rm -f ${bin_link_dir}/rmtaos || :
${csudo} rm -f ${bin_link_dir}/set_core || :
@ -107,7 +106,6 @@ function install_bin() {
[ -x ${bin_dir}/taos ] && ${csudo} ln -s ${bin_dir}/taos ${bin_link_dir}/taos || :
[ -x ${bin_dir}/taosd ] && ${csudo} ln -s ${bin_dir}/taosd ${bin_link_dir}/taosd || :
[ -x ${bin_dir}/taosdemo ] && ${csudo} ln -s ${bin_dir}/taosdemo ${bin_link_dir}/taosdemo || :
[ -x ${bin_dir}/taosdemox ] && ${csudo} ln -s ${bin_dir}/taosdemox ${bin_link_dir}/taosdemox || :
[ -x ${bin_dir}/taosdump ] && ${csudo} ln -s ${bin_dir}/taosdump ${bin_link_dir}/taosdump || :
[ -x ${bin_dir}/set_core.sh ] && ${csudo} ln -s ${bin_dir}/set_core.sh ${bin_link_dir}/set_core || :
}

View File

@ -72,7 +72,6 @@ function clean_bin() {
${csudo} rm -f ${bin_link_dir}/taos || :
${csudo} rm -f ${bin_link_dir}/taosd || :
${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${bin_link_dir}/taosdemox || :
${csudo} rm -f ${bin_link_dir}/taosdump || :
${csudo} rm -f ${bin_link_dir}/rmtaos || :
${csudo} rm -f ${bin_link_dir}/tarbitrator || :

View File

@ -38,7 +38,6 @@ function clean_bin() {
# Remove link
${csudo} rm -f ${bin_link_dir}/taos || :
${csudo} rm -f ${bin_link_dir}/taosdemo || :
${csudo} rm -f ${bin_link_dir}/taosdemox || :
${csudo} rm -f ${bin_link_dir}/taosdump || :
${csudo} rm -f ${bin_link_dir}/rmtaos || :
${csudo} rm -f ${bin_link_dir}/set_core || :

View File

@ -38,7 +38,6 @@ function clean_bin() {
# Remove link
${csudo} rm -f ${bin_link_dir}/power || :
${csudo} rm -f ${bin_link_dir}/powerdemo || :
${csudo} rm -f ${bin_link_dir}/powerdemox || :
${csudo} rm -f ${bin_link_dir}/powerdump || :
${csudo} rm -f ${bin_link_dir}/rmpower || :
${csudo} rm -f ${bin_link_dir}/set_core || :

View File

@ -72,7 +72,6 @@ function clean_bin() {
${csudo} rm -f ${bin_link_dir}/power || :
${csudo} rm -f ${bin_link_dir}/powerd || :
${csudo} rm -f ${bin_link_dir}/powerdemo || :
${csudo} rm -f ${bin_link_dir}/powerdemox || :
${csudo} rm -f ${bin_link_dir}/powerdump || :
${csudo} rm -f ${bin_link_dir}/rmpower || :
${csudo} rm -f ${bin_link_dir}/tarbitrator || :

View File

@ -6404,10 +6404,12 @@ int32_t doCheckForCreateFromStable(SSqlObj* pSql, SSqlInfo* pInfo) {
nameSize = taosArrayGetSize(pNameList);
if (valSize != nameSize) {
tdDestroyKVRowBuilder(&kvRowBuilder);
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg5);
}
if (schemaSize < valSize) {
tdDestroyKVRowBuilder(&kvRowBuilder);
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg5);
}
@ -6460,11 +6462,13 @@ int32_t doCheckForCreateFromStable(SSqlObj* pSql, SSqlInfo* pInfo) {
}
if (!findColumnIndex) {
tdDestroyKVRowBuilder(&kvRowBuilder);
return tscInvalidSQLErrMsg(pCmd->payload, "invalid tag name", sToken->z);
}
}
} else {
if (schemaSize != valSize) {
tdDestroyKVRowBuilder(&kvRowBuilder);
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg5);
}

View File

@ -330,7 +330,7 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcEpSet *pEpSet) {
pSql->cmd.submitSchema = 1;
}
if ((cmd == TSDB_SQL_SELECT || cmd == TSDB_SQL_FETCH || cmd == TSDB_SQL_UPDATE_TAGS_VAL) &&
if ((cmd == TSDB_SQL_SELECT || cmd == TSDB_SQL_UPDATE_TAGS_VAL) &&
(rpcMsg->code == TSDB_CODE_TDB_INVALID_TABLE_ID ||
rpcMsg->code == TSDB_CODE_VND_INVALID_VGROUP_ID ||
rpcMsg->code == TSDB_CODE_RPC_NETWORK_UNAVAIL ||

View File

@ -1848,7 +1848,7 @@ void doAppendData(SInterResult* pInterResult, TAOS_ROW row, int32_t numOfCols, S
TSKEY key = INT64_MIN;
for(int32_t i = 0; i < numOfCols; ++i) {
SSqlExpr* pExpr = tscSqlExprGet(pQueryInfo, i);
if (TSDB_COL_IS_TAG(pExpr->colInfo.flag)) {
if (TSDB_COL_IS_TAG(pExpr->colInfo.flag) || pExpr->functionId == TSDB_FUNC_PRJ) {
continue;
}
@ -1981,7 +1981,8 @@ void tscFirstRoundRetrieveCallback(void* param, TAOS_RES* tres, int numOfRows) {
// set the parameters for the second round query process
SSqlCmd *pPCmd = &pParent->cmd;
SQueryInfo *pQueryInfo1 = tscGetQueryInfoDetail(pPCmd, 0);
int32_t resRows = pSup->numOfRows;
if (pSup->numOfRows > 0) {
SBufferWriter bw = tbufInitWriter(NULL, false);
interResToBinary(&bw, pSup->pResult, pSup->tagLen);
@ -1999,6 +2000,12 @@ void tscFirstRoundRetrieveCallback(void* param, TAOS_RES* tres, int numOfRows) {
taos_free_result(pSql);
if (resRows == 0) {
pParent->cmd.command = TSDB_SQL_RETRIEVE_EMPTY_RESULT;
(*pParent->fp)(pParent->param, pParent, 0);
return;
}
pQueryInfo1->round = 1;
tscDoQuery(pParent);
}

View File

@ -2057,6 +2057,8 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, __async_cb_func_t
pnCmd->parseFinished = 1;
pnCmd->pTableNameList = NULL;
pnCmd->pTableBlockHashList = NULL;
pnCmd->tagData.data = NULL;
pnCmd->tagData.dataLen = 0;
if (tscAddSubqueryInfo(pnCmd) != TSDB_CODE_SUCCESS) {
terrno = TSDB_CODE_TSC_OUT_OF_MEMORY;

View File

@ -1555,6 +1555,8 @@ int32_t taosCheckGlobalCfg() {
tsQueryBufferSizeBytes = tsQueryBufferSize * 1048576UL;
}
uInfo(" check global cfg completed");
uInfo("==================================");
taosPrintGlobalCfg();
return 0;

View File

@ -107,6 +107,7 @@
<exclude>**/TaosInfoMonitorTest.java</exclude>
<exclude>**/FailOverTest.java</exclude>
<exclude>**/InvalidResultSetPointerTest.java</exclude>
<exclude>**/RestfulConnectionTest.java</exclude>
</excludes>
<testFailureIgnore>true</testFailureIgnore>
</configuration>

View File

@ -12,7 +12,8 @@ import java.util.Properties;
public class RestfulConnectionTest {
private static final String host = "127.0.0.1";
// private static final String host = "master";
// private static final String host = "master";
private static Connection conn;
@Test

View File

@ -229,6 +229,10 @@
#define TK_SPACE 300
#define TK_COMMENT 301
#define TK_ILLEGAL 302

View File

@ -3,5 +3,4 @@ PROJECT(TDengine)
ADD_SUBDIRECTORY(shell)
ADD_SUBDIRECTORY(taosdemo)
ADD_SUBDIRECTORY(taosdemox)
ADD_SUBDIRECTORY(taosdump)

View File

@ -341,7 +341,7 @@ void shellRunCommandOnServer(TAOS *con, char command[]) {
} else {
int num_rows_affacted = taos_affected_rows(pSql);
et = taosGetTimestampUs();
printf("Query OK, %d row(s) affected (%.6fs)\n", num_rows_affacted, (et - st) / 1E6);
printf("Query OK, %d of %d row(s) in database (%.6fs)\n", num_rows_affacted, num_rows_affacted, (et - st) / 1E6);
}
printf("\n");

View File

@ -2,28 +2,54 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(TDengine)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
INCLUDE_DIRECTORIES(inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/libcurl/include)
IF (TD_LINUX)
AUX_SOURCE_DIRECTORY(. SRC)
ADD_EXECUTABLE(taosdemo ${SRC})
#find_program(HAVE_CURL NAMES curl)
IF ((NOT TD_ARM_64) AND (NOT TD_ARM_32))
ADD_DEFINITIONS(-DTD_LOWA_CURL)
LINK_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/libcurl/lib)
ADD_LIBRARY(curl STATIC IMPORTED)
SET_PROPERTY(TARGET curl PROPERTY IMPORTED_LOCATION ${TD_COMMUNITY_DIR}/deps/libcurl/lib/libcurl.a)
TARGET_LINK_LIBRARIES(taosdemo curl)
ENDIF ()
IF (TD_SOMODE_STATIC)
TARGET_LINK_LIBRARIES(taosdemo taos_static)
TARGET_LINK_LIBRARIES(taosdemo taos_static cJson)
ELSE ()
TARGET_LINK_LIBRARIES(taosdemo taos)
TARGET_LINK_LIBRARIES(taosdemo taos cJson)
ENDIF ()
ELSEIF (TD_WINDOWS)
AUX_SOURCE_DIRECTORY(. SRC)
ADD_EXECUTABLE(taosdemo ${SRC})
TARGET_LINK_LIBRARIES(taosdemo taos_static)
ELSEIF (TD_DARWIN)
AUX_SOURCE_DIRECTORY(. SRC)
ADD_EXECUTABLE(taosdemo ${SRC})
SET_SOURCE_FILES_PROPERTIES(./taosdemo.c PROPERTIES COMPILE_FLAGS -w)
find_library(LIBCURL_A libcurl_a HINTS ${TD_COMMUNITY_DIR}/deps/libcurl/lib/win64)
IF (TD_SOMODE_STATIC)
TARGET_LINK_LIBRARIES(taosdemo taos_static)
TARGET_LINK_LIBRARIES(taosdemo taos_static cJson ${LIBCURL_A})
ELSE ()
TARGET_LINK_LIBRARIES(taosdemo taos)
TARGET_LINK_LIBRARIES(taosdemo taos cJson ${LIBCURL_A})
ENDIF ()
ELSEIF (TD_DARWIN)
# missing a few dependencies, such as <argp.h>
# AUX_SOURCE_DIRECTORY(. SRC)
# ADD_EXECUTABLE(taosdemo ${SRC})
#
# #find_program(HAVE_CURL NAMES curl)
# IF ((NOT TD_ARM_64) AND (NOT TD_ARM_32))
# ADD_DEFINITIONS(-DTD_LOWA_CURL)
# LINK_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/libcurl/lib)
# ADD_LIBRARY(curl STATIC IMPORTED)
# SET_PROPERTY(TARGET curl PROPERTY IMPORTED_LOCATION ${TD_COMMUNITY_DIR}/deps/libcurl/lib/libcurl.a)
# TARGET_LINK_LIBRARIES(taosdemo curl)
# ENDIF ()
#
# IF (TD_SOMODE_STATIC)
# TARGET_LINK_LIBRARIES(taosdemo taos_static cJson)
# ELSE ()
# TARGET_LINK_LIBRARIES(taosdemo taos cJson)
# ENDIF ()
ENDIF ()

File diff suppressed because it is too large Load Diff

View File

@ -1,47 +0,0 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(TDengine)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/libcurl/include)
IF (TD_LINUX)
AUX_SOURCE_DIRECTORY(. SRC)
ADD_EXECUTABLE(taosdemox ${SRC})
#find_program(HAVE_CURL NAMES curl)
IF ((NOT TD_ARM_64) AND (NOT TD_ARM_32))
ADD_DEFINITIONS(-DTD_LOWA_CURL)
LINK_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/libcurl/lib)
ADD_LIBRARY(curl STATIC IMPORTED)
SET_PROPERTY(TARGET curl PROPERTY IMPORTED_LOCATION ${TD_COMMUNITY_DIR}/deps/libcurl/lib/libcurl.a)
TARGET_LINK_LIBRARIES(taosdemox curl)
ENDIF ()
IF (TD_SOMODE_STATIC)
TARGET_LINK_LIBRARIES(taosdemox taos_static cJson)
ELSE ()
TARGET_LINK_LIBRARIES(taosdemox taos cJson)
ENDIF ()
ENDIF ()
IF (TD_DARWIN)
# missing a few dependencies, such as <argp.h>
# AUX_SOURCE_DIRECTORY(. SRC)
# ADD_EXECUTABLE(taosdemox ${SRC})
#
# #find_program(HAVE_CURL NAMES curl)
# IF ((NOT TD_ARM_64) AND (NOT TD_ARM_32))
# ADD_DEFINITIONS(-DTD_LOWA_CURL)
# LINK_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/libcurl/lib)
# ADD_LIBRARY(curl STATIC IMPORTED)
# SET_PROPERTY(TARGET curl PROPERTY IMPORTED_LOCATION ${TD_COMMUNITY_DIR}/deps/libcurl/lib/libcurl.a)
# TARGET_LINK_LIBRARIES(taosdemox curl)
# ENDIF ()
#
# IF (TD_SOMODE_STATIC)
# TARGET_LINK_LIBRARIES(taosdemox taos_static cJson)
# ELSE ()
# TARGET_LINK_LIBRARIES(taosdemox taos cJson)
# ENDIF ()
ENDIF ()

File diff suppressed because it is too large Load Diff

View File

@ -25,7 +25,8 @@ void taosGetTmpfilePath(const char *fileNamePrefix, char *dstPath) {
char tmpPath[PATH_MAX];
int32_t len = strlen(tsTempDir);
memcpy(tmpPath, tsTempDir, len);
static uint64_t seqId = 0;
if (tmpPath[len - 1] != '/') {
tmpPath[len++] = '/';
}
@ -36,8 +37,10 @@ void taosGetTmpfilePath(const char *fileNamePrefix, char *dstPath) {
strcat(tmpPath, "-%d-%s");
}
char rand[8] = {0};
taosRandStr(rand, tListLen(rand) - 1);
char rand[32] = {0};
sprintf(rand, "%"PRIu64, atomic_add_fetch_64(&seqId, 1));
snprintf(dstPath, PATH_MAX, tmpPath, getpid(), rand);
}

View File

@ -154,7 +154,9 @@ void httpReleaseContext(HttpContext *pContext, bool clearRes) {
}
if (clearRes) {
httpClearParser(pContext->parser);
if (pContext->parser) {
httpClearParser(pContext->parser);
}
memset(&pContext->singleCmd, 0, sizeof(HttpSqlCmd));
}

View File

@ -232,6 +232,8 @@ SArray *tVariantListAppendToken(SArray *pList, SStrToken *pAliasToken, uint8_t s
tSQLExpr *tSqlExprCreate(tSQLExpr *pLeft, tSQLExpr *pRight, int32_t optrType);
tSQLExpr *tSqlExprClone(tSQLExpr *pSrc);
void tSqlExprDestroy(tSQLExpr *pExpr);
tSQLExprList *tSqlExprListAppend(tSQLExprList *pList, tSQLExpr *pNode, SStrToken *pDistinct, SStrToken *pToken);

View File

@ -674,6 +674,8 @@ expr(A) ::= expr(X) GE expr(Y). {A = tSqlExprCreate(X, Y, TK_GE);}
expr(A) ::= expr(X) NE expr(Y). {A = tSqlExprCreate(X, Y, TK_NE);}
expr(A) ::= expr(X) EQ expr(Y). {A = tSqlExprCreate(X, Y, TK_EQ);}
expr(A) ::= expr(X) BETWEEN expr(Y) AND expr(Z). { tSQLExpr* X2 = tSqlExprClone(X); A = tSqlExprCreate(tSqlExprCreate(X, Y, TK_GE), tSqlExprCreate(X2, Z, TK_LE), TK_AND);}
expr(A) ::= expr(X) AND expr(Y). {A = tSqlExprCreate(X, Y, TK_AND);}
expr(A) ::= expr(X) OR expr(Y). {A = tSqlExprCreate(X, Y, TK_OR); }

View File

@ -3687,6 +3687,14 @@ static void spread_function(SQLFunctionCtx *pCtx) {
LIST_MINMAX_N(pCtx, pInfo->min, pInfo->max, pCtx->size, pData, double, pCtx->inputType, numOfElems);
} else if (pCtx->inputType == TSDB_DATA_TYPE_FLOAT) {
LIST_MINMAX_N(pCtx, pInfo->min, pInfo->max, pCtx->size, pData, float, pCtx->inputType, numOfElems);
} else if (pCtx->inputType == TSDB_DATA_TYPE_UTINYINT) {
LIST_MINMAX_N(pCtx, pInfo->min, pInfo->max, pCtx->size, pData, uint8_t, pCtx->inputType, numOfElems);
} else if (pCtx->inputType == TSDB_DATA_TYPE_USMALLINT) {
LIST_MINMAX_N(pCtx, pInfo->min, pInfo->max, pCtx->size, pData, uint16_t, pCtx->inputType, numOfElems);
} else if (pCtx->inputType == TSDB_DATA_TYPE_UINT) {
LIST_MINMAX_N(pCtx, pInfo->min, pInfo->max, pCtx->size, pData, uint32_t, pCtx->inputType, numOfElems);
} else if (pCtx->inputType == TSDB_DATA_TYPE_UBIGINT) {
LIST_MINMAX_N(pCtx, pInfo->min, pInfo->max, pCtx->size, pData, uint64_t, pCtx->inputType, numOfElems);
}
if (!pCtx->hasNull) {

View File

@ -5162,6 +5162,8 @@ static void sequentialTableProcess(SQInfo *pQInfo) {
assert(pQuery->prjInfo.vgroupLimit == -1);
}
setQueryStatus(pQuery, QUERY_NOT_COMPLETED);
bool hasMoreBlock = true;
int32_t step = GET_FORWARD_DIRECTION_FACTOR(pQuery->order.order);
SQueryCostInfo *summary = &pRuntimeEnv->summary;

View File

@ -289,6 +289,28 @@ tSQLExpr *tSqlExprCreate(tSQLExpr *pLeft, tSQLExpr *pRight, int32_t optrType) {
return pExpr;
}
tSQLExpr *tSqlExprClone(tSQLExpr *pSrc) {
tSQLExpr *pExpr = calloc(1, sizeof(tSQLExpr));
memcpy(pExpr, pSrc, sizeof(*pSrc));
if (pSrc->pLeft) {
pExpr->pLeft = tSqlExprClone(pSrc->pLeft);
}
if (pSrc->pRight) {
pExpr->pRight = tSqlExprClone(pSrc->pRight);
}
//we don't clone pParam now because clone is only used for between/and
assert(pSrc->pParam == NULL);
return pExpr;
}
void tSqlExprNodeDestroy(tSQLExpr *pExpr) {
if (pExpr == NULL) {
return;
@ -309,8 +331,9 @@ void tSqlExprDestroy(tSQLExpr *pExpr) {
}
tSqlExprDestroy(pExpr->pLeft);
pExpr->pLeft = NULL;
tSqlExprDestroy(pExpr->pRight);
pExpr->pRight = NULL;
tSqlExprNodeDestroy(pExpr);
}

View File

@ -136,18 +136,18 @@ typedef union {
#define ParseCTX_FETCH
#define ParseCTX_STORE
#define YYFALLBACK 1
#define YYNSTATE 290
#define YYNRULE 253
#define YYNRULE_WITH_ACTION 253
#define YYNSTATE 294
#define YYNRULE 254
#define YYNRULE_WITH_ACTION 254
#define YYNTOKEN 210
#define YY_MAX_SHIFT 289
#define YY_MIN_SHIFTREDUCE 473
#define YY_MAX_SHIFTREDUCE 725
#define YY_ERROR_ACTION 726
#define YY_ACCEPT_ACTION 727
#define YY_NO_ACTION 728
#define YY_MIN_REDUCE 729
#define YY_MAX_REDUCE 981
#define YY_MAX_SHIFT 293
#define YY_MIN_SHIFTREDUCE 477
#define YY_MAX_SHIFTREDUCE 730
#define YY_ERROR_ACTION 731
#define YY_ACCEPT_ACTION 732
#define YY_NO_ACTION 733
#define YY_MIN_REDUCE 734
#define YY_MAX_REDUCE 987
/************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
@ -214,139 +214,142 @@ typedef union {
** yy_default[] Default action for each state.
**
*********** Begin parsing tables **********************************************/
#define YY_ACTTAB_COUNT (627)
#define YY_ACTTAB_COUNT (651)
static const YYACTIONTYPE yy_action[] = {
/* 0 */ 888, 517, 727, 289, 517, 182, 287, 590, 28, 518,
/* 10 */ 15, 161, 518, 43, 44, 771, 45, 46, 150, 162,
/* 20 */ 194, 37, 126, 517, 238, 49, 47, 51, 48, 963,
/* 30 */ 166, 518, 186, 42, 41, 264, 263, 40, 39, 38,
/* 40 */ 43, 44, 877, 45, 46, 877, 184, 194, 37, 863,
/* 50 */ 121, 238, 49, 47, 51, 48, 183, 866, 885, 221,
/* 60 */ 42, 41, 126, 126, 40, 39, 38, 474, 475, 476,
/* 70 */ 477, 478, 479, 480, 481, 482, 483, 484, 485, 288,
/* 80 */ 43, 44, 211, 45, 46, 916, 254, 194, 37, 162,
/* 90 */ 630, 238, 49, 47, 51, 48, 71, 94, 189, 964,
/* 100 */ 42, 41, 274, 960, 40, 39, 38, 64, 65, 226,
/* 110 */ 21, 252, 282, 281, 251, 250, 249, 280, 248, 279,
/* 120 */ 278, 277, 247, 276, 275, 917, 70, 233, 830, 674,
/* 130 */ 818, 819, 820, 821, 822, 823, 824, 825, 826, 827,
/* 140 */ 828, 829, 831, 832, 44, 199, 45, 46, 274, 28,
/* 150 */ 194, 37, 162, 959, 238, 49, 47, 51, 48, 860,
/* 160 */ 201, 188, 964, 42, 41, 634, 214, 40, 39, 38,
/* 170 */ 866, 45, 46, 218, 217, 194, 37, 958, 72, 238,
/* 180 */ 49, 47, 51, 48, 16, 866, 205, 197, 42, 41,
/* 190 */ 863, 283, 40, 39, 38, 193, 687, 22, 200, 678,
/* 200 */ 170, 681, 203, 684, 178, 34, 171, 849, 850, 27,
/* 210 */ 853, 106, 105, 169, 193, 687, 866, 179, 678, 75,
/* 220 */ 681, 780, 684, 21, 150, 282, 281, 190, 191, 164,
/* 230 */ 280, 237, 279, 278, 277, 614, 276, 275, 611, 10,
/* 240 */ 612, 22, 613, 74, 165, 136, 190, 191, 63, 34,
/* 250 */ 836, 854, 207, 834, 835, 261, 260, 167, 837, 852,
/* 260 */ 839, 840, 838, 126, 841, 842, 208, 209, 204, 168,
/* 270 */ 220, 256, 49, 47, 51, 48, 28, 177, 851, 927,
/* 280 */ 42, 41, 92, 96, 40, 39, 38, 28, 86, 101,
/* 290 */ 104, 95, 3, 140, 28, 50, 28, 98, 31, 81,
/* 300 */ 77, 80, 28, 156, 152, 119, 28, 206, 686, 154,
/* 310 */ 109, 108, 107, 34, 50, 42, 41, 862, 224, 40,
/* 320 */ 39, 38, 29, 685, 235, 198, 69, 686, 863, 40,
/* 330 */ 39, 38, 257, 192, 258, 863, 254, 863, 676, 864,
/* 340 */ 262, 615, 685, 863, 266, 655, 656, 863, 286, 285,
/* 350 */ 113, 772, 627, 622, 150, 680, 642, 683, 646, 23,
/* 360 */ 123, 223, 54, 647, 706, 688, 239, 18, 17, 17,
/* 370 */ 679, 55, 682, 26, 677, 4, 244, 58, 600, 241,
/* 380 */ 602, 243, 29, 29, 54, 73, 601, 174, 85, 84,
/* 390 */ 54, 175, 56, 12, 11, 173, 59, 91, 90, 61,
/* 400 */ 973, 589, 14, 13, 618, 616, 619, 617, 103, 102,
/* 410 */ 118, 116, 160, 172, 163, 865, 926, 195, 923, 922,
/* 420 */ 196, 265, 879, 120, 887, 35, 909, 894, 896, 908,
/* 430 */ 122, 137, 859, 135, 34, 138, 139, 782, 222, 246,
/* 440 */ 158, 32, 255, 779, 117, 978, 641, 82, 977, 975,
/* 450 */ 141, 259, 972, 88, 971, 227, 969, 142, 800, 690,
/* 460 */ 185, 33, 30, 159, 231, 769, 97, 60, 876, 128,
/* 470 */ 767, 99, 57, 127, 236, 52, 234, 232, 230, 100,
/* 480 */ 765, 764, 130, 210, 228, 36, 151, 93, 762, 267,
/* 490 */ 268, 269, 270, 761, 760, 271, 759, 272, 273, 758,
/* 500 */ 153, 155, 755, 753, 751, 284, 749, 747, 157, 725,
/* 510 */ 225, 66, 212, 67, 910, 213, 724, 215, 216, 723,
/* 520 */ 180, 202, 711, 245, 219, 181, 176, 223, 78, 624,
/* 530 */ 62, 763, 6, 240, 110, 111, 68, 757, 145, 643,
/* 540 */ 144, 801, 143, 146, 147, 149, 148, 756, 1, 124,
/* 550 */ 112, 187, 748, 229, 125, 2, 648, 861, 7, 8,
/* 560 */ 689, 24, 133, 131, 129, 132, 134, 25, 5, 9,
/* 570 */ 691, 19, 20, 242, 76, 558, 554, 74, 552, 551,
/* 580 */ 550, 547, 253, 521, 83, 29, 79, 592, 53, 591,
/* 590 */ 87, 89, 588, 542, 540, 532, 538, 534, 536, 530,
/* 600 */ 528, 560, 559, 557, 556, 555, 553, 549, 548, 54,
/* 610 */ 519, 489, 487, 729, 728, 728, 728, 728, 728, 728,
/* 620 */ 728, 728, 728, 728, 728, 114, 115,
/* 0 */ 74, 521, 732, 293, 521, 165, 186, 291, 28, 522,
/* 10 */ 190, 893, 522, 43, 44, 969, 47, 48, 15, 776,
/* 20 */ 198, 37, 152, 46, 242, 51, 49, 53, 50, 854,
/* 30 */ 855, 27, 858, 42, 41, 871, 128, 40, 39, 38,
/* 40 */ 43, 44, 882, 47, 48, 882, 188, 198, 37, 868,
/* 50 */ 46, 242, 51, 49, 53, 50, 187, 128, 203, 225,
/* 60 */ 42, 41, 979, 165, 40, 39, 38, 43, 44, 890,
/* 70 */ 47, 48, 193, 970, 198, 37, 165, 46, 242, 51,
/* 80 */ 49, 53, 50, 871, 128, 192, 970, 42, 41, 258,
/* 90 */ 521, 40, 39, 38, 290, 289, 115, 239, 522, 71,
/* 100 */ 77, 43, 45, 128, 47, 48, 205, 66, 198, 37,
/* 110 */ 28, 46, 242, 51, 49, 53, 50, 40, 39, 38,
/* 120 */ 921, 42, 41, 278, 65, 40, 39, 38, 865, 678,
/* 130 */ 287, 871, 859, 210, 478, 479, 480, 481, 482, 483,
/* 140 */ 484, 485, 486, 487, 488, 489, 292, 72, 201, 215,
/* 150 */ 44, 868, 47, 48, 856, 871, 198, 37, 209, 46,
/* 160 */ 242, 51, 49, 53, 50, 869, 922, 204, 237, 42,
/* 170 */ 41, 96, 163, 40, 39, 38, 278, 21, 256, 286,
/* 180 */ 285, 255, 254, 253, 284, 252, 283, 282, 281, 251,
/* 190 */ 280, 279, 835, 594, 823, 824, 825, 826, 827, 828,
/* 200 */ 829, 830, 831, 832, 833, 834, 836, 837, 47, 48,
/* 210 */ 87, 86, 198, 37, 28, 46, 242, 51, 49, 53,
/* 220 */ 50, 268, 267, 16, 211, 42, 41, 265, 264, 40,
/* 230 */ 39, 38, 197, 691, 28, 634, 682, 207, 685, 174,
/* 240 */ 688, 22, 42, 41, 73, 175, 40, 39, 38, 34,
/* 250 */ 108, 107, 173, 197, 691, 867, 67, 682, 28, 685,
/* 260 */ 21, 688, 286, 285, 194, 195, 169, 284, 241, 283,
/* 270 */ 282, 281, 202, 280, 279, 868, 618, 28, 60, 615,
/* 280 */ 22, 616, 631, 617, 218, 194, 195, 123, 34, 23,
/* 290 */ 841, 222, 221, 839, 840, 857, 261, 61, 842, 868,
/* 300 */ 844, 845, 843, 208, 846, 847, 260, 212, 213, 224,
/* 310 */ 638, 51, 49, 53, 50, 262, 181, 28, 868, 42,
/* 320 */ 41, 94, 98, 40, 39, 38, 28, 88, 103, 106,
/* 330 */ 97, 10, 52, 3, 142, 76, 100, 138, 680, 31,
/* 340 */ 83, 79, 82, 158, 154, 690, 230, 659, 660, 156,
/* 350 */ 111, 110, 109, 52, 785, 266, 777, 152, 868, 152,
/* 360 */ 689, 626, 121, 684, 270, 687, 690, 868, 196, 227,
/* 370 */ 34, 228, 258, 646, 681, 29, 683, 125, 686, 650,
/* 380 */ 651, 689, 619, 56, 18, 711, 692, 243, 966, 17,
/* 390 */ 17, 57, 604, 245, 606, 247, 29, 29, 56, 75,
/* 400 */ 605, 63, 26, 593, 56, 248, 12, 11, 93, 92,
/* 410 */ 4, 965, 58, 14, 13, 622, 620, 623, 621, 105,
/* 420 */ 104, 120, 118, 932, 964, 182, 183, 167, 168, 170,
/* 430 */ 164, 171, 172, 178, 179, 177, 162, 176, 166, 870,
/* 440 */ 931, 199, 928, 927, 884, 200, 269, 122, 892, 35,
/* 450 */ 899, 901, 124, 139, 864, 914, 140, 141, 913, 137,
/* 460 */ 787, 250, 160, 32, 259, 34, 784, 984, 84, 983,
/* 470 */ 981, 143, 226, 119, 231, 263, 978, 90, 977, 975,
/* 480 */ 694, 144, 645, 805, 189, 235, 62, 881, 129, 33,
/* 490 */ 59, 240, 30, 54, 161, 132, 130, 238, 236, 131,
/* 500 */ 774, 99, 772, 133, 234, 134, 232, 101, 36, 102,
/* 510 */ 770, 95, 769, 271, 272, 214, 153, 767, 766, 765,
/* 520 */ 764, 763, 273, 155, 157, 760, 758, 756, 754, 752,
/* 530 */ 159, 274, 229, 68, 69, 915, 275, 276, 277, 184,
/* 540 */ 206, 249, 730, 185, 180, 288, 80, 216, 217, 768,
/* 550 */ 729, 220, 219, 112, 728, 762, 147, 761, 146, 806,
/* 560 */ 145, 148, 149, 151, 150, 113, 114, 753, 1, 716,
/* 570 */ 2, 223, 227, 628, 64, 6, 866, 244, 70, 647,
/* 580 */ 126, 135, 136, 191, 24, 233, 7, 652, 127, 8,
/* 590 */ 693, 5, 25, 9, 19, 246, 20, 695, 78, 76,
/* 600 */ 562, 558, 556, 555, 554, 551, 525, 257, 81, 85,
/* 610 */ 29, 55, 596, 595, 89, 91, 592, 546, 544, 536,
/* 620 */ 542, 538, 540, 534, 532, 564, 563, 561, 560, 559,
/* 630 */ 557, 553, 552, 56, 523, 493, 491, 734, 733, 733,
/* 640 */ 733, 733, 733, 733, 733, 733, 733, 733, 733, 116,
/* 650 */ 117,
};
static const YYCODETYPE yy_lookahead[] = {
/* 0 */ 213, 1, 210, 211, 1, 212, 213, 5, 213, 9,
/* 10 */ 270, 270, 9, 13, 14, 217, 16, 17, 220, 270,
/* 20 */ 20, 21, 213, 1, 24, 25, 26, 27, 28, 280,
/* 30 */ 270, 9, 230, 33, 34, 33, 34, 37, 38, 39,
/* 0 */ 218, 1, 210, 211, 1, 270, 212, 213, 213, 9,
/* 10 */ 230, 213, 9, 13, 14, 280, 16, 17, 270, 217,
/* 20 */ 20, 21, 220, 23, 24, 25, 26, 27, 28, 247,
/* 30 */ 248, 249, 250, 33, 34, 255, 213, 37, 38, 39,
/* 40 */ 13, 14, 253, 16, 17, 253, 251, 20, 21, 254,
/* 50 */ 213, 24, 25, 26, 27, 28, 267, 255, 271, 267,
/* 60 */ 33, 34, 213, 213, 37, 38, 39, 45, 46, 47,
/* 70 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
/* 80 */ 13, 14, 60, 16, 17, 276, 77, 20, 21, 270,
/* 90 */ 37, 24, 25, 26, 27, 28, 256, 74, 279, 280,
/* 100 */ 33, 34, 79, 270, 37, 38, 39, 107, 268, 272,
/* 110 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
/* 120 */ 96, 97, 98, 99, 100, 276, 276, 278, 229, 102,
/* 130 */ 231, 232, 233, 234, 235, 236, 237, 238, 239, 240,
/* 140 */ 241, 242, 243, 244, 14, 230, 16, 17, 79, 213,
/* 150 */ 20, 21, 270, 270, 24, 25, 26, 27, 28, 213,
/* 160 */ 230, 279, 280, 33, 34, 112, 131, 37, 38, 39,
/* 170 */ 255, 16, 17, 138, 139, 20, 21, 270, 218, 24,
/* 180 */ 25, 26, 27, 28, 44, 255, 66, 251, 33, 34,
/* 190 */ 254, 230, 37, 38, 39, 1, 2, 101, 252, 5,
/* 200 */ 60, 7, 66, 9, 270, 109, 66, 247, 248, 249,
/* 210 */ 250, 71, 72, 73, 1, 2, 255, 270, 5, 218,
/* 220 */ 7, 217, 9, 86, 220, 88, 89, 33, 34, 270,
/* 230 */ 93, 37, 95, 96, 97, 2, 99, 100, 5, 101,
/* 240 */ 7, 101, 9, 105, 270, 107, 33, 34, 218, 109,
/* 250 */ 229, 250, 132, 232, 233, 135, 136, 270, 237, 0,
/* 260 */ 239, 240, 241, 213, 243, 244, 33, 34, 132, 270,
/* 270 */ 130, 135, 25, 26, 27, 28, 213, 137, 248, 246,
/* 280 */ 33, 34, 61, 62, 37, 38, 39, 213, 67, 68,
/* 290 */ 69, 70, 61, 62, 213, 101, 213, 76, 67, 68,
/* 300 */ 69, 70, 213, 61, 62, 101, 213, 213, 114, 67,
/* 310 */ 68, 69, 70, 109, 101, 33, 34, 254, 102, 37,
/* 320 */ 38, 39, 106, 129, 274, 251, 276, 114, 254, 37,
/* 330 */ 38, 39, 251, 59, 251, 254, 77, 254, 1, 245,
/* 340 */ 251, 108, 129, 254, 251, 120, 121, 254, 63, 64,
/* 350 */ 65, 217, 106, 102, 220, 5, 102, 7, 102, 113,
/* 360 */ 106, 110, 106, 102, 102, 102, 15, 106, 106, 106,
/* 370 */ 5, 106, 7, 101, 37, 101, 104, 106, 102, 102,
/* 380 */ 102, 102, 106, 106, 106, 106, 102, 270, 133, 134,
/* 390 */ 106, 270, 127, 133, 134, 270, 125, 133, 134, 101,
/* 400 */ 255, 103, 133, 134, 5, 5, 7, 7, 74, 75,
/* 410 */ 61, 62, 270, 270, 270, 255, 246, 246, 246, 246,
/* 420 */ 246, 246, 253, 213, 213, 269, 277, 213, 213, 277,
/* 430 */ 213, 213, 213, 257, 109, 213, 213, 213, 253, 213,
/* 440 */ 213, 213, 213, 213, 59, 213, 114, 213, 213, 213,
/* 450 */ 213, 213, 213, 213, 213, 273, 213, 213, 213, 108,
/* 460 */ 273, 213, 213, 213, 273, 213, 213, 124, 266, 264,
/* 470 */ 213, 213, 126, 265, 118, 123, 122, 117, 116, 213,
/* 480 */ 213, 213, 262, 213, 115, 128, 213, 85, 213, 84,
/* 490 */ 49, 81, 83, 213, 213, 53, 213, 82, 80, 213,
/* 500 */ 213, 213, 213, 213, 213, 77, 213, 213, 213, 5,
/* 510 */ 214, 214, 140, 214, 214, 5, 5, 140, 5, 5,
/* 520 */ 214, 214, 87, 214, 131, 214, 214, 110, 218, 102,
/* 530 */ 111, 214, 101, 104, 215, 215, 106, 214, 222, 102,
/* 540 */ 226, 228, 227, 225, 223, 221, 224, 214, 219, 101,
/* 550 */ 215, 1, 214, 101, 101, 216, 102, 253, 119, 119,
/* 560 */ 102, 106, 259, 261, 263, 260, 258, 106, 101, 101,
/* 570 */ 108, 101, 101, 104, 74, 9, 5, 105, 5, 5,
/* 580 */ 5, 5, 15, 78, 134, 106, 74, 5, 16, 5,
/* 590 */ 134, 134, 102, 5, 5, 5, 5, 5, 5, 5,
/* 600 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 106,
/* 610 */ 78, 59, 58, 0, 281, 281, 281, 281, 281, 281,
/* 620 */ 281, 281, 281, 281, 281, 21, 21, 281, 281, 281,
/* 630 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
/* 640 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
/* 650 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
/* 50 */ 23, 24, 25, 26, 27, 28, 267, 213, 230, 267,
/* 60 */ 33, 34, 255, 270, 37, 38, 39, 13, 14, 271,
/* 70 */ 16, 17, 279, 280, 20, 21, 270, 23, 24, 25,
/* 80 */ 26, 27, 28, 255, 213, 279, 280, 33, 34, 77,
/* 90 */ 1, 37, 38, 39, 63, 64, 65, 274, 9, 276,
/* 100 */ 218, 13, 14, 213, 16, 17, 230, 107, 20, 21,
/* 110 */ 213, 23, 24, 25, 26, 27, 28, 37, 38, 39,
/* 120 */ 276, 33, 34, 79, 218, 37, 38, 39, 213, 102,
/* 130 */ 230, 255, 250, 213, 45, 46, 47, 48, 49, 50,
/* 140 */ 51, 52, 53, 54, 55, 56, 57, 276, 251, 60,
/* 150 */ 14, 254, 16, 17, 248, 255, 20, 21, 66, 23,
/* 160 */ 24, 25, 26, 27, 28, 245, 276, 252, 278, 33,
/* 170 */ 34, 74, 270, 37, 38, 39, 79, 86, 87, 88,
/* 180 */ 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
/* 190 */ 99, 100, 229, 5, 231, 232, 233, 234, 235, 236,
/* 200 */ 237, 238, 239, 240, 241, 242, 243, 244, 16, 17,
/* 210 */ 133, 134, 20, 21, 213, 23, 24, 25, 26, 27,
/* 220 */ 28, 33, 34, 44, 132, 33, 34, 135, 136, 37,
/* 230 */ 38, 39, 1, 2, 213, 37, 5, 66, 7, 60,
/* 240 */ 9, 101, 33, 34, 256, 66, 37, 38, 39, 109,
/* 250 */ 71, 72, 73, 1, 2, 254, 268, 5, 213, 7,
/* 260 */ 86, 9, 88, 89, 33, 34, 270, 93, 37, 95,
/* 270 */ 96, 97, 251, 99, 100, 254, 2, 213, 106, 5,
/* 280 */ 101, 7, 106, 9, 131, 33, 34, 213, 109, 113,
/* 290 */ 229, 138, 139, 232, 233, 0, 251, 125, 237, 254,
/* 300 */ 239, 240, 241, 132, 243, 244, 135, 33, 34, 130,
/* 310 */ 112, 25, 26, 27, 28, 251, 137, 213, 254, 33,
/* 320 */ 34, 61, 62, 37, 38, 39, 213, 67, 68, 69,
/* 330 */ 70, 101, 101, 61, 62, 105, 76, 107, 1, 67,
/* 340 */ 68, 69, 70, 61, 62, 114, 272, 120, 121, 67,
/* 350 */ 68, 69, 70, 101, 217, 251, 217, 220, 254, 220,
/* 360 */ 129, 102, 101, 5, 251, 7, 114, 254, 59, 110,
/* 370 */ 109, 102, 77, 102, 37, 106, 5, 106, 7, 102,
/* 380 */ 102, 129, 108, 106, 106, 102, 102, 15, 270, 106,
/* 390 */ 106, 106, 102, 102, 102, 102, 106, 106, 106, 106,
/* 400 */ 102, 101, 101, 103, 106, 104, 133, 134, 133, 134,
/* 410 */ 101, 270, 127, 133, 134, 5, 5, 7, 7, 74,
/* 420 */ 75, 61, 62, 246, 270, 270, 270, 270, 270, 270,
/* 430 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 255,
/* 440 */ 246, 246, 246, 246, 253, 246, 246, 213, 213, 269,
/* 450 */ 213, 213, 213, 213, 213, 277, 213, 213, 277, 257,
/* 460 */ 213, 213, 213, 213, 213, 109, 213, 213, 213, 213,
/* 470 */ 213, 213, 253, 59, 273, 213, 213, 213, 213, 213,
/* 480 */ 108, 213, 114, 213, 273, 273, 124, 266, 265, 213,
/* 490 */ 126, 118, 213, 123, 213, 262, 264, 122, 117, 263,
/* 500 */ 213, 213, 213, 261, 116, 260, 115, 213, 128, 213,
/* 510 */ 213, 85, 213, 84, 49, 213, 213, 213, 213, 213,
/* 520 */ 213, 213, 81, 213, 213, 213, 213, 213, 213, 213,
/* 530 */ 213, 83, 214, 214, 214, 214, 53, 82, 80, 214,
/* 540 */ 214, 214, 5, 214, 214, 77, 218, 140, 5, 214,
/* 550 */ 5, 5, 140, 215, 5, 214, 222, 214, 226, 228,
/* 560 */ 227, 225, 223, 221, 224, 215, 215, 214, 219, 87,
/* 570 */ 216, 131, 110, 102, 111, 101, 253, 104, 106, 102,
/* 580 */ 101, 259, 258, 1, 106, 101, 119, 102, 101, 119,
/* 590 */ 102, 101, 106, 101, 101, 104, 101, 108, 74, 105,
/* 600 */ 9, 5, 5, 5, 5, 5, 78, 15, 74, 134,
/* 610 */ 106, 16, 5, 5, 134, 134, 102, 5, 5, 5,
/* 620 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
/* 630 */ 5, 5, 5, 106, 78, 59, 58, 0, 281, 281,
/* 640 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 21,
/* 650 */ 21, 281, 281, 281, 281, 281, 281, 281, 281, 281,
/* 660 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
/* 670 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
/* 680 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
@ -364,93 +367,99 @@ static const YYCODETYPE yy_lookahead[] = {
/* 800 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
/* 810 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
/* 820 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
/* 830 */ 281, 281, 281, 281, 281, 281, 281,
/* 830 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
/* 840 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
/* 850 */ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
/* 860 */ 281,
};
#define YY_SHIFT_COUNT (289)
#define YY_SHIFT_COUNT (293)
#define YY_SHIFT_MIN (0)
#define YY_SHIFT_MAX (613)
#define YY_SHIFT_MAX (637)
static const unsigned short int yy_shift_ofst[] = {
/* 0 */ 140, 24, 137, 9, 194, 213, 3, 3, 3, 3,
/* 10 */ 3, 3, 3, 3, 3, 0, 22, 213, 233, 233,
/* 20 */ 233, 233, 96, 3, 3, 3, 3, 259, 3, 3,
/* 30 */ 23, 9, 69, 69, 627, 213, 213, 213, 213, 213,
/* 40 */ 213, 213, 213, 213, 213, 213, 213, 213, 213, 213,
/* 50 */ 213, 213, 213, 233, 233, 2, 2, 2, 2, 2,
/* 60 */ 2, 2, 204, 3, 3, 53, 3, 3, 3, 225,
/* 70 */ 225, 246, 3, 3, 3, 3, 3, 3, 3, 3,
/* 0 */ 179, 91, 174, 12, 231, 252, 3, 3, 3, 3,
/* 10 */ 3, 3, 3, 3, 3, 0, 89, 252, 274, 274,
/* 20 */ 274, 274, 140, 3, 3, 3, 3, 295, 3, 3,
/* 30 */ 97, 12, 44, 44, 651, 252, 252, 252, 252, 252,
/* 40 */ 252, 252, 252, 252, 252, 252, 252, 252, 252, 252,
/* 50 */ 252, 252, 252, 252, 252, 274, 274, 188, 188, 188,
/* 60 */ 188, 188, 188, 188, 261, 3, 3, 198, 3, 3,
/* 70 */ 3, 227, 227, 176, 3, 3, 3, 3, 3, 3,
/* 80 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
/* 90 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
/* 100 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
/* 110 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 325,
/* 120 */ 385, 385, 385, 332, 332, 332, 385, 343, 346, 352,
/* 130 */ 356, 354, 360, 362, 369, 357, 325, 385, 385, 385,
/* 140 */ 9, 385, 385, 402, 405, 441, 410, 409, 442, 415,
/* 150 */ 418, 385, 428, 385, 428, 385, 428, 385, 627, 627,
/* 160 */ 27, 67, 67, 67, 130, 155, 247, 247, 247, 221,
/* 170 */ 231, 242, 282, 282, 282, 282, 120, 35, 292, 292,
/* 180 */ 138, 136, 285, 251, 216, 254, 256, 261, 262, 263,
/* 190 */ 350, 365, 337, 274, 351, 265, 271, 276, 277, 278,
/* 200 */ 279, 284, 272, 255, 260, 264, 298, 269, 399, 400,
/* 210 */ 334, 349, 504, 372, 510, 511, 377, 513, 514, 435,
/* 220 */ 393, 417, 427, 419, 429, 431, 430, 437, 448, 550,
/* 230 */ 452, 454, 453, 455, 439, 461, 440, 458, 467, 462,
/* 240 */ 468, 429, 470, 469, 471, 472, 500, 566, 571, 573,
/* 250 */ 574, 575, 576, 505, 567, 512, 450, 479, 479, 572,
/* 260 */ 456, 457, 479, 582, 584, 490, 479, 588, 589, 590,
/* 270 */ 591, 592, 593, 594, 595, 596, 597, 598, 599, 600,
/* 280 */ 601, 602, 603, 503, 532, 604, 605, 552, 554, 613,
/* 110 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
/* 120 */ 3, 356, 414, 414, 414, 368, 368, 368, 414, 362,
/* 130 */ 364, 370, 373, 375, 381, 388, 391, 380, 356, 414,
/* 140 */ 414, 414, 12, 414, 414, 426, 429, 465, 441, 448,
/* 150 */ 483, 455, 458, 414, 468, 414, 468, 414, 468, 414,
/* 160 */ 651, 651, 27, 54, 88, 54, 54, 136, 192, 286,
/* 170 */ 286, 286, 286, 260, 272, 282, 209, 209, 209, 209,
/* 180 */ 92, 153, 80, 80, 230, 171, 31, 259, 269, 271,
/* 190 */ 277, 278, 283, 284, 358, 371, 337, 309, 372, 285,
/* 200 */ 172, 290, 291, 292, 293, 298, 301, 77, 273, 275,
/* 210 */ 300, 280, 410, 411, 345, 360, 537, 407, 543, 545,
/* 220 */ 412, 546, 549, 482, 440, 462, 471, 463, 473, 474,
/* 230 */ 472, 477, 479, 582, 484, 485, 487, 478, 467, 486,
/* 240 */ 470, 488, 490, 489, 492, 473, 493, 491, 495, 494,
/* 250 */ 524, 591, 596, 597, 598, 599, 600, 528, 592, 534,
/* 260 */ 475, 504, 504, 595, 480, 481, 504, 607, 608, 514,
/* 270 */ 504, 612, 613, 614, 615, 616, 617, 618, 619, 620,
/* 280 */ 621, 622, 623, 624, 625, 626, 627, 527, 556, 628,
/* 290 */ 629, 576, 578, 637,
};
#define YY_REDUCE_COUNT (159)
#define YY_REDUCE_MIN (-260)
#define YY_REDUCE_MAX (339)
#define YY_REDUCE_COUNT (161)
#define YY_REDUCE_MIN (-265)
#define YY_REDUCE_MAX (354)
static const short yy_reduce_ofst[] = {
/* 0 */ -208, -101, 21, -40, -181, -118, -205, -151, 50, -64,
/* 10 */ 74, 81, 83, 89, 93, -213, -207, -251, -198, -85,
/* 20 */ -70, -39, -211, -163, -191, -150, -54, 1, 94, 63,
/* 30 */ -202, 30, 4, 134, -160, -260, -259, -240, -167, -117,
/* 40 */ -93, -66, -53, -41, -26, -13, -1, 117, 121, 125,
/* 50 */ 142, 143, 144, 145, 160, 33, 170, 171, 172, 173,
/* 60 */ 174, 175, 169, 210, 211, 156, 214, 215, 217, 149,
/* 70 */ 152, 176, 218, 219, 222, 223, 224, 226, 227, 228,
/* 80 */ 229, 230, 232, 234, 235, 236, 237, 238, 239, 240,
/* 90 */ 241, 243, 244, 245, 248, 249, 250, 252, 253, 257,
/* 100 */ 258, 266, 267, 268, 270, 273, 275, 280, 281, 283,
/* 110 */ 286, 287, 288, 289, 290, 291, 293, 294, 295, 185,
/* 120 */ 296, 297, 299, 182, 187, 191, 300, 202, 208, 205,
/* 130 */ 301, 220, 302, 305, 303, 308, 304, 306, 307, 309,
/* 140 */ 310, 311, 312, 313, 315, 314, 316, 318, 321, 322,
/* 150 */ 324, 317, 319, 323, 320, 333, 335, 338, 329, 339,
/* 0 */ -208, -37, 61, -218, -207, -194, -205, -110, -177, -103,
/* 10 */ 21, 45, 64, 104, 113, -202, -206, -265, -220, -172,
/* 20 */ -124, -100, -211, 74, -156, -129, -85, -118, -80, 1,
/* 30 */ -198, -94, 137, 139, -12, -252, -98, -4, 118, 141,
/* 40 */ 154, 155, 156, 157, 158, 159, 160, 161, 162, 163,
/* 50 */ 164, 165, 166, 167, 168, -193, 184, 177, 194, 195,
/* 60 */ 196, 197, 199, 200, 191, 234, 235, 180, 237, 238,
/* 70 */ 239, 178, 181, 202, 240, 241, 243, 244, 247, 248,
/* 80 */ 249, 250, 251, 253, 254, 255, 256, 257, 258, 262,
/* 90 */ 263, 264, 265, 266, 268, 270, 276, 279, 281, 287,
/* 100 */ 288, 289, 294, 296, 297, 299, 302, 303, 304, 305,
/* 110 */ 306, 307, 308, 310, 311, 312, 313, 314, 315, 316,
/* 120 */ 317, 219, 318, 319, 320, 201, 211, 212, 321, 221,
/* 130 */ 223, 232, 236, 233, 242, 245, 322, 324, 323, 325,
/* 140 */ 326, 327, 328, 329, 330, 331, 333, 332, 334, 336,
/* 150 */ 339, 340, 342, 335, 338, 341, 350, 343, 351, 353,
/* 160 */ 349, 354,
};
static const YYACTIONTYPE yy_default[] = {
/* 0 */ 726, 781, 770, 778, 966, 966, 726, 726, 726, 726,
/* 10 */ 726, 726, 726, 726, 726, 889, 744, 966, 726, 726,
/* 20 */ 726, 726, 726, 726, 726, 726, 726, 778, 726, 726,
/* 30 */ 783, 778, 783, 783, 884, 726, 726, 726, 726, 726,
/* 40 */ 726, 726, 726, 726, 726, 726, 726, 726, 726, 726,
/* 50 */ 726, 726, 726, 726, 726, 726, 726, 726, 726, 726,
/* 60 */ 726, 726, 726, 726, 726, 891, 893, 895, 726, 913,
/* 70 */ 913, 882, 726, 726, 726, 726, 726, 726, 726, 726,
/* 80 */ 726, 726, 726, 726, 726, 726, 726, 726, 726, 726,
/* 90 */ 726, 726, 726, 726, 726, 726, 726, 768, 726, 766,
/* 100 */ 726, 726, 726, 726, 726, 726, 726, 726, 726, 726,
/* 110 */ 726, 726, 726, 754, 726, 726, 726, 726, 726, 726,
/* 120 */ 746, 746, 746, 726, 726, 726, 746, 920, 924, 918,
/* 130 */ 906, 914, 905, 901, 900, 928, 726, 746, 746, 746,
/* 140 */ 778, 746, 746, 799, 797, 795, 787, 793, 789, 791,
/* 150 */ 785, 746, 776, 746, 776, 746, 776, 746, 817, 833,
/* 160 */ 726, 929, 965, 919, 955, 954, 961, 953, 952, 726,
/* 170 */ 726, 726, 948, 949, 951, 950, 726, 726, 957, 956,
/* 180 */ 726, 726, 726, 726, 726, 726, 726, 726, 726, 726,
/* 190 */ 726, 726, 726, 931, 726, 925, 921, 726, 726, 726,
/* 200 */ 726, 726, 726, 726, 726, 726, 843, 726, 726, 726,
/* 210 */ 726, 726, 726, 726, 726, 726, 726, 726, 726, 726,
/* 220 */ 726, 881, 726, 726, 726, 726, 892, 726, 726, 726,
/* 230 */ 726, 726, 726, 915, 726, 907, 726, 726, 726, 726,
/* 240 */ 726, 855, 726, 726, 726, 726, 726, 726, 726, 726,
/* 250 */ 726, 726, 726, 726, 726, 726, 726, 976, 974, 726,
/* 260 */ 726, 726, 970, 726, 726, 726, 968, 726, 726, 726,
/* 270 */ 726, 726, 726, 726, 726, 726, 726, 726, 726, 726,
/* 280 */ 726, 726, 726, 802, 726, 752, 750, 726, 742, 726,
/* 0 */ 731, 786, 775, 783, 972, 972, 731, 731, 731, 731,
/* 10 */ 731, 731, 731, 731, 731, 894, 749, 972, 731, 731,
/* 20 */ 731, 731, 731, 731, 731, 731, 731, 783, 731, 731,
/* 30 */ 788, 783, 788, 788, 889, 731, 731, 731, 731, 731,
/* 40 */ 731, 731, 731, 731, 731, 731, 731, 731, 731, 731,
/* 50 */ 731, 731, 731, 731, 731, 731, 731, 731, 731, 731,
/* 60 */ 731, 731, 731, 731, 731, 731, 731, 896, 898, 900,
/* 70 */ 731, 918, 918, 887, 731, 731, 731, 731, 731, 731,
/* 80 */ 731, 731, 731, 731, 731, 731, 731, 731, 731, 731,
/* 90 */ 731, 731, 731, 731, 731, 731, 731, 731, 731, 773,
/* 100 */ 731, 771, 731, 731, 731, 731, 731, 731, 731, 731,
/* 110 */ 731, 731, 731, 731, 731, 759, 731, 731, 731, 731,
/* 120 */ 731, 731, 751, 751, 751, 731, 731, 731, 751, 925,
/* 130 */ 929, 923, 911, 919, 910, 906, 905, 933, 731, 751,
/* 140 */ 751, 751, 783, 751, 751, 804, 802, 800, 792, 798,
/* 150 */ 794, 796, 790, 751, 781, 751, 781, 751, 781, 751,
/* 160 */ 822, 838, 731, 934, 731, 971, 924, 961, 960, 967,
/* 170 */ 959, 958, 957, 731, 731, 731, 953, 954, 956, 955,
/* 180 */ 731, 731, 963, 962, 731, 731, 731, 731, 731, 731,
/* 190 */ 731, 731, 731, 731, 731, 731, 731, 936, 731, 930,
/* 200 */ 926, 731, 731, 731, 731, 731, 731, 731, 731, 731,
/* 210 */ 848, 731, 731, 731, 731, 731, 731, 731, 731, 731,
/* 220 */ 731, 731, 731, 731, 731, 886, 731, 731, 731, 731,
/* 230 */ 897, 731, 731, 731, 731, 731, 731, 920, 731, 912,
/* 240 */ 731, 731, 731, 731, 731, 860, 731, 731, 731, 731,
/* 250 */ 731, 731, 731, 731, 731, 731, 731, 731, 731, 731,
/* 260 */ 731, 982, 980, 731, 731, 731, 976, 731, 731, 731,
/* 270 */ 974, 731, 731, 731, 731, 731, 731, 731, 731, 731,
/* 280 */ 731, 731, 731, 731, 731, 731, 731, 807, 731, 757,
/* 290 */ 755, 731, 747, 731,
};
/********** End of lemon-generated parsing tables *****************************/
@ -1280,34 +1289,35 @@ static const char *const yyRuleName[] = {
/* 222 */ "expr ::= expr GE expr",
/* 223 */ "expr ::= expr NE expr",
/* 224 */ "expr ::= expr EQ expr",
/* 225 */ "expr ::= expr AND expr",
/* 226 */ "expr ::= expr OR expr",
/* 227 */ "expr ::= expr PLUS expr",
/* 228 */ "expr ::= expr MINUS expr",
/* 229 */ "expr ::= expr STAR expr",
/* 230 */ "expr ::= expr SLASH expr",
/* 231 */ "expr ::= expr REM expr",
/* 232 */ "expr ::= expr LIKE expr",
/* 233 */ "expr ::= expr IN LP exprlist RP",
/* 234 */ "exprlist ::= exprlist COMMA expritem",
/* 235 */ "exprlist ::= expritem",
/* 236 */ "expritem ::= expr",
/* 237 */ "expritem ::=",
/* 238 */ "cmd ::= RESET QUERY CACHE",
/* 239 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist",
/* 240 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids",
/* 241 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist",
/* 242 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids",
/* 243 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids",
/* 244 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem",
/* 245 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist",
/* 246 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids",
/* 247 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist",
/* 248 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids",
/* 249 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids",
/* 250 */ "cmd ::= KILL CONNECTION INTEGER",
/* 251 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER",
/* 252 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER",
/* 225 */ "expr ::= expr BETWEEN expr AND expr",
/* 226 */ "expr ::= expr AND expr",
/* 227 */ "expr ::= expr OR expr",
/* 228 */ "expr ::= expr PLUS expr",
/* 229 */ "expr ::= expr MINUS expr",
/* 230 */ "expr ::= expr STAR expr",
/* 231 */ "expr ::= expr SLASH expr",
/* 232 */ "expr ::= expr REM expr",
/* 233 */ "expr ::= expr LIKE expr",
/* 234 */ "expr ::= expr IN LP exprlist RP",
/* 235 */ "exprlist ::= exprlist COMMA expritem",
/* 236 */ "exprlist ::= expritem",
/* 237 */ "expritem ::= expr",
/* 238 */ "expritem ::=",
/* 239 */ "cmd ::= RESET QUERY CACHE",
/* 240 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist",
/* 241 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids",
/* 242 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist",
/* 243 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids",
/* 244 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids",
/* 245 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem",
/* 246 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist",
/* 247 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids",
/* 248 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist",
/* 249 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids",
/* 250 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids",
/* 251 */ "cmd ::= KILL CONNECTION INTEGER",
/* 252 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER",
/* 253 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER",
};
#endif /* NDEBUG */
@ -1992,34 +2002,35 @@ static const YYCODETYPE yyRuleInfoLhs[] = {
270, /* (222) expr ::= expr GE expr */
270, /* (223) expr ::= expr NE expr */
270, /* (224) expr ::= expr EQ expr */
270, /* (225) expr ::= expr AND expr */
270, /* (226) expr ::= expr OR expr */
270, /* (227) expr ::= expr PLUS expr */
270, /* (228) expr ::= expr MINUS expr */
270, /* (229) expr ::= expr STAR expr */
270, /* (230) expr ::= expr SLASH expr */
270, /* (231) expr ::= expr REM expr */
270, /* (232) expr ::= expr LIKE expr */
270, /* (233) expr ::= expr IN LP exprlist RP */
279, /* (234) exprlist ::= exprlist COMMA expritem */
279, /* (235) exprlist ::= expritem */
280, /* (236) expritem ::= expr */
280, /* (237) expritem ::= */
211, /* (238) cmd ::= RESET QUERY CACHE */
211, /* (239) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
211, /* (240) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
211, /* (241) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
211, /* (242) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
211, /* (243) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
211, /* (244) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
211, /* (245) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
211, /* (246) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
211, /* (247) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
211, /* (248) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
211, /* (249) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
211, /* (250) cmd ::= KILL CONNECTION INTEGER */
211, /* (251) cmd ::= KILL STREAM INTEGER COLON INTEGER */
211, /* (252) cmd ::= KILL QUERY INTEGER COLON INTEGER */
270, /* (225) expr ::= expr BETWEEN expr AND expr */
270, /* (226) expr ::= expr AND expr */
270, /* (227) expr ::= expr OR expr */
270, /* (228) expr ::= expr PLUS expr */
270, /* (229) expr ::= expr MINUS expr */
270, /* (230) expr ::= expr STAR expr */
270, /* (231) expr ::= expr SLASH expr */
270, /* (232) expr ::= expr REM expr */
270, /* (233) expr ::= expr LIKE expr */
270, /* (234) expr ::= expr IN LP exprlist RP */
279, /* (235) exprlist ::= exprlist COMMA expritem */
279, /* (236) exprlist ::= expritem */
280, /* (237) expritem ::= expr */
280, /* (238) expritem ::= */
211, /* (239) cmd ::= RESET QUERY CACHE */
211, /* (240) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
211, /* (241) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
211, /* (242) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
211, /* (243) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
211, /* (244) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
211, /* (245) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
211, /* (246) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
211, /* (247) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
211, /* (248) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
211, /* (249) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
211, /* (250) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
211, /* (251) cmd ::= KILL CONNECTION INTEGER */
211, /* (252) cmd ::= KILL STREAM INTEGER COLON INTEGER */
211, /* (253) cmd ::= KILL QUERY INTEGER COLON INTEGER */
};
/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
@ -2250,34 +2261,35 @@ static const signed char yyRuleInfoNRhs[] = {
-3, /* (222) expr ::= expr GE expr */
-3, /* (223) expr ::= expr NE expr */
-3, /* (224) expr ::= expr EQ expr */
-3, /* (225) expr ::= expr AND expr */
-3, /* (226) expr ::= expr OR expr */
-3, /* (227) expr ::= expr PLUS expr */
-3, /* (228) expr ::= expr MINUS expr */
-3, /* (229) expr ::= expr STAR expr */
-3, /* (230) expr ::= expr SLASH expr */
-3, /* (231) expr ::= expr REM expr */
-3, /* (232) expr ::= expr LIKE expr */
-5, /* (233) expr ::= expr IN LP exprlist RP */
-3, /* (234) exprlist ::= exprlist COMMA expritem */
-1, /* (235) exprlist ::= expritem */
-1, /* (236) expritem ::= expr */
0, /* (237) expritem ::= */
-3, /* (238) cmd ::= RESET QUERY CACHE */
-7, /* (239) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
-7, /* (240) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
-7, /* (241) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
-7, /* (242) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
-8, /* (243) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
-9, /* (244) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
-7, /* (245) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
-7, /* (246) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
-7, /* (247) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
-7, /* (248) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
-8, /* (249) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
-3, /* (250) cmd ::= KILL CONNECTION INTEGER */
-5, /* (251) cmd ::= KILL STREAM INTEGER COLON INTEGER */
-5, /* (252) cmd ::= KILL QUERY INTEGER COLON INTEGER */
-5, /* (225) expr ::= expr BETWEEN expr AND expr */
-3, /* (226) expr ::= expr AND expr */
-3, /* (227) expr ::= expr OR expr */
-3, /* (228) expr ::= expr PLUS expr */
-3, /* (229) expr ::= expr MINUS expr */
-3, /* (230) expr ::= expr STAR expr */
-3, /* (231) expr ::= expr SLASH expr */
-3, /* (232) expr ::= expr REM expr */
-3, /* (233) expr ::= expr LIKE expr */
-5, /* (234) expr ::= expr IN LP exprlist RP */
-3, /* (235) exprlist ::= exprlist COMMA expritem */
-1, /* (236) exprlist ::= expritem */
-1, /* (237) expritem ::= expr */
0, /* (238) expritem ::= */
-3, /* (239) cmd ::= RESET QUERY CACHE */
-7, /* (240) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
-7, /* (241) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
-7, /* (242) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
-7, /* (243) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
-8, /* (244) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
-9, /* (245) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
-7, /* (246) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
-7, /* (247) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
-7, /* (248) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
-7, /* (249) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
-8, /* (250) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
-3, /* (251) cmd ::= KILL CONNECTION INTEGER */
-5, /* (252) cmd ::= KILL STREAM INTEGER COLON INTEGER */
-5, /* (253) cmd ::= KILL QUERY INTEGER COLON INTEGER */
};
static void yy_accept(yyParser*); /* Forward Declaration */
@ -3049,7 +3061,7 @@ static YYACTIONTYPE yy_reduce(
break;
case 189: /* having_opt ::= */
case 199: /* where_opt ::= */ yytestcase(yyruleno==199);
case 237: /* expritem ::= */ yytestcase(yyruleno==237);
case 238: /* expritem ::= */ yytestcase(yyruleno==238);
{yymsp[1].minor.yy326 = 0;}
break;
case 190: /* having_opt ::= HAVING expr */
@ -3166,65 +3178,69 @@ static YYACTIONTYPE yy_reduce(
{yylhsminor.yy326 = tSqlExprCreate(yymsp[-2].minor.yy326, yymsp[0].minor.yy326, TK_EQ);}
yymsp[-2].minor.yy326 = yylhsminor.yy326;
break;
case 225: /* expr ::= expr AND expr */
case 225: /* expr ::= expr BETWEEN expr AND expr */
{ tSQLExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy326); yylhsminor.yy326 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy326, yymsp[-2].minor.yy326, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy326, TK_LE), TK_AND);}
yymsp[-4].minor.yy326 = yylhsminor.yy326;
break;
case 226: /* expr ::= expr AND expr */
{yylhsminor.yy326 = tSqlExprCreate(yymsp[-2].minor.yy326, yymsp[0].minor.yy326, TK_AND);}
yymsp[-2].minor.yy326 = yylhsminor.yy326;
break;
case 226: /* expr ::= expr OR expr */
case 227: /* expr ::= expr OR expr */
{yylhsminor.yy326 = tSqlExprCreate(yymsp[-2].minor.yy326, yymsp[0].minor.yy326, TK_OR); }
yymsp[-2].minor.yy326 = yylhsminor.yy326;
break;
case 227: /* expr ::= expr PLUS expr */
case 228: /* expr ::= expr PLUS expr */
{yylhsminor.yy326 = tSqlExprCreate(yymsp[-2].minor.yy326, yymsp[0].minor.yy326, TK_PLUS); }
yymsp[-2].minor.yy326 = yylhsminor.yy326;
break;
case 228: /* expr ::= expr MINUS expr */
case 229: /* expr ::= expr MINUS expr */
{yylhsminor.yy326 = tSqlExprCreate(yymsp[-2].minor.yy326, yymsp[0].minor.yy326, TK_MINUS); }
yymsp[-2].minor.yy326 = yylhsminor.yy326;
break;
case 229: /* expr ::= expr STAR expr */
case 230: /* expr ::= expr STAR expr */
{yylhsminor.yy326 = tSqlExprCreate(yymsp[-2].minor.yy326, yymsp[0].minor.yy326, TK_STAR); }
yymsp[-2].minor.yy326 = yylhsminor.yy326;
break;
case 230: /* expr ::= expr SLASH expr */
case 231: /* expr ::= expr SLASH expr */
{yylhsminor.yy326 = tSqlExprCreate(yymsp[-2].minor.yy326, yymsp[0].minor.yy326, TK_DIVIDE);}
yymsp[-2].minor.yy326 = yylhsminor.yy326;
break;
case 231: /* expr ::= expr REM expr */
case 232: /* expr ::= expr REM expr */
{yylhsminor.yy326 = tSqlExprCreate(yymsp[-2].minor.yy326, yymsp[0].minor.yy326, TK_REM); }
yymsp[-2].minor.yy326 = yylhsminor.yy326;
break;
case 232: /* expr ::= expr LIKE expr */
case 233: /* expr ::= expr LIKE expr */
{yylhsminor.yy326 = tSqlExprCreate(yymsp[-2].minor.yy326, yymsp[0].minor.yy326, TK_LIKE); }
yymsp[-2].minor.yy326 = yylhsminor.yy326;
break;
case 233: /* expr ::= expr IN LP exprlist RP */
case 234: /* expr ::= expr IN LP exprlist RP */
{yylhsminor.yy326 = tSqlExprCreate(yymsp[-4].minor.yy326, (tSQLExpr*)yymsp[-1].minor.yy522, TK_IN); }
yymsp[-4].minor.yy326 = yylhsminor.yy326;
break;
case 234: /* exprlist ::= exprlist COMMA expritem */
case 235: /* exprlist ::= exprlist COMMA expritem */
{yylhsminor.yy522 = tSqlExprListAppend(yymsp[-2].minor.yy522,yymsp[0].minor.yy326,0, 0);}
yymsp[-2].minor.yy522 = yylhsminor.yy522;
break;
case 235: /* exprlist ::= expritem */
case 236: /* exprlist ::= expritem */
{yylhsminor.yy522 = tSqlExprListAppend(0,yymsp[0].minor.yy326,0, 0);}
yymsp[0].minor.yy522 = yylhsminor.yy522;
break;
case 236: /* expritem ::= expr */
case 237: /* expritem ::= expr */
{yylhsminor.yy326 = yymsp[0].minor.yy326;}
yymsp[0].minor.yy326 = yylhsminor.yy326;
break;
case 238: /* cmd ::= RESET QUERY CACHE */
case 239: /* cmd ::= RESET QUERY CACHE */
{ setDCLSQLElems(pInfo, TSDB_SQL_RESET_CACHE, 0);}
break;
case 239: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
case 240: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy247, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 240: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
case 241: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
@ -3235,14 +3251,14 @@ static YYACTIONTYPE yy_reduce(
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 241: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
case 242: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy247, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 242: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
case 243: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
@ -3253,7 +3269,7 @@ static YYACTIONTYPE yy_reduce(
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 243: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
case 244: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
{
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
@ -3267,7 +3283,7 @@ static YYACTIONTYPE yy_reduce(
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 244: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
case 245: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
{
yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n;
@ -3279,14 +3295,14 @@ static YYACTIONTYPE yy_reduce(
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 245: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
case 246: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy247, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 246: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
case 247: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
@ -3297,14 +3313,14 @@ static YYACTIONTYPE yy_reduce(
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 247: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
case 248: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy247, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 248: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
case 249: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
@ -3315,7 +3331,7 @@ static YYACTIONTYPE yy_reduce(
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 249: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
case 250: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
{
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
@ -3329,13 +3345,13 @@ static YYACTIONTYPE yy_reduce(
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 250: /* cmd ::= KILL CONNECTION INTEGER */
case 251: /* cmd ::= KILL CONNECTION INTEGER */
{setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);}
break;
case 251: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */
case 252: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */
{yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_STREAM, &yymsp[-2].minor.yy0);}
break;
case 252: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */
case 253: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */
{yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_QUERY, &yymsp[-2].minor.yy0);}
break;
default:

View File

@ -170,14 +170,14 @@ static int32_t syncReadOneWalRecord(int32_t sfd, SWalHead *pHead) {
return sizeof(SWalHead) + pHead->len;
}
static int32_t syncRetrieveLastWal(SSyncPeer *pPeer, char *name, uint64_t fversion, int64_t offset) {
static int64_t syncRetrieveLastWal(SSyncPeer *pPeer, char *name, uint64_t fversion, int64_t offset) {
int32_t sfd = open(name, O_RDONLY | O_BINARY);
if (sfd < 0) {
sError("%s, failed to open wal:%s for retrieve since:%s", pPeer->id, name, tstrerror(errno));
return -1;
}
int32_t code = (int32_t)taosLSeek(sfd, offset, SEEK_SET);
int64_t code = taosLSeek(sfd, offset, SEEK_SET);
if (code < 0) {
sError("%s, failed to seek %" PRId64 " in wal:%s for retrieve since:%s", pPeer->id, offset, name, tstrerror(errno));
close(sfd);
@ -187,7 +187,7 @@ static int32_t syncRetrieveLastWal(SSyncPeer *pPeer, char *name, uint64_t fversi
sDebug("%s, retrieve last wal:%s, offset:%" PRId64 " fver:%" PRIu64, pPeer->id, name, offset, fversion);
SWalHead *pHead = malloc(SYNC_MAX_SIZE);
int32_t bytes = 0;
int64_t bytes = 0;
while (1) {
code = syncReadOneWalRecord(sfd, pHead);
@ -198,13 +198,13 @@ static int32_t syncRetrieveLastWal(SSyncPeer *pPeer, char *name, uint64_t fversi
if (code == 0) {
code = bytes;
sDebug("%s, read to the end of wal, bytes:%d", pPeer->id, bytes);
sDebug("%s, read to the end of wal, bytes:%" PRId64, pPeer->id, bytes);
break;
}
sDebug("%s, last wal is forwarded, hver:%" PRIu64, pPeer->id, pHead->version);
sTrace("%s, last wal is forwarded, hver:%" PRIu64, pPeer->id, pHead->version);
int32_t wsize = code;
int32_t wsize = (int32_t)code;
int32_t ret = taosWriteMsg(pPeer->syncFd, pHead, wsize);
if (ret != wsize) {
code = -1;
@ -228,7 +228,7 @@ static int32_t syncRetrieveLastWal(SSyncPeer *pPeer, char *name, uint64_t fversi
return code;
}
static int32_t syncProcessLastWal(SSyncPeer *pPeer, char *wname, int64_t index) {
static int64_t syncProcessLastWal(SSyncPeer *pPeer, char *wname, int64_t index) {
SSyncNode *pNode = pPeer->pSyncNode;
int32_t once = 0; // last WAL has once ever been processed
int64_t offset = 0;
@ -243,9 +243,9 @@ static int32_t syncProcessLastWal(SSyncPeer *pPeer, char *wname, int64_t index)
if (syncAreFilesModified(pNode, pPeer)) return -1;
if (syncGetWalVersion(pNode, pPeer) < 0) return -1;
int32_t bytes = syncRetrieveLastWal(pPeer, fname, fversion, offset);
int64_t bytes = syncRetrieveLastWal(pPeer, fname, fversion, offset);
if (bytes < 0) {
sDebug("%s, failed to retrieve last wal", pPeer->id);
sDebug("%s, failed to retrieve last wal, bytes:%" PRId64, pPeer->id, bytes);
return bytes;
}
@ -263,7 +263,7 @@ static int32_t syncProcessLastWal(SSyncPeer *pPeer, char *wname, int64_t index)
// if all data up to fversion is read out, it is over
if (pPeer->sversion >= fversion && fversion > 0) {
sDebug("%s, data up to fver:%" PRIu64 " has been read out, bytes:%d sver:%" PRIu64, pPeer->id, fversion, bytes,
sDebug("%s, data up to fver:%" PRIu64 " has been read out, bytes:%" PRId64 " sver:%" PRIu64, pPeer->id, fversion, bytes,
pPeer->sversion);
return 0;
}
@ -277,19 +277,19 @@ static int32_t syncProcessLastWal(SSyncPeer *pPeer, char *wname, int64_t index)
// if bytes > 0, file is updated, or fversion is not reached but file still open, read again
once = 1;
offset += bytes;
sDebug("%s, continue retrieve last wal, bytes:%d offset:%" PRId64 " sver:%" PRIu64 " fver:%" PRIu64, pPeer->id,
sDebug("%s, continue retrieve last wal, bytes:%" PRId64 " offset:%" PRId64 " sver:%" PRIu64 " fver:%" PRIu64, pPeer->id,
bytes, offset, pPeer->sversion, fversion);
}
return -1;
}
static int32_t syncRetrieveWal(SSyncPeer *pPeer) {
static int64_t syncRetrieveWal(SSyncPeer *pPeer) {
SSyncNode * pNode = pPeer->pSyncNode;
char fname[TSDB_FILENAME_LEN * 3];
char wname[TSDB_FILENAME_LEN * 2];
int32_t size;
int32_t code = -1;
int64_t code = -1;
int64_t index = 0;
while (1) {
@ -297,7 +297,7 @@ static int32_t syncRetrieveWal(SSyncPeer *pPeer) {
wname[0] = 0;
code = (*pNode->getWalInfoFp)(pNode->vgId, wname, &index);
if (code < 0) {
sError("%s, failed to get wal info since:%s, code:0x%x", pPeer->id, strerror(errno), code);
sError("%s, failed to get wal info since:%s, code:0x%" PRIx64, pPeer->id, strerror(errno), code);
break;
}
@ -309,6 +309,7 @@ static int32_t syncRetrieveWal(SSyncPeer *pPeer) {
if (code == 0) { // last wal
code = syncProcessLastWal(pPeer, wname, index);
sInfo("%s, last wal processed, code:%" PRId64, pPeer->id, code);
break;
}
@ -319,7 +320,7 @@ static int32_t syncRetrieveWal(SSyncPeer *pPeer) {
struct stat fstat;
if (stat(fname, &fstat) < 0) {
code = -1;
sDebug("%s, failed to stat wal:%s for retrieve since %s, code:0x%x", pPeer->id, fname, strerror(errno), code);
sDebug("%s, failed to stat wal:%s for retrieve since %s, code:0x%" PRIx64, pPeer->id, fname, strerror(errno), code);
break;
}
@ -329,14 +330,14 @@ static int32_t syncRetrieveWal(SSyncPeer *pPeer) {
int32_t sfd = open(fname, O_RDONLY | O_BINARY);
if (sfd < 0) {
code = -1;
sError("%s, failed to open wal:%s for retrieve since %s, code:0x%x", pPeer->id, fname, strerror(errno), code);
sError("%s, failed to open wal:%s for retrieve since %s, code:0x%" PRIx64, pPeer->id, fname, strerror(errno), code);
break;
}
code = (int32_t)taosSendFile(pPeer->syncFd, sfd, NULL, size);
close(sfd);
if (code < 0) {
sError("%s, failed to send wal:%s for retrieve since %s, code:0x%x", pPeer->id, fname, strerror(errno), code);
sError("%s, failed to send wal:%s for retrieve since %s, code:0x%" PRIx64, pPeer->id, fname, strerror(errno), code);
break;
}
@ -357,7 +358,7 @@ static int32_t syncRetrieveWal(SSyncPeer *pPeer) {
code = -1;
}
} else {
sError("%s, failed to send wal since %s, code:0x%x", pPeer->id, strerror(errno), code);
sError("%s, failed to send wal since %s, code:0x%" PRIx64, pPeer->id, strerror(errno), code);
}
return code;
@ -404,9 +405,9 @@ static int32_t syncRetrieveDataStepByStep(SSyncPeer *pPeer) {
if (pPeer->sversion == 0) pPeer->sversion = 1;
sInfo("%s, start to retrieve wals", pPeer->id);
int32_t code = syncRetrieveWal(pPeer);
if (code != 0) {
sError("%s, failed to retrieve wals, code:0x%x", pPeer->id, code);
int64_t code = syncRetrieveWal(pPeer);
if (code < 0) {
sError("%s, failed to retrieve wals, code:0x%" PRIx64, pPeer->id, code);
return -1;
}

View File

@ -52,7 +52,7 @@ int tfsUpdateDiskInfo(SDisk *pDisk) {
}
pDisk->dmeta.size = diskSize.tsize;
pDisk->dmeta.free = diskSize.tsize - diskSize.avail;
pDisk->dmeta.free = diskSize.avail;
return code;
}
}

View File

@ -171,7 +171,9 @@ static void *taosThreadToOpenNewFile(void *param) {
int32_t fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU | S_IRWXG | S_IRWXO);
if (fd < 0) {
uError("open new log file fail! fd:%d reason:%s", fd, strerror(errno));
tsLogObj.openInProgress = 0;
tsLogObj.lines = tsLogObj.maxLines - 1000;
uError("open new log file fail! fd:%d reason:%s, reuse lastlog", fd, strerror(errno));
return NULL;
}

2
tests/Jenkinsfile vendored
View File

@ -55,6 +55,8 @@ pipeline {
sh '''
cd ${WKC}/tests
./test-all.sh b1
cd ${WKC}/tests
./test-all.sh full jdbc
date'''
}
}

View File

@ -15,7 +15,7 @@ import os
import random
import argparse
class taosdemoxWrapper:
class taosdemoWrapper:
def __init__(self, host, metadata, database, tables, threads, configDir, replica,
columnType, columnsPerTable, rowsPerTable, disorderRatio, disorderRange, charTypeLen):
@ -35,11 +35,11 @@ class taosdemoxWrapper:
def run(self):
if self.metadata is None:
os.system("taosdemox -h %s -d %s -t %d -T %d -c %s -a %d -b %s -n %d -t %d -O %d -R %d -w %d -x -y"
os.system("taosdemo -h %s -d %s -t %d -T %d -c %s -a %d -b %s -n %d -t %d -O %d -R %d -w %d -x -y"
% (self.host, self.database, self.tables, self.threads, self.configDir, self.replica, self.columnType,
self.rowsPerTable, self.disorderRatio, self.disorderRange, self.charTypeLen))
else:
os.system("taosdemox -f %s" % self.metadata)
os.system("taosdemo -f %s" % self.metadata)
parser = argparse.ArgumentParser()
@ -136,7 +136,7 @@ parser.add_argument(
help='Out of order datas range, ms (default: 16)')
args = parser.parse_args()
taosdemox = taosdemoxWrapper(args.host_name, args.metadata, args.db_name, args.num_of_tables,
taosdemo = taosdemoWrapper(args.host_name, args.metadata, args.db_name, args.num_of_tables,
args.num_of_threads, args.config_dir, args.replica, args.column_type, args.num_of_cols,
args.num_of_rows, args.disorder_ratio, args.disorder_range, args.char_type_length)
taosdemox.run()
taosdemo.run()

View File

@ -40,7 +40,7 @@ class ConcurrentInquiry:
# stableNum = 2,subtableNum = 1000,insertRows = 100):
def __init__(self,ts,host,user,password,dbname,
stb_prefix,subtb_prefix,n_Therads,r_Therads,probabilities,loop,
stableNum ,subtableNum ,insertRows ,mix_table):
stableNum ,subtableNum ,insertRows ,mix_table, replay):
self.n_numOfTherads = n_Therads
self.r_numOfTherads = r_Therads
self.ts=ts
@ -65,6 +65,7 @@ class ConcurrentInquiry:
self.mix_table = mix_table
self.max_ts = datetime.datetime.now()
self.min_ts = datetime.datetime.now() - datetime.timedelta(days=5)
self.replay = replay
def SetThreadsNum(self,num):
self.numOfTherads=num
@ -412,7 +413,7 @@ class ConcurrentInquiry:
)
cl = conn.cursor()
cl.execute("use %s;" % self.dbname)
fo = open('bak_sql_n_%d'%threadID,'w+')
print("Thread %d: starting" % threadID)
loop = self.loop
while loop:
@ -423,6 +424,7 @@ class ConcurrentInquiry:
else:
sql=self.gen_query_join()
print("sql is ",sql)
fo.write(sql+'\n')
start = time.time()
cl.execute(sql)
cl.fetchall()
@ -438,13 +440,49 @@ class ConcurrentInquiry:
exit(-1)
loop -= 1
if loop == 0: break
fo.close()
cl.close()
conn.close()
print("Thread %d: finishing" % threadID)
def query_thread_nr(self,threadID): #使用原生python接口进行重放
host = self.host
user = self.user
password = self.password
conn = taos.connect(
host,
user,
password,
)
cl = conn.cursor()
cl.execute("use %s;" % self.dbname)
replay_sql = []
with open('bak_sql_n_%d'%threadID,'r') as f:
replay_sql = f.readlines()
print("Replay Thread %d: starting" % threadID)
for sql in replay_sql:
try:
print("sql is ",sql)
start = time.time()
cl.execute(sql)
cl.fetchall()
end = time.time()
print("time cost :",end-start)
except Exception as e:
print('-'*40)
print(
"Failure thread%d, sql: %s \nexception: %s" %
(threadID, str(sql),str(e)))
err_uec='Unable to establish connection'
if err_uec in str(e) and loop >0:
exit(-1)
cl.close()
conn.close()
print("Replay Thread %d: finishing" % threadID)
def query_thread_r(self,threadID): #使用rest接口查询
print("Thread %d: starting" % threadID)
fo = open('bak_sql_r_%d'%threadID,'w+')
loop = self.loop
while loop:
try:
@ -453,6 +491,7 @@ class ConcurrentInquiry:
else:
sql=self.gen_query_join()
print("sql is ",sql)
fo.write(sql+'\n')
start = time.time()
self.rest_query(sql)
end = time.time()
@ -467,20 +506,53 @@ class ConcurrentInquiry:
exit(-1)
loop -= 1
if loop == 0: break
print("Thread %d: finishing" % threadID)
fo.close()
print("Thread %d: finishing" % threadID)
def query_thread_rr(self,threadID): #使用rest接口重放
print("Replay Thread %d: starting" % threadID)
replay_sql = []
with open('bak_sql_r_%d'%threadID,'r') as f:
replay_sql = f.readlines()
for sql in replay_sql:
try:
print("sql is ",sql)
start = time.time()
self.rest_query(sql)
end = time.time()
print("time cost :",end-start)
except Exception as e:
print('-'*40)
print(
"Failure thread%d, sql: %s \nexception: %s" %
(threadID, str(sql),str(e)))
err_uec='Unable to establish connection'
if err_uec in str(e) and loop >0:
exit(-1)
print("Replay Thread %d: finishing" % threadID)
def run(self):
print(self.n_numOfTherads,self.r_numOfTherads)
threads = []
for i in range(self.n_numOfTherads):
thread = threading.Thread(target=self.query_thread_n, args=(i,))
threads.append(thread)
thread.start()
for i in range(self.r_numOfTherads):
thread = threading.Thread(target=self.query_thread_r, args=(i,))
threads.append(thread)
thread.start()
if self.replay: #whether replay
for i in range(self.n_numOfTherads):
thread = threading.Thread(target=self.query_thread_nr, args=(i,))
threads.append(thread)
thread.start()
for i in range(self.r_numOfTherads):
thread = threading.Thread(target=self.query_thread_rr, args=(i,))
threads.append(thread)
thread.start()
else:
for i in range(self.n_numOfTherads):
thread = threading.Thread(target=self.query_thread_n, args=(i,))
threads.append(thread)
thread.start()
for i in range(self.r_numOfTherads):
thread = threading.Thread(target=self.query_thread_r, args=(i,))
threads.append(thread)
thread.start()
parser = argparse.ArgumentParser()
parser.add_argument(
@ -595,13 +667,20 @@ parser.add_argument(
default=0,
type=int,
help='0:stable & substable ,1:subtable ,2:stable (default: 0)')
parser.add_argument(
'-R',
'--replay',
action='store',
default=0,
type=int,
help='0:not replay ,1:replay (default: 0)')
args = parser.parse_args()
q = ConcurrentInquiry(
args.ts,args.host_name,args.user,args.password,args.db_name,
args.stb_name_prefix,args.subtb_name_prefix,args.number_of_native_threads,args.number_of_rest_threads,
args.probabilities,args.loop_per_thread,args.number_of_stables,args.number_of_tables ,args.number_of_records,
args.mix_stable_subtable )
args.mix_stable_subtable, args.replay )
if args.create_table:
q.gen_data()

View File

@ -16,7 +16,7 @@ TOP_DIR=`pwd`
TAOSD_DIR=`find . -name "taosd"|grep -v community|head -n1`
nohup $TAOSD_DIR >/dev/null &
cd -
./crash_gen.sh --valgrind -p -t 10 -s 350 -b 4
./crash_gen.sh --valgrind -p -t 10 -s 500 -b 4
pidof taosd|xargs kill -9
grep 'start to execute\|ERROR SUMMARY' valgrind.err|grep -v 'grep'|uniq|tee crash_gen_mem_err.log
@ -36,11 +36,13 @@ for defiMemError in `grep 'definitely lost:' crash_gen-definitely-lost-out.log |
do
defiMemError=(${defiMemError//,/})
if [ -n "$defiMemError" ]; then
if [ "$defiMemError" -gt 3 -a "$defiMemError" -lt 1013 ]; then
echo -e "${RED} ## Memory errors number valgrind reports \
Definitely lost is $defiMemError. More than our threshold! ## ${NC}"
if [ "$defiMemError" -gt 0 -a "$defiMemError" -lt 1013 ]; then
cat valgrind.err
echo -e "${RED} ## Memory errors number valgrind reports \
Definitely lost is $defiMemError. More than our threshold! ## ${NC}"
exit 8
elif [ "$defiMemError" -gt 1013 ];then #add for azure
cat valgrind.err
echo -e "${RED} ## Memory errors number valgrind reports \
Definitely lost is $defiMemError. More than our threshold! ## ${NC}"
exit 8

View File

@ -51,7 +51,7 @@ class TDTestCase:
else:
tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath+ "/build/bin/"
os.system("yes | %staosdemox -f tools/insert.json" % binPath)
os.system("yes | %staosdemo -f tools/insert.json" % binPath)
tdSql.execute("use db01")
tdSql.query("select count(*) from stb01")

View File

@ -23,9 +23,10 @@ class TDTestCase:
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
self.numberOfTables = 10000
self.numberOfRecords = 100
def getBuildPath(self):
selfPath = os.path.dirname(os.path.realpath(__file__))
@ -38,9 +39,10 @@ class TDTestCase:
if ("taosd" in files):
rootRealPath = os.path.dirname(os.path.realpath(root))
if ("packaging" not in rootRealPath):
buildPath = root[:len(root)-len("/build/bin")]
buildPath = root[:len(root) - len("/build/bin")]
break
return buildPath
def run(self):
tdSql.prepare()
buildPath = self.getBuildPath()
@ -48,18 +50,21 @@ class TDTestCase:
tdLog.exit("taosd not found!")
else:
tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath+ "/build/bin/"
os.system("yes | %staosdemo -t %d -n %d -x" % (binPath,self.numberOfTables, self.numberOfRecords))
binPath = buildPath + "/build/bin/"
os.system("%staosdemo -y -M -t %d -n %d -x" %
(binPath, self.numberOfTables, self.numberOfRecords))
tdSql.execute("use test")
tdSql.query("select count(*) from meters")
tdSql.checkData(0, 0, self.numberOfTables * self.numberOfRecords)
tdSql.query("select sum(f1) from test.meters interval(1h) sliding(30m)")
tdSql.query(
"select sum(col1) from test.meters interval(1h) sliding(30m)")
tdSql.checkRows(2)
tdSql.query("select apercentile(f1, 1) from test.meters interval(10s)")
tdSql.checkRows(11)
tdSql.query(
"select apercentile(col1, 1) from test.meters interval(10s)")
tdSql.checkRows(1)
tdSql.error("select loc, count(loc) from test.meters")

View File

@ -31,11 +31,12 @@ class TDTestCase:
def insertDataAndAlterTable(self, threadID):
if(threadID == 0):
os.system("yes | taosdemo -t %d -n %d -x" % (self.numberOfTables, self.numberOfRecords))
os.system("taosdemo -M -y -t %d -n %d -x" %
(self.numberOfTables, self.numberOfRecords))
if(threadID == 1):
time.sleep(2)
print("use test")
tdSql.execute("use test")
tdSql.execute("use test")
# check if all the tables have heen created
while True:
tdSql.query("show tables")
@ -52,19 +53,19 @@ class TDTestCase:
print("number of records: %d" % rows)
if(rows > 0):
break
time.sleep(1)
print("alter table test.meters add column f4 int")
tdSql.execute("alter table test.meters add column f4 int")
print("insert into test.t0 values (now, 1, 2, 3, 4)")
tdSql.execute("insert into test.t0 values (now, 1, 2, 3, 4)")
time.sleep(1)
print("alter table test.meters add column col10 int")
tdSql.execute("alter table test.meters add column col10 int")
print("insert into test.t0 values (now, 1, 2, 3, 4, 0.1, 0.01,'test', '测试', TRUE, 1610000000000, 0)")
tdSql.execute("insert into test.t0 values (now, 1, 2, 3, 4, 0.1, 0.01,'test', '测试', TRUE, 1610000000000, 0)")
def run(self):
def run(self):
tdSql.prepare()
t1 = threading.Thread(target=self.insertDataAndAlterTable, args=(0, ))
t2 = threading.Thread(target=self.insertDataAndAlterTable, args=(1, ))
t1.start()
t1.start()
t2.start()
t1.join()
t2.join()
@ -78,4 +79,4 @@ class TDTestCase:
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())

View File

@ -0,0 +1,165 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
print ======================== dnode1 start
$db = testdb
sql create database $db
sql use $db
sql create stable st2 (ts timestamp, f1 int, f2 float, f3 double, f4 bigint, f5 smallint, f6 tinyint, f7 bool, f8 binary(10), f9 nchar(10)) tags (id1 int, id2 float, id3 nchar(10), id4 double, id5 smallint, id6 bigint, id7 binary(10))
sql create table tb1 using st2 tags (1,1.0,"1",1.0,1,1,"1");
sql create table tb2 using st2 tags (2,2.0,"2",2.0,2,2,"2");
sql create table tb3 using st2 tags (3,3.0,"3",3.0,3,3,"3");
sql create table tb4 using st2 tags (4,4.0,"4",4.0,4,4,"4");
sql insert into tb1 values (now-200s,1,1.0,1.0,1,1,1,true,"1","1")
sql insert into tb1 values (now-100s,2,2.0,2.0,2,2,2,true,"2","2")
sql insert into tb1 values (now,3,3.0,3.0,3,3,3,true,"3","3")
sql insert into tb1 values (now+100s,4,4.0,4.0,4,4,4,true,"4","4")
sql insert into tb1 values (now+200s,4,4.0,4.0,4,4,4,true,"4","4")
sql insert into tb1 values (now+300s,4,4.0,4.0,4,4,4,true,"4","4")
sql insert into tb1 values (now+400s,4,4.0,4.0,4,4,4,true,"4","4")
sql insert into tb1 values (now+500s,4,4.0,4.0,4,4,4,true,"4","4")
sql select tbname,id1 from st2;
if $rows != 4 then
return -1
endi
sql select * from st2;
if $rows != 8 then
return -1
endi
sql select * from st2 where ts between now-50s and now+450s
if $rows != 5 then
return -1
endi
sql select tbname,id1 from st2 where id1 between 2 and 3;
if $rows != 2 then
return -1
endi
if $data00 != tb2 then
return -1
endi
if $data01 != 2 then
return -1
endi
if $data10 != tb3 then
return -1
endi
if $data11 != 3 then
return -1
endi
sql select tbname,id2 from st2 where id2 between 2.0 and 3.0;
if $rows != 2 then
return -1
endi
if $data00 != tb2 then
return -1
endi
if $data01 != 2.00000 then
return -1
endi
if $data10 != tb3 then
return -1
endi
if $data11 != 3.00000 then
return -1
endi
sql select tbname,id4 from st2 where id4 between 2.0 and 3.0;
if $rows != 2 then
return -1
endi
if $data00 != tb2 then
return -1
endi
if $data01 != 2.000000000 then
return -1
endi
if $data10 != tb3 then
return -1
endi
if $data11 != 3.000000000 then
return -1
endi
sql select tbname,id5 from st2 where id5 between 2.0 and 3.0;
if $rows != 2 then
return -1
endi
if $data00 != tb2 then
return -1
endi
if $data01 != 2 then
return -1
endi
if $data10 != tb3 then
return -1
endi
if $data11 != 3 then
return -1
endi
sql select tbname,id6 from st2 where id6 between 2.0 and 3.0;
if $rows != 2 then
return -1
endi
if $data00 != tb2 then
return -1
endi
if $data01 != 2 then
return -1
endi
if $data10 != tb3 then
return -1
endi
if $data11 != 3 then
return -1
endi
sql select * from st2 where f1 between 2 and 3 and f2 between 2.0 and 3.0 and f3 between 2.0 and 3.0 and f4 between 2.0 and 3.0 and f5 between 2.0 and 3.0 and f6 between 2.0 and 3.0;
if $rows != 2 then
return -1
endi
if $data01 != 2 then
return -1
endi
if $data11 != 3 then
return -1
endi
sql_error select * from st2 where f7 between 2.0 and 3.0;
sql_error select * from st2 where f8 between 2.0 and 3.0;
sql_error select * from st2 where f9 between 2.0 and 3.0;
system sh/exec.sh -n dnode1 -s stop -x SIGINT

View File

@ -763,3 +763,20 @@ endi
if $data01 != 1.414213562 then
return -1
endi
sql create stable st1 (ts timestamp, f1 int, f2 int) tags (id int);
sql create table tb1 using st1 tags(1);
sql insert into tb1 values (now, 1, 1);
sql select stddev(f1) from st1 group by f1;
if $rows != 1 then
return -1
endi
if $data00 != 0.000000000 then
return -1
endi

View File

@ -7,6 +7,21 @@ GREEN_DARK='\033[0;32m'
GREEN_UNDERLINE='\033[4;32m'
NC='\033[0m'
tests_dir=`pwd`
IN_TDINTERNAL="community"
function stopTaosd {
echo "Stop taosd"
systemctl stop taosd
PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'`
while [ -n "$PID" ]
do
pkill -TERM -x taosd
sleep 1
PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'`
done
}
function dohavecore(){
corefile=`find $corepath -mmin 1`
if [ -n "$corefile" ];then
@ -19,8 +34,7 @@ function dohavecore(){
function runSimCaseOneByOne {
while read -r line; do
if [[ $line =~ ^./test.sh* ]] || [[ $line =~ ^run* ]]; then
case=`echo $line | grep sim$ |awk '{print $NF}'`
IN_TDINTERNAL="community"
case=`echo $line | grep sim$ |awk '{print $NF}'`
start_time=`date +%s`
date +%F\ %T | tee -a out.log
if [[ "$tests_dir" == *"$IN_TDINTERNAL"* ]]; then
@ -51,8 +65,7 @@ function runSimCaseOneByOnefq {
if [[ $line =~ ^./test.sh* ]] || [[ $line =~ ^run* ]]; then
case=`echo $line | grep sim$ |awk '{print $NF}'`
start_time=`date +%s`
IN_TDINTERNAL="community"
start_time=`date +%s`
date +%F\ %T | tee -a out.log
if [[ "$tests_dir" == *"$IN_TDINTERNAL"* ]]; then
echo -n $case
@ -143,12 +156,13 @@ function runPyCaseOneByOnefq {
fi
done < $1
}
totalFailed=0
totalPyFailed=0
totalJDBCFailed=0
tests_dir=`pwd`
corepath=`grep -oP '.*(?=core_)' /proc/sys/kernel/core_pattern||grep -oP '.*(?=core-)' /proc/sys/kernel/core_pattern`
if [ "$2" != "python" ]; then
if [ "$2" != "jdbc" ] && [ "$2" != "python" ]; then
echo "### run TSIM test case ###"
cd $tests_dir/script
@ -217,11 +231,10 @@ if [ "$2" != "python" ]; then
fi
fi
if [ "$2" != "sim" ]; then
if [ "$2" != "sim" ] && [ "$2" != "jdbc" ] ; then
echo "### run Python test case ###"
cd $tests_dir
IN_TDINTERNAL="community"
if [[ "$tests_dir" == *"$IN_TDINTERNAL"* ]]; then
cd ../..
@ -286,4 +299,48 @@ if [ "$2" != "sim" ]; then
fi
fi
exit $(($totalFailed + $totalPyFailed))
if [ "$2" != "sim" ] && [ "$2" != "python" ] && [ "$1" == "full" ]; then
echo "### run JDBC test case ###"
cd $tests_dir
if [[ "$tests_dir" == *"$IN_TDINTERNAL"* ]]; then
cd ../../
else
cd ../
fi
pwd
cd debug/
stopTaosd
nohup build/bin/taosd -c /etc/taos/ > /dev/null 2>&1 &
sleep 30
cd $tests_dir/../src/connector/jdbc
mvn test > jdbc-out.log 2>&1
tail -n 20 jdbc-out.log
cases=`grep 'Tests run' jdbc-out.log | awk 'END{print $3}'`
totalJDBCCases=`echo ${cases/%,}`
failed=`grep 'Tests run' jdbc-out.log | awk 'END{print $5}'`
JDBCFailed=`echo ${failed/%,}`
error=`grep 'Tests run' jdbc-out.log | awk 'END{print $7}'`
JDBCError=`echo ${error/%,}`
totalJDBCFailed=`expr $JDBCFailed + $JDBCError`
totalJDBCSuccess=`expr $totalJDBCCases - $totalJDBCFailed`
if [ "$totalJDBCSuccess" -gt "0" ]; then
echo -e "\n${GREEN} ### Total $totalJDBCSuccess JDBC case(s) succeed! ### ${NC}"
fi
if [ "$totalJDBCFailed" -ne "0" ]; then
echo -e "\n${RED} ### Total $totalJDBCFailed JDBC case(s) failed! ### ${NC}"
fi
dohavecore 1
fi
exit $(($totalFailed + $totalPyFailed + $totalJDBCFailed))