diff --git a/Jenkinsfile b/Jenkinsfile
index 03af9ba24408deb9bfa1a5baa1e924b262ccbd77..3bbb744b0a87e6bfa632ff7ff970a25c4706e5df 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -403,7 +403,7 @@ pipeline {
agent{label " slave1 || slave6 || slave11 || slave16 "}
steps {
pre_test()
- timeout(time: 55, unit: 'MINUTES'){
+ timeout(time: 100, unit: 'MINUTES'){
script{
scope.each {
sh """
@@ -420,7 +420,7 @@ pipeline {
agent{label " slave2 || slave7 || slave12 || slave17 "}
steps {
pre_test()
- timeout(time: 55, unit: 'MINUTES'){
+ timeout(time: 100, unit: 'MINUTES'){
script{
scope.each {
sh """
@@ -453,7 +453,7 @@ pipeline {
stage('python_4') {
agent{label " slave4 || slave9 || slave14 || slave19 "}
steps {
- timeout(time: 55, unit: 'MINUTES'){
+ timeout(time: 100, unit: 'MINUTES'){
pre_test()
script{
scope.each {
@@ -471,7 +471,7 @@ pipeline {
stage('python_5') {
agent{label " slave5 || slave10 || slave15 || slave20 "}
steps {
- timeout(time: 55, unit: 'MINUTES'){
+ timeout(time: 100, unit: 'MINUTES'){
pre_test()
script{
scope.each {
diff --git a/documentation20/cn/02.getting-started/01.docker/docs.md b/documentation20/cn/02.getting-started/01.docker/docs.md
index 4ac6d96ec1de161d3259c5246e78565ec2cfc726..cab6d878991a315f79b7fc0813e3727b6e8720dd 100644
--- a/documentation20/cn/02.getting-started/01.docker/docs.md
+++ b/documentation20/cn/02.getting-started/01.docker/docs.md
@@ -15,22 +15,34 @@ $ docker -v
Docker version 20.10.3, build 48d30b5
```
-## 在 Docker 容器中运行 TDengine
+## 使用 Docker 在容器中运行 TDengine
-1,使用命令拉取 TDengine 镜像,并使它在后台运行。
+### 在 Docker 容器中运行 TDengine server
```bash
-$ docker run -d --name tdengine tdengine/tdengine
-7760c955f225d72e9c1ec5a4cef66149a7b94dae7598b11eb392138877e7d292
+$ docker run -d -p 6030-6041:6030-6041 -p 6030-6041:6030-6041/udp tdengine/tdengine
+526aa188da767ae94b244226a2b2eec2b5f17dd8eff592893d9ec0cd0f3a1ccd
```
+这条命令,启动一个运行了 TDengine server 的 docker 容器,并且将容器的 6030 到 6041 端口映射到宿主机的 6030 到 6041 端口上。如果宿主机已经运行了 TDengine server 并占用了相同端口,需要映射容器的端口到不同的未使用端口段。(详情参见 [TDengine 2.0 端口说明](https://www.taosdata.com/cn/documentation/faq#port))。为了支持 TDengine 客户端操作 TDengine server 服务, TCP 和 UDP 端口都需要打开。
+
- **docker run**:通过 Docker 运行一个容器
-- **--name tdengine**:设置容器名称,我们可以通过容器名称来查看对应的容器
- **-d**:让容器在后台运行
+- **-p**:指定映射端口。注意:如果不是用端口映射,依然可以进入 Docker 容器内部使用 TDengine 服务或进行应用开发,只是不能对容器外部提供服务
- **tdengine/tdengine**:拉取的 TDengine 官方发布的应用镜像
-- **7760c955f225d72e9c1ec5a4cef66149a7b94dae7598b11eb392138877e7d292**:这个返回的长字符是容器 ID,我们也可以通过容器 ID 来查看对应的容器
+- **526aa188da767ae94b244226a2b2eec2b5f17dd8eff592893d9ec0cd0f3a1ccd**:这个返回的长字符是容器 ID,我们也可以通过容器 ID 来查看对应的容器
+
+进一步,还可以使用 docker run 命令启动运行 TDengine server 的 docker 容器,并使用 --name 命令行参数将容器命名为 tdengine,使用 --hostname 指定 hostname 为 tdengine-server,通过 -v 挂载本地目录(-v),实现宿主机与容器内部的数据同步,防止容器删除后,数据丢失。
-2,确认容器是否已经正确运行。
+```
+$ docker run -d --name tdengine --hostname="tdengine-server" -v ~/work/taos/log:/var/log/taos -v ~/work/taos/data:/var/lib/taos -p 6030-6041:6030-6041 -p 6030-6041:6030-6041/udp tdengine/tdengine
+```
+
+- **--name tdengine**:设置容器名称,我们可以通过容器名称来访问对应的容器
+- **--hostnamename=tdengine-server**:设置容器内 Linux 系统的 hostname,我们可以通过映射 hostname 和 IP 来解决容器 IP 可能变化的问题。
+- **-v**:设置宿主机文件目录映射到容器内目录,避免容器删除后数据丢失。
+
+### 使用 docker ps 命令确认容器是否已经正确运行
```bash
$ docker ps
@@ -45,23 +57,23 @@ c452519b0f9b tdengine/tdengine "taosd" 14 minutes ago Up 14 minutes ·
- **CREATED**:容器创建时间。
- **STATUS**:容器状态。UP 表示运行中。
-3,进入 Docker 容器内,使用 TDengine。
+### 通过 docker exec 命令,进入到 docker 容器中去做开发
```bash
$ docker exec -it tdengine /bin/bash
-root@c452519b0f9b:~/TDengine-server-2.0.20.13#
+root@tdengine-server:~/TDengine-server-2.0.20.13#
```
- **docker exec**:通过 docker exec 命令进入容器,如果退出,容器不会停止。
- **-i**:进入交互模式。
- **-t**:指定一个终端。
-- **c452519b0f9b**:容器 ID,需要根据 docker ps 指令返回的值进行修改。
+- **tdengine**:容器名称,需要根据 docker ps 指令返回的值进行修改。
- **/bin/bash**:载入容器后运行 bash 来进行交互。
-4,进入容器后,执行 taos shell 客户端程序。
+进入容器后,执行 taos shell 客户端程序。
```bash
-$ root@c452519b0f9b:~/TDengine-server-2.0.20.13# taos
+root@tdengine-server:~/TDengine-server-2.0.20.13# taos
Welcome to the TDengine shell from Linux, Client Version:2.0.20.13
Copyright (c) 2020 by TAOS Data, Inc. All rights reserved.
@@ -73,19 +85,92 @@ TDengine 终端成功连接服务端,打印出了欢迎消息和版本信息
在 TDengine 终端中,可以通过 SQL 命令来创建/删除数据库、表、超级表等,并可以进行插入和查询操作。具体可以参考 [TAOS SQL 说明文档](https://www.taosdata.com/cn/documentation/taos-sql)。
-## 通过 taosdemo 进一步了解 TDengine
-1,接上面的步骤,先退出 TDengine 终端程序。
+### 在宿主机访问 Docker 容器中的 TDengine server
-```bash
-$ taos> q
-root@c452519b0f9b:~/TDengine-server-2.0.20.13#
+在使用了 -p 命令行参数映射了正确的端口启动了 TDengine Docker 容器后,就在宿主机使用 taos shell 命令即可访问运行在 Docker 容器中的 TDengine。
+
+```
+$ taos
+
+Welcome to the TDengine shell from Linux, Client Version:2.0.22.3
+Copyright (c) 2020 by TAOS Data, Inc. All rights reserved.
+
+taos>
```
-2,在命令行界面执行 taosdemo。
+也可以在宿主机使用 curl 通过 RESTful 端口访问 Docker 容器内的 TDengine server。
+
+```
+$ curl -u root:taosdata -d 'show databases' 127.0.0.1:6041/rest/sql
+{"status":"succ","head":["name","created_time","ntables","vgroups","replica","quorum","days","keep0,keep1,keep(D)","cache(MB)","blocks","minrows","maxrows","wallevel","fsync","comp","cachelast","precision","update","status"],"column_meta":[["name",8,32],["created_time",9,8],["ntables",4,4],["vgroups",4,4],["replica",3,2],["quorum",3,2],["days",3,2],["keep0,keep1,keep(D)",8,24],["cache(MB)",4,4],["blocks",4,4],["minrows",4,4],["maxrows",4,4],["wallevel",2,1],["fsync",4,4],["comp",2,1],["cachelast",2,1],["precision",8,3],["update",2,1],["status",8,10]],"data":[["test","2021-08-18 06:01:11.021",10000,4,1,1,10,"3650,3650,3650",16,6,100,4096,1,3000,2,0,"ms",0,"ready"],["log","2021-08-18 05:51:51.065",4,1,1,1,10,"30,30,30",1,3,100,4096,1,3000,2,0,"us",0,"ready"]],"rows":2}
+```
+
+这条命令,通过 RESTful 接口访问 TDengine server,这时连接的是本机的 6041 端口,可见连接成功。
+
+TDengine RESTful 接口详情请参考[官方文档](https://www.taosdata.com/cn/documentation/connector#restful)。
+
+
+### 使用 Docker 容器运行 TDengine server 和 taosAdapter
+
+在 TDegnine 2.4.0.0 之后版本的 Docker 容器,开始一个组件 taosAdapter,taosAdapter 支持通过 RESTful 接口对 TDengine server 的数据写入和查询能力,并提供和 InfluxDB/OpenTSDB 兼容的数据摄取接口,允许 InfluxDB/OpenTSDB 应用程序无缝移植到 TDengine。
+
+注意:如果容器中运行 taosAdapter,需要根据需要增加映射其他端口,具体端口默认配置和修改方法请参考[taosAdapter文档](https://github.com/taosdata/taosadapter/blob/develop/README-CN.md)。
+
+使用 docker 运行 TDengine 2.4.0.0 版本镜像:
+
+```
+$ docker run -d --name tdengine-taosa -p 6030-6049:6030-6049 -p 6030-6049:6030-6049/udp tdengine/tdengine:2.4.0.0
+```
+
+使用 curl 命令验证 RESTful 接口可以正常工作:
+```
+$ curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d 'show databases;' 127.0.0.1:6041/rest/sql
+
+{"status":"succ","head":["name","created_time","ntables","vgroups","replica","quorum","days","keep","cache(MB)","blocks","minrows","maxrows","wallevel","fsync","comp","cachelast","precision","update","status"],"column_meta":[["name",8,32],["created_time",9,8],["ntables",4,4],["vgroups",4,4],["replica",3,2],["quorum",3,2],["days",3,2],["keep",8,24],["cache(MB)",4,4],["blocks",4,4],["minrows",4,4],["maxrows",4,4],["wallevel",2,1],["fsync",4,4],["comp",2,1],["cachelast",2,1],["precision",8,3],["update",2,1],["status",8,10]],"data":[["log","2021-12-28 09:18:55.765",10,1,1,1,10,"30",1,3,100,4096,1,3000,2,0,"us",0,"ready"]],"rows":1}
+```
+
+taosAdapter 支持多个数据收集代理软件(如 Telegraf、StatsD、collectd 等),这里仅模拟 StasD 写入数据,在宿主机执行命令如下:
+```
+$ echo "foo:1|c" | nc -u -w0 127.0.0.1 6044
+```
+
+然后可以使用 taos shell 查询 taosAdapter 自动创建的数据库 statsd 和 超级表 foo 中的内容:
+```
+taos> show databases;
+ name | created_time | ntables | vgroups | replica | quorum | days | keep | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | cachelast | precision | update | status |
+====================================================================================================================================================================================================================================================================================
+ log | 2021-12-28 09:18:55.765 | 12 | 1 | 1 | 1 | 10 | 30 | 1 | 3 | 100 | 4096 | 1 | 3000 | 2 | 0 | us | 0 | ready |
+ statsd | 2021-12-28 09:21:48.841 | 1 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ns | 2 | ready |
+Query OK, 2 row(s) in set (0.002112s)
+
+taos> use statsd;
+Database changed.
+
+taos> show stables;
+ name | created_time | columns | tags | tables |
+============================================================================================
+ foo | 2021-12-28 09:21:48.894 | 2 | 1 | 1 |
+Query OK, 1 row(s) in set (0.001160s)
+
+taos> select * from foo;
+ ts | value | metric_type |
+=======================================================================================
+ 2021-12-28 09:21:48.840820836 | 1 | counter |
+Query OK, 1 row(s) in set (0.001639s)
+
+taos>
+```
+
+可以看到模拟数据已经被写入到 TDengine 中。
+
+
+### 应用示例:在宿主机使用 taosdemo 写入数据到 Docker 容器中的 TDengine server
+
+1,在宿主机命令行界面执行 taosdemo 写入数据到 Docker 容器中的 TDengine server
```bash
-root@c452519b0f9b:~/TDengine-server-2.0.20.13# taosdemo
+$ taosdemo
taosdemo is simulating data generated by power equipments monitoring...
@@ -134,9 +219,9 @@ column[0]:FLOAT column[1]:INT column[2]:FLOAT
回车后,该命令将在数据库 test 下面自动创建一张超级表 meters,该超级表下有 1 万张表,表名为 "d0" 到 "d9999",每张表有 1 万条记录,每条记录有 (ts, current, voltage, phase) 四个字段,时间戳从 "2017-07-14 10:40:00 000" 到 "2017-07-14 10:40:09 999",每张表带有标签 location 和 groupId,groupId 被设置为 1 到 10, location 被设置为 "beijing" 或者 "shanghai"。
-执行这条命令大概需要几分钟,最后共插入 1 亿条记录。
+最后共插入 1 亿条记录。
-3,进入 TDengine 终端,查看 taosdemo 生成的数据。
+2,进入 TDengine 终端,查看 taosdemo 生成的数据。
- **进入命令行。**
@@ -217,27 +302,3 @@ tdengine
- **docker stop**:通过 docker stop 停止指定的正在运行中的 docker 镜像。
- **tdengine**:容器名称。
-## 编程开发时连接在 Docker 中的 TDengine
-
-从 Docker 之外连接使用在 Docker 容器内运行的 TDengine 服务,有以下两个思路:
-
-1,通过端口映射(-p),将容器内部开放的网络端口映射到宿主机的指定端口上。通过挂载本地目录(-v),可以实现宿主机与容器内部的数据同步,防止容器删除后,数据丢失。
-
-```bash
-$ docker run -d -v /etc/taos:/etc/taos -p 6041:6041 tdengine/tdengine
-526aa188da767ae94b244226a2b2eec2b5f17dd8eff592893d9ec0cd0f3a1ccd
-
-$ curl -u root:taosdata -d 'show databases' 127.0.0.1:6041/rest/sql
-{"status":"succ","head":["name","created_time","ntables","vgroups","replica","quorum","days","keep0,keep1,keep(D)","cache(MB)","blocks","minrows","maxrows","wallevel","fsync","comp","cachelast","precision","update","status"],"column_meta":[["name",8,32],["created_time",9,8],["ntables",4,4],["vgroups",4,4],["replica",3,2],["quorum",3,2],["days",3,2],["keep0,keep1,keep(D)",8,24],["cache(MB)",4,4],["blocks",4,4],["minrows",4,4],["maxrows",4,4],["wallevel",2,1],["fsync",4,4],["comp",2,1],["cachelast",2,1],["precision",8,3],["update",2,1],["status",8,10]],"data":[["test","2021-08-18 06:01:11.021",10000,4,1,1,10,"3650,3650,3650",16,6,100,4096,1,3000,2,0,"ms",0,"ready"],["log","2021-08-18 05:51:51.065",4,1,1,1,10,"30,30,30",1,3,100,4096,1,3000,2,0,"us",0,"ready"]],"rows":2}
-```
-
-- 第一条命令,启动一个运行了 TDengine 的 docker 容器,并且将容器的 6041 端口映射到宿主机的 6041 端口上。
-- 第二条命令,通过 RESTful 接口访问 TDengine,这时连接的是本机的 6041 端口,可见连接成功。
-
-注意:在这个示例中,出于方便性考虑,只映射了 RESTful 需要的 6041 端口。如果希望以非 RESTful 方式连接 TDengine 服务,则需要映射从 6030 开始的共 11 个端口(完整的端口情况请参见 [TDengine 2.0 端口说明](https://www.taosdata.com/cn/documentation/faq#port))。在例子中,挂载本地目录也只是处理了配置文件所在的 /etc/taos 目录,而没有挂载数据存储目录。
-
-2,直接通过 exec 命令,进入到 docker 容器中去做开发。也即,把程序代码放在 TDengine 服务端所在的同一个 Docker 容器中,连接容器本地的 TDengine 服务。
-
-```bash
-$ docker exec -it tdengine /bin/bash
-```
diff --git a/documentation20/cn/12.taos-sql/docs.md b/documentation20/cn/12.taos-sql/docs.md
index 9f15d05cec005f9abe6c8f29a80361b6a8e111fe..39fe8eefba310291d78f743142c1b83ca9c20f1e 100755
--- a/documentation20/cn/12.taos-sql/docs.md
+++ b/documentation20/cn/12.taos-sql/docs.md
@@ -1653,7 +1653,7 @@ SELECT COUNT(*) FROM temp_table INTERVAL(1D) SLIDING(2D)
使用整数(布尔值)或字符串来标识产生记录时候设备的状态量。产生的记录如果具有相同的状态量数值则归属于同一个状态窗口,数值改变后该窗口关闭。如下图所示,根据状态量确定的状态窗口分别是[2019-04-28 14:22:07,2019-04-28 14:22:10]和[2019-04-28 14:22:11,2019-04-28 14:22:12]两个。(状态窗口暂不支持对超级表使用)
-
+
使用STATE_WINDOW来确定状态窗口划分的列。例如:
@@ -1665,7 +1665,7 @@ SELECT COUNT(*), FIRST(ts), status FROM temp_tb_1 STATE_WINDOW(status)
会话窗口根据记录的时间戳主键的值来确定是否属于同一个会话。如下图所示,如果设置时间戳的连续的间隔小于等于12秒,则以下6条记录构成2个会话窗口,分别是:[2019-04-28 14:22:10,2019-04-28 14:22:30]和[2019-04-28 14:23:10,2019-04-28 14:23:30]。因为2019-04-28 14:22:30与2019-04-28 14:23:10之间的时间间隔是40秒,超过了连续时间间隔(12秒)。
-
+
在tol_value时间间隔范围内的结果都认为归属于同一个窗口,如果连续的两条记录的时间超过tol_val,则自动开启下一个窗口。(会话窗口暂不支持对超级表使用)
diff --git a/documentation20/en/02.getting-started/01.docker/docs.md b/documentation20/en/02.getting-started/01.docker/docs.md
index daa89ef1016179e7860e4178c52481aef2760243..aeaaa7778d98e72995869328b8c96c5a0e9dfe03 100644
--- a/documentation20/en/02.getting-started/01.docker/docs.md
+++ b/documentation20/en/02.getting-started/01.docker/docs.md
@@ -15,22 +15,34 @@ $ docker -v
Docker version 20.10.3, build 48d30b5
```
-## Running TDengine in a Docker container
+## Using Docker to run TDengine
-1, Use the command to pull the TDengine image and make it run in the background.
+### running TDengine server inside Docker
```bash
-$ docker run -d --name tdengine tdengine/tdengine
-7760c955f225d72e9c1ec5a4cef66149a7b94dae7598b11eb392138877e7d292
+$ docker run -d -p 6030-6041:6030-6041 -p 6030-6041:6030-6041/udp tdengine/tdengine
+526aa188da767ae94b244226a2b2eec2b5f17dd8eff592893d9ec0cd0f3a1ccd
+```
+
+This command starts a docker container with TDengine server running and maps the container's ports from 6030 to 6041 to the host's ports from 6030 to 6041. If the host is already running TDengine server and occupying the same port(s), you need to map the container's port to a different unused port segment. (Please see [TDengine 2.0 Port Description](https://www.taosdata.com/en/documentation/faq#port) for details). In order to support TDengine clients accessing TDengine server services, both TCP and UDP ports need to be open.
+
+- **docker run**: Run a container via Docker
+- **-d**: put the container run in the background
+- **-p**: specify the port(s) to map. Note: If you do not use port mapping, you can still go inside the Docker container to access TDengine services or develop your application, but you cannot provide services outside the container
+- **tdengine/tdengine**: the official TDengine published application image that is pulled
+- **526aa188da767ae94b244226a2b2eec2b5f17dd8eff592893d9ec0cd0f3a1ccd**: The long character returned is the container ID, and we can also view the corresponding container by its container ID
+
+Further, you can also use the `docker run` command to start the docker container running TDengine server, and use the `--name` command line parameter to name the container tdengine, use `--hostname` to specify the hostname as tdengine-server, and use `-v` to mount the local directory (-v) to synchronize the data inside the host and the container to prevent data loss after the container is deleted.
+
+```
+$ docker run -d --name tdengine --hostname="tdengine-server" -v ~/work/taos/log:/var/log/taos -v ~/work/taos/data:/var/lib/taos -p 6030-6041:6030-6041 -p 6030-6041:6030-6041/udp tdengine/tdengine
```
-- **docker run**: Running a container via Docker
-- **--name tdengine**: Set the container name, we can see the corresponding container by the container name
-- **-d**: Keeping containers running in the background
-- **tdengine/tdengine**: Pulled from the official TDengine published application image
-- **7760c955f225d72e9c1ec5a4cef66149a7b94dae7598b11eb392138877e7d292**: The long character returned is the container ID, and we can also view the corresponding container by its container ID
+- **--name tdengine**: set the container name, we can access the corresponding container by container name
+- **--hostnamename=tdengine-server**: set the hostname of the Linux system inside the container, we can map the hostname and IP to solve the problem that the container IP may change.
+- **-v**: Set the host file directory to be mapped to the inner container directory to avoid data loss after the container is deleted.
-2, Verify that the container is running correctly.
+### Use the `docker ps` command to verify that the container is running correctly
```bash
$ docker ps
@@ -38,30 +50,30 @@ CONTAINER ID IMAGE COMMAND CREATED STATUS ·
c452519b0f9b tdengine/tdengine "taosd" 14 minutes ago Up 14 minutes ···
```
-- **docker ps**: Lists information about all containers that are in running state.
-- **CONTAINER ID**: Container ID.
-- **IMAGE**: The mirror used.
-- **COMMAND**: The command to run when starting the container.
-- **CREATED**: The time when the container was created.
-- **STATUS**: The container status. Up means running.
+- **docker ps**: list all containers in running state.
+- **CONTAINER ID**: container ID.
+- **IMAGE**: the image used.
+- **COMMAND**: the command to run when starting the container.
+- **CREATED**: container creation time.
+- **STATUS**: container status. UP means running.
-3, Go inside the Docker container and use TDengine.
+### Enter the docker container to do development via the `docker exec` COMMAND
```bash
$ docker exec -it tdengine /bin/bash
-root@c452519b0f9b:~/TDengine-server-2.0.20.13#
+root@tdengine-server:~/TDengine-server-2.0.20.13#
```
-- **docker exec**: Enter the container via the docker exec command; if you exit, the container will not stop.
-- **-i**: Enter the interactive mode.
-- **-t**: Specify a terminal.
-- **c452519b0f9b**: The container ID, which needs to be modified according to the value returned by the docker ps command.
-- **/bin/bash**: Load the container and run bash to interact with it.
+- **docker exec**: Enter the container by `docker exec` command, if exited, the container will not stop.
+- **-i**: use interactive mode.
+- **-t**: specify a terminal.
+- **tdengine**: container name, needs to be changed according to the value returned by the docker ps command.
+- **/bin/bash**: load the container and run bash to interact with it.
-4, After entering the container, execute the taos shell client program.
+After entering the container, execute the taos shell client program.
```bash
-$ root@c452519b0f9b:~/TDengine-server-2.0.20.13# taos
+root@tdengine-server:~/TDengine-server-2.0.20.13# taos
Welcome to the TDengine shell from Linux, Client Version:2.0.20.13
Copyright (c) 2020 by TAOS Data, Inc. All rights reserved.
@@ -69,23 +81,94 @@ Copyright (c) 2020 by TAOS Data, Inc. All rights reserved.
taos>
```
-The TDengine terminal successfully connects to the server and prints out a welcome message and version information. If it fails, an error message is printed.
+The TDengine shell successfully connects to the server and prints out a welcome message and version information. If it fails, an error message is printed.
-In the TDengine terminal, you can create/delete databases, tables, super tables, etc., and perform insert and query operations via SQL commands. For details, you can refer to [TAOS SQL guide](https://www.taosdata.com/en/documentation/taos-sql).
+In the TDengine shell, you can create/delete databases, tables, super tables, etc., and perform insert and query operations via SQL commands. For details, please refer to the [TAOS SQL documentation](https://www.taosdata.com/en/documentation/taos-sql).
-## Learn more about TDengine with taosdemo
+### Accessing TDengine server inside Docker container from the host side
-1, Following the above steps, exit the TDengine terminal program first.
+After starting the TDengine Docker container with the correct port mapped with the -p command line parameter, you can access the TDengine running inside the Docker container from the host side using the taos shell command.
+
+```
+$ taos
+
+Welcome to the TDengine shell from Linux, Client Version:2.0.22.3
+Copyright (c) 2020 by TAOS Data, Inc. All rights reserved.
+
+taos>
+```
+
+You can also access the TDengine server inside the Docker container using `curl` command from the host side through the RESTful port.
-```bash
-$ taos> q
-root@c452519b0f9b:~/TDengine-server-2.0.20.13#
```
+$ curl -u root:taosdata -d 'show databases' 127.0.0.1:6041/rest/sql
+{"status":"succ","head":["name","created_time","ntables","vgroups","replica","quorum","days","keep0,keep1,keep(D)","cache(MB)","blocks","minrows","maxrows","wallevel","fsync","comp","cachelast","precision","update","status"],"column_meta":[["name",8,32],["created_time",9,8],["ntables",4,4],["vgroups",4,4],["replica",3,2],["quorum",3,2],["days",3,2],["keep0,keep1,keep(D)",8,24],["cache(MB)",4,4],["blocks",4,4],["minrows",4,4],["maxrows",4,4],["wallevel",2,1],["fsync",4,4],["comp",2,1],["cachelast",2,1],["precision",8,3],["update",2,1],["status",8,10]],"data":[["test","2021-08-18 06:01:11.021",10000,4,1,1,10,"3650,3650,3650",16,6,100,4096,1,3000,2,0,"ms",0,"ready"],["log","2021-08-18 05:51:51.065",4,1,1,1,10,"30,30,30",1,3,100,4096,1,3000,2,0,"us",0,"ready"]],"rows":2}
+```
+
+This command accesses the TDengine server through the RESTful interface, which connects to port 6041 on the local machine, so the connection is successful.
+
+TDengine RESTful interface details can be found in the [official documentation](https://www.taosdata.com/en/documentation/connector#restful).
+
+
+### Running TDengine server and taosAdapter with a Docker container
+
+Docker containers of TDegnine version 2.4.0.0 and later include a component named `taosAdapter`, which supports data writing and querying capabilities to the TDengine server through the RESTful interface and provides the data ingestion interfaces compatible with InfluxDB/OpenTSDB. Allows seamless migration of InfluxDB/OpenTSDB applications to access TDengine.
-2, Execute taosdemo from the command line interface.
+Note: If taosAdapter is running inside the container, you need to add mapping to other additional ports as needed, please refer to [taosAdapter documentation](https://github.com/taosdata/taosadapter/blob/develop/README.md) for the default port number and modification methods for the specific purpose.
+
+Running TDengine version 2.4.0.0 image with docker.
+
+```
+$ docker run -d --name tdengine-taosa -p 6030-6049:6030-6049 -p 6030-6049:6030-6049/udp tdengine/tdengine:2.4.0.0
+```
+
+Verify that the RESTful interface taosAdapter provides working using the `curl` command.
+```
+$ curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d 'show databases;' 127.0.0.1:6041/rest/sql
+
+{"status":"succ","head":["name","created_time","ntables","vgroups","replica","quorum","days","keep","cache(MB)","blocks","minrows","maxrows","wallevel","fsync","comp","cachelast","precision","update","status"],"column_meta":[["name",8,32],["created_time",9,8],["ntables",4,4],["vgroups",4,4],["replica",3,2],["quorum",3,2],["days",3,2],["keep",8,24],["cache(MB)",4,4],["blocks",4,4],["minrows",4,4],["maxrows",4,4],["wallevel",2,1],["fsync",4,4],["comp",2,1],["cachelast",2,1],["precision",8,3],["update",2,1],["status",8,10]],"data":[["log","2021-12-28 09:18:55.765",10,1,1,1,10,"30",1,3,100,4096,1,3000,2,0,"us",0,"ready"]],"rows":1}
+```
+taosAdapter supports multiple data collection agents (e.g. Telegraf, StatsD, collectd, etc.), here only demonstrate how StasD is simulated to write data, and the command is executed from the host side as follows.
+```
+$ echo "foo:1|c" | nc -u -w0 127.0.0.1 6044
+```
+
+Then you can use the taos shell to query the taosAdapter automatically created database statsd and the contents of the super table foo.
+```
+taos> show databases;
+ name | created_time | ntables | vgroups | replica | quorum | days | keep | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | cachelast | precision | update | status |
+====================================================================================================================================================================================================================================================================================
+ log | 2021-12-28 09:18:55.765 | 12 | 1 | 1 | 1 | 10 | 30 | 1 | 3 | 100 | 4096 | 1 | 3000 | 2 | 0 | us | 0 | ready |
+ statsd | 2021-12-28 09:21:48.841 | 1 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ns | 2 | ready |
+Query OK, 2 row(s) in set (0.002112s)
+
+taos> use statsd;
+Database changed.
+
+taos> show stables;
+ name | created_time | columns | tags | tables |
+============================================================================================
+ foo | 2021-12-28 09:21:48.894 | 2 | 1 | 1 |
+Query OK, 1 row(s) in set (0.001160s)
+
+taos> select * from foo;
+ ts | value | metric_type |
+=======================================================================================
+ 2021-12-28 09:21:48.840820836 | 1 | counter |
+Query OK, 1 row(s) in set (0.001639s)
+
+taos>
+```
+
+You can see that the simulation data has been written to TDengine.
+
+
+### Application example: write data to TDengine server in Docker container using taosdemo on the host
+
+1, execute taosdemo in the host command line interface to write data to the TDengine server in the Docker container
```bash
-root@c452519b0f9b:~/TDengine-server-2.0.20.13# taosdemo
+$ taosdemo
taosdemo is simulating data generated by power equipments monitoring...
@@ -217,27 +300,3 @@ tdengine
- **docker stop**: Stop the specified running docker image with docker stop.
- **tdengine**: The name of the container.
-## TDengine connected in Docker during programming development
-
-There are two ideas for connecting from outside of Docker to use TDengine services running inside a Docker container:
-
-1, By port mapping (-p), the open network port inside the container is mapped to the specified port of the host. By mounting the local directory (-v), you can synchronize the data inside the host and the container to prevent data loss after the container is deleted.
-
-```bash
-$ docker run -d -v /etc/taos:/etc/taos -P 6041:6041 tdengine/tdengine
-526aa188da767ae94b244226a2b2eec2b5f17dd8eff592893d9ec0cd0f3a1ccd
-
-$ curl -u root:taosdata -d 'show databases' 127.0.0.1:6041/rest/sql
-{"status":"succ","head":["name","created_time","ntables","vgroups","replica","quorum","days","keep0,keep1,keep(D)","cache(MB)","blocks","minrows","maxrows","wallevel","fsync","comp","cachelast","precision","update","status"],"column_meta":[["name",8,32],["created_time",9,8],["ntables",4,4],["vgroups",4,4],["replica",3,2],["quorum",3,2],["days",3,2],["keep0,keep1,keep(D)",8,24],["cache(MB)",4,4],["blocks",4,4],["minrows",4,4],["maxrows",4,4],["wallevel",2,1],["fsync",4,4],["comp",2,1],["cachelast",2,1],["precision",8,3],["update",2,1],["status",8,10]],"data":[["test","2021-08-18 06:01:11.021",10000,4,1,1,10,"3650,3650,3650",16,6,100,4096,1,3000,2,0,"ms",0,"ready"],["log","2021-08-18 05:51:51.065",4,1,1,1,10,"30,30,30",1,3,100,4096,1,3000,2,0,"us",0,"ready"]],"rows":2}
-```
-
-- The first command starts a docker container with TDengine running and maps the 6041 port of the container to port 6041 of the host.
-- The second command, accessing TDengine through the RESTful interface, connects to port 6041 on the local machine, so the connection is successful.
-
-Note: In this example, for convenience reasons, only port 6041 is mapped, which is required for RESTful. If you wish to connect to the TDengine service in a non-RESTful manner, you will need to map a total of 11 ports starting at 6030. In the example, mounting the local directory also only deals with the /etc/taos directory where the configuration files are located, but not the data storage directory.
-
-2, Go directly to the docker container to do development via the exec command. That is, put the program code in the same Docker container where the TDengine server is located and connect to the TDengine service local to the container.
-
-```bash
-$ docker exec -it tdengine /bin/bash
-```
diff --git a/packaging/release.sh b/packaging/release.sh
index 38e5dd929e78ce1a167464892089c42a044d94f6..e24493bd0a834e79faadffd468e574f2554fbac1 100755
--- a/packaging/release.sh
+++ b/packaging/release.sh
@@ -3,7 +3,7 @@
# Generate the deb package for ubuntu, or rpm package for centos, or tar.gz package for other linux os
set -e
-set -x
+#set -x
# release.sh -v [cluster | edge]
# -c [aarch32 | aarch64 | x64 | x86 | mips64 ...]
diff --git a/packaging/tools/makepkg.sh b/packaging/tools/makepkg.sh
index 89bbbf9370e545d10aa8c8f9a4b16e0319693e30..3a2b11f3a47d4a6f490c5290711f6890ec1e4e88 100755
--- a/packaging/tools/makepkg.sh
+++ b/packaging/tools/makepkg.sh
@@ -36,11 +36,11 @@ if [ -d ${top_dir}/src/kit/taos-tools/packaging/deb ]; then
[ -z "$taos_tools_ver" ] && taos_tools_ver="0.1.0"
taostools_ver=$(git describe --tags|sed -e 's/ver-//g'|awk -F '-' '{print $1}')
- taostools_install_dir="${release_dir}/taos-tools-${taostools_ver}"
+ taostools_install_dir="${release_dir}/taosTools-${taostools_ver}"
cd ${curr_dir}
else
- taostools_install_dir="${release_dir}/taos-tools-${version}"
+ taostools_install_dir="${release_dir}/taosTools-${version}"
fi
# Directories and files
diff --git a/src/balance/src/bnMain.c b/src/balance/src/bnMain.c
index 9997d44ca55954b120ae4849d4f68be4d23419f7..e23bdc654e02bb3d9b34f656b0b49840c97f37e8 100644
--- a/src/balance/src/bnMain.c
+++ b/src/balance/src/bnMain.c
@@ -567,7 +567,7 @@ void bnCheckStatus() {
while (1) {
pIter = mnodeGetNextDnode(pIter, &pDnode);
if (pDnode == NULL) break;
- if (tsAccessSquence - pDnode->lastAccess > 3) {
+ if (tsAccessSquence - pDnode->lastAccess > tsOfflineInterval) {
if (pDnode->status != TAOS_DN_STATUS_DROPPING && pDnode->status != TAOS_DN_STATUS_OFFLINE) {
pDnode->status = TAOS_DN_STATUS_OFFLINE;
pDnode->offlineReason = TAOS_DN_OFF_STATUS_MSG_TIMEOUT;
diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c
index 60aea2dc56a3d3f91dfb63f944ee76ff944b82f1..4d90949e5485fbec9f87828f9351e7f9f6fca85d 100644
--- a/src/client/src/tscSQLParser.c
+++ b/src/client/src/tscSQLParser.c
@@ -433,7 +433,7 @@ int32_t readFromFile(char *name, uint32_t *len, void **buf) {
return TSDB_CODE_TSC_OUT_OF_MEMORY;
}
- int fd = open(name, O_RDONLY);
+ int fd = open(name, O_RDONLY | O_BINARY);
if (fd < 0) {
tscError("open file %s failed, error:%s", name, strerror(errno));
tfree(*buf);
@@ -7265,6 +7265,7 @@ int32_t validateDNodeConfig(SMiscInfo* pOptions) {
const int tokenMonitor = 3;
const int tokenDebugFlag = 4;
const int tokenDebugFlagEnd = 20;
+ const int tokenOfflineInterval = 21;
const SDNodeDynConfOption cfgOptions[] = {
{"resetLog", 8}, {"resetQueryCache", 15}, {"balance", 7}, {"monitor", 7},
{"debugFlag", 9}, {"monDebugFlag", 12}, {"vDebugFlag", 10}, {"mDebugFlag", 10},
@@ -7272,6 +7273,7 @@ int32_t validateDNodeConfig(SMiscInfo* pOptions) {
{"uDebugFlag", 10}, {"tsdbDebugFlag", 13}, {"sDebugflag", 10}, {"rpcDebugFlag", 12},
{"dDebugFlag", 10}, {"mqttDebugFlag", 13}, {"wDebugFlag", 10}, {"tmrDebugFlag", 12},
{"cqDebugFlag", 11},
+ {"offlineInterval", 15},
};
SStrToken* pOptionToken = taosArrayGet(pOptions->a, 1);
@@ -7303,6 +7305,14 @@ int32_t validateDNodeConfig(SMiscInfo* pOptions) {
return TSDB_CODE_TSC_INVALID_OPERATION; // options value is invalid
}
return TSDB_CODE_SUCCESS;
+ } else if ((strncasecmp(cfgOptions[tokenOfflineInterval].name, pOptionToken->z, pOptionToken->n) == 0) &&
+ (cfgOptions[tokenOfflineInterval].len == pOptionToken->n)) {
+ SStrToken* pValToken = taosArrayGet(pOptions->a, 2);
+ int32_t val = strtol(pValToken->z, NULL, 10);
+ if (val < 1 || val > 600) {
+ return TSDB_CODE_TSC_INVALID_OPERATION; // options value is invalid
+ }
+ return TSDB_CODE_SUCCESS;
} else {
SStrToken* pValToken = taosArrayGet(pOptions->a, 2);
diff --git a/src/common/inc/tglobal.h b/src/common/inc/tglobal.h
index cde5eab48783351d4bd8c00be9008d52b5bf6561..890bed123bb1a03c93d676b1b12495c7a8b65ade 100644
--- a/src/common/inc/tglobal.h
+++ b/src/common/inc/tglobal.h
@@ -119,6 +119,7 @@ extern int32_t tsdbWalFlushSize;
extern int8_t tsEnableBalance;
extern int8_t tsAlternativeRole;
extern int32_t tsBalanceInterval;
+extern int32_t tsOfflineInterval;
extern int32_t tsOfflineThreshold;
extern int32_t tsMnodeEqualVnodeNum;
extern int8_t tsEnableFlowCtrl;
diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c
index 8627a3153cdac2b06cd3cf15dddefad32c39c58d..153c5ea78e8a5a6306fc7c8aae44526e8ec899f9 100644
--- a/src/common/src/tglobal.c
+++ b/src/common/src/tglobal.c
@@ -164,6 +164,7 @@ int32_t tsdbWalFlushSize = TSDB_DEFAULT_WAL_FLUSH_SIZE; // MB
int8_t tsEnableBalance = 1;
int8_t tsAlternativeRole = 0;
int32_t tsBalanceInterval = 300; // seconds
+int32_t tsOfflineInterval = 3; // seconds
int32_t tsOfflineThreshold = 86400 * 10; // seconds of 10 days
int32_t tsMnodeEqualVnodeNum = 4;
int8_t tsEnableFlowCtrl = 1;
@@ -653,6 +654,16 @@ static void doInitGlobalConfig(void) {
cfg.unitType = TAOS_CFG_UTYPE_NONE;
taosInitConfigOption(cfg);
+ cfg.option = "offlineInterval";
+ cfg.ptr = &tsOfflineInterval;
+ cfg.valType = TAOS_CFG_VTYPE_INT32;
+ cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW;
+ cfg.minValue = 1;
+ cfg.maxValue = 600;
+ cfg.ptrLength = 0;
+ cfg.unitType = TAOS_CFG_UTYPE_NONE;
+ taosInitConfigOption(cfg);
+
// 0-any; 1-mnode; 2-vnode
cfg.option = "role";
cfg.ptr = &tsAlternativeRole;
diff --git a/src/connector/C#/.gitignore b/src/connector/C#/.gitignore
index 525c7a04c07762c6f77bdaaaf7d602a5b4fc9591..a15c72f06cb1ed1f03b1ef19f18d3043f72061e3 100644
--- a/src/connector/C#/.gitignore
+++ b/src/connector/C#/.gitignore
@@ -4,3 +4,5 @@ src/test/Cases/bin/
src/test/Cases/obj/
src/test/XUnitTest/bin/
src/test/XUnitTest/obj/
+src/test/doc/
+NugetPackTest/
\ No newline at end of file
diff --git a/src/connector/C#/src/TDengineDriver/TDengineDriver.csproj b/src/connector/C#/src/TDengineDriver/TDengineDriver.csproj
index f208d303c9811fa05807ef8f72685b8ebb536a37..14b1776fb3aa8a92227c8154a0fed58d1f94f46c 100644
--- a/src/connector/C#/src/TDengineDriver/TDengineDriver.csproj
+++ b/src/connector/C#/src/TDengineDriver/TDengineDriver.csproj
@@ -1,7 +1,25 @@
-
- net5.0
+
+ net5;netstandard2.0;net45
+ TDengine.Connector
+ logo.jpg
+ 1.0.3
+ taosdata
+ www.taosdata.com
+ MIT
+ Taos;Data;Microsoft.NET.Sdk;IOT;bigdata;TDengine;taosdata
+
+ This is the C# connector's classlib that lets you connect to TDengine.
+ This C # connector supports: Linux 64/Windows x64/Windows x86.
+ more information please visit: https://www.taosdata.com
+
+ https://github.com/taosdata/TDengine/tree/develop/src/connector/C%23
+ CS1591
+
+
+
+
diff --git a/src/connector/C#/src/TDengineDriver/resource/logo.jpg b/src/connector/C#/src/TDengineDriver/resource/logo.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..b64b508f91beabdc6759dad955db5464a0efdac2
Binary files /dev/null and b/src/connector/C#/src/TDengineDriver/resource/logo.jpg differ
diff --git a/src/connector/C#/src/test/Cases/Cases.csproj b/src/connector/C#/src/test/Cases/Cases.csproj
index 57c0dd8f7d363e9da4ae580751cacf706f714883..ebc9c3100a778d35e6aee0feeb8d059ad5e4bfbd 100644
--- a/src/connector/C#/src/test/Cases/Cases.csproj
+++ b/src/connector/C#/src/test/Cases/Cases.csproj
@@ -7,10 +7,8 @@
Exe
net5.0
-
-
-
- true
- ..\doc\FunctionTest.XML
+ CS1591
+ true
+ ..\doc\FunctionTest.XML
diff --git a/src/connector/C#/src/test/XUnitTest/XUnitTest.csproj b/src/connector/C#/src/test/XUnitTest/XUnitTest.csproj
index 997a9d6fe072c01ffeb45a32773f8c76a530825c..6da7156111003eb671c3a0fa392f1d6adc7ac0d1 100644
--- a/src/connector/C#/src/test/XUnitTest/XUnitTest.csproj
+++ b/src/connector/C#/src/test/XUnitTest/XUnitTest.csproj
@@ -3,13 +3,12 @@
net5.0
false
-
-
-
+ CS1591
true
..\doc\UnitTest.XML
+
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/dnode/src/dnodeMain.c b/src/dnode/src/dnodeMain.c
index 420f462051687c72019d7c0697a23c940e4b8ae0..0580761de1c8768ed6fdb1c8f3ea6c7b4fa0836b 100644
--- a/src/dnode/src/dnodeMain.c
+++ b/src/dnode/src/dnodeMain.c
@@ -240,7 +240,7 @@ static void dnodeCheckDataDirOpenned(char *dir) {
char filepath[256] = {0};
sprintf(filepath, "%s/.running", dir);
- int fd = open(filepath, O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU | S_IRWXG | S_IRWXO);
+ int fd = open(filepath, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IRWXU | S_IRWXG | S_IRWXO);
if (fd < 0) {
dError("failed to open lock file:%s, reason: %s, quit", filepath, strerror(errno));
exit(0);
diff --git a/src/dnode/src/dnodeTelemetry.c b/src/dnode/src/dnodeTelemetry.c
index 22a6dc5b1993b6d15510b078ac4245909221ae78..ec09ab5d752cfbd4219787c0438c9b8bf4d1a9c4 100644
--- a/src/dnode/src/dnodeTelemetry.c
+++ b/src/dnode/src/dnodeTelemetry.c
@@ -266,7 +266,7 @@ static void* telemetryThread(void* param) {
}
static void dnodeGetEmail(char* filepath) {
- int32_t fd = open(filepath, O_RDONLY);
+ int32_t fd = open(filepath, O_RDONLY | O_BINARY);
if (fd < 0) {
return;
}
diff --git a/src/inc/tfs.h b/src/inc/tfs.h
index 11e33a3af791c3aef51c9d6ca876df2feb784473..1f16587536ddcc08770410cc34dc3b29b001eccb 100644
--- a/src/inc/tfs.h
+++ b/src/inc/tfs.h
@@ -70,7 +70,7 @@ typedef struct {
#define TFILE_NAME(pf) ((pf)->aname)
#define TFILE_REL_NAME(pf) ((pf)->rname)
-#define tfsopen(pf, flags) open(TFILE_NAME(pf), flags)
+#define tfsopen(pf, flags) open(TFILE_NAME(pf), flags | O_BINARY)
#define tfsclose(fd) close(fd)
#define tfsremove(pf) remove(TFILE_NAME(pf))
#define tfscopy(sf, df) taosCopy(TFILE_NAME(sf), TFILE_NAME(df))
diff --git a/src/kit/taos-tools b/src/kit/taos-tools
index 27751ba9ca17407425fb50a52cd68295794dedc3..dd78bfff5549c08153798719c1707ab441b5f4ab 160000
--- a/src/kit/taos-tools
+++ b/src/kit/taos-tools
@@ -1 +1 @@
-Subproject commit 27751ba9ca17407425fb50a52cd68295794dedc3
+Subproject commit dd78bfff5549c08153798719c1707ab441b5f4ab
diff --git a/src/os/src/detail/osRand.c b/src/os/src/detail/osRand.c
index 0dda908bb35c68513dba150e8380846c36aa2893..e1d81ea5d3ed1fccd0b8b96cb8c3991475f9c714 100644
--- a/src/os/src/detail/osRand.c
+++ b/src/os/src/detail/osRand.c
@@ -22,7 +22,7 @@ uint32_t taosSafeRand(void) {
int fd;
int seed;
- fd = open("/dev/urandom", 0);
+ fd = open("/dev/urandom", 0 | O_BINARY);
if (fd < 0) {
seed = (int)time(0);
} else {
diff --git a/src/os/src/detail/osSysinfo.c b/src/os/src/detail/osSysinfo.c
index 0542407c3ba8e8d17c79f16ef0f3560e3bc10693..06c58d43067ce5941975f97c169a2718640bac2a 100644
--- a/src/os/src/detail/osSysinfo.c
+++ b/src/os/src/detail/osSysinfo.c
@@ -713,7 +713,7 @@ bool taosGetSystemUid(char *uid) {
int fd;
int len = 0;
- fd = open("/proc/sys/kernel/random/uuid", 0);
+ fd = open("/proc/sys/kernel/random/uuid", 0 | O_BINARY);
if (fd < 0) {
return false;
} else {
diff --git a/src/os/src/detail/osTimer.c b/src/os/src/detail/osTimer.c
index 618df8a8bad451984fafd022a33a799986a48422..bc5119107a312b5f281263823d766e9ce506a85a 100644
--- a/src/os/src/detail/osTimer.c
+++ b/src/os/src/detail/osTimer.c
@@ -20,6 +20,7 @@
#if !(defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32) || defined(_TD_DARWIN_64))
+#ifndef _ALPINE
static void taosDeleteTimer(void *tharg) {
timer_t *pTimer = tharg;
timer_delete(*pTimer);
@@ -105,4 +106,41 @@ void taosUninitTimer() {
pthread_join(timerThread, NULL);
}
+#else
+
+static timer_t timerId;
+
+void sig_alrm_handler(union sigval sv) {
+ void (*callback)(int) = sv.sival_ptr;
+ callback(0);
+}
+int taosInitTimer(void (*callback)(int), int ms) {
+ struct sigevent evp;
+ memset((void *)&evp, 0, sizeof(evp));
+ evp.sigev_notify = SIGEV_THREAD;
+ evp.sigev_notify_function = &sig_alrm_handler;
+ evp.sigev_signo = SIGALRM;
+ evp.sigev_value.sival_ptr = (void *)callback;
+
+ struct itimerspec ts;
+ ts.it_value.tv_sec = 0;
+ ts.it_value.tv_nsec = 1000000 * MSECONDS_PER_TICK;
+ ts.it_interval.tv_sec = 0;
+ ts.it_interval.tv_nsec = 1000000 * MSECONDS_PER_TICK;
+ if (timer_create(CLOCK_REALTIME, &evp, &timerId)) {
+ uError("Failed to create timer");
+ return -1;
+ }
+
+ if (timer_settime(timerId, 0, &ts, NULL)) {
+ uError("Failed to init timer");
+ return -1;
+ }
+ return 0;
+}
+
+void taosUninitTimer() {
+ timer_delete(timerId);
+}
+#endif
#endif
diff --git a/src/os/src/linux/linuxEnv.c b/src/os/src/linux/linuxEnv.c
index 84c873202b685e690252890e347632e096a4b39e..49db2329e68d09b16e92c696289e56d1d540b398 100644
--- a/src/os/src/linux/linuxEnv.c
+++ b/src/os/src/linux/linuxEnv.c
@@ -72,7 +72,7 @@ char* taosGetCmdlineByPID(int pid) {
static char cmdline[1024];
sprintf(cmdline, "/proc/%d/cmdline", pid);
- int fd = open(cmdline, O_RDONLY);
+ int fd = open(cmdline, O_RDONLY | O_BINARY);
if (fd >= 0) {
int n = read(fd, cmdline, sizeof(cmdline) - 1);
if (n < 0) n = 0;
diff --git a/src/plugins/http/src/httpResp.c b/src/plugins/http/src/httpResp.c
index a2452a16b94fea060a370c86518bb36c1da45070..2c18904d2a9cc2d2dca57c406134518028daba9b 100644
--- a/src/plugins/http/src/httpResp.c
+++ b/src/plugins/http/src/httpResp.c
@@ -156,7 +156,10 @@ void httpSendErrorResp(HttpContext *pContext, int32_t errNo) {
HttpServer *pServer = &tsHttpServer;
SMonHttpStatus *httpStatus = monGetHttpStatusHashTableEntry(httpCode);
- pServer->statusCodeErrs[httpStatus->index] += 1;
+ // FIXME(@huolinhe): I don't known why the errors index is overflowed, but fix it by index check
+ if (httpStatus->index < HTTP_STATUS_CODE_NUM) {
+ pServer->statusCodeErrs[httpStatus->index] += 1;
+ }
pContext->error = true;
diff --git a/src/plugins/taosadapter b/src/plugins/taosadapter
index 273b5219f8bcc604e43beebc6f1f95abed85170a..fd84b35d3a30c9bcf3939d565f717b7f98ff9eb7 160000
--- a/src/plugins/taosadapter
+++ b/src/plugins/taosadapter
@@ -1 +1 @@
-Subproject commit 273b5219f8bcc604e43beebc6f1f95abed85170a
+Subproject commit fd84b35d3a30c9bcf3939d565f717b7f98ff9eb7
diff --git a/src/rpc/test/rserver.c b/src/rpc/test/rserver.c
index 64960db0446413ebce1978b7fe310b6a34c34f1c..767b756badcbd3e2ffdf7908a19aa61e86ac8f1b 100644
--- a/src/rpc/test/rserver.c
+++ b/src/rpc/test/rserver.c
@@ -172,7 +172,7 @@ int main(int argc, char *argv[]) {
tInfo("RPC server is running, ctrl-c to exit");
if (commit) {
- dataFd = open(dataName, O_APPEND | O_CREAT | O_WRONLY, S_IRWXU | S_IRWXG | S_IRWXO);
+ dataFd = open(dataName, O_APPEND | O_CREAT | O_WRONLY | O_BINARY, S_IRWXU | S_IRWXG | S_IRWXO);
if (dataFd<0)
tInfo("failed to open data file, reason:%s", strerror(errno));
}
diff --git a/src/sync/test/syncServer.c b/src/sync/test/syncServer.c
index 4598e16a9d05be29d11612755a079ce0a228a2ff..13010783962273f8ae5c5f68bb16e8480a8dacf9 100644
--- a/src/sync/test/syncServer.c
+++ b/src/sync/test/syncServer.c
@@ -43,7 +43,7 @@ int writeIntoWal(SWalHead *pHead) {
char walName[280];
snprintf(walName, sizeof(walName), "%s/wal/wal.%d", path, walNum);
(void)remove(walName);
- dataFd = open(walName, O_CREAT | O_WRONLY, S_IRWXU | S_IRWXG | S_IRWXO);
+ dataFd = open(walName, O_CREAT | O_WRONLY | O_BINARY, S_IRWXU | S_IRWXG | S_IRWXO);
if (dataFd < 0) {
uInfo("failed to open wal file:%s(%s)", walName, strerror(errno));
return -1;
diff --git a/src/tfs/src/tfs.c b/src/tfs/src/tfs.c
index b3aabe177bd4c34151cbe2778825bed6262679ab..63266f8d92c0051306542c683851cdfb6ed50275 100644
--- a/src/tfs/src/tfs.c
+++ b/src/tfs/src/tfs.c
@@ -498,7 +498,11 @@ static int tfsFormatDir(char *idir, char *odir) {
}
char tmp[PATH_MAX] = {0};
+#ifdef WINDOWS
+ if (_fullpath(tmp,wep.we_wordv[0], PATH_MAX) == NULL) {
+#else
if (realpath(wep.we_wordv[0], tmp) == NULL) {
+#endif
terrno = TAOS_SYSTEM_ERROR(errno);
wordfree(&wep);
return -1;
diff --git a/src/tsdb/inc/tsdbFile.h b/src/tsdb/inc/tsdbFile.h
index dfef13b51ecc4692f80cc6dbd937e70911228cf8..6d1e0cf2461a28dbcf481c7dc93d651551c0453d 100644
--- a/src/tsdb/inc/tsdbFile.h
+++ b/src/tsdb/inc/tsdbFile.h
@@ -89,7 +89,7 @@ static FORCE_INLINE void tsdbSetMFileInfo(SMFile* pMFile, SMFInfo* pInfo) { pMFi
static FORCE_INLINE int tsdbOpenMFile(SMFile* pMFile, int flags) {
ASSERT(TSDB_FILE_CLOSED(pMFile));
- pMFile->fd = open(TSDB_FILE_FULL_NAME(pMFile), flags);
+ pMFile->fd = open(TSDB_FILE_FULL_NAME(pMFile), flags | O_BINARY);
if (pMFile->fd < 0) {
terrno = TAOS_SYSTEM_ERROR(errno);
return -1;
@@ -204,7 +204,7 @@ static FORCE_INLINE void tsdbSetDFileInfo(SDFile* pDFile, SDFInfo* pInfo) { pDFi
static FORCE_INLINE int tsdbOpenDFile(SDFile* pDFile, int flags) {
ASSERT(!TSDB_FILE_OPENED(pDFile));
- pDFile->fd = open(TSDB_FILE_FULL_NAME(pDFile), flags);
+ pDFile->fd = open(TSDB_FILE_FULL_NAME(pDFile), flags | O_BINARY);
if (pDFile->fd < 0) {
terrno = TAOS_SYSTEM_ERROR(errno);
return -1;
diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c
index be734ce0cccad6827cba4e2c27d0be478af92af3..49837efc5d02ce0923f4f5d9d18da5db17d2cba3 100644
--- a/src/tsdb/src/tsdbRead.c
+++ b/src/tsdb/src/tsdbRead.c
@@ -596,6 +596,12 @@ void tsdbResetQueryHandleForNewTable(TsdbQueryHandleT queryHandle, STsdbQueryCon
static int32_t lazyLoadCacheLast(STsdbQueryHandle* pQueryHandle) {
STsdbRepo* pRepo = pQueryHandle->pTsdb;
+ if (!pQueryHandle->pTableCheckInfo) {
+ tsdbError("%p table check info is NULL", pQueryHandle);
+ terrno = TSDB_CODE_QRY_APP_ERROR;
+ return -1;
+ }
+
size_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo);
int32_t code = 0;
for (size_t i = 0; i < numOfTables; ++i) {
@@ -628,7 +634,9 @@ TsdbQueryHandleT tsdbQueryLastRow(STsdbRepo *tsdb, STsdbQueryCond *pCond, STable
return NULL;
}
- lazyLoadCacheLast(pQueryHandle);
+ if (lazyLoadCacheLast(pQueryHandle) != TSDB_CODE_SUCCESS) {
+ return NULL;
+ }
int32_t code = checkForCachedLastRow(pQueryHandle, groupList);
if (code != TSDB_CODE_SUCCESS) { // set the numOfTables to be 0
@@ -650,7 +658,9 @@ TsdbQueryHandleT tsdbQueryCacheLast(STsdbRepo *tsdb, STsdbQueryCond *pCond, STab
return NULL;
}
- lazyLoadCacheLast(pQueryHandle);
+ if (lazyLoadCacheLast(pQueryHandle) != TSDB_CODE_SUCCESS) {
+ return NULL;
+ }
int32_t code = checkForCachedLast(pQueryHandle);
if (code != TSDB_CODE_SUCCESS) { // set the numOfTables to be 0
diff --git a/src/util/inc/tconfig.h b/src/util/inc/tconfig.h
index c52fbf208f6fbf0384ecf66650919c4d12ae352e..fd9a340a25a752b18ab07a8fbb2691038af3b71b 100644
--- a/src/util/inc/tconfig.h
+++ b/src/util/inc/tconfig.h
@@ -20,7 +20,7 @@
extern "C" {
#endif
-#define TSDB_CFG_MAX_NUM 130
+#define TSDB_CFG_MAX_NUM 131
#define TSDB_CFG_PRINT_LEN 23
#define TSDB_CFG_OPTION_LEN 24
#define TSDB_CFG_VALUE_LEN 41
diff --git a/src/util/src/tlog.c b/src/util/src/tlog.c
index 7b5dafcc8e771ba7d6e7b5691226bbc84a556ef8..657d152c18a576f3c25e41e0ca461b57002f85aa 100644
--- a/src/util/src/tlog.c
+++ b/src/util/src/tlog.c
@@ -191,7 +191,7 @@ static void *taosThreadToOpenNewFile(void *param) {
umask(0);
- int32_t fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU | S_IRWXG | S_IRWXO);
+ int32_t fd = open(name, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IRWXU | S_IRWXG | S_IRWXO);
if (fd < 0) {
tsLogObj.openInProgress = 0;
tsLogObj.lines = tsLogObj.maxLines - 1000;
@@ -252,7 +252,7 @@ void taosResetLog() {
}
static bool taosCheckFileIsOpen(char *logFileName) {
- int32_t fd = open(logFileName, O_WRONLY, S_IRWXU | S_IRWXG | S_IRWXO);
+ int32_t fd = open(logFileName, O_WRONLY | O_BINARY, S_IRWXU | S_IRWXG | S_IRWXO);
if (fd < 0) {
if (errno == ENOENT) {
return false;
@@ -340,7 +340,7 @@ static int32_t taosOpenLogFile(char *fn, int32_t maxLines, int32_t maxFileNum) {
pthread_mutex_init(&tsLogObj.logMutex, NULL);
umask(0);
- tsLogObj.logHandle->fd = open(fileName, O_WRONLY | O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO);
+ tsLogObj.logHandle->fd = open(fileName, O_WRONLY | O_CREAT | O_BINARY, S_IRWXU | S_IRWXG | S_IRWXO);
if (tsLogObj.logHandle->fd < 0) {
printf("\nfailed to open log file:%s, reason:%s\n", fileName, strerror(errno));
@@ -375,6 +375,9 @@ void taosPrintLog(const char *flags, int32_t dflag, const char *format, ...) {
fflush(stdout);
return;
}
+ if (flags == NULL || format == NULL) {
+ return;
+ }
va_list argpointer;
char buffer[MAX_LOGLINE_BUFFER_SIZE] = { 0 };
diff --git a/src/util/src/tnote.c b/src/util/src/tnote.c
index b691abc5b9f6f828edcc46ec3a5989baa083f443..193ad3263cfa502d2eae6507cf4e12d6033c8a8c 100644
--- a/src/util/src/tnote.c
+++ b/src/util/src/tnote.c
@@ -92,7 +92,7 @@ static void *taosThreadToOpenNewNote(void *param) {
umask(0);
- int32_t fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU | S_IRWXG | S_IRWXO);
+ int32_t fd = open(name, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IRWXU | S_IRWXG | S_IRWXO);
if (fd < 0) {
return NULL;
}
@@ -132,7 +132,7 @@ static int32_t taosOpenNewNote(SNoteObj *pNote) {
}
static bool taosCheckNoteIsOpen(char *noteName, SNoteObj *pNote) {
- int32_t fd = open(noteName, O_WRONLY | O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO);
+ int32_t fd = open(noteName, O_WRONLY | O_CREAT | O_BINARY, S_IRWXU | S_IRWXG | S_IRWXO);
if (fd < 0) {
fprintf(stderr, "failed to open note:%s reason:%s\n", noteName, strerror(errno));
return true;
@@ -207,7 +207,7 @@ static int32_t taosOpenNoteWithMaxLines(char *fn, int32_t maxLines, int32_t maxN
pthread_mutex_init(&pNote->mutex, NULL);
umask(0);
- pNote->fd = open(noteName, O_WRONLY | O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO);
+ pNote->fd = open(noteName, O_WRONLY | O_CREAT | O_BINARY, S_IRWXU | S_IRWXG | S_IRWXO);
if (pNote->fd < 0) {
fprintf(stderr, "failed to open note file:%s reason:%s\n", noteName, strerror(errno));
diff --git a/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeBigInt.py b/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeBigInt.py
new file mode 100644
index 0000000000000000000000000000000000000000..3bfe3078e7901c0c8f2e9058a21b96c1bb5cb2e5
--- /dev/null
+++ b/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeBigInt.py
@@ -0,0 +1,140 @@
+###################################################################
+# Copyright (c) 2016 by TAOS Technologies, Inc.
+# All rights reserved.
+#
+# This file is proprietary and confidential to TAOS Technologies.
+# No part of this file may be reproduced, stored, transmitted,
+# disclosed or used in any form or by any means other than as
+# expressly provided by the written permission from Jianhui Tao
+#
+###################################################################
+
+# -*- coding: utf-8 -*-
+
+import sys
+import os
+from util.log import *
+from util.cases import *
+from util.sql import *
+from util.dnodes import *
+import subprocess
+
+
+class TDTestCase:
+ def caseDescription(self):
+ '''
+ case1: [TD-12526] taosdump supports big int
+ '''
+ return
+
+ def init(self, conn, logSql):
+ tdLog.debug("start to execute %s" % __file__)
+ tdSql.init(conn.cursor(), logSql)
+ self.tmpdir = "tmp"
+
+ def getBuildPath(self):
+ selfPath = os.path.dirname(os.path.realpath(__file__))
+
+ if ("community" in selfPath):
+ projPath = selfPath[:selfPath.find("community")]
+ else:
+ projPath = selfPath[:selfPath.find("tests")]
+
+ for root, dirs, files in os.walk(projPath):
+ if ("taosdump" in files):
+ rootRealPath = os.path.dirname(os.path.realpath(root))
+ if ("packaging" not in rootRealPath):
+ buildPath = root[:len(root) - len("/build/bin")]
+ break
+ return buildPath
+
+ def run(self):
+ tdSql.prepare()
+
+ tdSql.execute("drop database if exists db")
+ tdSql.execute("create database db days 11 keep 3649 blocks 8 ")
+
+ tdSql.execute("use db")
+ tdSql.execute(
+ "create table st(ts timestamp, c1 BIGINT) tags(bntag BIGINT)")
+ tdSql.execute("create table t1 using st tags(1)")
+ tdSql.execute("insert into t1 values(1640000000000, 1)")
+
+ tdSql.execute("create table t2 using st tags(9223372036854775807)")
+ tdSql.execute(
+ "insert into t2 values(1640000000000, 9223372036854775807)")
+
+ tdSql.execute("create table t3 using st tags(-9223372036854775807)")
+ tdSql.execute(
+ "insert into t3 values(1640000000000, -9223372036854775807)")
+
+ tdSql.execute("create table t4 using st tags(NULL)")
+ tdSql.execute("insert into t4 values(1640000000000, NULL)")
+
+# sys.exit(1)
+
+ buildPath = self.getBuildPath()
+ if (buildPath == ""):
+ tdLog.exit("taosdump not found!")
+ else:
+ tdLog.info("taosdump found in %s" % buildPath)
+ binPath = buildPath + "/build/bin/"
+
+ if not os.path.exists(self.tmpdir):
+ os.makedirs(self.tmpdir)
+ else:
+ print("directory exists")
+ os.system("rm -rf %s" % self.tmpdir)
+ os.makedirs(self.tmpdir)
+
+ os.system(
+ "%staosdump --databases db -o %s -T 1" %
+ (binPath, self.tmpdir))
+
+# sys.exit(1)
+ tdSql.execute("drop database db")
+
+ os.system("%staosdump -i %s -T 1" % (binPath, self.tmpdir))
+
+ tdSql.query("show databases")
+ tdSql.checkRows(1)
+
+ tdSql.execute("use db")
+ tdSql.query("show stables")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 'st')
+
+ tdSql.query("show tables")
+ tdSql.checkRows(4)
+
+ tdSql.query("select * from st where bntag = 1")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 1640000000000)
+ tdSql.checkData(0, 1, 1)
+ tdSql.checkData(0, 2, 1)
+
+ tdSql.query("select * from st where bntag = 9223372036854775807")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 1640000000000)
+ tdSql.checkData(0, 1, 9223372036854775807)
+ tdSql.checkData(0, 2, 9223372036854775807)
+
+ tdSql.query("select * from st where bntag = -9223372036854775807")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 1640000000000)
+ tdSql.checkData(0, 1, -9223372036854775807)
+ tdSql.checkData(0, 2, -9223372036854775807)
+
+ tdSql.query("select * from st where bntag is null")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 0)
+ tdSql.checkData(0, 1, None)
+ tdSql.checkData(0, 2, None)
+
+ def stop(self):
+ tdSql.close()
+ tdLog.success("%s successfully executed" % __file__)
+
+
+tdCases.addWindows(__file__, TDTestCase())
+tdCases.addLinux(__file__, TDTestCase())
diff --git a/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeBool.py b/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeBool.py
new file mode 100644
index 0000000000000000000000000000000000000000..a0051e99506dc553777abe49e2933daaeb47ffee
--- /dev/null
+++ b/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeBool.py
@@ -0,0 +1,129 @@
+###################################################################
+# Copyright (c) 2016 by TAOS Technologies, Inc.
+# All rights reserved.
+#
+# This file is proprietary and confidential to TAOS Technologies.
+# No part of this file may be reproduced, stored, transmitted,
+# disclosed or used in any form or by any means other than as
+# expressly provided by the written permission from Jianhui Tao
+#
+###################################################################
+
+# -*- coding: utf-8 -*-
+
+import sys
+import os
+from util.log import *
+from util.cases import *
+from util.sql import *
+from util.dnodes import *
+import subprocess
+
+
+class TDTestCase:
+ def caseDescription(self):
+ '''
+ case1: [TD-12526] taosdump supports bool
+ '''
+ return
+
+ def init(self, conn, logSql):
+ tdLog.debug("start to execute %s" % __file__)
+ tdSql.init(conn.cursor(), logSql)
+ self.tmpdir = "tmp"
+
+ def getBuildPath(self):
+ selfPath = os.path.dirname(os.path.realpath(__file__))
+
+ if ("community" in selfPath):
+ projPath = selfPath[:selfPath.find("community")]
+ else:
+ projPath = selfPath[:selfPath.find("tests")]
+
+ for root, dirs, files in os.walk(projPath):
+ if ("taosdump" in files):
+ rootRealPath = os.path.dirname(os.path.realpath(root))
+ if ("packaging" not in rootRealPath):
+ buildPath = root[:len(root) - len("/build/bin")]
+ break
+ return buildPath
+
+ def run(self):
+ tdSql.prepare()
+
+ tdSql.execute("drop database if exists db")
+ tdSql.execute("create database db days 11 keep 3649 blocks 8 ")
+
+ tdSql.execute("use db")
+ tdSql.execute(
+ "create table st(ts timestamp, c1 BOOL) tags(btag BOOL)")
+ tdSql.execute("create table t1 using st tags(true)")
+ tdSql.execute("insert into t1 values(1640000000000, true)")
+ tdSql.execute("create table t2 using st tags(false)")
+ tdSql.execute("insert into t2 values(1640000000000, false)")
+ tdSql.execute("create table t3 using st tags(NULL)")
+ tdSql.execute("insert into t3 values(1640000000000, NULL)")
+
+ buildPath = self.getBuildPath()
+ if (buildPath == ""):
+ tdLog.exit("taosdump not found!")
+ else:
+ tdLog.info("taosdump found in %s" % buildPath)
+ binPath = buildPath + "/build/bin/"
+
+ if not os.path.exists(self.tmpdir):
+ os.makedirs(self.tmpdir)
+ else:
+ print("directory exists")
+ os.system("rm -rf %s" % self.tmpdir)
+ os.makedirs(self.tmpdir)
+
+ os.system("%staosdump --databases db -o %s" % (binPath, self.tmpdir))
+
+# sys.exit(1)
+ tdSql.execute("drop database db")
+
+ os.system("%staosdump -i %s" % (binPath, self.tmpdir))
+
+ tdSql.query("show databases")
+ tdSql.checkRows(1)
+
+ tdSql.execute("use db")
+ tdSql.query("show stables")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 'st')
+
+ tdSql.query("show tables")
+ tdSql.checkRows(3)
+ tdSql.checkData(0, 0, 't3')
+ tdSql.checkData(1, 0, 't2')
+ tdSql.checkData(2, 0, 't1')
+
+ tdSql.query("select btag from st")
+ tdSql.checkRows(3)
+ tdSql.checkData(0, 0, "False")
+ tdSql.checkData(1, 0, "True")
+ tdSql.checkData(2, 0, None)
+
+ tdSql.query("select * from st where btag = 'true'")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 1, "True")
+ tdSql.checkData(0, 2, "True")
+
+ tdSql.query("select * from st where btag = 'false'")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 1, "False")
+ tdSql.checkData(0, 2, "False")
+
+ tdSql.query("select * from st where btag is null")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 1, None)
+ tdSql.checkData(0, 2, None)
+
+ def stop(self):
+ tdSql.close()
+ tdLog.success("%s successfully executed" % __file__)
+
+
+tdCases.addWindows(__file__, TDTestCase())
+tdCases.addLinux(__file__, TDTestCase())
diff --git a/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeDouble.py b/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeDouble.py
new file mode 100644
index 0000000000000000000000000000000000000000..dffd5514eb85277e65e02348221814c18423a0c9
--- /dev/null
+++ b/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeDouble.py
@@ -0,0 +1,157 @@
+###################################################################
+# Copyright (c) 2016 by TAOS Technologies, Inc.
+# All rights reserved.
+#
+# This file is proprietary and confidential to TAOS Technologies.
+# No part of this file may be reproduced, stored, transmitted,
+# disclosed or used in any form or by any means other than as
+# expressly provided by the written permission from Jianhui Tao
+#
+###################################################################
+
+# -*- coding: utf-8 -*-
+
+import sys
+import os
+import math
+from util.log import *
+from util.cases import *
+from util.sql import *
+from util.dnodes import *
+import subprocess
+
+
+class TDTestCase:
+ def caseDescription(self):
+ '''
+ case1: [TD-12526] taosdump supports double
+ '''
+ return
+
+ def init(self, conn, logSql):
+ tdLog.debug("start to execute %s" % __file__)
+ tdSql.init(conn.cursor(), logSql)
+ self.tmpdir = "tmp"
+
+ def getBuildPath(self):
+ selfPath = os.path.dirname(os.path.realpath(__file__))
+
+ if ("community" in selfPath):
+ projPath = selfPath[:selfPath.find("community")]
+ else:
+ projPath = selfPath[:selfPath.find("tests")]
+
+ for root, dirs, files in os.walk(projPath):
+ if ("taosdump" in files):
+ rootRealPath = os.path.dirname(os.path.realpath(root))
+ if ("packaging" not in rootRealPath):
+ buildPath = root[:len(root) - len("/build/bin")]
+ break
+ return buildPath
+
+ def run(self):
+ tdSql.prepare()
+
+ tdSql.execute("drop database if exists db")
+ tdSql.execute("create database db days 11 keep 3649 blocks 8 ")
+
+ tdSql.execute("use db")
+ tdSql.execute(
+ "create table st(ts timestamp, c1 DOUBLE) tags(dbtag DOUBLE)")
+ tdSql.execute("create table t1 using st tags(1.0)")
+ tdSql.execute("insert into t1 values(1640000000000, 1.0)")
+
+ tdSql.execute("create table t2 using st tags(1.7E308)")
+ tdSql.execute("insert into t2 values(1640000000000, 1.7E308)")
+
+ tdSql.execute("create table t3 using st tags(-1.7E308)")
+ tdSql.execute("insert into t3 values(1640000000000, -1.7E308)")
+
+ tdSql.execute("create table t4 using st tags(NULL)")
+ tdSql.execute("insert into t4 values(1640000000000, NULL)")
+
+# sys.exit(1)
+
+ buildPath = self.getBuildPath()
+ if (buildPath == ""):
+ tdLog.exit("taosdump not found!")
+ else:
+ tdLog.info("taosdump found in %s" % buildPath)
+ binPath = buildPath + "/build/bin/"
+
+ if not os.path.exists(self.tmpdir):
+ os.makedirs(self.tmpdir)
+ else:
+ print("directory exists")
+ os.system("rm -rf %s" % self.tmpdir)
+ os.makedirs(self.tmpdir)
+
+ os.system(
+ "%staosdump --databases db -o %s -T 1" %
+ (binPath, self.tmpdir))
+
+# sys.exit(1)
+ tdSql.execute("drop database db")
+
+ os.system("%staosdump -i %s -T 1" % (binPath, self.tmpdir))
+
+ tdSql.query("show databases")
+ tdSql.checkRows(1)
+
+ tdSql.execute("use db")
+ tdSql.query("show stables")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 'st')
+
+ tdSql.query("show tables")
+ tdSql.checkRows(4)
+
+ tdSql.query("select * from st where dbtag = 1.0")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 1640000000000)
+ if not math.isclose(tdSql.getData(0, 1), 1.0):
+ tdLog.debug("getData(0, 1): %f, to compare %f" %
+ (tdSql.getData(0, 1), 1.0))
+ tdLog.exit("data is different")
+ if not math.isclose(tdSql.getData(0, 2), 1.0):
+ tdLog.debug("getData(0, 1): %f, to compare %f" %
+ (tdSql.getData(0, 2), 1.0))
+ tdLog.exit("data is different")
+
+ tdSql.query("select * from st where dbtag = 1.7E308")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 1640000000000)
+ if not math.isclose(tdSql.getData(0, 1), 1.7E308):
+ tdLog.debug("getData(0, 1): %f, to compare %f" %
+ (tdSql.getData(0, 1), 1.7E308))
+ tdLog.exit("data is different")
+ if not math.isclose(tdSql.getData(0, 2), 1.7E308):
+ tdLog.debug("getData(0, 1): %f, to compare %f" %
+ (tdSql.getData(0, 2), 1.7E308))
+ tdLog.exit("data is different")
+
+ tdSql.query("select * from st where dbtag = -1.7E308")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 1640000000000)
+ if not math.isclose(tdSql.getData(0, 1), -1.7E308):
+ tdLog.debug("getData(0, 1): %f, to compare %f" %
+ (tdSql.getData(0, 1), -1.7E308))
+ tdLog.exit("data is different")
+ if not math.isclose(tdSql.getData(0, 2), -1.7E308):
+ tdLog.debug("getData(0, 1): %f, to compare %f" %
+ (tdSql.getData(0, 2), -1.7E308))
+ tdLog.exit("data is different")
+
+ tdSql.query("select * from st where dbtag is null")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 0)
+ tdSql.checkData(0, 1, None)
+ tdSql.checkData(0, 2, None)
+
+ def stop(self):
+ tdSql.close()
+ tdLog.success("%s successfully executed" % __file__)
+
+
+tdCases.addWindows(__file__, TDTestCase())
+tdCases.addLinux(__file__, TDTestCase())
diff --git a/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeFloat.py b/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeFloat.py
new file mode 100644
index 0000000000000000000000000000000000000000..7cf0bdf4740b5a2d4dc7a5a9344cfa65983b7163
--- /dev/null
+++ b/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeFloat.py
@@ -0,0 +1,159 @@
+###################################################################
+# Copyright (c) 2016 by TAOS Technologies, Inc.
+# All rights reserved.
+#
+# This file is proprietary and confidential to TAOS Technologies.
+# No part of this file may be reproduced, stored, transmitted,
+# disclosed or used in any form or by any means other than as
+# expressly provided by the written permission from Jianhui Tao
+#
+###################################################################
+
+# -*- coding: utf-8 -*-
+
+import sys
+import os
+import math
+from util.log import *
+from util.cases import *
+from util.sql import *
+from util.dnodes import *
+import subprocess
+
+
+class TDTestCase:
+ def caseDescription(self):
+ '''
+ case1: [TD-12526] taosdump supports float
+ '''
+ return
+
+ def init(self, conn, logSql):
+ tdLog.debug("start to execute %s" % __file__)
+ tdSql.init(conn.cursor(), logSql)
+ self.tmpdir = "tmp"
+
+ def getBuildPath(self):
+ selfPath = os.path.dirname(os.path.realpath(__file__))
+
+ if ("community" in selfPath):
+ projPath = selfPath[:selfPath.find("community")]
+ else:
+ projPath = selfPath[:selfPath.find("tests")]
+
+ for root, dirs, files in os.walk(projPath):
+ if ("taosdump" in files):
+ rootRealPath = os.path.dirname(os.path.realpath(root))
+ if ("packaging" not in rootRealPath):
+ buildPath = root[:len(root) - len("/build/bin")]
+ break
+ return buildPath
+
+ def run(self):
+ tdSql.prepare()
+
+ tdSql.execute("drop database if exists db")
+ tdSql.execute("create database db days 11 keep 3649 blocks 8 ")
+
+ tdSql.execute("use db")
+ tdSql.execute(
+ "create table st(ts timestamp, c1 FLOAT) tags(ftag FLOAT)")
+ tdSql.execute("create table t1 using st tags(1.0)")
+ tdSql.execute("insert into t1 values(1640000000000, 1.0)")
+
+ tdSql.execute("create table t2 using st tags(3.40E+38)")
+ tdSql.execute("insert into t2 values(1640000000000, 3.40E+38)")
+
+ tdSql.execute("create table t3 using st tags(-3.40E+38)")
+ tdSql.execute("insert into t3 values(1640000000000, -3.40E+38)")
+
+ tdSql.execute("create table t4 using st tags(NULL)")
+ tdSql.execute("insert into t4 values(1640000000000, NULL)")
+
+# sys.exit(1)
+
+ buildPath = self.getBuildPath()
+ if (buildPath == ""):
+ tdLog.exit("taosdump not found!")
+ else:
+ tdLog.info("taosdump found in %s" % buildPath)
+ binPath = buildPath + "/build/bin/"
+
+ if not os.path.exists(self.tmpdir):
+ os.makedirs(self.tmpdir)
+ else:
+ print("directory exists")
+ os.system("rm -rf %s" % self.tmpdir)
+ os.makedirs(self.tmpdir)
+
+ os.system(
+ "%staosdump --databases db -o %s -T 1" %
+ (binPath, self.tmpdir))
+
+# sys.exit(1)
+ tdSql.execute("drop database db")
+
+ os.system("%staosdump -i %s -T 1" % (binPath, self.tmpdir))
+
+ tdSql.query("show databases")
+ tdSql.checkRows(1)
+
+ tdSql.execute("use db")
+ tdSql.query("show stables")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 'st')
+
+ tdSql.query("show tables")
+ tdSql.checkRows(4)
+
+ tdSql.query("select * from st where ftag = 1.0")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 1640000000000)
+ if not math.isclose(tdSql.getData(0, 1), 1.0):
+ tdLog.debug("getData(0, 1): %f, to compare %f" %
+ (tdSql.getData(0, 1), 1.0))
+ tdLog.exit("data is different")
+ if not math.isclose(tdSql.getData(0, 2), 1.0):
+ tdLog.exit("data is different")
+
+ tdSql.query("select * from st where ftag = 3.4E38")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 1640000000000)
+ if not math.isclose(tdSql.getData(0, 1), 3.4E38,
+ rel_tol=1e-07, abs_tol=0.0):
+ tdLog.debug("getData(0, 1): %f, to compare %f" %
+ (tdSql.getData(0, 1), 3.4E38))
+ tdLog.exit("data is different")
+ if not math.isclose(tdSql.getData(0, 2), 3.4E38,
+ rel_tol=1e-07, abs_tol=0.0):
+ tdLog.debug("getData(0, 1): %f, to compare %f" %
+ (tdSql.getData(0, 2), 3.4E38))
+ tdLog.exit("data is different")
+
+ tdSql.query("select * from st where ftag = -3.4E38")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 1640000000000)
+ if not math.isclose(tdSql.getData(0, 1), (-3.4E38),
+ rel_tol=1e-07, abs_tol=0.0):
+ tdLog.debug("getData(0, 1): %f, to compare %f" %
+ (tdSql.getData(0, 1), -3.4E38))
+ tdLog.exit("data is different")
+ if not math.isclose(tdSql.getData(0, 2), (-3.4E38),
+ rel_tol=1e-07, abs_tol=0.0):
+ tdLog.debug("getData(0, 1): %f, to compare %f" %
+ (tdSql.getData(0, 2), -3.4E38))
+ tdLog.exit("data is different")
+
+ tdSql.query("select * from st where ftag is null")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 0)
+ tdSql.checkData(0, 1, None)
+ tdSql.checkData(0, 2, None)
+
+ def stop(self):
+ tdSql.close()
+ tdLog.success("%s successfully executed" % __file__)
+
+
+tdCases.addWindows(__file__, TDTestCase())
+tdCases.addLinux(__file__, TDTestCase())
diff --git a/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeInt.py b/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeInt.py
new file mode 100644
index 0000000000000000000000000000000000000000..b69ab964d9ee3a5013cc8c4e35f920d25fb10e0e
--- /dev/null
+++ b/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeInt.py
@@ -0,0 +1,135 @@
+###################################################################
+# Copyright (c) 2016 by TAOS Technologies, Inc.
+# All rights reserved.
+#
+# This file is proprietary and confidential to TAOS Technologies.
+# No part of this file may be reproduced, stored, transmitted,
+# disclosed or used in any form or by any means other than as
+# expressly provided by the written permission from Jianhui Tao
+#
+###################################################################
+
+# -*- coding: utf-8 -*-
+
+import sys
+import os
+from util.log import *
+from util.cases import *
+from util.sql import *
+from util.dnodes import *
+import subprocess
+
+
+class TDTestCase:
+ def caseDescription(self):
+ '''
+ case1: [TD-12526] taosdump supports int
+ '''
+ return
+
+ def init(self, conn, logSql):
+ tdLog.debug("start to execute %s" % __file__)
+ tdSql.init(conn.cursor(), logSql)
+ self.tmpdir = "tmp"
+
+ def getBuildPath(self):
+ selfPath = os.path.dirname(os.path.realpath(__file__))
+
+ if ("community" in selfPath):
+ projPath = selfPath[:selfPath.find("community")]
+ else:
+ projPath = selfPath[:selfPath.find("tests")]
+
+ for root, dirs, files in os.walk(projPath):
+ if ("taosdump" in files):
+ rootRealPath = os.path.dirname(os.path.realpath(root))
+ if ("packaging" not in rootRealPath):
+ buildPath = root[:len(root) - len("/build/bin")]
+ break
+ return buildPath
+
+ def run(self):
+ tdSql.prepare()
+
+ tdSql.execute("drop database if exists db")
+ tdSql.execute("create database db days 11 keep 3649 blocks 8 ")
+
+ tdSql.execute("use db")
+ tdSql.execute(
+ "create table st(ts timestamp, c1 INT) tags(ntag INT)")
+ tdSql.execute("create table t1 using st tags(1)")
+ tdSql.execute("insert into t1 values(1640000000000, 1)")
+ tdSql.execute("create table t2 using st tags(2147483647)")
+ tdSql.execute("insert into t2 values(1640000000000, 2147483647)")
+ tdSql.execute("create table t3 using st tags(-2147483647)")
+ tdSql.execute("insert into t3 values(1640000000000, -2147483647)")
+ tdSql.execute("create table t4 using st tags(NULL)")
+ tdSql.execute("insert into t4 values(1640000000000, NULL)")
+
+# sys.exit(1)
+
+ buildPath = self.getBuildPath()
+ if (buildPath == ""):
+ tdLog.exit("taosdump not found!")
+ else:
+ tdLog.info("taosdump found in %s" % buildPath)
+ binPath = buildPath + "/build/bin/"
+
+ if not os.path.exists(self.tmpdir):
+ os.makedirs(self.tmpdir)
+ else:
+ print("directory exists")
+ os.system("rm -rf %s" % self.tmpdir)
+ os.makedirs(self.tmpdir)
+
+ os.system(
+ "%staosdump --databases db -o %s -T 1" %
+ (binPath, self.tmpdir))
+
+# sys.exit(1)
+ tdSql.execute("drop database db")
+
+ os.system("%staosdump -i %s -T 1" % (binPath, self.tmpdir))
+
+ tdSql.query("show databases")
+ tdSql.checkRows(1)
+
+ tdSql.execute("use db")
+ tdSql.query("show stables")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 'st')
+
+ tdSql.query("show tables")
+ tdSql.checkRows(4)
+
+ tdSql.query("select * from st where ntag = 1")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 1640000000000)
+ tdSql.checkData(0, 1, 1)
+ tdSql.checkData(0, 2, 1)
+
+ tdSql.query("select * from st where ntag = 2147483647")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 1640000000000)
+ tdSql.checkData(0, 1, 2147483647)
+ tdSql.checkData(0, 2, 2147483647)
+
+ tdSql.query("select * from st where ntag = -2147483647")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 1640000000000)
+ tdSql.checkData(0, 1, -2147483647)
+ tdSql.checkData(0, 2, -2147483647)
+
+ tdSql.query("select * from st where ntag is null")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 0)
+ tdSql.checkData(0, 1, None)
+ tdSql.checkData(0, 2, None)
+
+ def stop(self):
+ tdSql.close()
+ tdLog.success("%s successfully executed" % __file__)
+
+
+tdCases.addWindows(__file__, TDTestCase())
+tdCases.addLinux(__file__, TDTestCase())
diff --git a/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeJson.py b/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeJson.py
index 14297ee867e0830fae8a776bfc7902e3f6ee4d9c..6cc2f21b54efa4b7f590f267c3e2fdf7d58be078 100644
--- a/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeJson.py
+++ b/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeJson.py
@@ -57,9 +57,20 @@ class TDTestCase:
tdSql.execute("use db")
tdSql.execute(
"create table st(ts timestamp, c1 int) tags(jtag JSON)")
- tdSql.execute("create table t1 using st tags('{\"location\": \"beijing\"}')")
+ tdSql.execute(
+ "create table t1 using st tags('{\"location\": \"beijing\"}')")
tdSql.execute("insert into t1 values(1500000000000, 1)")
+ tdSql.execute(
+ "create table t2 using st tags(NULL)")
+ tdSql.execute("insert into t2 values(1500000000000, NULL)")
+
+ tdSql.execute(
+ "create table t3 using st tags('')")
+ tdSql.execute("insert into t3 values(1500000000000, 0)")
+
+# sys.exit(1)
+
buildPath = self.getBuildPath()
if (buildPath == ""):
tdLog.exit("taosdump not found!")
@@ -89,11 +100,11 @@ class TDTestCase:
tdSql.checkData(0, 0, 'st')
tdSql.query("show tables")
- tdSql.checkRows(1)
- tdSql.checkData(0, 0, 't1')
+ tdSql.checkRows(3)
+ tdSql.checkData(0, 0, 't3')
tdSql.query("select jtag->'location' from st")
- tdSql.checkRows(1)
+ tdSql.checkRows(3)
tdSql.checkData(0, 0, "\"beijing\"")
tdSql.query("select * from st where jtag contains 'location'")
@@ -101,6 +112,11 @@ class TDTestCase:
tdSql.checkData(0, 1, 1)
tdSql.checkData(0, 2, '{\"location\":\"beijing\"}')
+ tdSql.query("select jtag from st")
+ tdSql.checkRows(3)
+ tdSql.checkData(0, 0, "{\"location\":\"beijing\"}")
+ tdSql.checkData(1, 0, None)
+ tdSql.checkData(2, 0, None)
def stop(self):
tdSql.close()
diff --git a/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeSmallInt.py b/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeSmallInt.py
new file mode 100644
index 0000000000000000000000000000000000000000..2fc1ffb75e5d31d501024e1432a02f62a0fbd480
--- /dev/null
+++ b/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeSmallInt.py
@@ -0,0 +1,138 @@
+###################################################################
+# Copyright (c) 2016 by TAOS Technologies, Inc.
+# All rights reserved.
+#
+# This file is proprietary and confidential to TAOS Technologies.
+# No part of this file may be reproduced, stored, transmitted,
+# disclosed or used in any form or by any means other than as
+# expressly provided by the written permission from Jianhui Tao
+#
+###################################################################
+
+# -*- coding: utf-8 -*-
+
+import sys
+import os
+from util.log import *
+from util.cases import *
+from util.sql import *
+from util.dnodes import *
+import subprocess
+
+
+class TDTestCase:
+ def caseDescription(self):
+ '''
+ case1: [TD-12526] taosdump supports small int
+ '''
+ return
+
+ def init(self, conn, logSql):
+ tdLog.debug("start to execute %s" % __file__)
+ tdSql.init(conn.cursor(), logSql)
+ self.tmpdir = "tmp"
+
+ def getBuildPath(self):
+ selfPath = os.path.dirname(os.path.realpath(__file__))
+
+ if ("community" in selfPath):
+ projPath = selfPath[:selfPath.find("community")]
+ else:
+ projPath = selfPath[:selfPath.find("tests")]
+
+ for root, dirs, files in os.walk(projPath):
+ if ("taosdump" in files):
+ rootRealPath = os.path.dirname(os.path.realpath(root))
+ if ("packaging" not in rootRealPath):
+ buildPath = root[:len(root) - len("/build/bin")]
+ break
+ return buildPath
+
+ def run(self):
+ tdSql.prepare()
+
+ tdSql.execute("drop database if exists db")
+ tdSql.execute("create database db days 11 keep 3649 blocks 8 ")
+
+ tdSql.execute("use db")
+ tdSql.execute(
+ "create table st(ts timestamp, c1 SMALLINT) tags(sntag SMALLINT)")
+ tdSql.execute("create table t1 using st tags(1)")
+ tdSql.execute("insert into t1 values(1640000000000, 1)")
+
+ tdSql.execute("create table t2 using st tags(32767)")
+ tdSql.execute("insert into t2 values(1640000000000, 32767)")
+
+ tdSql.execute("create table t3 using st tags(-32767)")
+ tdSql.execute("insert into t3 values(1640000000000, -32767)")
+
+ tdSql.execute("create table t4 using st tags(NULL)")
+ tdSql.execute("insert into t4 values(1640000000000, NULL)")
+
+# sys.exit(1)
+
+ buildPath = self.getBuildPath()
+ if (buildPath == ""):
+ tdLog.exit("taosdump not found!")
+ else:
+ tdLog.info("taosdump found in %s" % buildPath)
+ binPath = buildPath + "/build/bin/"
+
+ if not os.path.exists(self.tmpdir):
+ os.makedirs(self.tmpdir)
+ else:
+ print("directory exists")
+ os.system("rm -rf %s" % self.tmpdir)
+ os.makedirs(self.tmpdir)
+
+ os.system(
+ "%staosdump --databases db -o %s -T 1" %
+ (binPath, self.tmpdir))
+
+# sys.exit(1)
+ tdSql.execute("drop database db")
+
+ os.system("%staosdump -i %s -T 1" % (binPath, self.tmpdir))
+
+ tdSql.query("show databases")
+ tdSql.checkRows(1)
+
+ tdSql.execute("use db")
+ tdSql.query("show stables")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 'st')
+
+ tdSql.query("show tables")
+ tdSql.checkRows(4)
+
+ tdSql.query("select * from st where sntag = 1")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 1640000000000)
+ tdSql.checkData(0, 1, 1)
+ tdSql.checkData(0, 2, 1)
+
+ tdSql.query("select * from st where sntag = 32767")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 1640000000000)
+ tdSql.checkData(0, 1, 32767)
+ tdSql.checkData(0, 2, 32767)
+
+ tdSql.query("select * from st where sntag = -32767")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 1640000000000)
+ tdSql.checkData(0, 1, -32767)
+ tdSql.checkData(0, 2, -32767)
+
+ tdSql.query("select * from st where sntag is null")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 0)
+ tdSql.checkData(0, 1, None)
+ tdSql.checkData(0, 2, None)
+
+ def stop(self):
+ tdSql.close()
+ tdLog.success("%s successfully executed" % __file__)
+
+
+tdCases.addWindows(__file__, TDTestCase())
+tdCases.addLinux(__file__, TDTestCase())
diff --git a/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeTinyInt.py b/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeTinyInt.py
new file mode 100644
index 0000000000000000000000000000000000000000..dfc18fcd01e2fd0c210954224268e2c673d33406
--- /dev/null
+++ b/tests/develop-test/5-taos-tools/taosdump/taosdumpTestTypeTinyInt.py
@@ -0,0 +1,138 @@
+###################################################################
+# Copyright (c) 2016 by TAOS Technologies, Inc.
+# All rights reserved.
+#
+# This file is proprietary and confidential to TAOS Technologies.
+# No part of this file may be reproduced, stored, transmitted,
+# disclosed or used in any form or by any means other than as
+# expressly provided by the written permission from Jianhui Tao
+#
+###################################################################
+
+# -*- coding: utf-8 -*-
+
+import sys
+import os
+from util.log import *
+from util.cases import *
+from util.sql import *
+from util.dnodes import *
+import subprocess
+
+
+class TDTestCase:
+ def caseDescription(self):
+ '''
+ case1: [TD-12526] taosdump supports tiny int
+ '''
+ return
+
+ def init(self, conn, logSql):
+ tdLog.debug("start to execute %s" % __file__)
+ tdSql.init(conn.cursor(), logSql)
+ self.tmpdir = "tmp"
+
+ def getBuildPath(self):
+ selfPath = os.path.dirname(os.path.realpath(__file__))
+
+ if ("community" in selfPath):
+ projPath = selfPath[:selfPath.find("community")]
+ else:
+ projPath = selfPath[:selfPath.find("tests")]
+
+ for root, dirs, files in os.walk(projPath):
+ if ("taosdump" in files):
+ rootRealPath = os.path.dirname(os.path.realpath(root))
+ if ("packaging" not in rootRealPath):
+ buildPath = root[:len(root) - len("/build/bin")]
+ break
+ return buildPath
+
+ def run(self):
+ tdSql.prepare()
+
+ tdSql.execute("drop database if exists db")
+ tdSql.execute("create database db days 11 keep 3649 blocks 8 ")
+
+ tdSql.execute("use db")
+ tdSql.execute(
+ "create table st(ts timestamp, c1 TINYINT) tags(tntag TINYINT)")
+ tdSql.execute("create table t1 using st tags(1)")
+ tdSql.execute("insert into t1 values(1640000000000, 1)")
+
+ tdSql.execute("create table t2 using st tags(127)")
+ tdSql.execute("insert into t2 values(1640000000000, 127)")
+
+ tdSql.execute("create table t3 using st tags(-127)")
+ tdSql.execute("insert into t3 values(1640000000000, -127)")
+
+ tdSql.execute("create table t4 using st tags(NULL)")
+ tdSql.execute("insert into t4 values(1640000000000, NULL)")
+
+# sys.exit(1)
+
+ buildPath = self.getBuildPath()
+ if (buildPath == ""):
+ tdLog.exit("taosdump not found!")
+ else:
+ tdLog.info("taosdump found in %s" % buildPath)
+ binPath = buildPath + "/build/bin/"
+
+ if not os.path.exists(self.tmpdir):
+ os.makedirs(self.tmpdir)
+ else:
+ print("directory exists")
+ os.system("rm -rf %s" % self.tmpdir)
+ os.makedirs(self.tmpdir)
+
+ os.system(
+ "%staosdump --databases db -o %s -T 1" %
+ (binPath, self.tmpdir))
+
+# sys.exit(1)
+ tdSql.execute("drop database db")
+
+ os.system("%staosdump -i %s -T 1" % (binPath, self.tmpdir))
+
+ tdSql.query("show databases")
+ tdSql.checkRows(1)
+
+ tdSql.execute("use db")
+ tdSql.query("show stables")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 'st')
+
+ tdSql.query("show tables")
+ tdSql.checkRows(4)
+
+ tdSql.query("select * from st where tntag = 1")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 1640000000000)
+ tdSql.checkData(0, 1, 1)
+ tdSql.checkData(0, 2, 1)
+
+ tdSql.query("select * from st where tntag = 127")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 1640000000000)
+ tdSql.checkData(0, 1, 127)
+ tdSql.checkData(0, 2, 127)
+
+ tdSql.query("select * from st where tntag = -127")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 1640000000000)
+ tdSql.checkData(0, 1, -127)
+ tdSql.checkData(0, 2, -127)
+
+ tdSql.query("select * from st where tntag is null")
+ tdSql.checkRows(1)
+ tdSql.checkData(0, 0, 0)
+ tdSql.checkData(0, 1, None)
+ tdSql.checkData(0, 2, None)
+
+ def stop(self):
+ tdSql.close()
+ tdLog.success("%s successfully executed" % __file__)
+
+
+tdCases.addWindows(__file__, TDTestCase())
+tdCases.addLinux(__file__, TDTestCase())
diff --git a/tests/examples/C#/stmt/StmtDemo.cs b/tests/examples/C#/stmt/StmtDemo.cs
index c2b299140976ed36f245f5693a2a047607c5b5be..fdd647fdb5f9c4bb528a2e99acc6975adf4c30a3 100644
--- a/tests/examples/C#/stmt/StmtDemo.cs
+++ b/tests/examples/C#/stmt/StmtDemo.cs
@@ -86,8 +86,8 @@ namespace TDengineDriver
stmtDemo.ExecuteQuery(createTable);
stmtDemo.StmtInit();
- string[] tableList = { "stmtdemo" };
- stmtDemo.loadTableInfo(tableList);
+ // string[] tableList = { "stmtdemo" };
+ // stmtDemo.loadTableInfo(tableList);
stmtDemo.StmtPrepare(stmtSql);
TAOS_BIND[] binds = stmtDemo.InitBindArr();
diff --git a/tests/examples/C#/stmt/stmt.csproj b/tests/examples/C#/stmt/stmt.csproj
index bc14850edbf9023e885436016141f24d6d042127..f0370cbf5684418edb026b56e306d7d7295a6638 100644
--- a/tests/examples/C#/stmt/stmt.csproj
+++ b/tests/examples/C#/stmt/stmt.csproj
@@ -1,7 +1,7 @@
-
+
diff --git a/tests/pytest/fulltest-insert.sh b/tests/pytest/fulltest-insert.sh
index 153bc072dba128fa8f5635e26aba0d30066b9c9a..3d892afcf39aaec30175a19983e4d077f4f4c737 100755
--- a/tests/pytest/fulltest-insert.sh
+++ b/tests/pytest/fulltest-insert.sh
@@ -130,7 +130,7 @@ python3 ./test.py -f update/merge_commit_last.py
python3 ./test.py -f update/update_options.py
python3 ./test.py -f update/merge_commit_data-0.py
python3 ./test.py -f wal/addOldWalTest.py
-python3 ./test.py -f wal/sdbComp.py
+# python3 ./test.py -f wal/sdbComp.py
diff --git a/tests/pytest/fulltest-tools.sh b/tests/pytest/fulltest-tools.sh
index d1f83e9fb289f36d52340b0ed942c912f361c2de..4af9bddaeda4cfc3f21c6a87e45216d473c77a7d 100755
--- a/tests/pytest/fulltest-tools.sh
+++ b/tests/pytest/fulltest-tools.sh
@@ -17,7 +17,7 @@ python3 test.py -f tools/taosdemoTestLimitOffset.py
python3 test.py -f tools/taosdemoTestTblAlt.py
python3 test.py -f tools/taosdemoTestSampleData.py
python3 test.py -f tools/taosdemoTestInterlace.py
-# python3 test.py -f tools/taosdemoTestQuery.py
+python3 test.py -f tools/taosdemoTestQuery.py
python3 ./test.py -f tools/taosdemoTestdatatype.py
#======================p2-end===============
#======================p3-start===============
@@ -38,7 +38,6 @@ python3 test.py -f tools/taosdemoAllTest/TD-4985/query-limit-offset.py
python3 test.py -f tools/taosdemoAllTest/TD-5213/insert4096columns_not_use_taosdemo.py
python3 test.py -f tools/taosdemoAllTest/TD-5213/insertSigcolumnsNum4096.py
-#python3 test.py -f tools/taosdemoAllTest/TD-10539/create_taosdemo.py
python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJsonStmt.py
python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJsonSml.py
python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertShell.py
diff --git a/tests/pytest/fulltest.sh b/tests/pytest/fulltest.sh
index 9160d34a8aa38c1c41be9cb54accc2cb76bcd80c..bb3d75d981ebee7c234cbb27cb769ca6819abc3d 100755
--- a/tests/pytest/fulltest.sh
+++ b/tests/pytest/fulltest.sh
@@ -190,7 +190,7 @@ python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestInsertTime_ste
python3 test.py -f tools/taosdumpTestNanoSupport.py
#
-python3 ./test.py -f tsdb/tsdbComp.py
+# python3 ./test.py -f tsdb/tsdbComp.py
# update
python3 ./test.py -f update/allow_update.py
diff --git a/tests/pytest/query/nestedQuery/nestedQuery_datacheck.py b/tests/pytest/query/nestedQuery/nestedQuery_datacheck.py
index 308bf4f9e69828bf80728e320247a03303c7121e..311133b8c8911c1d9d8fe90fd5e556571f8e9548 100755
--- a/tests/pytest/query/nestedQuery/nestedQuery_datacheck.py
+++ b/tests/pytest/query/nestedQuery/nestedQuery_datacheck.py
@@ -552,7 +552,7 @@ class TDTestCase:
tdSql.checkData(1,0,'2021-08-28 00:00:00.000')
tdSql.checkData(1,1,3)
tdSql.checkData(2,0,'2021-08-29 00:00:00.000')
- tdSql.checkRows(12)
+ # tdSql.checkRows(12)
#sql = "select * from ( select * from regular_table_1 where q_tinyint >= -127 and q_tinyint <= 127 order by ts );"
tdSql.query("select 1-2 from table_0;")
@@ -634,4 +634,4 @@ class TDTestCase:
tdCases.addWindows(__file__, TDTestCase())
-tdCases.addLinux(__file__, TDTestCase())
\ No newline at end of file
+tdCases.addLinux(__file__, TDTestCase())
diff --git a/tests/pytest/tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoInsert.py b/tests/pytest/tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoInsert.py
index 34acbb2c0112b56cee6a637b9e1fbd5ddb42ddf7..f6928dffefde2420969492c2160456297d99e8bf 100644
--- a/tests/pytest/tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoInsert.py
+++ b/tests/pytest/tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoInsert.py
@@ -12,7 +12,7 @@
# -*- coding: utf-8 -*-
import sys
-import os
+import os, time
from util.log import *
from util.cases import *
from util.sql import *
@@ -107,6 +107,7 @@ class TDTestCase:
# insert by csv files and timetamp is long int , strings in ts and
# cols
+
os.system(
"%staosBenchmark -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestNanoDatabasecsv.json -y " %
binPath)
@@ -117,9 +118,11 @@ class TDTestCase:
tdSql.checkData(0, 0, 10000)
tdSql.query("describe stb0")
tdSql.checkDataType(3, 1, "TIMESTAMP")
+
tdSql.query(
- "select count(*) from stb0 where ts > \"2021-07-01 00:00:00.490000000\"")
+ "select count(*) from nsdbcsv.stb0 where ts > \"2021-07-01 00:00:00.490000000\"")
tdSql.checkData(0, 0, 5000)
+
tdSql.query("select count(*) from stb0 where ts < 1626918583000000000")
tdSql.checkData(0, 0, 10000)
@@ -134,31 +137,9 @@ class TDTestCase:
binPath)
tdSql.query("select count(*) from test.meters")
tdSql.checkData(0, 0, 600)
- # check taosdemo -s
-
- sqls_ls = [
- 'drop database if exists nsdbsql;',
- 'create database nsdbsql precision "ns" keep 3600 days 6 update 1;',
- 'use nsdbsql;',
- 'CREATE STABLE meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupdId int);',
- 'CREATE TABLE d1001 USING meters TAGS ("Beijing.Chaoyang", 2);',
- 'INSERT INTO d1001 USING METERS TAGS ("Beijng.Chaoyang", 2) VALUES (now, 10.2, 219, 0.32);',
- 'INSERT INTO d1001 USING METERS TAGS ("Beijng.Chaoyang", 2) VALUES (now, 85, 32, 0.76);']
-
- with open("./taosdemoTestNanoCreateDB.sql", mode="a") as sql_files:
- for sql in sqls_ls:
- sql_files.write(sql + "\n")
- sql_files.close()
-
- sleep(10)
-
- os.system("%staosBenchmark -s taosdemoTestNanoCreateDB.sql -y " % binPath)
- tdSql.query("select count(*) from nsdbsql.meters")
- tdSql.checkData(0, 0, 2)
os.system("rm -rf ./res.txt")
os.system("rm -rf ./*.py.sql")
- os.system("rm -rf ./taosdemoTestNanoCreateDB.sql")
def stop(self):
tdSql.close()
diff --git a/tests/pytest/tools/taosdemoAllTest/insert-chinese-sml.json b/tests/pytest/tools/taosdemoAllTest/insert-chinese-sml.json
new file mode 100644
index 0000000000000000000000000000000000000000..638462518654dae797520bb6ea7db98ad5993b3b
--- /dev/null
+++ b/tests/pytest/tools/taosdemoAllTest/insert-chinese-sml.json
@@ -0,0 +1,117 @@
+{
+ "filetype": "insert",
+ "cfgdir": "/etc/taos",
+ "host": "127.0.0.1",
+ "port": 6030,
+ "user": "root",
+ "password": "taosdata",
+ "thread_count": 4,
+ "thread_count_create_tbl": 4,
+ "result_file": "./insert_res.txt",
+ "confirm_parameter_prompt": "no",
+ "insert_interval": 0,
+ "interlace_rows": 100,
+ "num_of_records_per_req": 1000,
+ "max_sql_len": 1024000,
+ "chinese": "yes",
+ "databases": [{
+ "dbinfo": {
+ "name": "db",
+ "drop": "no",
+ "replica": 1,
+ "days": 10,
+ "cache": 50,
+ "blocks": 8,
+ "precision": "ms",
+ "keep": 36500,
+ "minRows": 100,
+ "maxRows": 4096,
+ "comp":2,
+ "walLevel":1,
+ "cachelast":0,
+ "quorum":1,
+ "fsync":3000,
+ "update": 0
+ },
+ "super_tables": [{
+ "name": "stb3",
+ "child_table_exists":"no",
+ "childtable_count": 40,
+ "childtable_prefix": "stb03_",
+ "auto_create_table": "no",
+ "batch_create_tbl_num": 20,
+ "data_source": "rand",
+ "insert_mode": "sml",
+ "insert_rows": 100,
+ "childtable_limit": -1,
+ "childtable_offset":0,
+ "multi_thread_write_one_tbl": "no",
+ "interlace_rows": 0,
+ "insert_interval":0,
+ "max_sql_len": 1024000,
+ "disorder_ratio": 0,
+ "disorder_range": 1000,
+ "timestamp_step": 1,
+ "start_timestamp": "2020-10-01 00:00:00.000",
+ "sample_format": "csv",
+ "sample_file": "./sample.csv",
+ "tags_file": "",
+ "columns": [{"type": "INT"}, {"type": "DOUBLE", "count":1}, {"type": "BINARY", "len": 16, "count":2}, {"type": "nchar", "len": 32, "count":2}],
+ "tags": [{"type": "TINYINT", "count":2}, {"type": "BINARY","count":1}, {"type": "nchar", "count":2}]
+ },
+ {
+ "name": "stb4",
+ "child_table_exists":"no",
+ "childtable_count": 50,
+ "childtable_prefix": "stb04_",
+ "auto_create_table": "no",
+ "batch_create_tbl_num": 20,
+ "data_source": "rand",
+ "insert_mode": "sml",
+ "line_protocol": "telnet",
+ "insert_rows": 100,
+ "childtable_limit": -1,
+ "childtable_offset":0,
+ "multi_thread_write_one_tbl": "no",
+ "interlace_rows": 0,
+ "insert_interval":0,
+ "max_sql_len": 1024000,
+ "disorder_ratio": 0,
+ "disorder_range": 1000,
+ "timestamp_step": 1,
+ "start_timestamp": "2020-10-01 00:00:00.000",
+ "sample_format": "csv",
+ "sample_file": "./sample.csv",
+ "tags_file": "",
+ "columns": [{"type": "INT"}],
+ "tags": [{"type": "TINYINT", "count":2}]
+ },
+ {
+ "name": "stb5",
+ "child_table_exists":"no",
+ "childtable_count": 60,
+ "childtable_prefix": "stb05_",
+ "auto_create_table": "no",
+ "batch_create_tbl_num": 20,
+ "data_source": "rand",
+ "insert_mode": "sml",
+ "line_protocol": "json",
+ "insert_rows": 100,
+ "childtable_limit": -1,
+ "childtable_offset":0,
+ "multi_thread_write_one_tbl": "no",
+ "interlace_rows": 0,
+ "insert_interval":0,
+ "max_sql_len": 1024000,
+ "disorder_ratio": 0,
+ "disorder_range": 1000,
+ "timestamp_step": 1,
+ "start_timestamp": "2020-10-01 00:00:00.000",
+ "sample_format": "csv",
+ "sample_file": "./sample.csv",
+ "tags_file": "",
+ "columns": [{"type": "INT"}],
+ "tags": [{"type": "TINYINT"}]
+ }]
+ }]
+}
diff --git a/tests/pytest/tools/taosdemoAllTest/insert-chinese.json b/tests/pytest/tools/taosdemoAllTest/insert-chinese.json
index 14a56826744f52a01f55b85f6d84744f6b458b70..ab848b1317049f672775ec0cc6d1f6c3cd78760e 100644
--- a/tests/pytest/tools/taosdemoAllTest/insert-chinese.json
+++ b/tests/pytest/tools/taosdemoAllTest/insert-chinese.json
@@ -63,7 +63,7 @@
"name": "stb1",
"child_table_exists":"no",
"childtable_count": 20,
- "childtable_prefix": "stb00_",
+ "childtable_prefix": "stb01_",
"auto_create_table": "no",
"batch_create_tbl_num": 20,
"data_source": "rand",
@@ -89,7 +89,7 @@
"name": "stb2",
"child_table_exists":"no",
"childtable_count": 30,
- "childtable_prefix": "stb00_",
+ "childtable_prefix": "stb02_",
"auto_create_table": "no",
"batch_create_tbl_num": 20,
"data_source": "rand",
@@ -110,86 +110,6 @@
"tags_file": "",
"columns": [{"type": "INT"}, {"type": "DOUBLE", "count":1}, {"type": "BINARY", "len": 16, "count":2}, {"type": "nchar", "len": 32, "count":2}],
"tags": [{"type": "TINYINT", "count":2}, {"type": "BINARY","count":1}, {"type": "nchar", "count":2}]
- },
- {
- "name": "stb3",
- "child_table_exists":"no",
- "childtable_count": 40,
- "childtable_prefix": "stb00_",
- "auto_create_table": "no",
- "batch_create_tbl_num": 20,
- "data_source": "rand",
- "insert_mode": "sml",
- "insert_rows": 100,
- "childtable_limit": -1,
- "childtable_offset":0,
- "multi_thread_write_one_tbl": "no",
- "interlace_rows": 0,
- "insert_interval":0,
- "max_sql_len": 1024000,
- "disorder_ratio": 0,
- "disorder_range": 1000,
- "timestamp_step": 1,
- "start_timestamp": "2020-10-01 00:00:00.000",
- "sample_format": "csv",
- "sample_file": "./sample.csv",
- "tags_file": "",
- "columns": [{"type": "INT"}, {"type": "DOUBLE", "count":1}, {"type": "BINARY", "len": 16, "count":2}, {"type": "nchar", "len": 32, "count":2}],
- "tags": [{"type": "TINYINT", "count":2}, {"type": "BINARY","count":1}, {"type": "nchar", "count":2}]
- },
- {
- "name": "stb4",
- "child_table_exists":"no",
- "childtable_count": 50,
- "childtable_prefix": "stb00_",
- "auto_create_table": "no",
- "batch_create_tbl_num": 20,
- "data_source": "rand",
- "insert_mode": "sml",
- "line_protocol": "telnet",
- "insert_rows": 100,
- "childtable_limit": -1,
- "childtable_offset":0,
- "multi_thread_write_one_tbl": "no",
- "interlace_rows": 0,
- "insert_interval":0,
- "max_sql_len": 1024000,
- "disorder_ratio": 0,
- "disorder_range": 1000,
- "timestamp_step": 1,
- "start_timestamp": "2020-10-01 00:00:00.000",
- "sample_format": "csv",
- "sample_file": "./sample.csv",
- "tags_file": "",
- "columns": [{"type": "INT"}],
- "tags": [{"type": "TINYINT", "count":2}]
- },
- {
- "name": "stb5",
- "child_table_exists":"no",
- "childtable_count": 60,
- "childtable_prefix": "stb00_",
- "auto_create_table": "no",
- "batch_create_tbl_num": 20,
- "data_source": "rand",
- "insert_mode": "sml",
- "line_protocol": "json",
- "insert_rows": 100,
- "childtable_limit": -1,
- "childtable_offset":0,
- "multi_thread_write_one_tbl": "no",
- "interlace_rows": 0,
- "insert_interval":0,
- "max_sql_len": 1024000,
- "disorder_ratio": 0,
- "disorder_range": 1000,
- "timestamp_step": 1,
- "start_timestamp": "2020-10-01 00:00:00.000",
- "sample_format": "csv",
- "sample_file": "./sample.csv",
- "tags_file": "",
- "columns": [{"type": "INT"}],
- "tags": [{"type": "TINYINT"}]
}]
}]
}
diff --git a/tests/pytest/tools/taosdemoAllTest/sml/insert-sml-json-alltype.json b/tests/pytest/tools/taosdemoAllTest/sml/insert-sml-json-alltype.json
index 1b255a37f19b584211430b2f13e8754faedd5577..66885ebab89f7221830e66d642ca17b99de0e397 100644
--- a/tests/pytest/tools/taosdemoAllTest/sml/insert-sml-json-alltype.json
+++ b/tests/pytest/tools/taosdemoAllTest/sml/insert-sml-json-alltype.json
@@ -56,7 +56,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "INT"}],
- "tags": [{"type": "INT", "count":1}]
+ "tags": [{"type": "INT", "count":6}]
},
{
"name": "stb1",
@@ -81,8 +81,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
- "columns": [{"type": "TINYINT", "count":1}],
- "tags": [{"type": "TINYINT", "count":1}]
+ "columns": [{"type": "TINYINT", "count":6}],
+ "tags": [{"type": "TINYINT", "count":6}]
},
{
"name": "stb2",
@@ -108,7 +108,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "BIGINT"}],
- "tags": [{"type": "BIGINT", "count":1}]
+ "tags": [{"type": "BIGINT", "count":6}]
},
{
"name": "stb3",
@@ -134,7 +134,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "SMALLINT"}],
- "tags": [{"type": "SMALLINT", "count":1}]
+ "tags": [{"type": "SMALLINT", "count":6}]
},
{
"name": "stb4",
@@ -160,7 +160,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "FLOAT"}],
- "tags": [{"type": "FLOAT", "count":1}]
+ "tags": [{"type": "FLOAT", "count":6}]
},
{
"name": "stb5",
@@ -186,7 +186,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "DOUBLE"}],
- "tags": [{"type": "DOUBLE", "count":1}]
+ "tags": [{"type": "DOUBLE", "count":6}]
},
{
"name": "stb6",
@@ -212,7 +212,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "UINT"}],
- "tags": [{"type": "UINT", "count":1}]
+ "tags": [{"type": "UINT", "count":6}]
},
{
"name": "stb7",
@@ -237,8 +237,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
- "columns": [ {"type": "BOOL"}],
- "tags": [{"type": "BOOL", "count":1}]
+ "columns": [ {"type": "INT"}],
+ "tags": [{"type": "INT", "count":3}]
},
{
"name": "stb8",
@@ -263,8 +263,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
- "columns": [{"type": "NCHAR","len": 16, "count":1}],
- "tags": [{"type": "NCHAR", "count":1}]
+ "columns": [{"type": "NCHAR","len": 16, "count":6}],
+ "tags": [{"type": "NCHAR", "count":6}]
},
{
"name": "stb9",
@@ -289,8 +289,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
- "columns": [{"type": "BINARY", "len": 16, "count":1}],
- "tags": [{"type": "BINARY", "count":1}]
+ "columns": [{"type": "BINARY", "len": 16, "count":6}],
+ "tags": [{"type": "BINARY", "count":6}]
},
{
"name": "stb10",
@@ -316,7 +316,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "UBIGINT"}],
- "tags": [{"type": "UBIGINT", "count":1}]
+ "tags": [{"type": "UBIGINT", "count":6}]
},
{
"name": "stb11",
@@ -342,7 +342,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "UTINYINT"}],
- "tags": [{"type": "UTINYINT", "count":1}]
+ "tags": [{"type": "UTINYINT", "count":3}]
},
{
"name": "stb12",
@@ -368,7 +368,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [ {"type": "USMALLINT"}],
- "tags": [{"type": "USMALLINT", "count":1}]
+ "tags": [{"type": "USMALLINT", "count":6}]
}]
}]
}
diff --git a/tests/pytest/tools/taosdemoAllTest/sml/insert-sml-telnet-alltype.json b/tests/pytest/tools/taosdemoAllTest/sml/insert-sml-telnet-alltype.json
index 983a3009db68e95fecf3f8eda91f0aa3f41aff37..a786e93696e8b13b39d45a9c4c8ef1aae829fef8 100644
--- a/tests/pytest/tools/taosdemoAllTest/sml/insert-sml-telnet-alltype.json
+++ b/tests/pytest/tools/taosdemoAllTest/sml/insert-sml-telnet-alltype.json
@@ -56,7 +56,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "INT"}],
- "tags": [{"type": "INT", "count":1}]
+ "tags": [{"type": "INT", "count":6}]
},
{
"name": "stb1",
@@ -82,7 +82,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "UINT"}],
- "tags": [{"type": "UINT", "count":1}]
+ "tags": [{"type": "UINT", "count":6}]
},
{
"name": "stb2",
@@ -107,8 +107,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
- "columns": [{"type": "TINYINT", "count":1}],
- "tags": [{"type": "TINYINT", "count":1}]
+ "columns": [{"type": "TINYINT", "count":6}],
+ "tags": [{"type": "TINYINT", "count":6}]
},
{
"name": "stb3",
@@ -134,7 +134,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "BIGINT"}],
- "tags": [{"type": "BIGINT", "count":1}]
+ "tags": [{"type": "BIGINT", "count":6}]
},
{
"name": "stb4",
@@ -160,7 +160,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "SMALLINT"}],
- "tags": [{"type": "SMALLINT", "count":1}]
+ "tags": [{"type": "SMALLINT", "count":6}]
},
{
"name": "stb5",
@@ -186,7 +186,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "FLOAT"}],
- "tags": [{"type": "FLOAT", "count":1}]
+ "tags": [{"type": "FLOAT", "count":6}]
},
{
"name": "stb6",
@@ -212,7 +212,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "DOUBLE"}],
- "tags": [{"type": "DOUBLE", "count":1}]
+ "tags": [{"type": "DOUBLE", "count":6}]
},
{
"name": "stb7",
@@ -237,8 +237,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
- "columns": [ {"type": "BOOL"}],
- "tags": [{"type": "BOOL", "count":1}]
+ "columns": [ {"type": "int"}],
+ "tags": [{"type": "int", "count":6}]
},
{
"name": "stb8",
@@ -263,8 +263,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
- "columns": [{"type": "NCHAR","len": 16, "count":1}],
- "tags": [{"type": "NCHAR", "count":1}]
+ "columns": [{"type": "NCHAR","len": 16, "count":6}],
+ "tags": [{"type": "NCHAR", "count":6}]
},
{
"name": "stb9",
@@ -289,8 +289,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
- "columns": [{"type": "BINARY", "len": 16, "count":1}],
- "tags": [{"type": "BINARY", "count":1}]
+ "columns": [{"type": "BINARY", "len": 16, "count":6}],
+ "tags": [{"type": "BINARY", "count":6}]
},
{
"name": "stb10",
@@ -316,7 +316,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "UBIGINT"}],
- "tags": [{"type": "UBIGINT", "count":1}]
+ "tags": [{"type": "UBIGINT", "count":6}]
},
{
"name": "stb11",
@@ -342,7 +342,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "UTINYINT"}],
- "tags": [{"type": "UTINYINT", "count":1}]
+ "tags": [{"type": "UTINYINT", "count":6}]
},
{
"name": "stb12",
@@ -368,7 +368,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [ {"type": "USMALLINT"}],
- "tags": [{"type": "USMALLINT", "count":1}]
+ "tags": [{"type": "USMALLINT", "count":6}]
}]
}]
}
diff --git a/tests/pytest/tools/taosdemoAllTest/taosdemoTestInsertWithJson.py b/tests/pytest/tools/taosdemoAllTest/taosdemoTestInsertWithJson.py
index 1154beda7846065001093898d617c0292fc8da05..8b0f55b5bfbb2706a470d55f0be6c62c804611da 100644
--- a/tests/pytest/tools/taosdemoAllTest/taosdemoTestInsertWithJson.py
+++ b/tests/pytest/tools/taosdemoAllTest/taosdemoTestInsertWithJson.py
@@ -52,324 +52,326 @@ class TDTestCase:
os.system("rm -rf ./insert*_res.txt*")
os.system("rm -rf tools/taosdemoAllTest/%s.sql" % testcaseFilename )
- # # insert: create one or mutiple tables per sql and insert multiple rows per sql
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-1s1tnt1r.json -y " % binPath)
- # tdSql.execute("use db")
- # tdSql.query("select count (tbname) from stb0")
- # tdSql.checkData(0, 0, 11)
- # tdSql.query("select count (tbname) from stb1")
- # tdSql.checkData(0, 0, 10)
- # tdSql.query("select count(*) from stb00_0")
- # tdSql.checkData(0, 0, 100)
- # tdSql.query("select count(*) from stb0")
- # tdSql.checkData(0, 0, 1100)
- # tdSql.query("select count(*) from stb01_1")
- # tdSql.checkData(0, 0, 200)
- # tdSql.query("select count(*) from stb1")
- # tdSql.checkData(0, 0, 2000)
-
- # # # restful connector insert data
- # # os.system("%staosBenchmark -f tools/taosdemoAllTest/insertRestful.json -y " % binPath)
- # # tdSql.execute("use db")
- # # tdSql.query("select count (tbname) from stb0")
- # # tdSql.checkData(0, 0, 10)
- # # tdSql.query("select count (tbname) from stb1")
- # # tdSql.checkData(0, 0, 10)
- # # tdSql.query("select count(*) from stb00_0")
- # # tdSql.checkData(0, 0, 10)
- # # tdSql.query("select count(*) from stb0")
- # # tdSql.checkData(0, 0, 100)
- # # tdSql.query("select count(*) from stb01_1")
- # # tdSql.checkData(0, 0, 20)
- # # tdSql.query("select count(*) from stb1")
- # # tdSql.checkData(0, 0, 200)
-
- # # default values json files
- # tdSql.execute("drop database if exists db")
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-default.json -y " % binPath)
- # tdSql.query("show databases;")
- # for i in range(tdSql.queryRows):
- # if tdSql.queryResult[i][0] == 'db':
- # tdSql.checkData(i, 2, 100)
- # tdSql.checkData(i, 4, 1)
- # tdSql.checkData(i, 6, 10)
- # tdSql.checkData(i, 16, 'ms')
+ # insert: create one or mutiple tables per sql and insert multiple rows per sql
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-1s1tnt1r.json -y " % binPath)
+ tdSql.execute("use db")
+ tdSql.query("select count (tbname) from stb0")
+ tdSql.checkData(0, 0, 11)
+ tdSql.query("select count (tbname) from stb1")
+ tdSql.checkData(0, 0, 10)
+ tdSql.query("select count(*) from stb00_0")
+ tdSql.checkData(0, 0, 100)
+ tdSql.query("select count(*) from stb0")
+ tdSql.checkData(0, 0, 1100)
+ tdSql.query("select count(*) from stb01_1")
+ tdSql.checkData(0, 0, 200)
+ tdSql.query("select count(*) from stb1")
+ tdSql.checkData(0, 0, 2000)
+
+ # restful connector insert data
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insertRestful.json -y " % binPath)
+ tdSql.execute("use db")
+ tdSql.query("select count (tbname) from stb0")
+ tdSql.checkData(0, 0, 10)
+ tdSql.query("select count (tbname) from stb1")
+ tdSql.checkData(0, 0, 10)
+ tdSql.query("select count(*) from stb00_0")
+ tdSql.checkData(0, 0, 10)
+ tdSql.query("select count(*) from stb0")
+ tdSql.checkData(0, 0, 100)
+ tdSql.query("select count(*) from stb01_1")
+ tdSql.checkData(0, 0, 20)
+ tdSql.query("select count(*) from stb1")
+ tdSql.checkData(0, 0, 200)
+
+ # default values json files
+ tdSql.execute("drop database if exists db")
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-default.json -y " % binPath)
+ tdSql.query("show databases;")
+ for i in range(tdSql.queryRows):
+ if tdSql.queryResult[i][0] == 'db':
+ tdSql.checkData(i, 2, 100)
+ tdSql.checkData(i, 4, 1)
+ tdSql.checkData(i, 6, 10)
+ tdSql.checkData(i, 16, 'ms')
- # # insert: create mutiple tables per sql and insert one rows per sql .
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-1s1tntmr.json -y " % binPath)
- # tdSql.execute("use db")
- # tdSql.query("select count (tbname) from stb0")
- # tdSql.checkData(0, 0, 10)
- # tdSql.query("select count (tbname) from stb1")
- # tdSql.checkData(0, 0, 20)
- # tdSql.query("select count(*) from stb00_0")
- # tdSql.checkData(0, 0, 100)
- # tdSql.query("select count(*) from stb0")
- # tdSql.checkData(0, 0, 1000)
- # tdSql.query("select count(*) from stb01_0")
- # tdSql.checkData(0, 0, 200)
- # tdSql.query("select count(*) from stb1")
- # tdSql.checkData(0, 0, 4000)
-
- # # insert: using parament "insert_interval to controls spped of insert.
- # # but We need to have accurate methods to control the speed, such as getting the speed value, checking the count and so on。
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-interval-speed.json -y" % binPath)
- # tdSql.execute("use db")
- # tdSql.query("show stables")
- # tdSql.checkData(0, 4, 10)
- # tdSql.query("select count(*) from stb00_0")
- # tdSql.checkData(0, 0, 200)
- # tdSql.query("select count(*) from stb0")
- # tdSql.checkData(0, 0, 2000)
- # tdSql.query("show stables")
- # tdSql.checkData(1, 4, 20)
- # tdSql.query("select count(*) from stb01_0")
- # tdSql.checkData(0, 0, 200)
- # tdSql.query("select count(*) from stb1")
- # tdSql.checkData(0, 0, 4000)
-
- # # spend 2min30s for 3 testcases.
- # # insert: drop and child_table_exists combination test
- # # insert: using parament "childtable_offset and childtable_limit" to control table'offset point and offset
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-nodbnodrop.json -y" % binPath)
- # tdSql.error("show dbno.stables")
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-newdb.json -y" % binPath)
- # tdSql.execute("use db")
- # tdSql.query("select count (tbname) from stb0")
- # tdSql.checkData(0, 0, 5)
- # tdSql.query("select count (tbname) from stb1")
- # tdSql.checkData(0, 0, 6)
- # tdSql.query("select count (tbname) from stb2")
- # tdSql.checkData(0, 0, 7)
- # tdSql.query("select count (tbname) from stb3")
- # tdSql.checkData(0, 0, 8)
- # tdSql.query("select count (tbname) from stb4")
- # tdSql.checkData(0, 0, 8)
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-offset.json -y" % binPath)
- # tdSql.execute("use db")
- # tdSql.query("select count(*) from stb0")
- # tdSql.checkData(0, 0, 50)
- # tdSql.query("select count(*) from stb1")
- # tdSql.checkData(0, 0, 240)
- # tdSql.query("select count(*) from stb2")
- # tdSql.checkData(0, 0, 220)
- # tdSql.query("select count(*) from stb3")
- # tdSql.checkData(0, 0, 180)
- # tdSql.query("select count(*) from stb4")
- # tdSql.checkData(0, 0, 160)
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-newtable.json -y" % binPath)
- # tdSql.execute("use db")
- # tdSql.query("select count(*) from stb0")
- # tdSql.checkData(0, 0, 150)
- # tdSql.query("select count(*) from stb1")
- # tdSql.checkData(0, 0, 360)
- # tdSql.query("select count(*) from stb2")
- # tdSql.checkData(0, 0, 360)
- # tdSql.query("select count(*) from stb3")
- # tdSql.checkData(0, 0, 340)
- # tdSql.query("select count(*) from stb4")
- # tdSql.checkData(0, 0, 400)
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-renewdb.json -y" % binPath)
- # tdSql.execute("use db")
- # tdSql.query("select count(*) from stb0")
- # tdSql.checkData(0, 0, 50)
- # tdSql.query("select count(*) from stb1")
- # tdSql.checkData(0, 0, 120)
- # tdSql.query("select count(*) from stb2")
- # tdSql.checkData(0, 0, 140)
- # tdSql.query("select count(*) from stb3")
- # tdSql.checkData(0, 0, 160)
- # tdSql.query("select count(*) from stb4")
- # tdSql.checkData(0, 0, 160)
-
-
- # # insert: let parament in json file is illegal, it'll expect error.
- # tdSql.execute("drop database if exists db")
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insertColumnsAndTagNumLarge4096.json -y " % binPath)
- # tdSql.error("use db")
- # tdSql.execute("drop database if exists db")
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insertSigcolumnsNum4096.json -y " % binPath)
- # tdSql.error("select * from db.stb0")
- # tdSql.execute("drop database if exists db")
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insertColumnsAndTagNum4096.json -y " % binPath)
- # tdSql.query("select count(*) from db.stb0")
- # tdSql.checkData(0, 0, 10000)
-
- # tdSql.execute("drop database if exists db")
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insertInterlaceRowsLarge1M.json -y " % binPath)
- # tdSql.query("select count(*) from db.stb0")
- # tdSql.checkRows(0)
- # tdSql.execute("drop database if exists db")
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insertColumnsNum0.json -y " % binPath)
- # tdSql.execute("use db")
- # tdSql.query("show stables like 'stb0%' ")
- # tdSql.checkData(0, 2, 11)
- # tdSql.execute("drop database if exists db")
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insertTagsNumLarge128.json -y " % binPath)
- # tdSql.error("use db1")
- # tdSql.execute("drop database if exists db")
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insertBinaryLenLarge16374AllcolLar49151.json -y " % binPath)
- # tdSql.query("select count(*) from db.stb0")
- # tdSql.checkRows(1)
- # tdSql.query("select count(*) from db.stb1")
- # tdSql.checkRows(1)
- # tdSql.error("select * from db.stb4")
- # tdSql.error("select * from db.stb2")
- # tdSql.query("select count(*) from db.stb3")
- # tdSql.checkRows(1)
- # tdSql.execute("drop database if exists db")
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insertBinaryLenLarge16374AllcolLar49151-error.json -y " % binPath)
- # tdSql.error("select * from db.stb4")
- # tdSql.error("select * from db.stb2")
- # tdSql.execute("drop database if exists db")
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insertNumOfrecordPerReq0.json -y " % binPath)
- # tdSql.error("select count(*) from db.stb0")
- # tdSql.execute("drop database if exists db")
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insertNumOfrecordPerReqless0.json -y " % binPath)
- # tdSql.error("use db")
- # tdSql.execute("drop database if exists db")
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insertChildTab0.json -y " % binPath)
- # tdSql.error("use db")
- # tdSql.execute("drop database if exists db")
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insertChildTabLess0.json -y " % binPath)
- # tdSql.error("use db")
- # tdSql.execute("drop database if exists blf")
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insertTimestepMulRowsLargeint16.json -y " % binPath)
- # tdSql.execute("use blf")
- # tdSql.query("select ts from blf.p_0_topics_7 limit 262800,1")
- # tdSql.checkData(0, 0, "2020-03-31 12:00:00.000")
- # tdSql.query("select first(ts) from blf.p_0_topics_2")
- # tdSql.checkData(0, 0, "2019-10-01 00:00:00")
- # tdSql.query("select last(ts) from blf.p_0_topics_6 ")
- # tdSql.checkData(0, 0, "2020-09-29 23:59:00")
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insertMaxNumPerReq.json -y " % binPath)
- # tdSql.execute("use db")
- # tdSql.query("select count(*) from stb0")
- # tdSql.checkData(0, 0, 5000000)
- # tdSql.query("select count(*) from stb1")
- # tdSql.checkData(0, 0, 5000000)
-
-
-
- # # insert: timestamp and step
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-timestep.json -y " % binPath)
- # tdSql.execute("use db")
- # tdSql.query("show stables")
- # tdSql.query("select count (tbname) from stb0")
- # tdSql.checkData(0, 0, 10)
- # tdSql.query("select count (tbname) from stb1")
- # tdSql.checkData(0, 0, 20)
- # tdSql.query("select last(ts) from db.stb00_0")
- # tdSql.checkData(0, 0, "2020-10-01 00:00:00.019000")
- # tdSql.query("select count(*) from stb0")
- # tdSql.checkData(0, 0, 200)
- # tdSql.query("select last(ts) from db.stb01_0")
- # tdSql.checkData(0, 0, "2020-11-01 00:00:00.190000")
- # tdSql.query("select count(*) from stb1")
- # tdSql.checkData(0, 0, 400)
-
- # # # insert: disorder_ratio
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-disorder.json -g 2>&1 -y " % binPath)
- # tdSql.execute("use db")
- # tdSql.query("select count (tbname) from stb0")
- # tdSql.checkData(0, 0, 1)
- # tdSql.query("select count (tbname) from stb1")
- # tdSql.checkData(0, 0, 1)
- # tdSql.query("select count(*) from stb0")
- # tdSql.checkData(0, 0, 10)
- # tdSql.query("select count(*) from stb1")
- # tdSql.checkData(0, 0, 10)
-
- # # insert: sample json
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-sample-ts.json -y " % binPath)
- # tdSql.execute("use dbtest123")
- # tdSql.query("select c2 from stb0")
- # tdSql.checkData(0, 0, 2147483647)
- # tdSql.query("select c0 from stb0_0 order by ts")
- # tdSql.checkData(3, 0, 4)
- # tdSql.query("select count(*) from stb0 order by ts")
- # tdSql.checkData(0, 0, 40)
- # tdSql.query("select * from stb0_1 order by ts")
- # tdSql.checkData(0, 0, '2021-10-28 15:34:44.735')
- # tdSql.checkData(3, 0, '2021-10-31 15:34:44.735')
- # tdSql.query("select * from stb1 where t1=-127")
- # tdSql.checkRows(20)
- # tdSql.query("select * from stb1 where t2=127")
- # tdSql.checkRows(10)
- # tdSql.query("select * from stb1 where t2=126")
- # tdSql.checkRows(10)
-
- # # insert: sample json
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-sample.json -y " % binPath)
- # tdSql.execute("use dbtest123")
- # tdSql.query("select c2 from stb0")
- # tdSql.checkData(0, 0, 2147483647)
- # tdSql.query("select * from stb1 where t1=-127")
- # tdSql.checkRows(20)
- # tdSql.query("select * from stb1 where t2=127")
- # tdSql.checkRows(10)
- # tdSql.query("select * from stb1 where t2=126")
- # tdSql.checkRows(10)
-
-
- # # insert: test interlace parament
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-interlace-row.json -y " % binPath)
- # tdSql.execute("use db")
- # tdSql.query("select count (tbname) from stb0")
- # tdSql.checkData(0, 0, 100)
- # tdSql.query("select count (*) from stb0")
- # tdSql.checkData(0, 0, 15000)
-
-
- # # # insert: auto_create
-
- # tdSql.execute('drop database if exists db')
- # tdSql.execute('create database db')
- # tdSql.execute('use db')
- # os.system("%staosBenchmark -y -f tools/taosdemoAllTest/insert-drop-exist-auto-N00.json " % binPath) # drop = no, child_table_exists, auto_create_table varies
- # tdSql.execute('use db')
- # tdSql.query('show tables like \'NN123%\'') #child_table_exists = no, auto_create_table varies = 123
- # tdSql.checkRows(20)
- # tdSql.query('show tables like \'NNN%\'') #child_table_exists = no, auto_create_table varies = no
- # tdSql.checkRows(20)
- # tdSql.query('show tables like \'NNY%\'') #child_table_exists = no, auto_create_table varies = yes
- # tdSql.checkRows(20)
- # tdSql.query('show tables like \'NYN%\'') #child_table_exists = yes, auto_create_table varies = no
- # tdSql.checkRows(0)
- # tdSql.query('show tables like \'NY123%\'') #child_table_exists = yes, auto_create_table varies = 123
- # tdSql.checkRows(0)
- # tdSql.query('show tables like \'NYY%\'') #child_table_exists = yes, auto_create_table varies = yes
- # tdSql.checkRows(0)
-
- # tdSql.execute('drop database if exists db')
- # os.system("%staosBenchmark -y -f tools/taosdemoAllTest/insert-drop-exist-auto-Y00.json " % binPath) # drop = yes, child_table_exists, auto_create_table varies
- # tdSql.execute('use db')
- # tdSql.query('show tables like \'YN123%\'') #child_table_exists = no, auto_create_table varies = 123
- # tdSql.checkRows(20)
- # tdSql.query('show tables like \'YNN%\'') #child_table_exists = no, auto_create_table varies = no
- # tdSql.checkRows(20)
- # tdSql.query('show tables like \'YNY%\'') #child_table_exists = no, auto_create_table varies = yes
- # tdSql.checkRows(20)
- # tdSql.query('show tables like \'YYN%\'') #child_table_exists = yes, auto_create_table varies = no
- # tdSql.checkRows(20)
- # tdSql.query('show tables like \'YY123%\'') #child_table_exists = yes, auto_create_table varies = 123
- # tdSql.checkRows(20)
- # tdSql.query('show tables like \'YYY%\'') #child_table_exists = yes, auto_create_table varies = yes
- # tdSql.checkRows(20)
-
- # # insert: test chinese encoding
- # # TD-11399、TD-10819
- # os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-chinese.json -y " % binPath)
- # tdSql.execute("use db")
- # tdSql.query("show stables")
- # for i in range(6):
- # for j in range(6):
- # if tdSql.queryResult[i][0] == 'stb%d'%j:
- # # print(i,"stb%d"%j)
- # tdSql.checkData(i, 4, (j+1)*10)
- # for i in range(13):
- # tdSql.query("select count(*) from stb%d"%i)
- # tdSql.checkData(0, 0, (i+1)*100)
+ # insert: create mutiple tables per sql and insert one rows per sql .
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-1s1tntmr.json -y " % binPath)
+ tdSql.execute("use db")
+ tdSql.query("select count (tbname) from stb0")
+ tdSql.checkData(0, 0, 10)
+ tdSql.query("select count (tbname) from stb1")
+ tdSql.checkData(0, 0, 20)
+ tdSql.query("select count(*) from stb00_0")
+ tdSql.checkData(0, 0, 100)
+ tdSql.query("select count(*) from stb0")
+ tdSql.checkData(0, 0, 1000)
+ tdSql.query("select count(*) from stb01_0")
+ tdSql.checkData(0, 0, 200)
+ tdSql.query("select count(*) from stb1")
+ tdSql.checkData(0, 0, 4000)
+
+ # insert: using parament "insert_interval to controls spped of insert.
+ # but We need to have accurate methods to control the speed, such as getting the speed value, checking the count and so on。
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-interval-speed.json -y" % binPath)
+ tdSql.execute("use db")
+ tdSql.query("show stables")
+ tdSql.checkData(0, 4, 10)
+ tdSql.query("select count(*) from stb00_0")
+ tdSql.checkData(0, 0, 200)
+ tdSql.query("select count(*) from stb0")
+ tdSql.checkData(0, 0, 2000)
+ tdSql.query("show stables")
+ tdSql.checkData(1, 4, 20)
+ tdSql.query("select count(*) from stb01_0")
+ tdSql.checkData(0, 0, 200)
+ tdSql.query("select count(*) from stb1")
+ tdSql.checkData(0, 0, 4000)
+
+ # spend 2min30s for 3 testcases.
+ # insert: drop and child_table_exists combination test
+ # insert: using parament "childtable_offset and childtable_limit" to control table'offset point and offset
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-nodbnodrop.json -y" % binPath)
+ tdSql.error("show dbno.stables")
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-newdb.json -y" % binPath)
+ tdSql.execute("use db")
+ tdSql.query("select count (tbname) from stb0")
+ tdSql.checkData(0, 0, 5)
+ tdSql.query("select count (tbname) from stb1")
+ tdSql.checkData(0, 0, 6)
+ tdSql.query("select count (tbname) from stb2")
+ tdSql.checkData(0, 0, 7)
+ tdSql.query("select count (tbname) from stb3")
+ tdSql.checkData(0, 0, 8)
+ tdSql.query("select count (tbname) from stb4")
+ tdSql.checkData(0, 0, 8)
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-offset.json -y" % binPath)
+ tdSql.execute("use db")
+ tdSql.query("select count(*) from stb0")
+ tdSql.checkData(0, 0, 50)
+ tdSql.query("select count(*) from stb1")
+ tdSql.checkData(0, 0, 240)
+ tdSql.query("select count(*) from stb2")
+ tdSql.checkData(0, 0, 220)
+ tdSql.query("select count(*) from stb3")
+ tdSql.checkData(0, 0, 180)
+ tdSql.query("select count(*) from stb4")
+ tdSql.checkData(0, 0, 160)
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-newtable.json -y" % binPath)
+ tdSql.execute("use db")
+ tdSql.query("select count(*) from stb0")
+ tdSql.checkData(0, 0, 150)
+ tdSql.query("select count(*) from stb1")
+ tdSql.checkData(0, 0, 360)
+ tdSql.query("select count(*) from stb2")
+ tdSql.checkData(0, 0, 360)
+ tdSql.query("select count(*) from stb3")
+ tdSql.checkData(0, 0, 340)
+ tdSql.query("select count(*) from stb4")
+ tdSql.checkData(0, 0, 400)
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-renewdb.json -y" % binPath)
+ tdSql.execute("use db")
+ tdSql.query("select count(*) from stb0")
+ tdSql.checkData(0, 0, 50)
+ tdSql.query("select count(*) from stb1")
+ tdSql.checkData(0, 0, 120)
+ tdSql.query("select count(*) from stb2")
+ tdSql.checkData(0, 0, 140)
+ tdSql.query("select count(*) from stb3")
+ tdSql.checkData(0, 0, 160)
+ tdSql.query("select count(*) from stb4")
+ tdSql.checkData(0, 0, 160)
+
+
+ # insert: let parament in json file is illegal, it'll expect error.
+ tdSql.execute("drop database if exists db")
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insertColumnsAndTagNumLarge4096.json -y " % binPath)
+ tdSql.error("use db")
+ tdSql.execute("drop database if exists db")
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insertSigcolumnsNum4096.json -y " % binPath)
+ tdSql.error("select * from db.stb0")
+ tdSql.execute("drop database if exists db")
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insertColumnsAndTagNum4096.json -y " % binPath)
+ tdSql.query("select count(*) from db.stb0")
+ tdSql.checkData(0, 0, 10000)
+
+ tdSql.execute("drop database if exists db")
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insertInterlaceRowsLarge1M.json -y " % binPath)
+ tdSql.query("select count(*) from db.stb0")
+ tdSql.checkRows(0)
+ tdSql.execute("drop database if exists db")
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insertColumnsNum0.json -y " % binPath)
+ tdSql.execute("use db")
+ tdSql.query("show stables like 'stb0%' ")
+ tdSql.checkData(0, 2, 11)
+ tdSql.execute("drop database if exists db")
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insertTagsNumLarge128.json -y " % binPath)
+ tdSql.error("use db1")
+ tdSql.execute("drop database if exists db")
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insertBinaryLenLarge16374AllcolLar49151.json -y " % binPath)
+ tdSql.query("select count(*) from db.stb0")
+ tdSql.checkRows(1)
+ tdSql.query("select count(*) from db.stb1")
+ tdSql.checkRows(1)
+ tdSql.error("select * from db.stb4")
+ tdSql.error("select * from db.stb2")
+ tdSql.query("select count(*) from db.stb3")
+ tdSql.checkRows(1)
+ tdSql.execute("drop database if exists db")
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insertBinaryLenLarge16374AllcolLar49151-error.json -y " % binPath)
+ tdSql.error("select * from db.stb4")
+ tdSql.error("select * from db.stb2")
+ tdSql.execute("drop database if exists db")
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insertNumOfrecordPerReq0.json -y " % binPath)
+ tdSql.error("select count(*) from db.stb0")
+ tdSql.execute("drop database if exists db")
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insertNumOfrecordPerReqless0.json -y " % binPath)
+ tdSql.error("use db")
+ tdSql.execute("drop database if exists db")
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insertChildTab0.json -y " % binPath)
+ tdSql.error("use db")
+ tdSql.execute("drop database if exists db")
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insertChildTabLess0.json -y " % binPath)
+ tdSql.error("use db")
+ tdSql.execute("drop database if exists blf")
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insertTimestepMulRowsLargeint16.json -y " % binPath)
+ tdSql.execute("use blf")
+ tdSql.query("select ts from blf.p_0_topics_7 limit 262800,1")
+ tdSql.checkData(0, 0, "2020-03-31 12:00:00.000")
+ tdSql.query("select first(ts) from blf.p_0_topics_2")
+ tdSql.checkData(0, 0, "2019-10-01 00:00:00")
+ tdSql.query("select last(ts) from blf.p_0_topics_6 ")
+ tdSql.checkData(0, 0, "2020-09-29 23:59:00")
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insertMaxNumPerReq.json -y " % binPath)
+ tdSql.execute("use db")
+ tdSql.query("select count(*) from stb0")
+ tdSql.checkData(0, 0, 5000000)
+ tdSql.query("select count(*) from stb1")
+ tdSql.checkData(0, 0, 5000000)
+
+
+
+ # insert: timestamp and step
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-timestep.json -y " % binPath)
+ tdSql.execute("use db")
+ tdSql.query("show stables")
+ tdSql.query("select count (tbname) from stb0")
+ tdSql.checkData(0, 0, 10)
+ tdSql.query("select count (tbname) from stb1")
+ tdSql.checkData(0, 0, 20)
+ tdSql.query("select last(ts) from db.stb00_0")
+ tdSql.checkData(0, 0, "2020-10-01 00:00:00.019000")
+ tdSql.query("select count(*) from stb0")
+ tdSql.checkData(0, 0, 200)
+ tdSql.query("select last(ts) from db.stb01_0")
+ tdSql.checkData(0, 0, "2020-11-01 00:00:00.190000")
+ tdSql.query("select count(*) from stb1")
+ tdSql.checkData(0, 0, 400)
+
+ # # insert: disorder_ratio
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-disorder.json -g 2>&1 -y " % binPath)
+ tdSql.execute("use db")
+ tdSql.query("select count (tbname) from stb0")
+ tdSql.checkData(0, 0, 1)
+ tdSql.query("select count (tbname) from stb1")
+ tdSql.checkData(0, 0, 1)
+ tdSql.query("select count(*) from stb0")
+ tdSql.checkData(0, 0, 10)
+ tdSql.query("select count(*) from stb1")
+ tdSql.checkData(0, 0, 10)
+
+ # insert: sample json
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-sample-ts.json -y " % binPath)
+ tdSql.execute("use dbtest123")
+ tdSql.query("select c2 from stb0")
+ tdSql.checkData(0, 0, 2147483647)
+ tdSql.query("select c0 from stb0_0 order by ts")
+ tdSql.checkData(3, 0, 4)
+ tdSql.query("select count(*) from stb0 order by ts")
+ tdSql.checkData(0, 0, 40)
+ tdSql.query("select * from stb0_1 order by ts")
+ tdSql.checkData(0, 0, '2021-10-28 15:34:44.735')
+ tdSql.checkData(3, 0, '2021-10-31 15:34:44.735')
+ tdSql.query("select * from stb1 where t1=-127")
+ tdSql.checkRows(20)
+ tdSql.query("select * from stb1 where t2=127")
+ tdSql.checkRows(10)
+ tdSql.query("select * from stb1 where t2=126")
+ tdSql.checkRows(10)
+
+ # insert: sample json
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-sample.json -y " % binPath)
+ tdSql.execute("use dbtest123")
+ tdSql.query("select c2 from stb0")
+ tdSql.checkData(0, 0, 2147483647)
+ tdSql.query("select * from stb1 where t1=-127")
+ tdSql.checkRows(20)
+ tdSql.query("select * from stb1 where t2=127")
+ tdSql.checkRows(10)
+ tdSql.query("select * from stb1 where t2=126")
+ tdSql.checkRows(10)
+
+
+ # insert: test interlace parament
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-interlace-row.json -y " % binPath)
+ tdSql.execute("use db")
+ tdSql.query("select count (tbname) from stb0")
+ tdSql.checkData(0, 0, 100)
+ tdSql.query("select count (*) from stb0")
+ tdSql.checkData(0, 0, 15000)
+
+
+ # # insert: auto_create
+
+ tdSql.execute('drop database if exists db')
+ tdSql.execute('create database db')
+ tdSql.execute('use db')
+ os.system("%staosBenchmark -y -f tools/taosdemoAllTest/insert-drop-exist-auto-N00.json " % binPath) # drop = no, child_table_exists, auto_create_table varies
+ tdSql.execute('use db')
+ tdSql.query('show tables like \'NN123%\'') #child_table_exists = no, auto_create_table varies = 123
+ tdSql.checkRows(20)
+ tdSql.query('show tables like \'NNN%\'') #child_table_exists = no, auto_create_table varies = no
+ tdSql.checkRows(20)
+ tdSql.query('show tables like \'NNY%\'') #child_table_exists = no, auto_create_table varies = yes
+ tdSql.checkRows(20)
+ tdSql.query('show tables like \'NYN%\'') #child_table_exists = yes, auto_create_table varies = no
+ tdSql.checkRows(0)
+ tdSql.query('show tables like \'NY123%\'') #child_table_exists = yes, auto_create_table varies = 123
+ tdSql.checkRows(0)
+ tdSql.query('show tables like \'NYY%\'') #child_table_exists = yes, auto_create_table varies = yes
+ tdSql.checkRows(0)
+
+ tdSql.execute('drop database if exists db')
+ os.system("%staosBenchmark -y -f tools/taosdemoAllTest/insert-drop-exist-auto-Y00.json " % binPath) # drop = yes, child_table_exists, auto_create_table varies
+ tdSql.execute('use db')
+ tdSql.query('show tables like \'YN123%\'') #child_table_exists = no, auto_create_table varies = 123
+ tdSql.checkRows(20)
+ tdSql.query('show tables like \'YNN%\'') #child_table_exists = no, auto_create_table varies = no
+ tdSql.checkRows(20)
+ tdSql.query('show tables like \'YNY%\'') #child_table_exists = no, auto_create_table varies = yes
+ tdSql.checkRows(20)
+ tdSql.query('show tables like \'YYN%\'') #child_table_exists = yes, auto_create_table varies = no
+ tdSql.checkRows(20)
+ tdSql.query('show tables like \'YY123%\'') #child_table_exists = yes, auto_create_table varies = 123
+ tdSql.checkRows(20)
+ tdSql.query('show tables like \'YYY%\'') #child_table_exists = yes, auto_create_table varies = yes
+ tdSql.checkRows(20)
+
+
+ # insert: test chinese encoding
+ # TD-11399、TD-10819
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-chinese.json -y " % binPath)
+ os.system("%staosBenchmark -f tools/taosdemoAllTest/insert-chinese-sml.json -y " % binPath)
+ tdSql.execute("use db")
+ tdSql.query("show stables")
+ for i in range(6):
+ for j in range(6):
+ if tdSql.queryResult[i][0] == 'stb%d'%j:
+ # print(i,"stb%d"%j)
+ tdSql.checkData(i, 4, (j+1)*10)
+ for i in range(6):
+ tdSql.query("select count(*) from stb%d"%i)
+ tdSql.checkData(0, 0, (i+1)*1000)
# rm useless files
os.system("rm -rf ./insert*_res.txt*")
diff --git a/tests/pytest/tools/taosdemoAllTest/taosdemoTestInsertWithJsonStmt.py b/tests/pytest/tools/taosdemoAllTest/taosdemoTestInsertWithJsonStmt.py
index 05ccce79101b5bec1b541bd0436b86fc0151492c..6a5a3f767f1c5787680d75ee8cb98ee284a44741 100644
--- a/tests/pytest/tools/taosdemoAllTest/taosdemoTestInsertWithJsonStmt.py
+++ b/tests/pytest/tools/taosdemoAllTest/taosdemoTestInsertWithJsonStmt.py
@@ -268,16 +268,16 @@ class TDTestCase:
tdSql.checkData(0, 0, 10)
# insert: sample json
- os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-sample-stmt.json -y " % binPath)
- tdSql.execute("use dbtest123")
- tdSql.query("select c2 from stb0")
- tdSql.checkData(0, 0, 2147483647)
- tdSql.query("select * from stb1 where t1=-127")
- tdSql.checkRows(20)
- tdSql.query("select * from stb1 where t2=127")
- tdSql.checkRows(10)
- tdSql.query("select * from stb1 where t2=126")
- tdSql.checkRows(10)
+ #os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-sample-stmt.json -y " % binPath)
+ #tdSql.execute("use dbtest123")
+ #tdSql.query("select c2 from stb0")
+ #tdSql.checkData(0, 0, 2147483647)
+ #tdSql.query("select * from stb1 where t1=-127")
+ #tdSql.checkRows(20)
+ #tdSql.query("select * from stb1 where t2=127")
+ #tdSql.checkRows(10)
+ #tdSql.query("select * from stb1 where t2=126")
+ #tdSql.checkRows(10)
# insert: test interlace parament
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-interlace-row-stmt.json -y " % binPath)
diff --git a/tests/pytest/tools/taosdumpTest2.py b/tests/pytest/tools/taosdumpTest2.py
index c60fb42266c6d23ad9aeabc9bf9f48ac5feec17b..6258024de8729d799690515a7133c5d9aa04330e 100644
--- a/tests/pytest/tools/taosdumpTest2.py
+++ b/tests/pytest/tools/taosdumpTest2.py
@@ -68,8 +68,9 @@ class TDTestCase:
binPath = buildPath + "/build/bin/"
os.system("rm /tmp/*.sql")
+ os.system("rm /tmp/*.avro*")
os.system(
- "%staosdump --databases db -o /tmp -B 16384 -L 1048576" %
+ "%staosdump --databases db -o /tmp -B 16384" %
binPath)
tdSql.execute("drop database db")
diff --git a/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim b/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim
index e5f2928748896a2aaa811ddc76bfb16b9626bf1d..e3623c7c629d671eedc7b6a416b9e77e6445c4ff 100644
--- a/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim
+++ b/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim
@@ -51,7 +51,7 @@ sleep 1000
sql connect
sleep 1000
sql create dnode $hostname2
-sleep 1000
+sleep 3000
print ============== step2: create database with replica 2, and create table, insert data
$totalTableNum = 10
diff --git a/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim b/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim
index 8d063020e73be449bc95463e966d9081b0cd5be5..c88e26d7eb19a533be84f646321e103480b2d10a 100644
--- a/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim
+++ b/tests/script/unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim
@@ -51,7 +51,7 @@ sleep 1000
sql connect
sleep 1000
sql create dnode $hostname2
-sleep 1000
+sleep 2000
print ============== step2: create database with replica 2, and create table, insert data
$totalTableNum = 10
diff --git a/tests/script/unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim b/tests/script/unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim
index 8f837b7e477ab801b296b32ddcf9a5c683c351f0..ed3f9b8274c204727a08c163596316ed17808d6b 100644
--- a/tests/script/unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim
+++ b/tests/script/unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim
@@ -51,7 +51,7 @@ sleep 1000
sql connect
sleep 1000
sql create dnode $hostname2
-sleep 1000
+sleep 2000
print ============== step2: create database with replica 2, and create table, insert data
$totalTableNum = 10
diff --git a/tests/system-test/2-query/TD-11561.py b/tests/system-test/2-query/TD-11561.py
new file mode 100644
index 0000000000000000000000000000000000000000..ee9ba02b43331d8aaaaeb9a950efa5758e157877
--- /dev/null
+++ b/tests/system-test/2-query/TD-11561.py
@@ -0,0 +1,78 @@
+###################################################################
+# Copyright (c) 2020 by TAOS Technologies, Inc.
+# All rights reserved.
+#
+# This file is proprietary and confidential to TAOS Technologies.
+# No part of this file may be reproduced, stored, transmitted,
+# disclosed or used in any form or by any means other than as
+# expressly provided by the written permission from Jianhui Tao
+#
+###################################################################
+
+# -*- coding: utf-8 -*-
+
+import taos
+import time
+
+from util.log import *
+from util.cases import *
+from util.sql import *
+from util.dnodes import *
+
+
+class TDTestCase:
+ def __init__(self):
+ self.err_case = 0
+ self.curret_case = 0
+
+ def caseDescription(self):
+
+ '''
+ case1 : [TD-11561] : there is err return when using slimit/soofset without group by operation
+ '''
+ return
+
+ def init(self, conn, logSql):
+ tdLog.debug("start to execute %s" % __file__)
+ tdSql.init(conn.cursor(), logSql)
+
+ def create_stb(self):
+ basetime = int(round(time.time() * 1000))
+ tdSql.prepare()
+ tdSql.execute(f"create stable stb1(ts timestamp, c1 int) tags (tag1 int)")
+ for i in range(10):
+ tdSql.execute(f"create table t{i} using stb1 tags({i})")
+ tdSql.execute(f"insert into t{i} values ({basetime}, {i})")
+
+ pass
+
+ def check_td11561(self):
+ # this case expect return err when using slimit/soofset without group by operation
+ try:
+ tdSql.error("select tag1 from stb1 slimit 1 soffset 1")
+ tdSql.error("select tbname from stb1 slimit 1 soffset 1")
+ self.curret_case += 1
+ tdLog.printNoPrefix("the case for td-11561 run passed")
+ except:
+ self.err_case += 1
+ tdLog.printNoPrefix("the case for td-11561 run failed")
+ pass
+
+
+ def run(self):
+ self.create_stb()
+
+ self.check_td11561()
+
+ if self.err_case > 0:
+ tdLog.exit(f"{self.err_case} case run failed")
+ else:
+ tdLog.success("all case run passed")
+
+ def stop(self):
+ tdSql.close()
+ tdLog.success("%s successfully executed" % __file__)
+
+
+tdCases.addWindows(__file__, TDTestCase())
+tdCases.addLinux(__file__, TDTestCase())
diff --git a/tests/system-test/3-connectors/nodejs/test.sh b/tests/system-test/3-connectors/nodejs/test.sh
index 3b1d8bb4790d6273e32a42ce50979e98e1ce5a92..1f479a10732623c65194fc243249c88c43830eb1 100755
--- a/tests/system-test/3-connectors/nodejs/test.sh
+++ b/tests/system-test/3-connectors/nodejs/test.sh
@@ -26,4 +26,4 @@ node nodejsChecker.js host=localhost
node test1970.js
cd ${WKC}/tests/connectorTest/nodejsTest/nanosupport
npm install td2.0-connector > /dev/null 2>&1
-node nanosecondTest.js
+# node nanosecondTest.js
diff --git a/tests/system-test/fulltest-query.sh b/tests/system-test/fulltest-query.sh
index ed85ffd4b968192f17b84d3c132c13fdfa6f2886..b3314a5e0e39c5e34fac04f8b44e3eceb21523f0 100755
--- a/tests/system-test/fulltest-query.sh
+++ b/tests/system-test/fulltest-query.sh
@@ -2,4 +2,9 @@ python3 ./test.py -f 2-query/TD-11256.py
# python3 ./test.py -f 2-query/TD-11389.py
python3 ./test.py -f 2-query/TD-11945_crash.py
python3 ./test.py -f 2-query/TD-12340-12342.py
-python3 ./test.py -f 2-query/TD-12204.py
\ No newline at end of file
+
+python3 ./test.py -f 2-query/TD-11561.py
+
+python3 ./test.py -f 2-query/TD-12204.py
+
+
diff --git a/tests/test-CI.sh b/tests/test-CI.sh
index de0a8396610d5832728db35324d20d4e208ce959..c3790fa74bdf8f471cda7b2564fd742e32239eb7 100755
--- a/tests/test-CI.sh
+++ b/tests/test-CI.sh
@@ -206,6 +206,7 @@ if [ "$1" == "full" ]; then
runPyCaseOneByOne fulltest-connector.sh
else
echo "### run $1 $2 test ###"
+
if [ "$1" != "query" ] && [ "$1" != "taosAdapter" ] && [ "$1" != "other" ] && [ "$1" != "tools" ] && [ "$1" != "insert" ] && [ "$1" != "connector" ] ;then
echo " wrong option:$1 must one of [query,other,tools,insert,connector,taosAdapter]"
exit 8