未验证 提交 59790c4d 编写于 作者: W wu champion 提交者: GitHub

Merge pull request #7 from wu-champion/develop

更新分支1380
[![Build Status](https://travis-ci.org/taosdata/TDengine.svg?branch=master)](https://travis-ci.org/taosdata/TDengine)
[![Build status](https://ci.appveyor.com/api/projects/status/kf3pwh2or5afsgl9/branch/master?svg=true)](https://ci.appveyor.com/project/sangshuduo/tdengine-2n8ge/branch/master)
[![Coverage Status](https://coveralls.io/repos/github/taosdata/TDengine/badge.svg?branch=develop)](https://coveralls.io/github/taosdata/TDengine?branch=develop)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4201/badge)](https://bestpractices.coreinfrastructure.org/projects/4201)
[![tdengine](https://snapcraft.io//tdengine/badge.svg)](https://snapcraft.io/tdengine)
[![TDengine](TDenginelogo.png)](https://www.taosdata.com)
简体中文 | [English](./README.md)
# TDengine 简介
TDengine是涛思数据专为物联网、车联网、工业互联网、IT运维等设计和优化的大数据平台。除核心的快10倍以上的时序数据库功能外,还提供缓存、数据订阅、流式计算等功能,最大程度减少研发和运维的复杂度,且核心代码,包括集群功能全部开源(开源协议,AGPL v3.0)。
- 10 倍以上性能提升。定义了创新的数据存储结构,单核每秒就能处理至少2万次请求,插入数百万个数据点,读出一千万以上数据点,比现有通用数据库快了十倍以上。
- 硬件或云服务成本降至1/5。由于超强性能,计算资源不到通用大数据方案的1/5;通过列式存储和先进的压缩算法,存储空间不到通用数据库的1/10。
- 全栈时序数据处理引擎。将数据库、消息队列、缓存、流式计算等功能融合一起,应用无需再集成Kafka/Redis/HBase/Spark等软件,大幅降低应用开发和维护成本。
- 强大的分析功能。无论是十年前还是一秒钟前的数据,指定时间范围即可查询。数据可在时间轴上或多个设备上进行聚合。即席查询可通过Shell/Python/R/Matlab随时进行。
- 与第三方工具无缝连接。不用一行代码,即可与Telegraf, Grafana, EMQ X, Prometheus, Matlab, R集成。后续还将支持MQTT, OPC, Hadoop,Spark等, BI工具也将无缝连接。
- 零运维成本、零学习成本。安装、集群一秒搞定,无需分库分表,实时备份。标准SQL,支持JDBC,RESTful,支持Python/Java/C/C++/Go/Node.JS, 与MySQL相似,零学习成本。
# 文档
TDengine是一个高效的存储、查询、分析时序大数据的平台,专为物联网、车联网、工业互联网、运维监测等优化而设计。您可以像使用关系型数据库MySQL一样来使用它,但建议您在使用前仔细阅读一遍下面的文档,特别是 [数据模型](https://www.taosdata.com/cn/documentation/architecture)[数据建模](https://www.taosdata.com/cn/documentation/model)。除本文档之外,欢迎 [下载产品白皮书](https://www.taosdata.com/downloads/TDengine%20White%20Paper.pdf)
# 生成
TDengine目前2.0版服务器仅能在Linux系统上安装和运行,后续会支持Windows、macOS等系统。客户端可以在Windows或Linux上安装和运行。任何OS的应用也可以选择RESTful接口连接服务器taosd。CPU支持X64/ARM64/MIPS64/Alpha64,后续会支持ARM32、RISC-V等CPU架构。用户可根据需求选择通过[源码](https://www.taosdata.com/cn/getting-started/#通过源码安装)或者[安装包](https://www.taosdata.com/cn/getting-started/#通过安装包安装)来安装。本快速指南仅适用于通过源码安装。
## 安装工具
### Ubuntu 16.04 及以上版本 & Debian:
```bash
sudo apt-get install -y gcc cmake build-essential git
```
### Ubuntu 14.04:
```bash
sudo apt-get install -y gcc cmake3 build-essential git binutils-2.26
export PATH=/usr/lib/binutils-2.26/bin:$PATH
```
编译或打包 JDBC 驱动源码,需安装 Java JDK 8 或以上版本和 Apache Maven 2.7 或以上版本。
安装 OpenJDK 8:
```bash
sudo apt-get install -y openjdk-8-jdk
```
安装 Apache Maven:
```bash
sudo apt-get install -y maven
```
### CentOS 7:
```bash
sudo yum install -y gcc gcc-c++ make cmake git
```
安装 OpenJDK 8:
```bash
sudo yum install -y java-1.8.0-openjdk
```
安装 Apache Maven:
```bash
sudo yum install -y maven
```
### CentOS 8 & Fedora:
```bash
sudo dnf install -y gcc gcc-c++ make cmake epel-release git
```
安装 OpenJDK 8:
```bash
sudo dnf install -y java-1.8.0-openjdk
```
安装 Apache Maven:
```bash
sudo dnf install -y maven
```
## 获取源码
首先,你需要从 GitHub 克隆源码:
```bash
git clone https://github.com/taosdata/TDengine.git
cd TDengine
```
Go 连接器和 Grafana 插件在其他独立仓库,如果安装它们的话,需要在 TDengine 目录下通过此命令安装:
```bash
git submodule update --init --recursive
```
## 生成 TDengine
### Linux 系统
```bash
mkdir debug && cd debug
cmake .. && cmake --build .
```
在X86-64、X86、arm64 和 arm32 平台上,TDengine 生成脚本可以自动检测机器架构。也可以手动配置 CPUTYPE 参数来指定 CPU 类型,如 aarch64 或 aarch32 等。
aarch64:
```bash
cmake .. -DCPUTYPE=aarch64 && cmake --build .
```
aarch32:
```bash
cmake .. -DCPUTYPE=aarch32 && cmake --build .
```
### Windows 系统
如果你使用的是 Visual Studio 2013 版本:
打开 cmd.exe,执行 vcvarsall.bat 时,为 64 位操作系统指定“x86_amd64”,为 32 位操作系统指定“x86”。
```bash
mkdir debug && cd debug
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" < x86_amd64 | x86 >
cmake .. -G "NMake Makefiles"
nmake
```
如果你使用的是 Visual Studio 2019 或 2017 版本:
打开cmd.exe,执行 vcvarsall.bat 时,为 64 位操作系统指定“x64”,为 32 位操作系统指定“x86”。
```bash
mkdir debug && cd debug
"c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" < x64 | x86 >
cmake .. -G "NMake Makefiles"
nmake
```
你也可以从开始菜单中找到"Visual Studio < 2019 | 2017 >"菜单项,根据你的系统选择"x64 Native Tools Command Prompt for VS < 2019 | 2017 >"或"x86 Native Tools Command Prompt for VS < 2019 | 2017 >",打开命令行窗口,执行:
```bash
mkdir debug && cd debug
cmake .. -G "NMake Makefiles"
nmake
```
### Mac OS X 系统
安装 Xcode 命令行工具和 cmake. 在 Catalina 和 Big Sur 操作系统上,需要安装 XCode 11.4+ 版本。
```bash
mkdir debug && cd debug
cmake .. && cmake --build .
```
# 安装
如果你不想安装,可以直接在shell中运行。生成完成后,安装 TDengine:
```bash
make install
```
用户可以在[文件目录结构](https://www.taosdata.com/cn/documentation/administrator#directories)中了解更多在操作系统中生成的目录或文件。
安装成功后,在终端中启动 TDengine 服务:
```bash
taosd
```
用户可以使用 TDengine Shell 来连接 TDengine 服务,在终端中,输入:
```bash
taos
```
如果 TDengine Shell 连接服务成功,将会打印出欢迎消息和版本信息。如果失败,则会打印出错误消息。
## 快速运行
TDengine 生成后,在终端执行以下命令:
```bash
./build/bin/taosd -c test/cfg
```
在另一个终端,使用 TDengine shell 连接服务器:
```bash
./build/bin/taos -c test/cfg
```
"-c test/cfg"指定系统配置文件所在目录。
# 体验 TDengine
在TDengine终端中,用户可以通过SQL命令来创建/删除数据库、表等,并进行插入查询操作。
```bash
create database demo;
use demo;
create table t (ts timestamp, speed int);
insert into t values ('2019-07-15 00:00:00', 10);
insert into t values ('2019-07-15 01:00:00', 20);
select * from t;
ts | speed |
===================================
19-07-15 00:00:00.000| 10|
19-07-15 01:00:00.000| 20|
Query OK, 2 row(s) in set (0.001700s)
```
# 应用开发
## 官方连接器
TDengine 提供了丰富的应用程序开发接口,其中包括C/C++、Java、Python、Go、Node.js、C# 、RESTful 等,便于用户快速开发应用:
- Java
- C/C++
- Python
- Go
- RESTful API
- Node.js
## 第三方连接器
TDengine 社区生态中也有一些非常友好的第三方连接器,可以通过以下链接访问它们的源码。
- [Rust Connector](https://github.com/taosdata/TDengine/tree/master/tests/examples/rust)
- [.Net Core Connector](https://github.com/maikebing/Maikebing.EntityFrameworkCore.Taos)
- [Lua Connector](https://github.com/taosdata/TDengine/tree/develop/tests/examples/lua)
# 运行和添加测试例
TDengine 的测试框架和所有测试例全部开源。
点击[这里](tests/How-To-Run-Test-And-How-To-Add-New-Test-Case.md),了解如何运行测试例和添加新的测试例。
# 成为社区贡献者
点击[这里](https://www.taosdata.com/cn/contributor/),了解如何成为 TDengine 的贡献者。
#加入技术交流群
TDengine官方社群「物联网大数据群」对外开放,欢迎您加入讨论。搜索微信号 "tdengine",加小T为好友,即可入群。
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
[![TDengine](TDenginelogo.png)](https://www.taosdata.com) [![TDengine](TDenginelogo.png)](https://www.taosdata.com)
English | [简体中文](./README-CN.md)
# What is TDengine? # What is TDengine?
TDengine is an open-sourced big data platform under [GNU AGPL v3.0](http://www.gnu.org/licenses/agpl-3.0.html), designed and optimized for the Internet of Things (IoT), Connected Cars, Industrial IoT, and IT Infrastructure and Application Monitoring. Besides the 10x faster time-series database, it provides caching, stream computing, message queuing and other functionalities to reduce the complexity and cost of development and operation. TDengine is an open-sourced big data platform under [GNU AGPL v3.0](http://www.gnu.org/licenses/agpl-3.0.html), designed and optimized for the Internet of Things (IoT), Connected Cars, Industrial IoT, and IT Infrastructure and Application Monitoring. Besides the 10x faster time-series database, it provides caching, stream computing, message queuing and other functionalities to reduce the complexity and cost of development and operation.
...@@ -160,24 +162,13 @@ mkdir debug && cd debug ...@@ -160,24 +162,13 @@ mkdir debug && cd debug
cmake .. && cmake --build . cmake .. && cmake --build .
``` ```
# Quick Run
# Quick Run
To quickly start a TDengine server after building, run the command below in terminal:
```bash
./build/bin/taosd -c test/cfg
```
In another terminal, use the TDengine shell to connect the server:
```bash
./build/bin/taos -c test/cfg
```
option "-c test/cfg" specifies the system configuration file directory.
# Installing # Installing
After building successfully, TDengine can be installed by: After building successfully, TDengine can be installed by:
```bash ```bash
sudo make install sudo make install
``` ```
Users can find more information about directories installed on the system in the [directory and files](https://www.taosdata.com/en/documentation/administrator/#Directory-and-Files) section. Since version 2.0, installing from source code will also configure service management for TDengine. Users can find more information about directories installed on the system in the [directory and files](https://www.taosdata.com/en/documentation/administrator/#Directory-and-Files) section. Since version 2.0, installing from source code will also configure service management for TDengine.
Users can also choose to [install from packages](https://www.taosdata.com/en/getting-started/#Install-from-Package) for it. Users can also choose to [install from packages](https://www.taosdata.com/en/getting-started/#Install-from-Package) for it.
...@@ -193,6 +184,20 @@ taos ...@@ -193,6 +184,20 @@ taos
If TDengine shell connects the server successfully, welcome messages and version info are printed. Otherwise, an error message is shown. If TDengine shell connects the server successfully, welcome messages and version info are printed. Otherwise, an error message is shown.
## Quick Run
If you don't want to run TDengine as a service, you can run it in current shell. For example, to quickly start a TDengine server after building, run the command below in terminal:
```bash
./build/bin/taosd -c test/cfg
```
In another terminal, use the TDengine shell to connect the server:
```bash
./build/bin/taos -c test/cfg
```
option "-c test/cfg" specifies the system configuration file directory.
# Try TDengine # Try TDengine
It is easy to run SQL commands from TDengine shell which is the same as other SQL databases. It is easy to run SQL commands from TDengine shell which is the same as other SQL databases.
```sql ```sql
......
...@@ -145,7 +145,7 @@ TDengine 建议用数据采集点的名字(如上表中的D1001)来做表名。 ...@@ -145,7 +145,7 @@ TDengine 建议用数据采集点的名字(如上表中的D1001)来做表名。
在TDengine的设计里,**表用来代表一个具体的数据采集点,超级表用来代表一组相同类型的数据采集点集合**。当为某个具体数据采集点创建表时,用户使用超级表的定义做模板,同时指定该具体采集点(表)的标签值。与传统的关系型数据库相比,表(一个数据采集点)是带有静态标签的,而且这些标签可以事后增加、删除、修改。**一张超级表包含有多张表,这些表具有相同的时序数据schema,但带有不同的标签值** 在TDengine的设计里,**表用来代表一个具体的数据采集点,超级表用来代表一组相同类型的数据采集点集合**。当为某个具体数据采集点创建表时,用户使用超级表的定义做模板,同时指定该具体采集点(表)的标签值。与传统的关系型数据库相比,表(一个数据采集点)是带有静态标签的,而且这些标签可以事后增加、删除、修改。**一张超级表包含有多张表,这些表具有相同的时序数据schema,但带有不同的标签值**
当对多个具有相同数据类型的数据采集点进行聚合操作时,TDengine将先把满足标签过滤条件的表从超级表的中查找出来,然后再扫描这些表的时序数据,进行聚合操作,这样能将需要扫描的数据集大幅减少,从而大幅提高聚合计算的性能。 当对多个具有相同数据类型的数据采集点进行聚合操作时,TDengine会先把满足标签过滤条件的表从超级表中找出来,然后再扫描这些表的时序数据,进行聚合操作,这样需要扫描的数据集会大幅减少,从而显著提高聚合计算的性能。
## <a class="anchor" id="cluster"></a>集群与基本逻辑单元 ## <a class="anchor" id="cluster"></a>集群与基本逻辑单元
......
...@@ -125,7 +125,7 @@ TDengine缺省的时间戳是毫秒精度,但通过修改配置参数enableMic ...@@ -125,7 +125,7 @@ TDengine缺省的时间戳是毫秒精度,但通过修改配置参数enableMic
```mysql ```mysql
ALTER DATABASE db_name CACHELAST 0; ALTER DATABASE db_name CACHELAST 0;
``` ```
CACHELAST 参数控制是否在内存中缓存数据子表的 last_row。缺省值为 0,取值范围 [0, 1]。其中 0 表示不启用、1 表示启用。(从 2.0.11 版本开始支持) CACHELAST 参数控制是否在内存中缓存数据子表的 last_row。缺省值为 0,取值范围 [0, 1]。其中 0 表示不启用、1 表示启用。(从 2.0.11 版本开始支持,修改后需要重启服务器生效。
**Tips**: 以上所有参数修改后都可以用show databases来确认是否修改成功。 **Tips**: 以上所有参数修改后都可以用show databases来确认是否修改成功。
......
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
## 1. TDengine2.0之前的版本升级到2.0及以上的版本应该注意什么?☆☆☆ ## 1. TDengine2.0之前的版本升级到2.0及以上的版本应该注意什么?☆☆☆
2.0版在之前版本的基础上,进行了完全的重构,配置文件和数据文件是不兼容的。在升级之前务必进行如下操作: 2.0版在之前版本的基础上,进行了完全的重构,配置文件和数据文件是不兼容的。在升级之前务必进行如下操作:
1. 删除配置文件,执行 <code> sudo rm -rf /etc/taos/taos.cfg </code> 1. 删除配置文件,执行 `sudo rm -rf /etc/taos/taos.cfg`
2. 删除日志文件,执行 <code> sudo rm -rf /var/log/taos/ </code> 2. 删除日志文件,执行 `sudo rm -rf /var/log/taos/`
3. 确保数据已经不再需要的前提下,删除数据文件,执行 <code> sudo rm -rf /var/lib/taos/ </code> 3. 确保数据已经不再需要的前提下,删除数据文件,执行 `sudo rm -rf /var/lib/taos/`
4. 安装最新稳定版本的TDengine 4. 安装最新稳定版本的 TDengine
5. 如果数据需要迁移数据或者数据文件损坏,请联系涛思数据官方技术支持团队,进行协助解决 5. 如果需要迁移数据或者数据文件损坏,请联系涛思数据官方技术支持团队,进行协助解决
## 2. Windows平台下JDBCDriver找不到动态链接库,怎么办? ## 2. Windows平台下JDBCDriver找不到动态链接库,怎么办?
......
...@@ -213,10 +213,10 @@ fi ...@@ -213,10 +213,10 @@ fi
if echo $osinfo | grep -qwi "ubuntu" ; then if echo $osinfo | grep -qwi "ubuntu" ; then
# echo "this is ubuntu system" # echo "this is ubuntu system"
${csudo} rm -f /var/lib/dpkg/info/tdengine* || : ${csudo} dpkg --force-all -P tdengine || :
elif echo $osinfo | grep -qwi "debian" ; then elif echo $osinfo | grep -qwi "debian" ; then
# echo "this is debian system" # echo "this is debian system"
${csudo} rm -f /var/lib/dpkg/info/tdengine* || : ${csudo} dpkg --force-all -P tdengine || :
elif echo $osinfo | grep -qwi "centos" ; then elif echo $osinfo | grep -qwi "centos" ; then
# echo "this is centos system" # echo "this is centos system"
${csudo} rpm -e --noscripts tdengine || : ${csudo} rpm -e --noscripts tdengine || :
......
...@@ -425,7 +425,7 @@ static bool bnMonitorVgroups() { ...@@ -425,7 +425,7 @@ static bool bnMonitorVgroups() {
while (1) { while (1) {
pIter = mnodeGetNextVgroup(pIter, &pVgroup); pIter = mnodeGetNextVgroup(pIter, &pVgroup);
if (pVgroup == NULL) break; if (pVgroup == NULL || pVgroup->pDb == NULL) break;
int32_t dbReplica = pVgroup->pDb->cfg.replications; int32_t dbReplica = pVgroup->pDb->cfg.replications;
int32_t vgReplica = pVgroup->numOfVnodes; int32_t vgReplica = pVgroup->numOfVnodes;
......
...@@ -281,7 +281,7 @@ void tscQueueAsyncError(void(*fp), void *param, int32_t code) { ...@@ -281,7 +281,7 @@ void tscQueueAsyncError(void(*fp), void *param, int32_t code) {
} }
static void tscAsyncResultCallback(SSchedMsg *pMsg) { static void tscAsyncResultCallback(SSchedMsg *pMsg) {
SSqlObj* pSql = pMsg->ahandle; SSqlObj* pSql = (SSqlObj*)taosAcquireRef(tscObjRef, (int64_t)pMsg->ahandle);
if (pSql == NULL || pSql->signature != pSql) { if (pSql == NULL || pSql->signature != pSql) {
tscDebug("%p SqlObj is freed, not add into queue async res", pSql); tscDebug("%p SqlObj is freed, not add into queue async res", pSql);
return; return;
...@@ -292,23 +292,26 @@ static void tscAsyncResultCallback(SSchedMsg *pMsg) { ...@@ -292,23 +292,26 @@ static void tscAsyncResultCallback(SSchedMsg *pMsg) {
SSqlRes *pRes = &pSql->res; SSqlRes *pRes = &pSql->res;
if (pSql->fp == NULL || pSql->fetchFp == NULL){ if (pSql->fp == NULL || pSql->fetchFp == NULL){
taosReleaseRef(tscObjRef, pSql->self);
return; return;
} }
pSql->fp = pSql->fetchFp; pSql->fp = pSql->fetchFp;
(*pSql->fp)(pSql->param, pSql, pRes->code); (*pSql->fp)(pSql->param, pSql, pRes->code);
taosReleaseRef(tscObjRef, pSql->self);
} }
void tscAsyncResultOnError(SSqlObj* pSql) { void tscAsyncResultOnError(SSqlObj* pSql) {
SSchedMsg schedMsg = {0}; SSchedMsg schedMsg = {0};
schedMsg.fp = tscAsyncResultCallback; schedMsg.fp = tscAsyncResultCallback;
schedMsg.ahandle = pSql; schedMsg.ahandle = (void *)pSql->self;
schedMsg.thandle = (void *)1; schedMsg.thandle = (void *)1;
schedMsg.msg = 0; schedMsg.msg = 0;
taosScheduleTask(tscQhandle, &schedMsg); taosScheduleTask(tscQhandle, &schedMsg);
} }
int tscSendMsgToServer(SSqlObj *pSql); int tscSendMsgToServer(SSqlObj *pSql);
void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) { void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
......
...@@ -2223,7 +2223,7 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col ...@@ -2223,7 +2223,7 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col
bool multiColOutput = taosArrayGetSize(pItem->pNode->pParam) > 1; bool multiColOutput = taosArrayGetSize(pItem->pNode->pParam) > 1;
setResultColName(name, pItem, cvtFunc.originFuncId, &pParamElem->pNode->colInfo, multiColOutput); setResultColName(name, pItem, cvtFunc.originFuncId, &pParamElem->pNode->colInfo, multiColOutput);
if (setExprInfoForFunctions(pCmd, pQueryInfo, pSchema, cvtFunc, name, colIndex + i, &index, finalResult) != 0) { if (setExprInfoForFunctions(pCmd, pQueryInfo, pSchema, cvtFunc, name, colIndex++, &index, finalResult) != 0) {
return TSDB_CODE_TSC_INVALID_SQL; return TSDB_CODE_TSC_INVALID_SQL;
} }
} }
...@@ -3092,18 +3092,26 @@ static int32_t doExtractColumnFilterInfo(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, ...@@ -3092,18 +3092,26 @@ static int32_t doExtractColumnFilterInfo(SSqlCmd* pCmd, SQueryInfo* pQueryInfo,
} }
int32_t retVal = TSDB_CODE_SUCCESS; int32_t retVal = TSDB_CODE_SUCCESS;
int32_t bufLen = 0;
if (IS_NUMERIC_TYPE(pRight->value.nType)) {
bufLen = 60;
} else {
bufLen = pRight->value.nLen + 1;
}
if (pExpr->tokenId == TK_LE || pExpr->tokenId == TK_LT) { if (pExpr->tokenId == TK_LE || pExpr->tokenId == TK_LT) {
retVal = tVariantDump(&pRight->value, (char*)&pColumnFilter->upperBndd, colType, false); retVal = tVariantDump(&pRight->value, (char*)&pColumnFilter->upperBndd, colType, false);
// TK_GT,TK_GE,TK_EQ,TK_NE are based on the pColumn->lowerBndd // TK_GT,TK_GE,TK_EQ,TK_NE are based on the pColumn->lowerBndd
} else if (colType == TSDB_DATA_TYPE_BINARY) { } else if (colType == TSDB_DATA_TYPE_BINARY) {
pColumnFilter->pz = (int64_t)calloc(1, pRight->value.nLen + TSDB_NCHAR_SIZE); pColumnFilter->pz = (int64_t)calloc(1, bufLen * TSDB_NCHAR_SIZE);
pColumnFilter->len = pRight->value.nLen; pColumnFilter->len = pRight->value.nLen;
retVal = tVariantDump(&pRight->value, (char*)pColumnFilter->pz, colType, false); retVal = tVariantDump(&pRight->value, (char*)pColumnFilter->pz, colType, false);
} else if (colType == TSDB_DATA_TYPE_NCHAR) { } else if (colType == TSDB_DATA_TYPE_NCHAR) {
// pRight->value.nLen + 1 is larger than the actual nchar string length // pRight->value.nLen + 1 is larger than the actual nchar string length
pColumnFilter->pz = (int64_t)calloc(1, (pRight->value.nLen + 1) * TSDB_NCHAR_SIZE); pColumnFilter->pz = (int64_t)calloc(1, bufLen * TSDB_NCHAR_SIZE);
retVal = tVariantDump(&pRight->value, (char*)pColumnFilter->pz, colType, false); retVal = tVariantDump(&pRight->value, (char*)pColumnFilter->pz, colType, false);
size_t len = twcslen((wchar_t*)pColumnFilter->pz); size_t len = twcslen((wchar_t*)pColumnFilter->pz);
pColumnFilter->len = len * TSDB_NCHAR_SIZE; pColumnFilter->len = len * TSDB_NCHAR_SIZE;
...@@ -4138,13 +4146,21 @@ static int32_t validateTagCondExpr(SSqlCmd* pCmd, tExprNode *p) { ...@@ -4138,13 +4146,21 @@ static int32_t validateTagCondExpr(SSqlCmd* pCmd, tExprNode *p) {
} }
int32_t retVal = TSDB_CODE_SUCCESS; int32_t retVal = TSDB_CODE_SUCCESS;
int32_t bufLen = 0;
if (IS_NUMERIC_TYPE(vVariant->nType)) {
bufLen = 60; // The maximum length of string that a number is converted to.
} else {
bufLen = vVariant->nLen + 1;
}
if (schemaType == TSDB_DATA_TYPE_BINARY) { if (schemaType == TSDB_DATA_TYPE_BINARY) {
char *tmp = calloc(1, vVariant->nLen + TSDB_NCHAR_SIZE); char *tmp = calloc(1, bufLen * TSDB_NCHAR_SIZE);
retVal = tVariantDump(vVariant, tmp, schemaType, false); retVal = tVariantDump(vVariant, tmp, schemaType, false);
free(tmp); free(tmp);
} else if (schemaType == TSDB_DATA_TYPE_NCHAR) { } else if (schemaType == TSDB_DATA_TYPE_NCHAR) {
// pRight->value.nLen + 1 is larger than the actual nchar string length // pRight->value.nLen + 1 is larger than the actual nchar string length
char *tmp = calloc(1, (vVariant->nLen + 1) * TSDB_NCHAR_SIZE); char *tmp = calloc(1, bufLen * TSDB_NCHAR_SIZE);
retVal = tVariantDump(vVariant, tmp, schemaType, false); retVal = tVariantDump(vVariant, tmp, schemaType, false);
free(tmp); free(tmp);
} else { } else {
...@@ -4155,7 +4171,7 @@ static int32_t validateTagCondExpr(SSqlCmd* pCmd, tExprNode *p) { ...@@ -4155,7 +4171,7 @@ static int32_t validateTagCondExpr(SSqlCmd* pCmd, tExprNode *p) {
if (retVal != TSDB_CODE_SUCCESS) { if (retVal != TSDB_CODE_SUCCESS) {
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2); return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2);
} }
}while (0); } while (0);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
......
...@@ -136,7 +136,8 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet { ...@@ -136,7 +136,8 @@ public class RestfulResultSet extends AbstractResultSet implements ResultSet {
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_PARAMETER_INDEX_OUT_RANGE, "Column Index out of range, " + columnIndex + " > " + resultSet.get(pos).size()); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_PARAMETER_INDEX_OUT_RANGE, "Column Index out of range, " + columnIndex + " > " + resultSet.get(pos).size());
columnIndex = getTrueColumnIndex(columnIndex); columnIndex = getTrueColumnIndex(columnIndex);
return resultSet.get(pos).get(columnIndex).toString(); Object value = resultSet.get(pos).get(columnIndex);
return value == null ? null : value.toString();
} }
@Override @Override
......
...@@ -22,7 +22,7 @@ extern "C" { ...@@ -22,7 +22,7 @@ extern "C" {
int32_t tpInit(); int32_t tpInit();
void tpCleanUp(); void tpCleanUp();
void tpUpdateTs(int32_t *seq, void *pMsg); void tpUpdateTs(int32_t vgId, int64_t *seq, void *pMsg);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#include "tdataformat.h" #include "tdataformat.h"
#include "tname.h" #include "tname.h"
#include "hash.h" #include "hash.h"
#include "tlockfree.h"
#include "tlist.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
...@@ -172,10 +174,32 @@ typedef struct STsdbQueryCond { ...@@ -172,10 +174,32 @@ typedef struct STsdbQueryCond {
int32_t type; // data block load type: int32_t type; // data block load type:
} STsdbQueryCond; } STsdbQueryCond;
typedef struct STableData STableData;
typedef struct {
T_REF_DECLARE()
SRWLatch latch;
TSKEY keyFirst;
TSKEY keyLast;
int64_t numOfRows;
int32_t maxTables;
STableData **tData;
SList * actList;
SList * extraBuffList;
SList * bufBlockList;
int64_t pointsAdd; // TODO
int64_t storageAdd; // TODO
} SMemTable;
typedef struct {
SMemTable* mem;
SMemTable* imem;
SMemTable mtable;
SMemTable* omem;
} SMemSnapshot;
typedef struct SMemRef { typedef struct SMemRef {
int32_t ref; int32_t ref;
void * mem; SMemSnapshot snapshot;
void * imem;
} SMemRef; } SMemRef;
typedef struct SDataBlockInfo { typedef struct SDataBlockInfo {
......
...@@ -197,13 +197,11 @@ ...@@ -197,13 +197,11 @@
#define TK_PREV 178 #define TK_PREV 178
#define TK_LINEAR 179 #define TK_LINEAR 179
#define TK_IMPORT 180 #define TK_IMPORT 180
#define TK_METRIC 181 #define TK_TBNAME 181
#define TK_TBNAME 182 #define TK_JOIN 182
#define TK_JOIN 183 #define TK_INSERT 183
#define TK_METRICS 184 #define TK_INTO 184
#define TK_INSERT 185 #define TK_VALUES 185
#define TK_INTO 186
#define TK_VALUES 187
#define TK_SPACE 300 #define TK_SPACE 300
......
{
"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": 1000,
"num_of_records_per_req": 100,
"max_sql_len": 1024000,
"databases": [{
"dbinfo": {
"name": "db",
"drop": "yes",
"replica": 1,
"days": 10,
"cache": 16,
"blocks": 8,
"precision": "ms",
"keep": 365,
"minRows": 100,
"maxRows": 4096,
"comp":2,
"walLevel":1,
"cachelast":0,
"quorum":1,
"fsync":3000,
"update": 0
},
"super_tables": [{
"name": "stb",
"child_table_exists":"no",
"childtable_count": 100,
"childtable_prefix": "stb_",
"auto_create_table": "no",
"data_source": "rand",
"insert_mode": "taosc",
"insert_rows": 1000,
"multi_thread_write_one_tbl": "no",
"rows_per_tbl": 20,
"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":1}]
}]
}]
}
...@@ -60,9 +60,12 @@ extern char configDir[]; ...@@ -60,9 +60,12 @@ extern char configDir[];
#define QUERY_JSON_NAME "query.json" #define QUERY_JSON_NAME "query.json"
#define SUBSCRIBE_JSON_NAME "subscribe.json" #define SUBSCRIBE_JSON_NAME "subscribe.json"
#define INSERT_MODE 0 enum TEST_MODE {
#define QUERY_MODE 1 INSERT_TEST, // 0
#define SUBSCRIBE_MODE 2 QUERY_TEST, // 1
SUBSCRIBE_TEST, // 2
INVAID_TEST
};
#define MAX_SQL_SIZE 65536 #define MAX_SQL_SIZE 65536
#define BUFFER_SIZE (65536*2) #define BUFFER_SIZE (65536*2)
...@@ -98,8 +101,8 @@ typedef enum CREATE_SUB_TALBE_MOD_EN { ...@@ -98,8 +101,8 @@ typedef enum CREATE_SUB_TALBE_MOD_EN {
} CREATE_SUB_TALBE_MOD_EN; } CREATE_SUB_TALBE_MOD_EN;
typedef enum TALBE_EXISTS_EN { typedef enum TALBE_EXISTS_EN {
TBL_ALREADY_EXISTS,
TBL_NO_EXISTS, TBL_NO_EXISTS,
TBL_ALREADY_EXISTS,
TBL_EXISTS_BUTT TBL_EXISTS_BUTT
} TALBE_EXISTS_EN; } TALBE_EXISTS_EN;
...@@ -109,6 +112,12 @@ enum MODE { ...@@ -109,6 +112,12 @@ enum MODE {
MODE_BUT MODE_BUT
}; };
typedef enum enum_INSERT_MODE {
PROGRESSIVE_INSERT_MODE,
INTERLACE_INSERT_MODE,
INVALID_INSERT_MODE
} INSERT_MODE;
enum QUERY_TYPE { enum QUERY_TYPE {
NO_INSERT_TYPE, NO_INSERT_TYPE,
INSERT_TYPE, INSERT_TYPE,
...@@ -149,6 +158,7 @@ enum _show_stables_index { ...@@ -149,6 +158,7 @@ enum _show_stables_index {
TSDB_SHOW_STABLES_VGID_INDEX, TSDB_SHOW_STABLES_VGID_INDEX,
TSDB_MAX_SHOW_STABLES TSDB_MAX_SHOW_STABLES
}; };
enum _describe_table_index { enum _describe_table_index {
TSDB_DESCRIBE_METRIC_FIELD_INDEX, TSDB_DESCRIBE_METRIC_FIELD_INDEX,
TSDB_DESCRIBE_METRIC_TYPE_INDEX, TSDB_DESCRIBE_METRIC_TYPE_INDEX,
...@@ -188,6 +198,7 @@ typedef struct SArguments_S { ...@@ -188,6 +198,7 @@ typedef struct SArguments_S {
int num_of_CPR; int num_of_CPR;
int num_of_threads; int num_of_threads;
int insert_interval; int insert_interval;
int rows_per_tbl;
int num_of_RPR; int num_of_RPR;
int max_sql_len; int max_sql_len;
int num_of_tables; int num_of_tables;
...@@ -197,6 +208,8 @@ typedef struct SArguments_S { ...@@ -197,6 +208,8 @@ typedef struct SArguments_S {
int disorderRange; int disorderRange;
int method_of_delete; int method_of_delete;
char ** arg_list; char ** arg_list;
int64_t totalInsertRows;
int64_t totalAffectedRows;
} SArguments; } SArguments;
typedef struct SColumn_S { typedef struct SColumn_S {
...@@ -379,8 +392,9 @@ typedef struct SThreadInfo_S { ...@@ -379,8 +392,9 @@ typedef struct SThreadInfo_S {
char db_name[MAX_DB_NAME_SIZE+1]; char db_name[MAX_DB_NAME_SIZE+1];
char fp[4096]; char fp[4096];
char tb_prefix[MAX_TB_NAME_SIZE]; char tb_prefix[MAX_TB_NAME_SIZE];
int start_table_id; int start_table_from;
int end_table_id; int end_table_to;
int ntables;
int data_of_rate; int data_of_rate;
uint64_t start_time; uint64_t start_time;
char* cols; char* cols;
...@@ -531,6 +545,7 @@ SArguments g_args = { ...@@ -531,6 +545,7 @@ SArguments g_args = {
10, // num_of_CPR 10, // num_of_CPR
10, // num_of_connections/thread 10, // num_of_connections/thread
0, // insert_interval 0, // insert_interval
0, // rows_per_tbl;
100, // num_of_RPR 100, // num_of_RPR
TSDB_PAYLOAD_SIZE, // max_sql_len TSDB_PAYLOAD_SIZE, // max_sql_len
10000, // num_of_tables 10000, // num_of_tables
...@@ -552,11 +567,19 @@ static FILE * g_fpOfInsertResult = NULL; ...@@ -552,11 +567,19 @@ static FILE * g_fpOfInsertResult = NULL;
#define debugPrint(fmt, ...) \ #define debugPrint(fmt, ...) \
do { if (g_args.debug_print || g_args.verbose_print) \ do { if (g_args.debug_print || g_args.verbose_print) \
fprintf(stderr, "DEBG: "fmt, __VA_ARGS__); } while(0) fprintf(stderr, "DEBG: "fmt, __VA_ARGS__); } while(0)
#define verbosePrint(fmt, ...) \ #define verbosePrint(fmt, ...) \
do { if (g_args.verbose_print) fprintf(stderr, "VERB: "fmt, __VA_ARGS__); } while(0) do { if (g_args.verbose_print) \
fprintf(stderr, "VERB: "fmt, __VA_ARGS__); } while(0)
#define errorPrint(fmt, ...) \
do { fprintf(stderr, "ERROR: "fmt, __VA_ARGS__); } while(0)
/////////////////////////////////////////////////// ///////////////////////////////////////////////////
static void ERROR_EXIT(const char *msg) { perror(msg); exit(-1); }
void printHelp() { void printHelp() {
char indent[10] = " "; char indent[10] = " ";
printf("%s%s%s%s\n", indent, "-f", indent, printf("%s%s%s%s\n", indent, "-f", indent,
...@@ -629,7 +652,7 @@ void parse_args(int argc, char *argv[], SArguments *arguments) { ...@@ -629,7 +652,7 @@ void parse_args(int argc, char *argv[], SArguments *arguments) {
} else if (strcmp(argv[i], "-c") == 0) { } else if (strcmp(argv[i], "-c") == 0) {
char *configPath = argv[++i]; char *configPath = argv[++i];
if (wordexp(configPath, &full_path, 0) != 0) { if (wordexp(configPath, &full_path, 0) != 0) {
fprintf(stderr, "Invalid path %s\n", configPath); errorPrint( "Invalid path %s\n", configPath);
return; return;
} }
taos_options(TSDB_OPTION_CONFIGDIR, full_path.we_wordv[0]); taos_options(TSDB_OPTION_CONFIGDIR, full_path.we_wordv[0]);
...@@ -652,6 +675,8 @@ void parse_args(int argc, char *argv[], SArguments *arguments) { ...@@ -652,6 +675,8 @@ void parse_args(int argc, char *argv[], SArguments *arguments) {
arguments->num_of_threads = atoi(argv[++i]); arguments->num_of_threads = atoi(argv[++i]);
} else if (strcmp(argv[i], "-i") == 0) { } else if (strcmp(argv[i], "-i") == 0) {
arguments->insert_interval = atoi(argv[++i]); arguments->insert_interval = atoi(argv[++i]);
} else if (strcmp(argv[i], "-B") == 0) {
arguments->rows_per_tbl = atoi(argv[++i]);
} else if (strcmp(argv[i], "-r") == 0) { } else if (strcmp(argv[i], "-r") == 0) {
arguments->num_of_RPR = atoi(argv[++i]); arguments->num_of_RPR = atoi(argv[++i]);
} else if (strcmp(argv[i], "-t") == 0) { } else if (strcmp(argv[i], "-t") == 0) {
...@@ -676,8 +701,8 @@ void parse_args(int argc, char *argv[], SArguments *arguments) { ...@@ -676,8 +701,8 @@ void parse_args(int argc, char *argv[], SArguments *arguments) {
&& strcasecmp(argv[i], "DOUBLE") && strcasecmp(argv[i], "DOUBLE")
&& strcasecmp(argv[i], "BINARY") && strcasecmp(argv[i], "BINARY")
&& strcasecmp(argv[i], "NCHAR")) { && strcasecmp(argv[i], "NCHAR")) {
fprintf(stderr, "Invalid data_type!\n");
printHelp(); printHelp();
ERROR_EXIT( "Invalid data_type!\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
sptr[0] = argv[i]; sptr[0] = argv[i];
...@@ -697,8 +722,8 @@ void parse_args(int argc, char *argv[], SArguments *arguments) { ...@@ -697,8 +722,8 @@ void parse_args(int argc, char *argv[], SArguments *arguments) {
&& strcasecmp(token, "DOUBLE") && strcasecmp(token, "DOUBLE")
&& strcasecmp(token, "BINARY") && strcasecmp(token, "BINARY")
&& strcasecmp(token, "NCHAR")) { && strcasecmp(token, "NCHAR")) {
fprintf(stderr, "Invalid data_type!\n");
printHelp(); printHelp();
ERROR_EXIT("Invalid data_type!\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
sptr[index++] = token; sptr[index++] = token;
...@@ -753,8 +778,8 @@ void parse_args(int argc, char *argv[], SArguments *arguments) { ...@@ -753,8 +778,8 @@ void parse_args(int argc, char *argv[], SArguments *arguments) {
printHelp(); printHelp();
exit(0); exit(0);
} else { } else {
fprintf(stderr, "wrong options\n");
printHelp(); printHelp();
ERROR_EXIT("ERROR: wrong options\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} }
...@@ -840,7 +865,7 @@ static int queryDbExec(TAOS *taos, char *command, int type) { ...@@ -840,7 +865,7 @@ static int queryDbExec(TAOS *taos, char *command, int type) {
if (code != 0) { if (code != 0) {
debugPrint("%s() LN%d - command: %s\n", __func__, __LINE__, command); debugPrint("%s() LN%d - command: %s\n", __func__, __LINE__, command);
fprintf(stderr, "Failed to run %s, reason: %s\n", command, taos_errstr(res)); errorPrint( "Failed to run %s, reason: %s\n", command, taos_errstr(res));
taos_free_result(res); taos_free_result(res);
//taos_close(taos); //taos_close(taos);
return -1; return -1;
...@@ -866,13 +891,13 @@ static void getResult(TAOS_RES *res, char* resultFileName) { ...@@ -866,13 +891,13 @@ static void getResult(TAOS_RES *res, char* resultFileName) {
if (resultFileName[0] != 0) { if (resultFileName[0] != 0) {
fp = fopen(resultFileName, "at"); fp = fopen(resultFileName, "at");
if (fp == NULL) { if (fp == NULL) {
fprintf(stderr, "failed to open result file: %s, result will not save to file\n", resultFileName); errorPrint("%s() LN%d, failed to open result file: %s, result will not save to file\n", __func__, __LINE__, resultFileName);
} }
} }
char* databuf = (char*) calloc(1, 100*1024*1024); char* databuf = (char*) calloc(1, 100*1024*1024);
if (databuf == NULL) { if (databuf == NULL) {
fprintf(stderr, "failed to malloc, warning: save result to file slowly!\n"); errorPrint("%s() LN%d, failed to malloc, warning: save result to file slowly!\n", __func__, __LINE__);
if (fp) if (fp)
fclose(fp); fclose(fp);
return ; return ;
...@@ -972,7 +997,7 @@ void rand_string(char *str, int size) { ...@@ -972,7 +997,7 @@ void rand_string(char *str, int size) {
if (size > 0) { if (size > 0) {
//--size; //--size;
int n; int n;
for (n = 0; n < size; n++) { for (n = 0; n < size - 1; n++) {
int key = rand_tinyint() % (int)(sizeof(charset) - 1); int key = rand_tinyint() % (int)(sizeof(charset) - 1);
str[n] = charset[key]; str[n] = charset[key];
} }
...@@ -1299,19 +1324,30 @@ static void printfInsertMetaToFile(FILE* fp) { ...@@ -1299,19 +1324,30 @@ static void printfInsertMetaToFile(FILE* fp) {
fprintf(fp, " columnCount: %d\n ", g_Dbs.db[i].superTbls[j].columnCount); fprintf(fp, " columnCount: %d\n ", g_Dbs.db[i].superTbls[j].columnCount);
for (int k = 0; k < g_Dbs.db[i].superTbls[j].columnCount; k++) { for (int k = 0; k < g_Dbs.db[i].superTbls[j].columnCount; k++) {
//printf("dataType:%s, dataLen:%d\t", g_Dbs.db[i].superTbls[j].columns[k].dataType, g_Dbs.db[i].superTbls[j].columns[k].dataLen); //printf("dataType:%s, dataLen:%d\t", g_Dbs.db[i].superTbls[j].columns[k].dataType, g_Dbs.db[i].superTbls[j].columns[k].dataLen);
if ((0 == strncasecmp(g_Dbs.db[i].superTbls[j].columns[k].dataType, "binary", 6)) || (0 == strncasecmp(g_Dbs.db[i].superTbls[j].columns[k].dataType, "nchar", 5))) { if ((0 == strncasecmp(
fprintf(fp, "column[%d]:%s(%d) ", k, g_Dbs.db[i].superTbls[j].columns[k].dataType, g_Dbs.db[i].superTbls[j].columns[k].dataLen); g_Dbs.db[i].superTbls[j].columns[k].dataType,
"binary", strlen("binary")))
|| (0 == strncasecmp(g_Dbs.db[i].superTbls[j].columns[k].dataType,
"nchar", strlen("nchar")))) {
fprintf(fp, "column[%d]:%s(%d) ", k,
g_Dbs.db[i].superTbls[j].columns[k].dataType,
g_Dbs.db[i].superTbls[j].columns[k].dataLen);
} else { } else {
fprintf(fp, "column[%d]:%s ", k, g_Dbs.db[i].superTbls[j].columns[k].dataType); fprintf(fp, "column[%d]:%s ", k, g_Dbs.db[i].superTbls[j].columns[k].dataType);
} }
} }
fprintf(fp, "\n"); fprintf(fp, "\n");
fprintf(fp, " tagCount: %d\n ", g_Dbs.db[i].superTbls[j].tagCount); fprintf(fp, " tagCount: %d\n ",
g_Dbs.db[i].superTbls[j].tagCount);
for (int k = 0; k < g_Dbs.db[i].superTbls[j].tagCount; k++) { for (int k = 0; k < g_Dbs.db[i].superTbls[j].tagCount; k++) {
//printf("dataType:%s, dataLen:%d\t", g_Dbs.db[i].superTbls[j].tags[k].dataType, g_Dbs.db[i].superTbls[j].tags[k].dataLen); //printf("dataType:%s, dataLen:%d\t", g_Dbs.db[i].superTbls[j].tags[k].dataType, g_Dbs.db[i].superTbls[j].tags[k].dataLen);
if ((0 == strncasecmp(g_Dbs.db[i].superTbls[j].tags[k].dataType, "binary", 6)) || (0 == strncasecmp(g_Dbs.db[i].superTbls[j].tags[k].dataType, "nchar", 5))) { if ((0 == strncasecmp(g_Dbs.db[i].superTbls[j].tags[k].dataType,
fprintf(fp, "tag[%d]:%s(%d) ", k, g_Dbs.db[i].superTbls[j].tags[k].dataType, g_Dbs.db[i].superTbls[j].tags[k].dataLen); "binary", strlen("binary")))
|| (0 == strncasecmp(g_Dbs.db[i].superTbls[j].tags[k].dataType,
"nchar", strlen("nchar")))) {
fprintf(fp, "tag[%d]:%s(%d) ", k, g_Dbs.db[i].superTbls[j].tags[k].dataType,
g_Dbs.db[i].superTbls[j].tags[k].dataLen);
} else { } else {
fprintf(fp, "tag[%d]:%s ", k, g_Dbs.db[i].superTbls[j].tags[k].dataType); fprintf(fp, "tag[%d]:%s ", k, g_Dbs.db[i].superTbls[j].tags[k].dataType);
} }
...@@ -1325,7 +1361,8 @@ static void printfInsertMetaToFile(FILE* fp) { ...@@ -1325,7 +1361,8 @@ static void printfInsertMetaToFile(FILE* fp) {
static void printfQueryMeta() { static void printfQueryMeta() {
SHOW_PARSE_RESULT_START(); SHOW_PARSE_RESULT_START();
printf("host: \033[33m%s:%u\033[0m\n", g_queryInfo.host, g_queryInfo.port); printf("host: \033[33m%s:%u\033[0m\n",
g_queryInfo.host, g_queryInfo.port);
printf("user: \033[33m%s\033[0m\n", g_queryInfo.user); printf("user: \033[33m%s\033[0m\n", g_queryInfo.user);
printf("password: \033[33m%s\033[0m\n", g_queryInfo.password); printf("password: \033[33m%s\033[0m\n", g_queryInfo.password);
printf("database name: \033[33m%s\033[0m\n", g_queryInfo.dbName); printf("database name: \033[33m%s\033[0m\n", g_queryInfo.dbName);
...@@ -1336,7 +1373,7 @@ static void printfQueryMeta() { ...@@ -1336,7 +1373,7 @@ static void printfQueryMeta() {
printf("concurrent: \033[33m%d\033[0m\n", g_queryInfo.superQueryInfo.concurrent); printf("concurrent: \033[33m%d\033[0m\n", g_queryInfo.superQueryInfo.concurrent);
printf("sqlCount: \033[33m%d\033[0m\n", g_queryInfo.superQueryInfo.sqlCount); printf("sqlCount: \033[33m%d\033[0m\n", g_queryInfo.superQueryInfo.sqlCount);
if (SUBSCRIBE_MODE == g_args.test_mode) { if (SUBSCRIBE_TEST == g_args.test_mode) {
printf("mod: \033[33m%d\033[0m\n", g_queryInfo.superQueryInfo.subscribeMode); printf("mod: \033[33m%d\033[0m\n", g_queryInfo.superQueryInfo.subscribeMode);
printf("interval: \033[33m%d\033[0m\n", g_queryInfo.superQueryInfo.subscribeInterval); printf("interval: \033[33m%d\033[0m\n", g_queryInfo.superQueryInfo.subscribeInterval);
printf("restart: \033[33m%d\033[0m\n", g_queryInfo.superQueryInfo.subscribeRestart); printf("restart: \033[33m%d\033[0m\n", g_queryInfo.superQueryInfo.subscribeRestart);
...@@ -1353,7 +1390,7 @@ static void printfQueryMeta() { ...@@ -1353,7 +1390,7 @@ static void printfQueryMeta() {
printf("childTblCount: \033[33m%d\033[0m\n", g_queryInfo.subQueryInfo.childTblCount); printf("childTblCount: \033[33m%d\033[0m\n", g_queryInfo.subQueryInfo.childTblCount);
printf("stable name: \033[33m%s\033[0m\n", g_queryInfo.subQueryInfo.sTblName); printf("stable name: \033[33m%s\033[0m\n", g_queryInfo.subQueryInfo.sTblName);
if (SUBSCRIBE_MODE == g_args.test_mode) { if (SUBSCRIBE_TEST == g_args.test_mode) {
printf("mod: \033[33m%d\033[0m\n", g_queryInfo.subQueryInfo.subscribeMode); printf("mod: \033[33m%d\033[0m\n", g_queryInfo.subQueryInfo.subscribeMode);
printf("interval: \033[33m%d\033[0m\n", g_queryInfo.subQueryInfo.subscribeInterval); printf("interval: \033[33m%d\033[0m\n", g_queryInfo.subQueryInfo.subscribeInterval);
printf("restart: \033[33m%d\033[0m\n", g_queryInfo.subQueryInfo.subscribeRestart); printf("restart: \033[33m%d\033[0m\n", g_queryInfo.subQueryInfo.subscribeRestart);
...@@ -1454,7 +1491,7 @@ static int xDumpResultToFile(const char* fname, TAOS_RES* tres) { ...@@ -1454,7 +1491,7 @@ static int xDumpResultToFile(const char* fname, TAOS_RES* tres) {
FILE* fp = fopen(fname, "at"); FILE* fp = fopen(fname, "at");
if (fp == NULL) { if (fp == NULL) {
fprintf(stderr, "ERROR: failed to open file: %s\n", fname); errorPrint("%s() LN%d, failed to open file: %s\n", __func__, __LINE__, fname);
return -1; return -1;
} }
...@@ -1499,7 +1536,7 @@ static int getDbFromServer(TAOS * taos, SDbInfo** dbInfos) { ...@@ -1499,7 +1536,7 @@ static int getDbFromServer(TAOS * taos, SDbInfo** dbInfos) {
int32_t code = taos_errno(res); int32_t code = taos_errno(res);
if (code != 0) { if (code != 0) {
fprintf(stderr, "failed to run <show databases>, reason: %s\n", taos_errstr(res)); errorPrint( "failed to run <show databases>, reason: %s\n", taos_errstr(res));
return -1; return -1;
} }
...@@ -1511,19 +1548,23 @@ static int getDbFromServer(TAOS * taos, SDbInfo** dbInfos) { ...@@ -1511,19 +1548,23 @@ static int getDbFromServer(TAOS * taos, SDbInfo** dbInfos) {
dbInfos[count] = (SDbInfo *)calloc(1, sizeof(SDbInfo)); dbInfos[count] = (SDbInfo *)calloc(1, sizeof(SDbInfo));
if (dbInfos[count] == NULL) { if (dbInfos[count] == NULL) {
fprintf(stderr, "failed to allocate memory for some dbInfo[%d]\n", count); errorPrint( "failed to allocate memory for some dbInfo[%d]\n", count);
return -1; return -1;
} }
tstrncpy(dbInfos[count]->name, (char *)row[TSDB_SHOW_DB_NAME_INDEX], fields[TSDB_SHOW_DB_NAME_INDEX].bytes); tstrncpy(dbInfos[count]->name, (char *)row[TSDB_SHOW_DB_NAME_INDEX],
xFormatTimestamp(dbInfos[count]->create_time, *(int64_t*)row[TSDB_SHOW_DB_CREATED_TIME_INDEX], TSDB_TIME_PRECISION_MILLI); fields[TSDB_SHOW_DB_NAME_INDEX].bytes);
xFormatTimestamp(dbInfos[count]->create_time,
*(int64_t*)row[TSDB_SHOW_DB_CREATED_TIME_INDEX],
TSDB_TIME_PRECISION_MILLI);
dbInfos[count]->ntables = *((int32_t *)row[TSDB_SHOW_DB_NTABLES_INDEX]); dbInfos[count]->ntables = *((int32_t *)row[TSDB_SHOW_DB_NTABLES_INDEX]);
dbInfos[count]->vgroups = *((int32_t *)row[TSDB_SHOW_DB_VGROUPS_INDEX]); dbInfos[count]->vgroups = *((int32_t *)row[TSDB_SHOW_DB_VGROUPS_INDEX]);
dbInfos[count]->replica = *((int16_t *)row[TSDB_SHOW_DB_REPLICA_INDEX]); dbInfos[count]->replica = *((int16_t *)row[TSDB_SHOW_DB_REPLICA_INDEX]);
dbInfos[count]->quorum = *((int16_t *)row[TSDB_SHOW_DB_QUORUM_INDEX]); dbInfos[count]->quorum = *((int16_t *)row[TSDB_SHOW_DB_QUORUM_INDEX]);
dbInfos[count]->days = *((int16_t *)row[TSDB_SHOW_DB_DAYS_INDEX]); dbInfos[count]->days = *((int16_t *)row[TSDB_SHOW_DB_DAYS_INDEX]);
tstrncpy(dbInfos[count]->keeplist, (char *)row[TSDB_SHOW_DB_KEEP_INDEX], fields[TSDB_SHOW_DB_KEEP_INDEX].bytes); tstrncpy(dbInfos[count]->keeplist, (char *)row[TSDB_SHOW_DB_KEEP_INDEX],
fields[TSDB_SHOW_DB_KEEP_INDEX].bytes);
dbInfos[count]->cache = *((int32_t *)row[TSDB_SHOW_DB_CACHE_INDEX]); dbInfos[count]->cache = *((int32_t *)row[TSDB_SHOW_DB_CACHE_INDEX]);
dbInfos[count]->blocks = *((int32_t *)row[TSDB_SHOW_DB_BLOCKS_INDEX]); dbInfos[count]->blocks = *((int32_t *)row[TSDB_SHOW_DB_BLOCKS_INDEX]);
dbInfos[count]->minrows = *((int32_t *)row[TSDB_SHOW_DB_MINROWS_INDEX]); dbInfos[count]->minrows = *((int32_t *)row[TSDB_SHOW_DB_MINROWS_INDEX]);
...@@ -1537,11 +1578,12 @@ static int getDbFromServer(TAOS * taos, SDbInfo** dbInfos) { ...@@ -1537,11 +1578,12 @@ static int getDbFromServer(TAOS * taos, SDbInfo** dbInfos) {
(char *)row[TSDB_SHOW_DB_PRECISION_INDEX], (char *)row[TSDB_SHOW_DB_PRECISION_INDEX],
fields[TSDB_SHOW_DB_PRECISION_INDEX].bytes); fields[TSDB_SHOW_DB_PRECISION_INDEX].bytes);
dbInfos[count]->update = *((int8_t *)row[TSDB_SHOW_DB_UPDATE_INDEX]); dbInfos[count]->update = *((int8_t *)row[TSDB_SHOW_DB_UPDATE_INDEX]);
tstrncpy(dbInfos[count]->status, (char *)row[TSDB_SHOW_DB_STATUS_INDEX], fields[TSDB_SHOW_DB_STATUS_INDEX].bytes); tstrncpy(dbInfos[count]->status, (char *)row[TSDB_SHOW_DB_STATUS_INDEX],
fields[TSDB_SHOW_DB_STATUS_INDEX].bytes);
count++; count++;
if (count > MAX_DATABASE_COUNT) { if (count > MAX_DATABASE_COUNT) {
fprintf(stderr, "The database count overflow than %d\n", MAX_DATABASE_COUNT); errorPrint( "The database count overflow than %d\n", MAX_DATABASE_COUNT);
break; break;
} }
} }
...@@ -1555,7 +1597,7 @@ static void printfDbInfoForQueryToFile(char* filename, SDbInfo* dbInfos, int ind ...@@ -1555,7 +1597,7 @@ static void printfDbInfoForQueryToFile(char* filename, SDbInfo* dbInfos, int ind
FILE *fp = fopen(filename, "at"); FILE *fp = fopen(filename, "at");
if (fp == NULL) { if (fp == NULL) {
fprintf(stderr, "failed to open file: %s\n", filename); errorPrint( "failed to open file: %s\n", filename);
return; return;
} }
...@@ -1593,7 +1635,9 @@ static void printfQuerySystemInfo(TAOS * taos) { ...@@ -1593,7 +1635,9 @@ static void printfQuerySystemInfo(TAOS * taos) {
struct tm* lt; struct tm* lt;
time(&t); time(&t);
lt = localtime(&t); lt = localtime(&t);
snprintf(filename, MAX_QUERY_SQL_LENGTH, "querySystemInfo-%d-%d-%d %d:%d:%d", lt->tm_year+1900, lt->tm_mon, lt->tm_mday, lt->tm_hour, lt->tm_min, lt->tm_sec); snprintf(filename, MAX_QUERY_SQL_LENGTH, "querySystemInfo-%d-%d-%d %d:%d:%d",
lt->tm_year+1900, lt->tm_mon, lt->tm_mday, lt->tm_hour, lt->tm_min,
lt->tm_sec);
// show variables // show variables
res = taos_query(taos, "show variables;"); res = taos_query(taos, "show variables;");
...@@ -1609,7 +1653,7 @@ static void printfQuerySystemInfo(TAOS * taos) { ...@@ -1609,7 +1653,7 @@ static void printfQuerySystemInfo(TAOS * taos) {
res = taos_query(taos, "show databases;"); res = taos_query(taos, "show databases;");
SDbInfo** dbInfos = (SDbInfo **)calloc(MAX_DATABASE_COUNT, sizeof(SDbInfo *)); SDbInfo** dbInfos = (SDbInfo **)calloc(MAX_DATABASE_COUNT, sizeof(SDbInfo *));
if (dbInfos == NULL) { if (dbInfos == NULL) {
fprintf(stderr, "failed to allocate memory\n"); errorPrint("%s() LN%d, failed to allocate memory\n", __func__, __LINE__);
return; return;
} }
int dbCount = getDbFromServer(taos, dbInfos); int dbCount = getDbFromServer(taos, dbInfos);
...@@ -1639,9 +1683,7 @@ static void printfQuerySystemInfo(TAOS * taos) { ...@@ -1639,9 +1683,7 @@ static void printfQuerySystemInfo(TAOS * taos) {
} }
void ERROR_EXIT(const char *msg) { perror(msg); exit(-1); } static int postProceSql(char* host, uint16_t port, char* sqlstr)
int postProceSql(char* host, uint16_t port, char* sqlstr)
{ {
char *req_fmt = "POST %s HTTP/1.1\r\nHost: %s:%d\r\nAccept: */*\r\nAuthorization: Basic %s\r\nContent-Length: %d\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\n%s"; char *req_fmt = "POST %s HTTP/1.1\r\nHost: %s:%d\r\nAccept: */*\r\nAuthorization: Basic %s\r\nContent-Length: %d\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\n%s";
...@@ -1688,9 +1730,9 @@ int postProceSql(char* host, uint16_t port, char* sqlstr) ...@@ -1688,9 +1730,9 @@ int postProceSql(char* host, uint16_t port, char* sqlstr)
sockfd = socket(AF_INET, SOCK_STREAM, 0); sockfd = socket(AF_INET, SOCK_STREAM, 0);
if (sockfd < 0) { if (sockfd < 0) {
#ifdef WINDOWS #ifdef WINDOWS
fprintf(stderr, "Could not create socket : %d" , WSAGetLastError()); errorPrint( "Could not create socket : %d" , WSAGetLastError());
#endif #endif
debugPrint("%s() LN%d sockfd=%d\n", __func__, __LINE__, sockfd); debugPrint("%s() LN%d, sockfd=%d\n", __func__, __LINE__, sockfd);
free(request_buf); free(request_buf);
ERROR_EXIT("ERROR opening socket"); ERROR_EXIT("ERROR opening socket");
} }
...@@ -1810,7 +1852,7 @@ int postProceSql(char* host, uint16_t port, char* sqlstr) ...@@ -1810,7 +1852,7 @@ int postProceSql(char* host, uint16_t port, char* sqlstr)
static char* getTagValueFromTagSample(SSuperTable* stbInfo, int tagUsePos) { static char* getTagValueFromTagSample(SSuperTable* stbInfo, int tagUsePos) {
char* dataBuf = (char*)calloc(TSDB_MAX_SQL_LEN+1, 1); char* dataBuf = (char*)calloc(TSDB_MAX_SQL_LEN+1, 1);
if (NULL == dataBuf) { if (NULL == dataBuf) {
printf("calloc failed! size:%d\n", TSDB_MAX_SQL_LEN+1); errorPrint("%s() LN%d, calloc failed! size:%d\n", __func__, __LINE__, TSDB_MAX_SQL_LEN+1);
return NULL; return NULL;
} }
...@@ -2002,7 +2044,8 @@ static int getChildNameOfSuperTableWithLimitAndOffset(TAOS * taos, ...@@ -2002,7 +2044,8 @@ static int getChildNameOfSuperTableWithLimitAndOffset(TAOS * taos,
//printf("==== sub table name: %s\n", pTblName); //printf("==== sub table name: %s\n", pTblName);
count++; count++;
if (count >= childTblCount - 1) { if (count >= childTblCount - 1) {
char *tmp = realloc(childTblName, (size_t)childTblCount*1.5*TSDB_TABLE_NAME_LEN+1); char *tmp = realloc(childTblName,
(size_t)childTblCount*1.5*TSDB_TABLE_NAME_LEN+1);
if (tmp != NULL) { if (tmp != NULL) {
childTblName = tmp; childTblName = tmp;
childTblCount = (int)(childTblCount*1.5); childTblCount = (int)(childTblCount*1.5);
...@@ -2010,7 +2053,8 @@ static int getChildNameOfSuperTableWithLimitAndOffset(TAOS * taos, ...@@ -2010,7 +2053,8 @@ static int getChildNameOfSuperTableWithLimitAndOffset(TAOS * taos,
(size_t)((childTblCount-count)*TSDB_TABLE_NAME_LEN)); (size_t)((childTblCount-count)*TSDB_TABLE_NAME_LEN));
} else { } else {
// exit, if allocate more memory failed // exit, if allocate more memory failed
printf("realloc fail for save child table name of %s.%s\n", dbName, sTblName); errorPrint("%s() LN%d, realloc fail for save child table name of %s.%s\n",
__func__, __LINE__, dbName, sTblName);
tmfree(childTblName); tmfree(childTblName);
taos_free_result(res); taos_free_result(res);
taos_close(taos); taos_close(taos);
...@@ -2098,12 +2142,13 @@ static int getSuperTableFromServer(TAOS * taos, char* dbName, ...@@ -2098,12 +2142,13 @@ static int getSuperTableFromServer(TAOS * taos, char* dbName,
calcRowLen(superTbls); calcRowLen(superTbls);
/*
if (TBL_ALREADY_EXISTS == superTbls->childTblExists) { if (TBL_ALREADY_EXISTS == superTbls->childTblExists) {
//get all child table name use cmd: select tbname from superTblName; //get all child table name use cmd: select tbname from superTblName;
int childTblCount = 10000; int childTblCount = 10000;
superTbls->childTblName = (char*)calloc(1, childTblCount * TSDB_TABLE_NAME_LEN); superTbls->childTblName = (char*)calloc(1, childTblCount * TSDB_TABLE_NAME_LEN);
if (superTbls->childTblName == NULL) { if (superTbls->childTblName == NULL) {
fprintf(stderr, "alloc memory failed!"); errorPrint("%s() LN%d, alloc memory failed!\n", __func__, __LINE__);
return -1; return -1;
} }
getAllChildNameOfSuperTable(taos, dbName, getAllChildNameOfSuperTable(taos, dbName,
...@@ -2111,6 +2156,7 @@ static int getSuperTableFromServer(TAOS * taos, char* dbName, ...@@ -2111,6 +2156,7 @@ static int getSuperTableFromServer(TAOS * taos, char* dbName,
&superTbls->childTblName, &superTbls->childTblName,
&superTbls->childTblCount); &superTbls->childTblCount);
} }
*/
return 0; return 0;
} }
...@@ -2242,7 +2288,7 @@ static int createSuperTable(TAOS * taos, char* dbName, SSuperTable* superTbls, ...@@ -2242,7 +2288,7 @@ static int createSuperTable(TAOS * taos, char* dbName, SSuperTable* superTbls,
verbosePrint("%s() LN%d: %s\n", __func__, __LINE__, command); verbosePrint("%s() LN%d: %s\n", __func__, __LINE__, command);
if (0 != queryDbExec(taos, command, NO_INSERT_TYPE)) { if (0 != queryDbExec(taos, command, NO_INSERT_TYPE)) {
fprintf(stderr, "create supertable %s failed!\n\n", errorPrint( "create supertable %s failed!\n\n",
superTbls->sTblName); superTbls->sTblName);
return -1; return -1;
} }
...@@ -2256,7 +2302,7 @@ static int createDatabases() { ...@@ -2256,7 +2302,7 @@ static int createDatabases() {
int ret = 0; int ret = 0;
taos = taos_connect(g_Dbs.host, g_Dbs.user, g_Dbs.password, NULL, g_Dbs.port); taos = taos_connect(g_Dbs.host, g_Dbs.user, g_Dbs.password, NULL, g_Dbs.port);
if (taos == NULL) { if (taos == NULL) {
fprintf(stderr, "Failed to connect to TDengine, reason:%s\n", taos_errstr(NULL)); errorPrint( "Failed to connect to TDengine, reason:%s\n", taos_errstr(NULL));
return -1; return -1;
} }
char command[BUFFER_SIZE] = "\0"; char command[BUFFER_SIZE] = "\0";
...@@ -2341,12 +2387,13 @@ static int createDatabases() { ...@@ -2341,12 +2387,13 @@ static int createDatabases() {
debugPrint("%s() %d command: %s\n", __func__, __LINE__, command); debugPrint("%s() %d command: %s\n", __func__, __LINE__, command);
if (0 != queryDbExec(taos, command, NO_INSERT_TYPE)) { if (0 != queryDbExec(taos, command, NO_INSERT_TYPE)) {
taos_close(taos); taos_close(taos);
fprintf(stderr, "\ncreate database %s failed!\n\n", g_Dbs.db[i].dbName); errorPrint( "\ncreate database %s failed!\n\n", g_Dbs.db[i].dbName);
return -1; return -1;
} }
printf("\ncreate database %s success!\n\n", g_Dbs.db[i].dbName); printf("\ncreate database %s success!\n\n", g_Dbs.db[i].dbName);
debugPrint("%s() %d supertbl count:%d\n", __func__, __LINE__, g_Dbs.db[i].superTblCount); debugPrint("%s() %d supertbl count:%d\n",
__func__, __LINE__, g_Dbs.db[i].superTblCount);
for (int j = 0; j < g_Dbs.db[i].superTblCount; j++) { for (int j = 0; j < g_Dbs.db[i].superTblCount; j++) {
// describe super table, if exists // describe super table, if exists
sprintf(command, "describe %s.%s;", g_Dbs.db[i].dbName, sprintf(command, "describe %s.%s;", g_Dbs.db[i].dbName,
...@@ -2358,9 +2405,12 @@ static int createDatabases() { ...@@ -2358,9 +2405,12 @@ static int createDatabases() {
&g_Dbs.db[i].superTbls[j], g_Dbs.use_metric); &g_Dbs.db[i].superTbls[j], g_Dbs.use_metric);
} else { } else {
g_Dbs.db[i].superTbls[j].superTblExists = TBL_ALREADY_EXISTS; g_Dbs.db[i].superTbls[j].superTblExists = TBL_ALREADY_EXISTS;
if (g_Dbs.db[i].superTbls[j].childTblExists != TBL_ALREADY_EXISTS) {
ret = getSuperTableFromServer(taos, g_Dbs.db[i].dbName, ret = getSuperTableFromServer(taos, g_Dbs.db[i].dbName,
&g_Dbs.db[i].superTbls[j]); &g_Dbs.db[i].superTbls[j]);
} }
}
if (0 != ret) { if (0 != ret) {
printf("\ncreate super table %d failed!\n\n", j); printf("\ncreate super table %d failed!\n\n", j);
...@@ -2389,14 +2439,18 @@ static void* createTable(void *sarg) ...@@ -2389,14 +2439,18 @@ static void* createTable(void *sarg)
char *buffer = calloc(buff_len, 1); char *buffer = calloc(buff_len, 1);
if (buffer == NULL) { if (buffer == NULL) {
fprintf(stderr, "Memory allocated failed!"); errorPrint("%s() LN%d, Memory allocated failed!\n", __func__, __LINE__);
exit(-1); exit(-1);
} }
int len = 0; int len = 0;
int batchNum = 0; int batchNum = 0;
//printf("Creating table from %d to %d\n", winfo->start_table_id, winfo->end_table_id);
for (int i = winfo->start_table_id; i <= winfo->end_table_id; i++) { verbosePrint("%s() LN%d: Creating table from %d to %d\n",
__func__, __LINE__,
winfo->start_table_from, winfo->end_table_to);
for (int i = winfo->start_table_from; i <= winfo->end_table_to; i++) {
if (0 == g_Dbs.use_metric) { if (0 == g_Dbs.use_metric) {
snprintf(buffer, buff_len, snprintf(buffer, buff_len,
"create table if not exists %s.%s%d %s;", "create table if not exists %s.%s%d %s;",
...@@ -2443,7 +2497,7 @@ static void* createTable(void *sarg) ...@@ -2443,7 +2497,7 @@ static void* createTable(void *sarg)
len = 0; len = 0;
verbosePrint("%s() LN%d %s\n", __func__, __LINE__, buffer); verbosePrint("%s() LN%d %s\n", __func__, __LINE__, buffer);
if (0 != queryDbExec(winfo->taos, buffer, NO_INSERT_TYPE)){ if (0 != queryDbExec(winfo->taos, buffer, NO_INSERT_TYPE)){
fprintf(stderr, "queryDbExec() failed. buffer:\n%s\n", buffer); errorPrint( "queryDbExec() failed. buffer:\n%s\n", buffer);
free(buffer); free(buffer);
return NULL; return NULL;
} }
...@@ -2451,7 +2505,7 @@ static void* createTable(void *sarg) ...@@ -2451,7 +2505,7 @@ static void* createTable(void *sarg)
int64_t currentPrintTime = taosGetTimestampMs(); int64_t currentPrintTime = taosGetTimestampMs();
if (currentPrintTime - lastPrintTime > 30*1000) { if (currentPrintTime - lastPrintTime > 30*1000) {
printf("thread[%d] already create %d - %d tables\n", printf("thread[%d] already create %d - %d tables\n",
winfo->threadID, winfo->start_table_id, i); winfo->threadID, winfo->start_table_from, i);
lastPrintTime = currentPrintTime; lastPrintTime = currentPrintTime;
} }
} }
...@@ -2459,7 +2513,7 @@ static void* createTable(void *sarg) ...@@ -2459,7 +2513,7 @@ static void* createTable(void *sarg)
if (0 != len) { if (0 != len) {
verbosePrint("%s() %d buffer: %s\n", __func__, __LINE__, buffer); verbosePrint("%s() %d buffer: %s\n", __func__, __LINE__, buffer);
if (0 != queryDbExec(winfo->taos, buffer, NO_INSERT_TYPE)) { if (0 != queryDbExec(winfo->taos, buffer, NO_INSERT_TYPE)) {
fprintf(stderr, "queryDbExec() failed. buffer:\n%s\n", buffer); errorPrint( "queryDbExec() failed. buffer:\n%s\n", buffer);
} }
} }
...@@ -2467,7 +2521,7 @@ static void* createTable(void *sarg) ...@@ -2467,7 +2521,7 @@ static void* createTable(void *sarg)
return NULL; return NULL;
} }
int startMultiThreadCreateChildTable( static int startMultiThreadCreateChildTable(
char* cols, int threads, int startFrom, int ntables, char* cols, int threads, int startFrom, int ntables,
char* db_name, SSuperTable* superTblInfo) { char* db_name, SSuperTable* superTblInfo) {
pthread_t *pids = malloc(threads * sizeof(pthread_t)); pthread_t *pids = malloc(threads * sizeof(pthread_t));
...@@ -2491,7 +2545,6 @@ int startMultiThreadCreateChildTable( ...@@ -2491,7 +2545,6 @@ int startMultiThreadCreateChildTable(
int b = 0; int b = 0;
b = ntables % threads; b = ntables % threads;
int last = startFrom;
for (int i = 0; i < threads; i++) { for (int i = 0; i < threads; i++) {
threadInfo *t_info = infos + i; threadInfo *t_info = infos + i;
t_info->threadID = i; t_info->threadID = i;
...@@ -2505,14 +2558,16 @@ int startMultiThreadCreateChildTable( ...@@ -2505,14 +2558,16 @@ int startMultiThreadCreateChildTable(
db_name, db_name,
g_Dbs.port); g_Dbs.port);
if (t_info->taos == NULL) { if (t_info->taos == NULL) {
fprintf(stderr, "Failed to connect to TDengine, reason:%s\n", taos_errstr(NULL)); errorPrint( "Failed to connect to TDengine, reason:%s\n", taos_errstr(NULL));
free(pids); free(pids);
free(infos); free(infos);
return -1; return -1;
} }
t_info->start_table_id = last;
t_info->end_table_id = i < b ? last + a : last + a - 1; t_info->start_table_from = startFrom;
last = t_info->end_table_id + 1; t_info->ntables = i<b?a+1:a;
t_info->end_table_to = i < b ? startFrom + a : startFrom + a - 1;
startFrom = t_info->end_table_to + 1;
t_info->use_metric = 1; t_info->use_metric = 1;
t_info->cols = cols; t_info->cols = cols;
t_info->minDelay = INT16_MAX; t_info->minDelay = INT16_MAX;
...@@ -2599,7 +2654,7 @@ static void createChildTables() { ...@@ -2599,7 +2654,7 @@ static void createChildTables() {
/* /*
Read 10000 lines at most. If more than 10000 lines, continue to read after using Read 10000 lines at most. If more than 10000 lines, continue to read after using
*/ */
int readTagFromCsvFileToMem(SSuperTable * superTblInfo) { static int readTagFromCsvFileToMem(SSuperTable * superTblInfo) {
size_t n = 0; size_t n = 0;
ssize_t readLen = 0; ssize_t readLen = 0;
char * line = NULL; char * line = NULL;
...@@ -2669,7 +2724,6 @@ int readSampleFromJsonFileToMem(SSuperTable * superTblInfo) { ...@@ -2669,7 +2724,6 @@ int readSampleFromJsonFileToMem(SSuperTable * superTblInfo) {
return 0; return 0;
} }
/* /*
Read 10000 lines at most. If more than 10000 lines, continue to read after using Read 10000 lines at most. If more than 10000 lines, continue to read after using
*/ */
...@@ -2682,7 +2736,7 @@ static int readSampleFromCsvFileToMem( ...@@ -2682,7 +2736,7 @@ static int readSampleFromCsvFileToMem(
FILE* fp = fopen(superTblInfo->sampleFile, "r"); FILE* fp = fopen(superTblInfo->sampleFile, "r");
if (fp == NULL) { if (fp == NULL) {
fprintf(stderr, "Failed to open sample file: %s, reason:%s\n", errorPrint( "Failed to open sample file: %s, reason:%s\n",
superTblInfo->sampleFile, strerror(errno)); superTblInfo->sampleFile, strerror(errno));
return -1; return -1;
} }
...@@ -2694,7 +2748,7 @@ static int readSampleFromCsvFileToMem( ...@@ -2694,7 +2748,7 @@ static int readSampleFromCsvFileToMem(
readLen = tgetline(&line, &n, fp); readLen = tgetline(&line, &n, fp);
if (-1 == readLen) { if (-1 == readLen) {
if(0 != fseek(fp, 0, SEEK_SET)) { if(0 != fseek(fp, 0, SEEK_SET)) {
fprintf(stderr, "Failed to fseek file: %s, reason:%s\n", errorPrint( "Failed to fseek file: %s, reason:%s\n",
superTblInfo->sampleFile, strerror(errno)); superTblInfo->sampleFile, strerror(errno));
fclose(fp); fclose(fp);
return -1; return -1;
...@@ -2716,7 +2770,8 @@ static int readSampleFromCsvFileToMem( ...@@ -2716,7 +2770,8 @@ static int readSampleFromCsvFileToMem(
continue; continue;
} }
verbosePrint("readLen=%ld stb->lenOfOneRow=%d getRows=%d\n", readLen, superTblInfo->lenOfOneRow, getRows); verbosePrint("readLen=%ld stb->lenOfOneRow=%d getRows=%d\n", readLen,
superTblInfo->lenOfOneRow, getRows);
memcpy(superTblInfo->sampleDataBuf + getRows * superTblInfo->lenOfOneRow, memcpy(superTblInfo->sampleDataBuf + getRows * superTblInfo->lenOfOneRow,
line, readLen); line, readLen);
...@@ -2746,7 +2801,8 @@ void readSampleFromFileToMem(SSuperTable * supterTblInfo) { ...@@ -2746,7 +2801,8 @@ void readSampleFromFileToMem(SSuperTable * supterTblInfo) {
} }
} }
*/ */
static bool getColumnAndTagTypeFromInsertJsonFile(cJSON* stbInfo, SSuperTable* superTbls) { static bool getColumnAndTagTypeFromInsertJsonFile(
cJSON* stbInfo, SSuperTable* superTbls) {
bool ret = false; bool ret = false;
// columns // columns
...@@ -2762,8 +2818,8 @@ static bool getColumnAndTagTypeFromInsertJsonFile(cJSON* stbInfo, SSuperTable* s ...@@ -2762,8 +2818,8 @@ static bool getColumnAndTagTypeFromInsertJsonFile(cJSON* stbInfo, SSuperTable* s
int columnSize = cJSON_GetArraySize(columns); int columnSize = cJSON_GetArraySize(columns);
if (columnSize > MAX_COLUMN_COUNT) { if (columnSize > MAX_COLUMN_COUNT) {
printf("ERROR: failed to read json, column size overflow, max column size is %d\n", errorPrint("%s() LN%d, failed to read json, column size overflow, max column size is %d\n",
MAX_COLUMN_COUNT); __func__, __LINE__, MAX_COLUMN_COUNT);
goto PARSE_OVER; goto PARSE_OVER;
} }
...@@ -2781,7 +2837,7 @@ static bool getColumnAndTagTypeFromInsertJsonFile(cJSON* stbInfo, SSuperTable* s ...@@ -2781,7 +2837,7 @@ static bool getColumnAndTagTypeFromInsertJsonFile(cJSON* stbInfo, SSuperTable* s
if (countObj && countObj->type == cJSON_Number) { if (countObj && countObj->type == cJSON_Number) {
count = countObj->valueint; count = countObj->valueint;
} else if (countObj && countObj->type != cJSON_Number) { } else if (countObj && countObj->type != cJSON_Number) {
printf("ERROR: failed to read json, column count not found\n"); errorPrint("%s() LN%d, failed to read json, column count not found\n", __func__, __LINE__);
goto PARSE_OVER; goto PARSE_OVER;
} else { } else {
count = 1; count = 1;
...@@ -2791,7 +2847,7 @@ static bool getColumnAndTagTypeFromInsertJsonFile(cJSON* stbInfo, SSuperTable* s ...@@ -2791,7 +2847,7 @@ static bool getColumnAndTagTypeFromInsertJsonFile(cJSON* stbInfo, SSuperTable* s
memset(&columnCase, 0, sizeof(StrColumn)); memset(&columnCase, 0, sizeof(StrColumn));
cJSON *dataType = cJSON_GetObjectItem(column, "type"); cJSON *dataType = cJSON_GetObjectItem(column, "type");
if (!dataType || dataType->type != cJSON_String || dataType->valuestring == NULL) { if (!dataType || dataType->type != cJSON_String || dataType->valuestring == NULL) {
printf("ERROR: failed to read json, column type not found\n"); errorPrint("%s() LN%d: failed to read json, column type not found\n", __func__, __LINE__);
goto PARSE_OVER; goto PARSE_OVER;
} }
//tstrncpy(superTbls->columns[k].dataType, dataType->valuestring, MAX_TB_NAME_SIZE); //tstrncpy(superTbls->columns[k].dataType, dataType->valuestring, MAX_TB_NAME_SIZE);
...@@ -2801,14 +2857,15 @@ static bool getColumnAndTagTypeFromInsertJsonFile(cJSON* stbInfo, SSuperTable* s ...@@ -2801,14 +2857,15 @@ static bool getColumnAndTagTypeFromInsertJsonFile(cJSON* stbInfo, SSuperTable* s
if (dataLen && dataLen->type == cJSON_Number) { if (dataLen && dataLen->type == cJSON_Number) {
columnCase.dataLen = dataLen->valueint; columnCase.dataLen = dataLen->valueint;
} else if (dataLen && dataLen->type != cJSON_Number) { } else if (dataLen && dataLen->type != cJSON_Number) {
printf("ERROR: failed to read json, column len not found\n"); debugPrint("%s() LN%d: failed to read json, column len not found\n", __func__, __LINE__);
goto PARSE_OVER; goto PARSE_OVER;
} else { } else {
columnCase.dataLen = 8; columnCase.dataLen = 8;
} }
for (int n = 0; n < count; ++n) { for (int n = 0; n < count; ++n) {
tstrncpy(superTbls->columns[index].dataType, columnCase.dataType, MAX_TB_NAME_SIZE); tstrncpy(superTbls->columns[index].dataType,
columnCase.dataType, MAX_TB_NAME_SIZE);
superTbls->columns[index].dataLen = columnCase.dataLen; superTbls->columns[index].dataLen = columnCase.dataLen;
index++; index++;
} }
...@@ -2820,13 +2877,13 @@ static bool getColumnAndTagTypeFromInsertJsonFile(cJSON* stbInfo, SSuperTable* s ...@@ -2820,13 +2877,13 @@ static bool getColumnAndTagTypeFromInsertJsonFile(cJSON* stbInfo, SSuperTable* s
// tags // tags
cJSON *tags = cJSON_GetObjectItem(stbInfo, "tags"); cJSON *tags = cJSON_GetObjectItem(stbInfo, "tags");
if (!tags || tags->type != cJSON_Array) { if (!tags || tags->type != cJSON_Array) {
printf("ERROR: failed to read json, tags not found\n"); debugPrint("%s() LN%d, failed to read json, tags not found\n", __func__, __LINE__);
goto PARSE_OVER; goto PARSE_OVER;
} }
int tagSize = cJSON_GetArraySize(tags); int tagSize = cJSON_GetArraySize(tags);
if (tagSize > MAX_TAG_COUNT) { if (tagSize > MAX_TAG_COUNT) {
printf("ERROR: failed to read json, tags size overflow, max tag size is %d\n", MAX_TAG_COUNT); debugPrint("%s() LN%d, failed to read json, tags size overflow, max tag size is %d\n", __func__, __LINE__, MAX_TAG_COUNT);
goto PARSE_OVER; goto PARSE_OVER;
} }
...@@ -2954,7 +3011,17 @@ static bool getMetaFromInsertJsonFile(cJSON* root) { ...@@ -2954,7 +3011,17 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
} else if (!gInsertInterval) { } else if (!gInsertInterval) {
g_args.insert_interval = 0; g_args.insert_interval = 0;
} else { } else {
fprintf(stderr, "ERROR: failed to read json, insert_interval input mistake\n"); errorPrint("%s() LN%d, failed to read json, insert_interval input mistake\n", __func__, __LINE__);
goto PARSE_OVER;
}
cJSON* rowsPerTbl = cJSON_GetObjectItem(root, "rows_per_tbl");
if (rowsPerTbl && rowsPerTbl->type == cJSON_Number) {
g_args.rows_per_tbl = rowsPerTbl->valueint;
} else if (!rowsPerTbl) {
g_args.rows_per_tbl = 0; // 0 means progressive mode, > 0 mean interlace mode. max value is less or equ num_of_records_per_req
} else {
errorPrint("%s() LN%d, failed to read json, rows_per_tbl input mistake\n", __func__, __LINE__);
goto PARSE_OVER; goto PARSE_OVER;
} }
...@@ -2964,7 +3031,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) { ...@@ -2964,7 +3031,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
} else if (!maxSqlLen) { } else if (!maxSqlLen) {
g_args.max_sql_len = TSDB_PAYLOAD_SIZE; g_args.max_sql_len = TSDB_PAYLOAD_SIZE;
} else { } else {
fprintf(stderr, "ERROR: failed to read json, max_sql_len input mistake\n"); errorPrint("%s() LN%d, failed to read json, max_sql_len input mistake\n", __func__, __LINE__);
goto PARSE_OVER; goto PARSE_OVER;
} }
...@@ -2975,7 +3042,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) { ...@@ -2975,7 +3042,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
} else if (!numRecPerReq) { } else if (!numRecPerReq) {
g_args.num_of_RPR = 100; g_args.num_of_RPR = 100;
} else { } else {
printf("ERROR: failed to read json, num_of_records_per_req not found\n"); errorPrint("%s() LN%d, failed to read json, num_of_records_per_req not found\n", __func__, __LINE__);
goto PARSE_OVER; goto PARSE_OVER;
} }
...@@ -3005,7 +3072,9 @@ static bool getMetaFromInsertJsonFile(cJSON* root) { ...@@ -3005,7 +3072,9 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
int dbSize = cJSON_GetArraySize(dbs); int dbSize = cJSON_GetArraySize(dbs);
if (dbSize > MAX_DB_COUNT) { if (dbSize > MAX_DB_COUNT) {
printf("ERROR: failed to read json, databases size overflow, max database is %d\n", MAX_DB_COUNT); errorPrint(
"ERROR: failed to read json, databases size overflow, max database is %d\n",
MAX_DB_COUNT);
goto PARSE_OVER; goto PARSE_OVER;
} }
...@@ -3043,8 +3112,10 @@ static bool getMetaFromInsertJsonFile(cJSON* root) { ...@@ -3043,8 +3112,10 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
} }
cJSON *precision = cJSON_GetObjectItem(dbinfo, "precision"); cJSON *precision = cJSON_GetObjectItem(dbinfo, "precision");
if (precision && precision->type == cJSON_String && precision->valuestring != NULL) { if (precision && precision->type == cJSON_String
tstrncpy(g_Dbs.db[i].dbCfg.precision, precision->valuestring, MAX_DB_NAME_SIZE); && precision->valuestring != NULL) {
tstrncpy(g_Dbs.db[i].dbCfg.precision, precision->valuestring,
MAX_DB_NAME_SIZE);
} else if (!precision) { } else if (!precision) {
//tstrncpy(g_Dbs.db[i].dbCfg.precision, "ms", MAX_DB_NAME_SIZE); //tstrncpy(g_Dbs.db[i].dbCfg.precision, "ms", MAX_DB_NAME_SIZE);
memset(g_Dbs.db[i].dbCfg.precision, 0, MAX_DB_NAME_SIZE); memset(g_Dbs.db[i].dbCfg.precision, 0, MAX_DB_NAME_SIZE);
...@@ -3202,7 +3273,9 @@ static bool getMetaFromInsertJsonFile(cJSON* root) { ...@@ -3202,7 +3273,9 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
int stbSize = cJSON_GetArraySize(stables); int stbSize = cJSON_GetArraySize(stables);
if (stbSize > MAX_SUPER_TABLE_COUNT) { if (stbSize > MAX_SUPER_TABLE_COUNT) {
printf("ERROR: failed to read json, databases size overflow, max database is %d\n", MAX_SUPER_TABLE_COUNT); errorPrint(
"ERROR: failed to read json, databases size overflow, max database is %d\n",
MAX_SUPER_TABLE_COUNT);
goto PARSE_OVER; goto PARSE_OVER;
} }
...@@ -3268,13 +3341,13 @@ static bool getMetaFromInsertJsonFile(cJSON* root) { ...@@ -3268,13 +3341,13 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
} else if (!childTblExists) { } else if (!childTblExists) {
g_Dbs.db[i].superTbls[j].childTblExists = TBL_NO_EXISTS; g_Dbs.db[i].superTbls[j].childTblExists = TBL_NO_EXISTS;
} else { } else {
printf("ERROR: failed to read json, child_table_exists not found\n"); errorPrint("%s() LN%d, failed to read json, child_table_exists not found\n", __func__, __LINE__);
goto PARSE_OVER; goto PARSE_OVER;
} }
cJSON* count = cJSON_GetObjectItem(stbInfo, "childtable_count"); cJSON* count = cJSON_GetObjectItem(stbInfo, "childtable_count");
if (!count || count->type != cJSON_Number || 0 >= count->valueint) { if (!count || count->type != cJSON_Number || 0 >= count->valueint) {
printf("ERROR: failed to read json, childtable_count not found\n"); errorPrint("%s() LN%d, failed to read json, childtable_count not found\n", __func__, __LINE__);
goto PARSE_OVER; goto PARSE_OVER;
} }
g_Dbs.db[i].superTbls[j].childTblCount = count->valueint; g_Dbs.db[i].superTbls[j].childTblCount = count->valueint;
...@@ -3287,7 +3360,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) { ...@@ -3287,7 +3360,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
} else if (!dataSource) { } else if (!dataSource) {
tstrncpy(g_Dbs.db[i].superTbls[j].dataSource, "rand", MAX_DB_NAME_SIZE); tstrncpy(g_Dbs.db[i].superTbls[j].dataSource, "rand", MAX_DB_NAME_SIZE);
} else { } else {
printf("ERROR: failed to read json, data_source not found\n"); errorPrint("%s() LN%d, failed to read json, data_source not found\n", __func__, __LINE__);
goto PARSE_OVER; goto PARSE_OVER;
} }
...@@ -3327,9 +3400,11 @@ static bool getMetaFromInsertJsonFile(cJSON* root) { ...@@ -3327,9 +3400,11 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
cJSON *ts = cJSON_GetObjectItem(stbInfo, "start_timestamp"); cJSON *ts = cJSON_GetObjectItem(stbInfo, "start_timestamp");
if (ts && ts->type == cJSON_String && ts->valuestring != NULL) { if (ts && ts->type == cJSON_String && ts->valuestring != NULL) {
tstrncpy(g_Dbs.db[i].superTbls[j].startTimestamp, ts->valuestring, MAX_DB_NAME_SIZE); tstrncpy(g_Dbs.db[i].superTbls[j].startTimestamp,
ts->valuestring, MAX_DB_NAME_SIZE);
} else if (!ts) { } else if (!ts) {
tstrncpy(g_Dbs.db[i].superTbls[j].startTimestamp, "now", MAX_DB_NAME_SIZE); tstrncpy(g_Dbs.db[i].superTbls[j].startTimestamp,
"now", MAX_DB_NAME_SIZE);
} else { } else {
printf("ERROR: failed to read json, start_timestamp not found\n"); printf("ERROR: failed to read json, start_timestamp not found\n");
goto PARSE_OVER; goto PARSE_OVER;
...@@ -3429,13 +3504,14 @@ static bool getMetaFromInsertJsonFile(cJSON* root) { ...@@ -3429,13 +3504,14 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
printf("ERROR: failed to read json, multiThreadWriteOneTbl not found\n"); printf("ERROR: failed to read json, multiThreadWriteOneTbl not found\n");
goto PARSE_OVER; goto PARSE_OVER;
} }
cJSON* rowsPerTbl = cJSON_GetObjectItem(stbInfo, "rows_per_tbl"); cJSON* rowsPerTbl = cJSON_GetObjectItem(stbInfo, "rows_per_tbl");
if (rowsPerTbl && rowsPerTbl->type == cJSON_Number) { if (rowsPerTbl && rowsPerTbl->type == cJSON_Number) {
g_Dbs.db[i].superTbls[j].rowsPerTbl = rowsPerTbl->valueint; g_Dbs.db[i].superTbls[j].rowsPerTbl = rowsPerTbl->valueint;
} else if (!rowsPerTbl) { } else if (!rowsPerTbl) {
g_Dbs.db[i].superTbls[j].rowsPerTbl = 0; // 0 means progressive mode, > 0 mean interlace mode. max value is less or equ num_of_records_per_req g_Dbs.db[i].superTbls[j].rowsPerTbl = 0; // 0 means progressive mode, > 0 mean interlace mode. max value is less or equ num_of_records_per_req
} else { } else {
fprintf(stderr, "ERROR: failed to read json, rowsPerTbl input mistake\n"); errorPrint("%s() LN%d, failed to read json, rowsPerTbl input mistake\n", __func__, __LINE__);
goto PARSE_OVER; goto PARSE_OVER;
} }
...@@ -3465,7 +3541,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) { ...@@ -3465,7 +3541,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
} else if (!insertRows) { } else if (!insertRows) {
g_Dbs.db[i].superTbls[j].insertRows = 0x7FFFFFFFFFFFFFFF; g_Dbs.db[i].superTbls[j].insertRows = 0x7FFFFFFFFFFFFFFF;
} else { } else {
fprintf(stderr, "failed to read json, insert_rows input mistake"); errorPrint("%s() LN%d, failed to read json, insert_rows input mistake\n", __func__, __LINE__);
goto PARSE_OVER; goto PARSE_OVER;
} }
...@@ -3477,16 +3553,18 @@ static bool getMetaFromInsertJsonFile(cJSON* root) { ...@@ -3477,16 +3553,18 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
__func__, __LINE__, g_args.insert_interval); __func__, __LINE__, g_args.insert_interval);
g_Dbs.db[i].superTbls[j].insertInterval = g_args.insert_interval; g_Dbs.db[i].superTbls[j].insertInterval = g_args.insert_interval;
} else { } else {
fprintf(stderr, "failed to read json, insert_interval input mistake"); errorPrint("%s() LN%d, failed to read json, insert_interval input mistake\n", __func__, __LINE__);
goto PARSE_OVER; goto PARSE_OVER;
} }
if (NO_CREATE_SUBTBL == g_Dbs.db[i].superTbls[j].autoCreateTable /* CBD if (NO_CREATE_SUBTBL == g_Dbs.db[i].superTbls[j].autoCreateTable
|| (TBL_ALREADY_EXISTS == g_Dbs.db[i].superTbls[j].childTblExists)) { || (TBL_ALREADY_EXISTS == g_Dbs.db[i].superTbls[j].childTblExists)) {
continue; continue;
} }
*/
int retVal = getColumnAndTagTypeFromInsertJsonFile(stbInfo, &g_Dbs.db[i].superTbls[j]); int retVal = getColumnAndTagTypeFromInsertJsonFile(
stbInfo, &g_Dbs.db[i].superTbls[j]);
if (false == retVal) { if (false == retVal) {
goto PARSE_OVER; goto PARSE_OVER;
} }
...@@ -3768,7 +3846,9 @@ static bool getMetaFromQueryJsonFile(cJSON* root) { ...@@ -3768,7 +3846,9 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
} }
cJSON* subkeepProgress = cJSON_GetObjectItem(subQuery, "keepProgress"); cJSON* subkeepProgress = cJSON_GetObjectItem(subQuery, "keepProgress");
if (subkeepProgress && subkeepProgress->type == cJSON_String && subkeepProgress->valuestring != NULL) { if (subkeepProgress &&
subkeepProgress->type == cJSON_String
&& subkeepProgress->valuestring != NULL) {
if (0 == strcmp("yes", subkeepProgress->valuestring)) { if (0 == strcmp("yes", subkeepProgress->valuestring)) {
g_queryInfo.subQueryInfo.subscribeKeepProgress = 1; g_queryInfo.subQueryInfo.subscribeKeepProgress = 1;
} else if (0 == strcmp("no", subkeepProgress->valuestring)) { } else if (0 == strcmp("no", subkeepProgress->valuestring)) {
...@@ -3859,30 +3939,30 @@ static bool getInfoFromJsonFile(char* file) { ...@@ -3859,30 +3939,30 @@ static bool getInfoFromJsonFile(char* file) {
cJSON* filetype = cJSON_GetObjectItem(root, "filetype"); cJSON* filetype = cJSON_GetObjectItem(root, "filetype");
if (filetype && filetype->type == cJSON_String && filetype->valuestring != NULL) { if (filetype && filetype->type == cJSON_String && filetype->valuestring != NULL) {
if (0 == strcasecmp("insert", filetype->valuestring)) { if (0 == strcasecmp("insert", filetype->valuestring)) {
g_args.test_mode = INSERT_MODE; g_args.test_mode = INSERT_TEST;
} else if (0 == strcasecmp("query", filetype->valuestring)) { } else if (0 == strcasecmp("query", filetype->valuestring)) {
g_args.test_mode = QUERY_MODE; g_args.test_mode = QUERY_TEST;
} else if (0 == strcasecmp("subscribe", filetype->valuestring)) { } else if (0 == strcasecmp("subscribe", filetype->valuestring)) {
g_args.test_mode = SUBSCRIBE_MODE; g_args.test_mode = SUBSCRIBE_TEST;
} else { } else {
printf("ERROR: failed to read json, filetype not support\n"); printf("ERROR: failed to read json, filetype not support\n");
goto PARSE_OVER; goto PARSE_OVER;
} }
} else if (!filetype) { } else if (!filetype) {
g_args.test_mode = INSERT_MODE; g_args.test_mode = INSERT_TEST;
} else { } else {
printf("ERROR: failed to read json, filetype not found\n"); printf("ERROR: failed to read json, filetype not found\n");
goto PARSE_OVER; goto PARSE_OVER;
} }
if (INSERT_MODE == g_args.test_mode) { if (INSERT_TEST == g_args.test_mode) {
ret = getMetaFromInsertJsonFile(root); ret = getMetaFromInsertJsonFile(root);
} else if (QUERY_MODE == g_args.test_mode) { } else if (QUERY_TEST == g_args.test_mode) {
ret = getMetaFromQueryJsonFile(root); ret = getMetaFromQueryJsonFile(root);
} else if (SUBSCRIBE_MODE == g_args.test_mode) { } else if (SUBSCRIBE_TEST == g_args.test_mode) {
ret = getMetaFromQueryJsonFile(root); ret = getMetaFromQueryJsonFile(root);
} else { } else {
printf("ERROR: input json file type error! please input correct file type: insert or query or subscribe\n"); errorPrint("%s() LN%d, input json file type error! please input correct file type: insert or query or subscribe\n", __func__, __LINE__);
goto PARSE_OVER; goto PARSE_OVER;
} }
...@@ -3964,14 +4044,14 @@ static int generateRowData(char* dataBuf, int maxLen, int64_t timestamp, SSuper ...@@ -3964,14 +4044,14 @@ static int generateRowData(char* dataBuf, int maxLen, int64_t timestamp, SSuper
if ((0 == strncasecmp(stbInfo->columns[i].dataType, "binary", 6)) if ((0 == strncasecmp(stbInfo->columns[i].dataType, "binary", 6))
|| (0 == strncasecmp(stbInfo->columns[i].dataType, "nchar", 5))) { || (0 == strncasecmp(stbInfo->columns[i].dataType, "nchar", 5))) {
if (stbInfo->columns[i].dataLen > TSDB_MAX_BINARY_LEN) { if (stbInfo->columns[i].dataLen > TSDB_MAX_BINARY_LEN) {
printf("binary or nchar length overflow, max size:%u\n", errorPrint( "binary or nchar length overflow, max size:%u\n",
(uint32_t)TSDB_MAX_BINARY_LEN); (uint32_t)TSDB_MAX_BINARY_LEN);
return (-1); return (-1);
} }
char* buf = (char*)calloc(stbInfo->columns[i].dataLen+1, 1); char* buf = (char*)calloc(stbInfo->columns[i].dataLen+1, 1);
if (NULL == buf) { if (NULL == buf) {
printf("calloc failed! size:%d\n", stbInfo->columns[i].dataLen); errorPrint( "calloc failed! size:%d\n", stbInfo->columns[i].dataLen);
return (-1); return (-1);
} }
rand_string(buf, stbInfo->columns[i].dataLen); rand_string(buf, stbInfo->columns[i].dataLen);
...@@ -4003,7 +4083,7 @@ static int generateRowData(char* dataBuf, int maxLen, int64_t timestamp, SSuper ...@@ -4003,7 +4083,7 @@ static int generateRowData(char* dataBuf, int maxLen, int64_t timestamp, SSuper
} else if (0 == strncasecmp(stbInfo->columns[i].dataType, "timestamp", 9)) { } else if (0 == strncasecmp(stbInfo->columns[i].dataType, "timestamp", 9)) {
dataLen += snprintf(dataBuf + dataLen, maxLen - dataLen, "%"PRId64", ", rand_bigint()); dataLen += snprintf(dataBuf + dataLen, maxLen - dataLen, "%"PRId64", ", rand_bigint());
} else { } else {
printf("No support data type: %s\n", stbInfo->columns[i].dataType); errorPrint( "No support data type: %s\n", stbInfo->columns[i].dataType);
return (-1); return (-1);
} }
} }
...@@ -4078,7 +4158,8 @@ static int prepareSampleDataForSTable(SSuperTable *superTblInfo) { ...@@ -4078,7 +4158,8 @@ static int prepareSampleDataForSTable(SSuperTable *superTblInfo) {
sampleDataBuf = calloc( sampleDataBuf = calloc(
superTblInfo->lenOfOneRow * MAX_SAMPLES_ONCE_FROM_FILE, 1); superTblInfo->lenOfOneRow * MAX_SAMPLES_ONCE_FROM_FILE, 1);
if (sampleDataBuf == NULL) { if (sampleDataBuf == NULL) {
fprintf(stderr, "Failed to calloc %d Bytes, reason:%s\n", errorPrint("%s() LN%d, Failed to calloc %d Bytes, reason:%s\n",
__func__, __LINE__,
superTblInfo->lenOfOneRow * MAX_SAMPLES_ONCE_FROM_FILE, superTblInfo->lenOfOneRow * MAX_SAMPLES_ONCE_FROM_FILE,
strerror(errno)); strerror(errno));
return -1; return -1;
...@@ -4088,7 +4169,7 @@ static int prepareSampleDataForSTable(SSuperTable *superTblInfo) { ...@@ -4088,7 +4169,7 @@ static int prepareSampleDataForSTable(SSuperTable *superTblInfo) {
int ret = readSampleFromCsvFileToMem(superTblInfo); int ret = readSampleFromCsvFileToMem(superTblInfo);
if (0 != ret) { if (0 != ret) {
fprintf(stderr, "read sample from csv file failed.\n"); errorPrint("%s() LN%d, read sample from csv file failed.\n", __func__, __LINE__);
tmfree(sampleDataBuf); tmfree(sampleDataBuf);
superTblInfo->sampleDataBuf = NULL; superTblInfo->sampleDataBuf = NULL;
return -1; return -1;
...@@ -4097,41 +4178,60 @@ static int prepareSampleDataForSTable(SSuperTable *superTblInfo) { ...@@ -4097,41 +4178,60 @@ static int prepareSampleDataForSTable(SSuperTable *superTblInfo) {
return 0; return 0;
} }
static int execInsert(threadInfo *winfo, char *buffer, int k) static int execInsert(threadInfo *pThreadInfo, char *buffer, int k)
{ {
int affectedRows; int affectedRows;
SSuperTable* superTblInfo = winfo->superTblInfo; SSuperTable* superTblInfo = pThreadInfo->superTblInfo;
verbosePrint("[%d] %s() LN%d %s\n", pThreadInfo->threadID,
__func__, __LINE__, buffer);
if (superTblInfo) { if (superTblInfo) {
if (0 == strncasecmp(superTblInfo->insertMode, "taosc", strlen("taosc"))) { if (0 == strncasecmp(superTblInfo->insertMode, "taosc", strlen("taosc"))) {
verbosePrint("%s() LN%d %s\n", __func__, __LINE__, buffer); affectedRows = queryDbExec(pThreadInfo->taos, buffer, INSERT_TYPE);
affectedRows = queryDbExec(winfo->taos, buffer, INSERT_TYPE);
} else { } else {
verbosePrint("%s() LN%d %s\n", __func__, __LINE__, buffer); if (0 != postProceSql(g_Dbs.host, g_Dbs.port, buffer)) {
int retCode = postProceSql(g_Dbs.host, g_Dbs.port, buffer);
if (0 != retCode) {
affectedRows = -1; affectedRows = -1;
printf("========restful return fail, threadID[%d]\n", winfo->threadID); printf("========restful return fail, threadID[%d]\n", pThreadInfo->threadID);
} else { } else {
affectedRows = k; affectedRows = k;
} }
} }
} else { } else {
verbosePrint("%s() LN%d %s\n", __func__, __LINE__, buffer); affectedRows = queryDbExec(pThreadInfo->taos, buffer, 1);
affectedRows = queryDbExec(winfo->taos, buffer, 1);
} }
return affectedRows; return affectedRows;
} }
static int generateDataBuffer(int32_t tableSeq, static void getTableName(char *pTblName, threadInfo* pThreadInfo, int tableSeq)
threadInfo *pThreadInfo, char *buffer,
int64_t insertRows,
int64_t startFrom, int64_t startTime, int *pSampleUsePos)
{ {
SSuperTable* superTblInfo = pThreadInfo->superTblInfo; SSuperTable* superTblInfo = pThreadInfo->superTblInfo;
if (superTblInfo) {
if ((superTblInfo->childTblOffset >= 0)
&& (superTblInfo->childTblLimit > 0)) {
snprintf(pTblName, TSDB_TABLE_NAME_LEN, "%s",
superTblInfo->childTblName + (tableSeq - superTblInfo->childTblOffset) * TSDB_TABLE_NAME_LEN);
} else {
verbosePrint("[%d] %s() LN%d: from=%d count=%d seq=%d\n",
pThreadInfo->threadID, __func__, __LINE__,
pThreadInfo->start_table_from,
pThreadInfo->ntables, tableSeq);
snprintf(pTblName, TSDB_TABLE_NAME_LEN, "%s",
superTblInfo->childTblName + tableSeq * TSDB_TABLE_NAME_LEN);
}
} else {
snprintf(pTblName, TSDB_TABLE_NAME_LEN, "%s%d",
superTblInfo?superTblInfo->childTblPrefix:g_args.tb_prefix, tableSeq);
}
}
static int generateDataTail(char *tableName, int32_t tableSeq,
threadInfo* pThreadInfo,
SSuperTable* superTblInfo,
int batch, char* buffer, int64_t insertRows,
int64_t startFrom, uint64_t startTime, int *pSamplePos, int *dataLen) {
int len = 0;
int ncols_per_record = 1; // count first col ts int ncols_per_record = 1; // count first col ts
if (superTblInfo == NULL) { if (superTblInfo == NULL) {
...@@ -4142,91 +4242,21 @@ static int generateDataBuffer(int32_t tableSeq, ...@@ -4142,91 +4242,21 @@ static int generateDataBuffer(int32_t tableSeq,
} }
} }
assert(buffer != NULL); verbosePrint("%s() LN%d batch=%d\n", __func__, __LINE__, batch);
char *pChildTblName;
pChildTblName = calloc(TSDB_TABLE_NAME_LEN, 1);
if (NULL == pChildTblName) {
fprintf(stderr, "failed to alloc memory %d\n", TSDB_TABLE_NAME_LEN);
return -1;
}
if (superTblInfo && (superTblInfo->childTblOffset >= 0)
&& (superTblInfo->childTblLimit > 0)) {
snprintf(pChildTblName, TSDB_TABLE_NAME_LEN, "%s",
superTblInfo->childTblName + (tableSeq - superTblInfo->childTblOffset) * TSDB_TABLE_NAME_LEN);
} else {
snprintf(pChildTblName, TSDB_TABLE_NAME_LEN, "%s%d",
superTblInfo?superTblInfo->childTblPrefix:g_args.tb_prefix, tableSeq);
}
memset(buffer, 0, superTblInfo?superTblInfo->maxSqlLen:g_args.max_sql_len);
char *pstr = buffer;
if (superTblInfo) {
if (AUTO_CREATE_SUBTBL == superTblInfo->autoCreateTable) {
char* tagsValBuf = NULL;
if (0 == superTblInfo->tagSource) {
tagsValBuf = generateTagVaulesForStb(superTblInfo);
} else {
tagsValBuf = getTagValueFromTagSample(
superTblInfo,
tableSeq % superTblInfo->tagSampleCount);
}
if (NULL == tagsValBuf) {
free(pChildTblName);
fprintf(stderr, "tag buf failed to allocate memory\n");
return -1;
}
pstr += snprintf(pstr,
superTblInfo->maxSqlLen,
"insert into %s.%s using %s.%s tags %s values",
pThreadInfo->db_name,
pChildTblName,
pThreadInfo->db_name,
superTblInfo->sTblName,
tagsValBuf);
tmfree(tagsValBuf);
} else if (TBL_ALREADY_EXISTS == superTblInfo->childTblExists) {
pstr += snprintf(pstr,
superTblInfo->maxSqlLen,
"insert into %s.%s values",
pThreadInfo->db_name,
superTblInfo->childTblName + tableSeq * TSDB_TABLE_NAME_LEN);
} else {
pstr += snprintf(pstr,
(superTblInfo?superTblInfo->maxSqlLen:g_args.max_sql_len),
"insert into %s.%s values",
pThreadInfo->db_name,
pChildTblName);
}
} else {
pstr += snprintf(pstr,
g_args.max_sql_len,
"insert into %s.%s values",
pThreadInfo->db_name,
pChildTblName);
}
int k;
int len = 0;
verbosePrint("%s() LN%d num_of_RPR=%d\n", __func__, __LINE__, g_args.num_of_RPR); int k = 0;
for (k = 0; k < g_args.num_of_RPR;) { for (k = 0; k < batch;) {
if (superTblInfo) { if (superTblInfo) {
int retLen = 0; int retLen = 0;
if (0 == strncasecmp(superTblInfo->dataSource, if (0 == strncasecmp(superTblInfo->dataSource,
"sample", strlen("sample"))) { "sample", strlen("sample"))) {
retLen = getRowDataFromSample( retLen = getRowDataFromSample(
pstr + len, buffer + len,
superTblInfo->maxSqlLen - len, superTblInfo->maxSqlLen - len,
startTime + superTblInfo->timeStampStep * startFrom, startTime + superTblInfo->timeStampStep * startFrom,
superTblInfo, superTblInfo,
pSampleUsePos); pSamplePos);
} else if (0 == strncasecmp(superTblInfo->dataSource, } else if (0 == strncasecmp(superTblInfo->dataSource,
"rand", strlen("rand"))) { "rand", strlen("rand"))) {
int rand_num = rand_tinyint() % 100; int rand_num = rand_tinyint() % 100;
...@@ -4234,13 +4264,13 @@ static int generateDataBuffer(int32_t tableSeq, ...@@ -4234,13 +4264,13 @@ static int generateDataBuffer(int32_t tableSeq,
&& rand_num < superTblInfo->disorderRatio) { && rand_num < superTblInfo->disorderRatio) {
int64_t d = startTime - taosRandom() % superTblInfo->disorderRange; int64_t d = startTime - taosRandom() % superTblInfo->disorderRange;
retLen = generateRowData( retLen = generateRowData(
pstr + len, buffer + len,
superTblInfo->maxSqlLen - len, superTblInfo->maxSqlLen - len,
d, d,
superTblInfo); superTblInfo);
} else { } else {
retLen = generateRowData( retLen = generateRowData(
pstr + len, buffer + len,
superTblInfo->maxSqlLen - len, superTblInfo->maxSqlLen - len,
startTime + superTblInfo->timeStampStep * startFrom, startTime + superTblInfo->timeStampStep * startFrom,
superTblInfo); superTblInfo);
...@@ -4248,7 +4278,6 @@ static int generateDataBuffer(int32_t tableSeq, ...@@ -4248,7 +4278,6 @@ static int generateDataBuffer(int32_t tableSeq,
} }
if (retLen < 0) { if (retLen < 0) {
free(pChildTblName);
return -1; return -1;
} }
...@@ -4277,28 +4306,313 @@ static int generateDataBuffer(int32_t tableSeq, ...@@ -4277,28 +4306,313 @@ static int generateDataBuffer(int32_t tableSeq,
lenOfBinary); lenOfBinary);
} }
pstr += sprintf(pstr, " %s", data); buffer += sprintf(buffer, " %s", data);
if (len + pstr - buffer >= (g_args.max_sql_len - 256)) { // too long if (strlen(buffer) >= (g_args.max_sql_len - 256)) { // too long
k++; k++;
break; break;
} }
} }
verbosePrint("%s() LN%d len=%d k=%d \nbuffer=%s\n", __func__, __LINE__, len, k, buffer); verbosePrint("%s() LN%d len=%d k=%d \nbuffer=%s\n",
__func__, __LINE__, len, k, buffer);
k++; k++;
startFrom ++; startFrom ++;
if (startFrom >= insertRows) if (startFrom >= insertRows) {
break; break;
} }
}
*dataLen = len;
return k;
}
static int generateSQLHead(char *tableName, int32_t tableSeq, threadInfo* pThreadInfo, SSuperTable* superTblInfo, char *buffer)
{
int len;
if (superTblInfo) {
if (AUTO_CREATE_SUBTBL == superTblInfo->autoCreateTable) {
char* tagsValBuf = NULL;
if (0 == superTblInfo->tagSource) {
tagsValBuf = generateTagVaulesForStb(superTblInfo);
} else {
tagsValBuf = getTagValueFromTagSample(
superTblInfo,
tableSeq % superTblInfo->tagSampleCount);
}
if (NULL == tagsValBuf) {
errorPrint("%s() LN%d, tag buf failed to allocate memory\n", __func__, __LINE__);
return -1;
}
len = snprintf(buffer,
superTblInfo->maxSqlLen,
"insert into %s.%s using %s.%s tags %s values",
pThreadInfo->db_name,
tableName,
pThreadInfo->db_name,
superTblInfo->sTblName,
tagsValBuf);
tmfree(tagsValBuf);
} else if (TBL_ALREADY_EXISTS == superTblInfo->childTblExists) {
len = snprintf(buffer,
superTblInfo->maxSqlLen,
"insert into %s.%s values",
pThreadInfo->db_name,
tableName);
} else {
len = snprintf(buffer,
(superTblInfo?superTblInfo->maxSqlLen:g_args.max_sql_len),
"insert into %s.%s values",
pThreadInfo->db_name,
tableName);
}
} else {
len = snprintf(buffer,
g_args.max_sql_len,
"insert into %s.%s values",
pThreadInfo->db_name,
tableName);
}
if (pChildTblName) return len;
free(pChildTblName); }
static int generateDataBuffer(char *pTblName,
int32_t tableSeq,
threadInfo *pThreadInfo, char *buffer,
int64_t insertRows,
int64_t startFrom, int64_t startTime, int *pSamplePos)
{
SSuperTable* superTblInfo = pThreadInfo->superTblInfo;
int ncols_per_record = 1; // count first col ts
if (superTblInfo == NULL) {
int datatypeSeq = 0;
while(g_args.datatype[datatypeSeq]) {
datatypeSeq ++;
ncols_per_record ++;
}
}
assert(buffer != NULL);
memset(buffer, 0, superTblInfo?superTblInfo->maxSqlLen:g_args.max_sql_len);
char *pstr = buffer;
int headLen = generateSQLHead(pTblName, tableSeq, pThreadInfo, superTblInfo, buffer);
pstr += headLen;
int k;
int dataLen;
k = generateDataTail(pTblName, tableSeq, pThreadInfo, superTblInfo,
g_args.num_of_RPR, pstr, insertRows, startFrom, startTime,
pSamplePos, &dataLen);
return k; return k;
} }
static void* syncWriteInterlace(threadInfo *pThreadInfo) {
debugPrint("[%d] %s() LN%d: ### interlace write\n",
pThreadInfo->threadID, __func__, __LINE__);
SSuperTable* superTblInfo = pThreadInfo->superTblInfo;
char* buffer = calloc(superTblInfo?superTblInfo->maxSqlLen:g_args.max_sql_len, 1);
if (NULL == buffer) {
errorPrint( "Failed to alloc %d Bytes, reason:%s\n",
superTblInfo?superTblInfo->maxSqlLen:g_args.max_sql_len,
strerror(errno));
return NULL;
}
int insertMode;
char tableName[TSDB_TABLE_NAME_LEN];
int rowsPerTbl = superTblInfo?superTblInfo->rowsPerTbl:g_args.rows_per_tbl;
if (rowsPerTbl > 0) {
insertMode = INTERLACE_INSERT_MODE;
} else {
insertMode = PROGRESSIVE_INSERT_MODE;
}
// rows per table need be less than insert batch
if (rowsPerTbl > g_args.num_of_RPR)
rowsPerTbl = g_args.num_of_RPR;
pThreadInfo->totalInsertRows = 0;
pThreadInfo->totalAffectedRows = 0;
int64_t insertRows = (superTblInfo)?superTblInfo->insertRows:g_args.num_of_DPT;
int insert_interval = superTblInfo?superTblInfo->insertInterval:g_args.insert_interval;
uint64_t st = 0;
uint64_t et = 0xffffffff;
int64_t lastPrintTime = taosGetTimestampMs();
int64_t startTs = taosGetTimestampUs();
int64_t endTs;
int tableSeq = pThreadInfo->start_table_from;
debugPrint("[%d] %s() LN%d: start_table_from=%d ntables=%d insertRows=%"PRId64"\n",
pThreadInfo->threadID, __func__, __LINE__, pThreadInfo->start_table_from,
pThreadInfo->ntables, insertRows);
int64_t startTime = pThreadInfo->start_time;
int batchPerTblTimes;
int batchPerTbl;
assert(pThreadInfo->ntables > 0);
if (rowsPerTbl > g_args.num_of_RPR)
rowsPerTbl = g_args.num_of_RPR;
batchPerTbl = rowsPerTbl;
if ((rowsPerTbl > 0) && (pThreadInfo->ntables > 1)) {
batchPerTblTimes =
(g_args.num_of_RPR / (rowsPerTbl * pThreadInfo->ntables)) + 1;
} else {
batchPerTblTimes = 1;
}
int generatedRecPerTbl = 0;
bool flagSleep = true;
int sleepTimeTotal = 0;
while(pThreadInfo->totalInsertRows < pThreadInfo->ntables * insertRows) {
if ((flagSleep) && (insert_interval)) {
st = taosGetTimestampUs();
flagSleep = false;
}
// generate data
memset(buffer, 0, superTblInfo?superTblInfo->maxSqlLen:g_args.max_sql_len);
char *pstr = buffer;
int recOfBatch = 0;
for (int i = 0; i < batchPerTblTimes; i ++) {
getTableName(tableName, pThreadInfo, tableSeq);
int headLen;
if (i == 0) {
headLen = generateSQLHead(tableName, tableSeq, pThreadInfo,
superTblInfo, pstr);
} else {
headLen = snprintf(pstr, TSDB_TABLE_NAME_LEN, "%s.%s values",
pThreadInfo->db_name,
tableName);
}
// generate data buffer
verbosePrint("[%d] %s() LN%d i=%d buffer:\n%s\n",
pThreadInfo->threadID, __func__, __LINE__, i, buffer);
pstr += headLen;
int dataLen = 0;
verbosePrint("[%d] %s() LN%d i=%d batchPerTblTimes=%d batchPerTbl = %d\n",
pThreadInfo->threadID, __func__, __LINE__,
i, batchPerTblTimes, batchPerTbl);
generateDataTail(
tableName, tableSeq, pThreadInfo, superTblInfo,
batchPerTbl, pstr, insertRows, 0,
startTime + sleepTimeTotal +
pThreadInfo->totalInsertRows * superTblInfo->timeStampStep,
&(pThreadInfo->samplePos), &dataLen);
pstr += dataLen;
recOfBatch += batchPerTbl;
pThreadInfo->totalInsertRows += batchPerTbl;
verbosePrint("[%d] %s() LN%d batchPerTbl=%d recOfBatch=%d\n",
pThreadInfo->threadID, __func__, __LINE__,
batchPerTbl, recOfBatch);
tableSeq ++;
if (insertMode == INTERLACE_INSERT_MODE) {
if (tableSeq == pThreadInfo->start_table_from + pThreadInfo->ntables) {
// turn to first table
tableSeq = pThreadInfo->start_table_from;
generatedRecPerTbl += batchPerTbl;
flagSleep = true;
if (generatedRecPerTbl >= insertRows)
break;
if (pThreadInfo->ntables * batchPerTbl < g_args.num_of_RPR)
break;
}
}
int remainRows = insertRows - generatedRecPerTbl;
if ((remainRows > 0) && (batchPerTbl > remainRows))
batchPerTbl = remainRows;
verbosePrint("[%d] %s() LN%d generatedRecPerTbl=%d insertRows=%"PRId64"\n",
pThreadInfo->threadID, __func__, __LINE__,
generatedRecPerTbl, insertRows);
if ((g_args.num_of_RPR - recOfBatch) < batchPerTbl)
break;
}
verbosePrint("[%d] %s() LN%d recOfBatch=%d totalInsertRows=%"PRId64"\n",
pThreadInfo->threadID, __func__, __LINE__, recOfBatch,
pThreadInfo->totalInsertRows);
verbosePrint("[%d] %s() LN%d, buffer=%s\n",
pThreadInfo->threadID, __func__, __LINE__, buffer);
int affectedRows = execInsert(pThreadInfo, buffer, recOfBatch);
verbosePrint("[%d] %s() LN%d affectedRows=%d\n", pThreadInfo->threadID,
__func__, __LINE__, affectedRows);
if ((affectedRows < 0) || (recOfBatch != affectedRows)) {
errorPrint("[%d] %s() LN%d execInsert insert %d, affected rows: %d\n%s\n",
pThreadInfo->threadID, __func__, __LINE__,
recOfBatch, affectedRows, buffer);
goto free_and_statistics_interlace;
}
pThreadInfo->totalAffectedRows += affectedRows;
endTs = taosGetTimestampUs();
int64_t delay = endTs - startTs;
if (delay > pThreadInfo->maxDelay) pThreadInfo->maxDelay = delay;
if (delay < pThreadInfo->minDelay) pThreadInfo->minDelay = delay;
pThreadInfo->cntDelay++;
pThreadInfo->totalDelay += delay;
int64_t currentPrintTime = taosGetTimestampMs();
if (currentPrintTime - lastPrintTime > 30*1000) {
printf("thread[%d] has currently inserted rows: %"PRId64 ", affected rows: %"PRId64 "\n",
pThreadInfo->threadID,
pThreadInfo->totalInsertRows,
pThreadInfo->totalAffectedRows);
lastPrintTime = currentPrintTime;
}
if ((insert_interval) && flagSleep) {
et = taosGetTimestampUs();
if (insert_interval > ((et - st)/1000) ) {
int sleepTime = insert_interval - (et -st)/1000;
// verbosePrint("%s() LN%d sleep: %d ms for insert interval\n",
// __func__, __LINE__, sleepTime);
taosMsleep(sleepTime); // ms
sleepTimeTotal += insert_interval;
}
}
}
free_and_statistics_interlace:
tmfree(buffer);
printf("====thread[%d] completed total inserted rows: %"PRId64 ", total affected rows: %"PRId64 "====\n",
pThreadInfo->threadID,
pThreadInfo->totalInsertRows,
pThreadInfo->totalAffectedRows);
return NULL;
}
// sync insertion // sync insertion
/* /*
1 thread: 100 tables * 2000 rows/s 1 thread: 100 tables * 2000 rows/s
...@@ -4307,14 +4621,14 @@ static int generateDataBuffer(int32_t tableSeq, ...@@ -4307,14 +4621,14 @@ static int generateDataBuffer(int32_t tableSeq,
2 taosinsertdata , 1 thread: 10 tables * 20000 rows/s 2 taosinsertdata , 1 thread: 10 tables * 20000 rows/s
*/ */
static void* syncWrite(void *sarg) { static void* syncWriteProgressive(threadInfo *pThreadInfo) {
debugPrint("%s() LN%d: ### progressive write\n", __func__, __LINE__);
threadInfo *winfo = (threadInfo *)sarg; SSuperTable* superTblInfo = pThreadInfo->superTblInfo;
SSuperTable* superTblInfo = winfo->superTblInfo;
char* buffer = calloc(superTblInfo?superTblInfo->maxSqlLen:g_args.max_sql_len, 1); char* buffer = calloc(superTblInfo?superTblInfo->maxSqlLen:g_args.max_sql_len, 1);
if (NULL == buffer) { if (NULL == buffer) {
fprintf(stderr, "Failed to alloc %d Bytes, reason:%s\n", errorPrint( "Failed to alloc %d Bytes, reason:%s\n",
superTblInfo?superTblInfo->maxSqlLen:g_args.max_sql_len, superTblInfo?superTblInfo->maxSqlLen:g_args.max_sql_len,
strerror(errno)); strerror(errno));
return NULL; return NULL;
...@@ -4324,19 +4638,18 @@ static void* syncWrite(void *sarg) { ...@@ -4324,19 +4638,18 @@ static void* syncWrite(void *sarg) {
int64_t startTs = taosGetTimestampUs(); int64_t startTs = taosGetTimestampUs();
int64_t endTs; int64_t endTs;
int insert_interval = superTblInfo?superTblInfo->insertInterval: int insert_interval = superTblInfo?superTblInfo->insertInterval:g_args.insert_interval;
g_args.insert_interval;
uint64_t st = 0; uint64_t st = 0;
uint64_t et = 0xffffffff; uint64_t et = 0xffffffff;
winfo->totalInsertRows = 0; pThreadInfo->totalInsertRows = 0;
winfo->totalAffectedRows = 0; pThreadInfo->totalAffectedRows = 0;
winfo->samplePos = 0; pThreadInfo->samplePos = 0;
for (uint32_t tableSeq = winfo->start_table_id; tableSeq <= winfo->end_table_id; for (uint32_t tableSeq = pThreadInfo->start_table_from; tableSeq <= pThreadInfo->end_table_to;
tableSeq ++) { tableSeq ++) {
int64_t start_time = winfo->start_time; int64_t start_time = pThreadInfo->start_time;
int64_t insertRows = (superTblInfo)?superTblInfo->insertRows:g_args.num_of_DPT; int64_t insertRows = (superTblInfo)?superTblInfo->insertRows:g_args.num_of_DPT;
verbosePrint("%s() LN%d insertRows=%"PRId64"\n", __func__, __LINE__, insertRows); verbosePrint("%s() LN%d insertRows=%"PRId64"\n", __func__, __LINE__, insertRows);
...@@ -4346,34 +4659,39 @@ static void* syncWrite(void *sarg) { ...@@ -4346,34 +4659,39 @@ static void* syncWrite(void *sarg) {
st = taosGetTimestampUs(); st = taosGetTimestampUs();
} }
int generated = generateDataBuffer(tableSeq, winfo, buffer, insertRows, char tableName[TSDB_TABLE_NAME_LEN];
i, start_time, &(winfo->samplePos)); getTableName(tableName, pThreadInfo, tableSeq);
verbosePrint("%s() LN%d: tid=%d seq=%d tableName=%s\n",
__func__, __LINE__,
pThreadInfo->threadID, tableSeq, tableName);
int generated = generateDataBuffer(tableName, tableSeq, pThreadInfo, buffer, insertRows,
i, start_time, &(pThreadInfo->samplePos));
if (generated > 0) if (generated > 0)
i += generated; i += generated;
else else
goto free_and_statistics_2; goto free_and_statistics_2;
int affectedRows = execInsert(winfo, buffer, generated); int affectedRows = execInsert(pThreadInfo, buffer, generated);
if (affectedRows < 0) if (affectedRows < 0)
goto free_and_statistics_2; goto free_and_statistics_2;
pThreadInfo->totalInsertRows += generated;
winfo->totalInsertRows += generated; pThreadInfo->totalAffectedRows += affectedRows;
winfo->totalAffectedRows += affectedRows;
endTs = taosGetTimestampUs(); endTs = taosGetTimestampUs();
int64_t delay = endTs - startTs; int64_t delay = endTs - startTs;
if (delay > winfo->maxDelay) winfo->maxDelay = delay; if (delay > pThreadInfo->maxDelay) pThreadInfo->maxDelay = delay;
if (delay < winfo->minDelay) winfo->minDelay = delay; if (delay < pThreadInfo->minDelay) pThreadInfo->minDelay = delay;
winfo->cntDelay++; pThreadInfo->cntDelay++;
winfo->totalDelay += delay; pThreadInfo->totalDelay += delay;
int64_t currentPrintTime = taosGetTimestampMs(); int64_t currentPrintTime = taosGetTimestampMs();
if (currentPrintTime - lastPrintTime > 30*1000) { if (currentPrintTime - lastPrintTime > 30*1000) {
printf("thread[%d] has currently inserted rows: %"PRId64 ", affected rows: %"PRId64 "\n", printf("thread[%d] has currently inserted rows: %"PRId64 ", affected rows: %"PRId64 "\n",
winfo->threadID, pThreadInfo->threadID,
winfo->totalInsertRows, pThreadInfo->totalInsertRows,
winfo->totalAffectedRows); pThreadInfo->totalAffectedRows);
lastPrintTime = currentPrintTime; lastPrintTime = currentPrintTime;
} }
...@@ -4391,10 +4709,11 @@ static void* syncWrite(void *sarg) { ...@@ -4391,10 +4709,11 @@ static void* syncWrite(void *sarg) {
} }
} // num_of_DPT } // num_of_DPT
if ((tableSeq == winfo->end_table_id) && superTblInfo && if ((tableSeq == pThreadInfo->ntables - 1) && superTblInfo &&
(0 == strncasecmp( (0 == strncasecmp(
superTblInfo->dataSource, "sample", strlen("sample")))) { superTblInfo->dataSource, "sample", strlen("sample")))) {
printf("%s() LN%d samplePos=%d\n", __func__, __LINE__, winfo->samplePos); printf("%s() LN%d samplePos=%d\n",
__func__, __LINE__, pThreadInfo->samplePos);
} }
} // tableSeq } // tableSeq
...@@ -4402,12 +4721,28 @@ free_and_statistics_2: ...@@ -4402,12 +4721,28 @@ free_and_statistics_2:
tmfree(buffer); tmfree(buffer);
printf("====thread[%d] completed total inserted rows: %"PRId64 ", total affected rows: %"PRId64 "====\n", printf("====thread[%d] completed total inserted rows: %"PRId64 ", total affected rows: %"PRId64 "====\n",
winfo->threadID, pThreadInfo->threadID,
winfo->totalInsertRows, pThreadInfo->totalInsertRows,
winfo->totalAffectedRows); pThreadInfo->totalAffectedRows);
return NULL; return NULL;
} }
static void* syncWrite(void *sarg) {
threadInfo *winfo = (threadInfo *)sarg;
SSuperTable* superTblInfo = winfo->superTblInfo;
int rowsPerTbl = superTblInfo?superTblInfo->rowsPerTbl:g_args.rows_per_tbl;
if (rowsPerTbl > 0) {
// interlace mode
return syncWriteInterlace(winfo);
} else {
// progressive mode
return syncWriteProgressive(winfo);
}
}
void callBack(void *param, TAOS_RES *res, int code) { void callBack(void *param, TAOS_RES *res, int code) {
threadInfo* winfo = (threadInfo*)param; threadInfo* winfo = (threadInfo*)param;
SSuperTable* superTblInfo = winfo->superTblInfo; SSuperTable* superTblInfo = winfo->superTblInfo;
...@@ -4423,13 +4758,14 @@ void callBack(void *param, TAOS_RES *res, int code) { ...@@ -4423,13 +4758,14 @@ void callBack(void *param, TAOS_RES *res, int code) {
char *buffer = calloc(1, winfo->superTblInfo->maxSqlLen); char *buffer = calloc(1, winfo->superTblInfo->maxSqlLen);
char *data = calloc(1, MAX_DATA_SIZE); char *data = calloc(1, MAX_DATA_SIZE);
char *pstr = buffer; char *pstr = buffer;
pstr += sprintf(pstr, "insert into %s.%s%d values", winfo->db_name, winfo->tb_prefix, winfo->start_table_id); pstr += sprintf(pstr, "insert into %s.%s%d values", winfo->db_name, winfo->tb_prefix,
winfo->start_table_from);
// if (winfo->counter >= winfo->superTblInfo->insertRows) { // if (winfo->counter >= winfo->superTblInfo->insertRows) {
if (winfo->counter >= g_args.num_of_RPR) { if (winfo->counter >= g_args.num_of_RPR) {
winfo->start_table_id++; winfo->start_table_from++;
winfo->counter = 0; winfo->counter = 0;
} }
if (winfo->start_table_id > winfo->end_table_id) { if (winfo->start_table_from > winfo->end_table_to) {
tsem_post(&winfo->lock_sem); tsem_post(&winfo->lock_sem);
free(buffer); free(buffer);
free(data); free(data);
...@@ -4538,7 +4874,7 @@ static void startMultiThreadInsertData(int threads, char* db_name, ...@@ -4538,7 +4874,7 @@ static void startMultiThreadInsertData(int threads, char* db_name,
} else if (0 == strncasecmp(precision, "us", 2)) { } else if (0 == strncasecmp(precision, "us", 2)) {
timePrec = TSDB_TIME_PRECISION_MICRO; timePrec = TSDB_TIME_PRECISION_MICRO;
} else { } else {
fprintf(stderr, "No support precision: %s\n", precision); errorPrint( "No support precision: %s\n", precision);
exit(-1); exit(-1);
} }
} }
...@@ -4553,8 +4889,7 @@ static void startMultiThreadInsertData(int threads, char* db_name, ...@@ -4553,8 +4889,7 @@ static void startMultiThreadInsertData(int threads, char* db_name,
&start_time, &start_time,
strlen(superTblInfo->startTimestamp), strlen(superTblInfo->startTimestamp),
timePrec, 0)) { timePrec, 0)) {
printf("ERROR to parse time!\n"); ERROR_EXIT("failed to parse time!\n");
exit(-1);
} }
} }
} else { } else {
...@@ -4563,51 +4898,69 @@ static void startMultiThreadInsertData(int threads, char* db_name, ...@@ -4563,51 +4898,69 @@ static void startMultiThreadInsertData(int threads, char* db_name,
double start = getCurrentTime(); double start = getCurrentTime();
int last; int startFrom;
if ((superTblInfo) && (superTblInfo->childTblOffset >= 0)) if ((superTblInfo) && (superTblInfo->childTblOffset >= 0))
last = superTblInfo->childTblOffset; startFrom = superTblInfo->childTblOffset;
else else
last = 0; startFrom = 0;
// read sample data from file first // read sample data from file first
if ((superTblInfo) && (0 == strncasecmp(superTblInfo->dataSource, if ((superTblInfo) && (0 == strncasecmp(superTblInfo->dataSource,
"sample", strlen("sample")))) { "sample", strlen("sample")))) {
if (0 != prepareSampleDataForSTable(superTblInfo)) { if (0 != prepareSampleDataForSTable(superTblInfo)) {
fprintf(stderr, "prepare sample data for stable failed!\n"); errorPrint("%s() LN%d, prepare sample data for stable failed!\n", __func__, __LINE__);
exit(-1); exit(-1);
} }
} }
if (superTblInfo && (superTblInfo->childTblOffset >= 0) // read sample data from file first
&& (superTblInfo->childTblLimit > 0)) { if ((superTblInfo) && (0 == strncasecmp(superTblInfo->dataSource,
"sample", strlen("sample")))) {
if (0 != prepareSampleDataForSTable(superTblInfo)) {
errorPrint("%s() LN%d, prepare sample data for stable failed!\n", __func__, __LINE__);
exit(-1);
}
}
TAOS* taos = taos_connect( TAOS* taos = taos_connect(
g_Dbs.host, g_Dbs.user, g_Dbs.host, g_Dbs.user,
g_Dbs.password, db_name, g_Dbs.port); g_Dbs.password, db_name, g_Dbs.port);
if (NULL == taos) { if (NULL == taos) {
fprintf(stderr, "connect to server fail , reason: %s\n", errorPrint("%s() LN%d, connect to server fail , reason: %s\n",
taos_errstr(NULL)); __func__, __LINE__, taos_errstr(NULL));
exit(-1); exit(-1);
} }
if (superTblInfo) {
int limit, offset;
if (superTblInfo && (superTblInfo->childTblOffset >= 0)
&& (superTblInfo->childTblLimit > 0)) {
limit = superTblInfo->childTblLimit;
offset = superTblInfo->childTblOffset;
} else {
limit = superTblInfo->childTblCount;
offset = 0;
}
superTblInfo->childTblName = (char*)calloc(1, superTblInfo->childTblName = (char*)calloc(1,
superTblInfo->childTblLimit * TSDB_TABLE_NAME_LEN); limit * TSDB_TABLE_NAME_LEN);
if (superTblInfo->childTblName == NULL) { if (superTblInfo->childTblName == NULL) {
fprintf(stderr, "alloc memory failed!"); errorPrint("%s() LN%d, alloc memory failed!\n", __func__, __LINE__);
taos_close(taos); taos_close(taos);
exit(-1); exit(-1);
} }
int childTblCount;
int childTblCount;
getChildNameOfSuperTableWithLimitAndOffset( getChildNameOfSuperTableWithLimitAndOffset(
taos, taos,
db_name, superTblInfo->sTblName, db_name, superTblInfo->sTblName,
&superTblInfo->childTblName, &childTblCount, &superTblInfo->childTblName, &childTblCount,
superTblInfo->childTblLimit, limit,
superTblInfo->childTblOffset); offset);
taos_close(taos);
} }
taos_close(taos);
for (int i = 0; i < threads; i++) { for (int i = 0; i < threads; i++) {
threadInfo *t_info = infos + i; threadInfo *t_info = infos + i;
...@@ -4625,7 +4978,7 @@ static void startMultiThreadInsertData(int threads, char* db_name, ...@@ -4625,7 +4978,7 @@ static void startMultiThreadInsertData(int threads, char* db_name,
g_Dbs.host, g_Dbs.user, g_Dbs.host, g_Dbs.user,
g_Dbs.password, db_name, g_Dbs.port); g_Dbs.password, db_name, g_Dbs.port);
if (NULL == t_info->taos) { if (NULL == t_info->taos) {
printf("connect to server fail from insert sub thread, reason: %s\n", errorPrint( "connect to server fail from insert sub thread, reason: %s\n",
taos_errstr(NULL)); taos_errstr(NULL));
exit(-1); exit(-1);
} }
...@@ -4635,12 +4988,13 @@ static void startMultiThreadInsertData(int threads, char* db_name, ...@@ -4635,12 +4988,13 @@ static void startMultiThreadInsertData(int threads, char* db_name,
if ((NULL == superTblInfo) if ((NULL == superTblInfo)
|| (0 == superTblInfo->multiThreadWriteOneTbl)) { || (0 == superTblInfo->multiThreadWriteOneTbl)) {
t_info->start_table_id = last; t_info->start_table_from = startFrom;
t_info->end_table_id = i < b ? last + a : last + a - 1; t_info->ntables = i<b?a+1:a;
last = t_info->end_table_id + 1; t_info->end_table_to = i < b ? startFrom + a : startFrom + a - 1;
startFrom = t_info->end_table_to + 1;
} else { } else {
t_info->start_table_id = 0; t_info->start_table_from = 0;
t_info->end_table_id = superTblInfo->childTblCount - 1; t_info->ntables = superTblInfo->childTblCount;
t_info->start_time = t_info->start_time + rand_int() % 10000 - rand_tinyint(); t_info->start_time = t_info->start_time + rand_int() % 10000 - rand_tinyint();
} }
...@@ -4668,9 +5022,16 @@ static void startMultiThreadInsertData(int threads, char* db_name, ...@@ -4668,9 +5022,16 @@ static void startMultiThreadInsertData(int threads, char* db_name,
tsem_destroy(&(t_info->lock_sem)); tsem_destroy(&(t_info->lock_sem));
taos_close(t_info->taos); taos_close(t_info->taos);
debugPrint("%s() LN%d, [%d] totalInsert=%"PRId64" totalAffected=%"PRId64"\n",
__func__, __LINE__,
t_info->threadID, t_info->totalInsertRows,
t_info->totalAffectedRows);
if (superTblInfo) { if (superTblInfo) {
superTblInfo->totalAffectedRows += t_info->totalAffectedRows; superTblInfo->totalAffectedRows += t_info->totalAffectedRows;
superTblInfo->totalInsertRows += t_info->totalInsertRows; superTblInfo->totalInsertRows += t_info->totalInsertRows;
} else {
g_args.totalAffectedRows += t_info->totalAffectedRows;
g_args.totalInsertRows += t_info->totalInsertRows;
} }
totalDelay += t_info->totalDelay; totalDelay += t_info->totalDelay;
...@@ -4698,6 +5059,18 @@ static void startMultiThreadInsertData(int threads, char* db_name, ...@@ -4698,6 +5059,18 @@ static void startMultiThreadInsertData(int threads, char* db_name,
superTblInfo->totalAffectedRows, superTblInfo->totalAffectedRows,
threads, db_name, superTblInfo->sTblName, threads, db_name, superTblInfo->sTblName,
superTblInfo->totalInsertRows/ t); superTblInfo->totalInsertRows/ t);
} else {
printf("Spent %.4f seconds to insert rows: %"PRId64", affected rows: %"PRId64" with %d thread(s) into %s %2.f records/second\n\n",
t, g_args.totalInsertRows,
g_args.totalAffectedRows,
threads, db_name,
g_args.totalInsertRows / t);
fprintf(g_fpOfInsertResult,
"Spent %.4f seconds to insert rows: %"PRId64", affected rows: %"PRId64" with %d thread(s) into %s %2.f records/second\n\n",
t, g_args.totalInsertRows,
g_args.totalAffectedRows,
threads, db_name,
g_args.totalInsertRows / t);
} }
printf("insert delay, avg: %10.6fms, max: %10.6fms, min: %10.6fms\n\n", printf("insert delay, avg: %10.6fms, max: %10.6fms, min: %10.6fms\n\n",
...@@ -4720,7 +5093,7 @@ void *readTable(void *sarg) { ...@@ -4720,7 +5093,7 @@ void *readTable(void *sarg) {
char *tb_prefix = rinfo->tb_prefix; char *tb_prefix = rinfo->tb_prefix;
FILE *fp = fopen(rinfo->fp, "a"); FILE *fp = fopen(rinfo->fp, "a");
if (NULL == fp) { if (NULL == fp) {
printf("fopen %s fail, reason:%s.\n", rinfo->fp, strerror(errno)); errorPrint( "fopen %s fail, reason:%s.\n", rinfo->fp, strerror(errno));
return NULL; return NULL;
} }
...@@ -4732,7 +5105,7 @@ void *readTable(void *sarg) { ...@@ -4732,7 +5105,7 @@ void *readTable(void *sarg) {
num_of_DPT = g_args.num_of_DPT; num_of_DPT = g_args.num_of_DPT;
// } // }
int num_of_tables = rinfo->end_table_id - rinfo->start_table_id + 1; int num_of_tables = rinfo->ntables; // rinfo->end_table_to - rinfo->start_table_from + 1;
int totalData = num_of_DPT * num_of_tables; int totalData = num_of_DPT * num_of_tables;
bool do_aggreFunc = g_Dbs.do_aggreFunc; bool do_aggreFunc = g_Dbs.do_aggreFunc;
...@@ -4754,7 +5127,7 @@ void *readTable(void *sarg) { ...@@ -4754,7 +5127,7 @@ void *readTable(void *sarg) {
int32_t code = taos_errno(pSql); int32_t code = taos_errno(pSql);
if (code != 0) { if (code != 0) {
fprintf(stderr, "Failed to query:%s\n", taos_errstr(pSql)); errorPrint( "Failed to query:%s\n", taos_errstr(pSql));
taos_free_result(pSql); taos_free_result(pSql);
taos_close(taos); taos_close(taos);
fclose(fp); fclose(fp);
...@@ -4794,7 +5167,7 @@ void *readMetric(void *sarg) { ...@@ -4794,7 +5167,7 @@ void *readMetric(void *sarg) {
} }
int num_of_DPT = rinfo->superTblInfo->insertRows; int num_of_DPT = rinfo->superTblInfo->insertRows;
int num_of_tables = rinfo->end_table_id - rinfo->start_table_id + 1; int num_of_tables = rinfo->ntables; // rinfo->end_table_to - rinfo->start_table_from + 1;
int totalData = num_of_DPT * num_of_tables; int totalData = num_of_DPT * num_of_tables;
bool do_aggreFunc = g_Dbs.do_aggreFunc; bool do_aggreFunc = g_Dbs.do_aggreFunc;
...@@ -4830,7 +5203,7 @@ void *readMetric(void *sarg) { ...@@ -4830,7 +5203,7 @@ void *readMetric(void *sarg) {
int32_t code = taos_errno(pSql); int32_t code = taos_errno(pSql);
if (code != 0) { if (code != 0) {
fprintf(stderr, "Failed to query:%s\n", taos_errstr(pSql)); errorPrint( "Failed to query:%s\n", taos_errstr(pSql));
taos_free_result(pSql); taos_free_result(pSql);
taos_close(taos); taos_close(taos);
fclose(fp); fclose(fp);
...@@ -4842,7 +5215,8 @@ void *readMetric(void *sarg) { ...@@ -4842,7 +5215,8 @@ void *readMetric(void *sarg) {
} }
t = getCurrentTime() - t; t = getCurrentTime() - t;
fprintf(fp, "| Speed: %12.2f(per s) | Latency: %.4f(ms) |\n", num_of_tables * num_of_DPT / t, t * 1000); fprintf(fp, "| Speed: %12.2f(per s) | Latency: %.4f(ms) |\n",
num_of_tables * num_of_DPT / t, t * 1000);
printf("select %10s took %.6f second(s)\n\n", aggreFunc[j], t); printf("select %10s took %.6f second(s)\n\n", aggreFunc[j], t);
taos_free_result(pSql); taos_free_result(pSql);
...@@ -4867,7 +5241,7 @@ static int insertTestProcess() { ...@@ -4867,7 +5241,7 @@ static int insertTestProcess() {
debugPrint("%d result file: %s\n", __LINE__, g_Dbs.resultFile); debugPrint("%d result file: %s\n", __LINE__, g_Dbs.resultFile);
g_fpOfInsertResult = fopen(g_Dbs.resultFile, "a"); g_fpOfInsertResult = fopen(g_Dbs.resultFile, "a");
if (NULL == g_fpOfInsertResult) { if (NULL == g_fpOfInsertResult) {
fprintf(stderr, "Failed to open %s for save result\n", g_Dbs.resultFile); errorPrint( "Failed to open %s for save result\n", g_Dbs.resultFile);
return -1; return -1;
} }
...@@ -4956,7 +5330,7 @@ void *superQueryProcess(void *sarg) { ...@@ -4956,7 +5330,7 @@ void *superQueryProcess(void *sarg) {
while (1) { while (1) {
if (g_queryInfo.superQueryInfo.rate && (et - st) < (int64_t)g_queryInfo.superQueryInfo.rate*1000) { if (g_queryInfo.superQueryInfo.rate && (et - st) < (int64_t)g_queryInfo.superQueryInfo.rate*1000) {
taosMsleep(g_queryInfo.superQueryInfo.rate*1000 - (et - st)); // ms taosMsleep(g_queryInfo.superQueryInfo.rate*1000 - (et - st)); // ms
//printf("========sleep duration:%"PRId64 "========inserted rows:%d, table range:%d - %d\n", (1000 - (et - st)), i, winfo->start_table_id, winfo->end_table_id); //printf("========sleep duration:%"PRId64 "========inserted rows:%d, table range:%d - %d\n", (1000 - (et - st)), i, winfo->start_table_from, winfo->end_table_to);
} }
st = taosGetTimestampUs(); st = taosGetTimestampUs();
...@@ -5020,13 +5394,14 @@ static void *subQueryProcess(void *sarg) { ...@@ -5020,13 +5394,14 @@ static void *subQueryProcess(void *sarg) {
int64_t st = 0; int64_t st = 0;
int64_t et = (int64_t)g_queryInfo.subQueryInfo.rate*1000; int64_t et = (int64_t)g_queryInfo.subQueryInfo.rate*1000;
while (1) { while (1) {
if (g_queryInfo.subQueryInfo.rate && (et - st) < (int64_t)g_queryInfo.subQueryInfo.rate*1000) { if (g_queryInfo.subQueryInfo.rate
&& (et - st) < (int64_t)g_queryInfo.subQueryInfo.rate*1000) {
taosMsleep(g_queryInfo.subQueryInfo.rate*1000 - (et - st)); // ms taosMsleep(g_queryInfo.subQueryInfo.rate*1000 - (et - st)); // ms
//printf("========sleep duration:%"PRId64 "========inserted rows:%d, table range:%d - %d\n", (1000 - (et - st)), i, winfo->start_table_id, winfo->end_table_id); //printf("========sleep duration:%"PRId64 "========inserted rows:%d, table range:%d - %d\n", (1000 - (et - st)), i, winfo->start_table_from, winfo->end_table_to);
} }
st = taosGetTimestampUs(); st = taosGetTimestampUs();
for (int i = winfo->start_table_id; i <= winfo->end_table_id; i++) { for (int i = winfo->start_table_from; i <= winfo->end_table_to; i++) {
for (int j = 0; j < g_queryInfo.subQueryInfo.sqlCount; j++) { for (int j = 0; j < g_queryInfo.subQueryInfo.sqlCount; j++) {
memset(sqlstr,0,sizeof(sqlstr)); memset(sqlstr,0,sizeof(sqlstr));
replaceSubTblName(g_queryInfo.subQueryInfo.sql[j], sqlstr, i); replaceSubTblName(g_queryInfo.subQueryInfo.sql[j], sqlstr, i);
...@@ -5042,8 +5417,8 @@ static void *subQueryProcess(void *sarg) { ...@@ -5042,8 +5417,8 @@ static void *subQueryProcess(void *sarg) {
et = taosGetTimestampUs(); et = taosGetTimestampUs();
printf("####thread[%"PRId64"] complete all sqls to allocate all sub-tables[%d - %d] once queries duration:%.4fs\n\n", printf("####thread[%"PRId64"] complete all sqls to allocate all sub-tables[%d - %d] once queries duration:%.4fs\n\n",
taosGetSelfPthreadId(), taosGetSelfPthreadId(),
winfo->start_table_id, winfo->start_table_from,
winfo->end_table_id, winfo->end_table_to,
(double)(et - st)/1000000.0); (double)(et - st)/1000000.0);
} }
return NULL; return NULL;
...@@ -5057,7 +5432,7 @@ static int queryTestProcess() { ...@@ -5057,7 +5432,7 @@ static int queryTestProcess() {
NULL, NULL,
g_queryInfo.port); g_queryInfo.port);
if (taos == NULL) { if (taos == NULL) {
fprintf(stderr, "Failed to connect to TDengine, reason:%s\n", taos_errstr(NULL)); errorPrint( "Failed to connect to TDengine, reason:%s\n", taos_errstr(NULL));
exit(-1); exit(-1);
} }
...@@ -5081,7 +5456,8 @@ static int queryTestProcess() { ...@@ -5081,7 +5456,8 @@ static int queryTestProcess() {
pthread_t *pids = NULL; pthread_t *pids = NULL;
threadInfo *infos = NULL; threadInfo *infos = NULL;
//==== create sub threads for query from specify table //==== create sub threads for query from specify table
if (g_queryInfo.superQueryInfo.sqlCount > 0 && g_queryInfo.superQueryInfo.concurrent > 0) { if (g_queryInfo.superQueryInfo.sqlCount > 0
&& g_queryInfo.superQueryInfo.concurrent > 0) {
pids = malloc(g_queryInfo.superQueryInfo.concurrent * sizeof(pthread_t)); pids = malloc(g_queryInfo.superQueryInfo.concurrent * sizeof(pthread_t));
infos = malloc(g_queryInfo.superQueryInfo.concurrent * sizeof(threadInfo)); infos = malloc(g_queryInfo.superQueryInfo.concurrent * sizeof(threadInfo));
...@@ -5139,14 +5515,15 @@ static int queryTestProcess() { ...@@ -5139,14 +5515,15 @@ static int queryTestProcess() {
b = ntables % threads; b = ntables % threads;
} }
int last = 0; int startFrom = 0;
for (int i = 0; i < threads; i++) { for (int i = 0; i < threads; i++) {
threadInfo *t_info = infosOfSub + i; threadInfo *t_info = infosOfSub + i;
t_info->threadID = i; t_info->threadID = i;
t_info->start_table_id = last; t_info->start_table_from = startFrom;
t_info->end_table_id = i < b ? last + a : last + a - 1; t_info->ntables = i<b?a+1:a;
last = t_info->end_table_id + 1; t_info->end_table_to = i < b ? startFrom + a : startFrom + a - 1;
startFrom = t_info->end_table_to + 1;
t_info->taos = taos; t_info->taos = taos;
pthread_create(pidsOfSub + i, NULL, subQueryProcess, t_info); pthread_create(pidsOfSub + i, NULL, subQueryProcess, t_info);
} }
...@@ -5222,7 +5599,7 @@ void *subSubscribeProcess(void *sarg) { ...@@ -5222,7 +5599,7 @@ void *subSubscribeProcess(void *sarg) {
do { do {
//if (g_queryInfo.superQueryInfo.rate && (et - st) < g_queryInfo.superQueryInfo.rate*1000) { //if (g_queryInfo.superQueryInfo.rate && (et - st) < g_queryInfo.superQueryInfo.rate*1000) {
// taosMsleep(g_queryInfo.superQueryInfo.rate*1000 - (et - st)); // ms // taosMsleep(g_queryInfo.superQueryInfo.rate*1000 - (et - st)); // ms
// //printf("========sleep duration:%"PRId64 "========inserted rows:%d, table range:%d - %d\n", (1000 - (et - st)), i, winfo->start_table_id, winfo->end_table_id); // //printf("========sleep duration:%"PRId64 "========inserted rows:%d, table range:%d - %d\n", (1000 - (et - st)), i, winfo->start_table_from, winfo->end_table_to);
//} //}
//st = taosGetTimestampMs(); //st = taosGetTimestampMs();
...@@ -5288,7 +5665,7 @@ void *superSubscribeProcess(void *sarg) { ...@@ -5288,7 +5665,7 @@ void *superSubscribeProcess(void *sarg) {
do { do {
//if (g_queryInfo.superQueryInfo.rate && (et - st) < g_queryInfo.superQueryInfo.rate*1000) { //if (g_queryInfo.superQueryInfo.rate && (et - st) < g_queryInfo.superQueryInfo.rate*1000) {
// taosMsleep(g_queryInfo.superQueryInfo.rate*1000 - (et - st)); // ms // taosMsleep(g_queryInfo.superQueryInfo.rate*1000 - (et - st)); // ms
// //printf("========sleep duration:%"PRId64 "========inserted rows:%d, table range:%d - %d\n", (1000 - (et - st)), i, winfo->start_table_id, winfo->end_table_id); // //printf("========sleep duration:%"PRId64 "========inserted rows:%d, table range:%d - %d\n", (1000 - (et - st)), i, winfo->start_table_from, winfo->end_table_to);
//} //}
//st = taosGetTimestampMs(); //st = taosGetTimestampMs();
...@@ -5355,7 +5732,7 @@ static int subscribeTestProcess() { ...@@ -5355,7 +5732,7 @@ static int subscribeTestProcess() {
g_queryInfo.dbName, g_queryInfo.dbName,
g_queryInfo.port); g_queryInfo.port);
if (taos == NULL) { if (taos == NULL) {
fprintf(stderr, "Failed to connect to TDengine, reason:%s\n", taos_errstr(NULL)); errorPrint( "Failed to connect to TDengine, reason:%s\n", taos_errstr(NULL));
exit(-1); exit(-1);
} }
...@@ -5417,13 +5794,15 @@ static int subscribeTestProcess() { ...@@ -5417,13 +5794,15 @@ static int subscribeTestProcess() {
b = ntables % threads; b = ntables % threads;
} }
int last = 0; int startFrom = 0;
for (int i = 0; i < threads; i++) { for (int i = 0; i < threads; i++) {
threadInfo *t_info = infosOfSub + i; threadInfo *t_info = infosOfSub + i;
t_info->threadID = i; t_info->threadID = i;
t_info->start_table_id = last; t_info->start_table_from = startFrom;
t_info->end_table_id = i < b ? last + a : last + a - 1; t_info->ntables = i<b?a+1:a;
t_info->end_table_to = i < b ? startFrom + a : startFrom + a - 1;
startFrom = t_info->end_table_to + 1;
t_info->taos = taos; t_info->taos = taos;
pthread_create(pidsOfSub + i, NULL, subSubscribeProcess, t_info); pthread_create(pidsOfSub + i, NULL, subSubscribeProcess, t_info);
} }
...@@ -5665,14 +6044,14 @@ void querySqlFile(TAOS* taos, char* sqlFile) ...@@ -5665,14 +6044,14 @@ void querySqlFile(TAOS* taos, char* sqlFile)
} }
static void testMetaFile() { static void testMetaFile() {
if (INSERT_MODE == g_args.test_mode) { if (INSERT_TEST == g_args.test_mode) {
if (g_Dbs.cfgDir[0]) taos_options(TSDB_OPTION_CONFIGDIR, g_Dbs.cfgDir); if (g_Dbs.cfgDir[0]) taos_options(TSDB_OPTION_CONFIGDIR, g_Dbs.cfgDir);
insertTestProcess(); insertTestProcess();
} else if (QUERY_MODE == g_args.test_mode) { } else if (QUERY_TEST == g_args.test_mode) {
if (g_queryInfo.cfgDir[0]) if (g_queryInfo.cfgDir[0])
taos_options(TSDB_OPTION_CONFIGDIR, g_queryInfo.cfgDir); taos_options(TSDB_OPTION_CONFIGDIR, g_queryInfo.cfgDir);
queryTestProcess(); queryTestProcess();
} else if (SUBSCRIBE_MODE == g_args.test_mode) { } else if (SUBSCRIBE_TEST == g_args.test_mode) {
if (g_queryInfo.cfgDir[0]) if (g_queryInfo.cfgDir[0])
taos_options(TSDB_OPTION_CONFIGDIR, g_queryInfo.cfgDir); taos_options(TSDB_OPTION_CONFIGDIR, g_queryInfo.cfgDir);
subscribeTestProcess(); subscribeTestProcess();
...@@ -5689,16 +6068,18 @@ static void queryResult() { ...@@ -5689,16 +6068,18 @@ static void queryResult() {
pthread_t read_id; pthread_t read_id;
threadInfo *rInfo = malloc(sizeof(threadInfo)); threadInfo *rInfo = malloc(sizeof(threadInfo));
rInfo->start_time = 1500000000000; // 2017-07-14 10:40:00.000 rInfo->start_time = 1500000000000; // 2017-07-14 10:40:00.000
rInfo->start_table_id = 0; rInfo->start_table_from = 0;
//rInfo->do_aggreFunc = g_Dbs.do_aggreFunc; //rInfo->do_aggreFunc = g_Dbs.do_aggreFunc;
if (g_args.use_metric) { if (g_args.use_metric) {
rInfo->end_table_id = g_Dbs.db[0].superTbls[0].childTblCount - 1; rInfo->ntables = g_Dbs.db[0].superTbls[0].childTblCount;
rInfo->end_table_to = g_Dbs.db[0].superTbls[0].childTblCount - 1;
rInfo->superTblInfo = &g_Dbs.db[0].superTbls[0]; rInfo->superTblInfo = &g_Dbs.db[0].superTbls[0];
strcpy(rInfo->tb_prefix, strcpy(rInfo->tb_prefix,
g_Dbs.db[0].superTbls[0].childTblPrefix); g_Dbs.db[0].superTbls[0].childTblPrefix);
} else { } else {
rInfo->end_table_id = g_args.num_of_tables -1; rInfo->ntables = g_args.num_of_tables;
rInfo->end_table_to = g_args.num_of_tables -1;
strcpy(rInfo->tb_prefix, g_args.tb_prefix); strcpy(rInfo->tb_prefix, g_args.tb_prefix);
} }
...@@ -5709,7 +6090,7 @@ static void queryResult() { ...@@ -5709,7 +6090,7 @@ static void queryResult() {
g_Dbs.db[0].dbName, g_Dbs.db[0].dbName,
g_Dbs.port); g_Dbs.port);
if (rInfo->taos == NULL) { if (rInfo->taos == NULL) {
fprintf(stderr, "Failed to connect to TDengine, reason:%s\n", taos_errstr(NULL)); errorPrint( "Failed to connect to TDengine, reason:%s\n", taos_errstr(NULL));
free(rInfo); free(rInfo);
exit(-1); exit(-1);
} }
...@@ -5729,7 +6110,7 @@ static void queryResult() { ...@@ -5729,7 +6110,7 @@ static void queryResult() {
static void testCmdLine() { static void testCmdLine() {
g_args.test_mode = INSERT_MODE; g_args.test_mode = INSERT_TEST;
insertTestProcess(); insertTestProcess();
if (g_Dbs.insert_only) if (g_Dbs.insert_only)
......
...@@ -44,7 +44,7 @@ void mnodeDropVgroup(SVgObj *pVgroup, void *ahandle); ...@@ -44,7 +44,7 @@ void mnodeDropVgroup(SVgObj *pVgroup, void *ahandle);
void mnodeAlterVgroup(SVgObj *pVgroup, void *ahandle); void mnodeAlterVgroup(SVgObj *pVgroup, void *ahandle);
int32_t mnodeGetAvailableVgroup(struct SMnodeMsg *pMsg, SVgObj **pVgroup, int32_t *sid); int32_t mnodeGetAvailableVgroup(struct SMnodeMsg *pMsg, SVgObj **pVgroup, int32_t *sid);
void mnodeAddTableIntoVgroup(SVgObj *pVgroup, SCTableObj *pTable); int32_t mnodeAddTableIntoVgroup(SVgObj *pVgroup, SCTableObj *pTable, bool needCheck);
void mnodeRemoveTableFromVgroup(SVgObj *pVgroup, SCTableObj *pTable); void mnodeRemoveTableFromVgroup(SVgObj *pVgroup, SCTableObj *pTable);
void mnodeSendDropVnodeMsg(int32_t vgId, SRpcEpSet *epSet, void *ahandle); void mnodeSendDropVnodeMsg(int32_t vgId, SRpcEpSet *epSet, void *ahandle);
void mnodeSendCreateVgroupMsg(SVgObj *pVgroup, void *ahandle); void mnodeSendCreateVgroupMsg(SVgObj *pVgroup, void *ahandle);
......
...@@ -55,7 +55,7 @@ int32_t mnodeProcessAlterDbMsg(SMnodeMsg *pMsg); ...@@ -55,7 +55,7 @@ int32_t mnodeProcessAlterDbMsg(SMnodeMsg *pMsg);
#ifndef _TOPIC #ifndef _TOPIC
int32_t tpInit() { return 0; } int32_t tpInit() { return 0; }
void tpCleanUp() {} void tpCleanUp() {}
void tpUpdateTs(int32_t *seq, void *pMsg) {} void tpUpdateTs(int32_t vgId, int64_t *seq, void *pMsg) {}
#endif #endif
static void mnodeDestroyDb(SDbObj *pDb) { static void mnodeDestroyDb(SDbObj *pDb) {
......
...@@ -552,7 +552,7 @@ static int32_t sdbInsertHash(SSdbTable *pTable, SSdbRow *pRow) { ...@@ -552,7 +552,7 @@ static int32_t sdbInsertHash(SSdbTable *pTable, SSdbRow *pRow) {
int32_t code = (*pTable->fpInsert)(pRow); int32_t code = (*pTable->fpInsert)(pRow);
if (code != TSDB_CODE_SUCCESS) { if (code != TSDB_CODE_SUCCESS) {
sdbError("vgId:1, sdb:%s, failed to insert key:%s to hash, remove it", pTable->name, sdbError("vgId:1, sdb:%s, failed to perform insert action for key:%s, remove it", pTable->name,
sdbGetRowStr(pTable, pRow->pObj)); sdbGetRowStr(pTable, pRow->pObj));
sdbDeleteHash(pTable, pRow); sdbDeleteHash(pTable, pRow);
} }
......
...@@ -108,10 +108,12 @@ static int32_t mnodeChildTableActionDestroy(SSdbRow *pRow) { ...@@ -108,10 +108,12 @@ static int32_t mnodeChildTableActionDestroy(SSdbRow *pRow) {
static int32_t mnodeChildTableActionInsert(SSdbRow *pRow) { static int32_t mnodeChildTableActionInsert(SSdbRow *pRow) {
SCTableObj *pTable = pRow->pObj; SCTableObj *pTable = pRow->pObj;
int32_t code = 0;
SVgObj *pVgroup = mnodeGetVgroup(pTable->vgId); SVgObj *pVgroup = mnodeGetVgroup(pTable->vgId);
if (pVgroup == NULL) { if (pVgroup == NULL) {
mError("ctable:%s, not in vgId:%d", pTable->info.tableId, pTable->vgId); mError("ctable:%s, not in vgId:%d", pTable->info.tableId, pTable->vgId);
code = -1;
} }
SDbObj *pDb = NULL; SDbObj *pDb = NULL;
...@@ -119,6 +121,7 @@ static int32_t mnodeChildTableActionInsert(SSdbRow *pRow) { ...@@ -119,6 +121,7 @@ static int32_t mnodeChildTableActionInsert(SSdbRow *pRow) {
pDb = mnodeGetDb(pVgroup->dbName); pDb = mnodeGetDb(pVgroup->dbName);
if (pDb == NULL) { if (pDb == NULL) {
mError("ctable:%s, vgId:%d not in db:%s", pTable->info.tableId, pVgroup->vgId, pVgroup->dbName); mError("ctable:%s, vgId:%d not in db:%s", pTable->info.tableId, pVgroup->vgId, pVgroup->dbName);
code = -1;
} }
} }
...@@ -127,6 +130,7 @@ static int32_t mnodeChildTableActionInsert(SSdbRow *pRow) { ...@@ -127,6 +130,7 @@ static int32_t mnodeChildTableActionInsert(SSdbRow *pRow) {
pAcct = mnodeGetAcct(pDb->acct); pAcct = mnodeGetAcct(pDb->acct);
if (pAcct == NULL) { if (pAcct == NULL) {
mError("ctable:%s, acct:%s not exists", pTable->info.tableId, pDb->acct); mError("ctable:%s, acct:%s not exists", pTable->info.tableId, pDb->acct);
code = -1;
} }
} }
...@@ -139,6 +143,7 @@ static int32_t mnodeChildTableActionInsert(SSdbRow *pRow) { ...@@ -139,6 +143,7 @@ static int32_t mnodeChildTableActionInsert(SSdbRow *pRow) {
if (pAcct) pAcct->acctInfo.numOfTimeSeries += (pTable->superTable->numOfColumns - 1); if (pAcct) pAcct->acctInfo.numOfTimeSeries += (pTable->superTable->numOfColumns - 1);
} else { } else {
mError("table:%s:%p, correspond stable not found suid:%" PRIu64, pTable->info.tableId, pTable, pTable->suid); mError("table:%s:%p, correspond stable not found suid:%" PRIu64, pTable->info.tableId, pTable, pTable->suid);
code = -1;
} }
} else { } else {
grantAdd(TSDB_GRANT_TIMESERIES, pTable->numOfColumns - 1); grantAdd(TSDB_GRANT_TIMESERIES, pTable->numOfColumns - 1);
...@@ -146,18 +151,31 @@ static int32_t mnodeChildTableActionInsert(SSdbRow *pRow) { ...@@ -146,18 +151,31 @@ static int32_t mnodeChildTableActionInsert(SSdbRow *pRow) {
} }
if (pDb) mnodeAddTableIntoDb(pDb); if (pDb) mnodeAddTableIntoDb(pDb);
if (pVgroup) mnodeAddTableIntoVgroup(pVgroup, pTable); if (pVgroup) {
if (mnodeAddTableIntoVgroup(pVgroup, pTable, pRow->pMsg == NULL) != 0) {
mError("table:%s, vgId:%d tid:%d, failed to perform insert action, uid:%" PRIu64 " suid:%" PRIu64,
pTable->info.tableId, pTable->vgId, pTable->tid, pTable->uid, pTable->suid);
code = -1;
}
}
mnodeDecVgroupRef(pVgroup); mnodeDecVgroupRef(pVgroup);
mnodeDecDbRef(pDb); mnodeDecDbRef(pDb);
mnodeDecAcctRef(pAcct); mnodeDecAcctRef(pAcct);
return TSDB_CODE_SUCCESS; if (code == 0) {
mTrace("table:%s, vgId:%d tid:%d, perform insert action, uid:%" PRIu64 " suid:%" PRIu64, pTable->info.tableId,
pTable->vgId, pTable->tid, pTable->uid, pTable->suid);
}
return code;
} }
static int32_t mnodeChildTableActionDelete(SSdbRow *pRow) { static int32_t mnodeChildTableActionDelete(SSdbRow *pRow) {
SCTableObj *pTable = pRow->pObj; SCTableObj *pTable = pRow->pObj;
if (pTable->vgId == 0) { if (pTable->vgId == 0) {
mError("table:%s, vgId:%d tid:%d, failed to perform delete action, uid:%" PRIu64 " suid:%" PRIu64,
pTable->info.tableId, pTable->vgId, pTable->tid, pTable->uid, pTable->suid);
return TSDB_CODE_MND_VGROUP_NOT_EXIST; return TSDB_CODE_MND_VGROUP_NOT_EXIST;
} }
...@@ -188,6 +206,8 @@ static int32_t mnodeChildTableActionDelete(SSdbRow *pRow) { ...@@ -188,6 +206,8 @@ static int32_t mnodeChildTableActionDelete(SSdbRow *pRow) {
mnodeDecDbRef(pDb); mnodeDecDbRef(pDb);
mnodeDecAcctRef(pAcct); mnodeDecAcctRef(pAcct);
mTrace("table:%s, vgId:%d tid:%d, perform delete action, uid:%" PRIu64 " suid:%" PRIu64, pTable->info.tableId,
pTable->vgId, pTable->tid, pTable->uid, pTable->suid);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -399,13 +419,13 @@ static void mnodeAddTableIntoStable(SSTableObj *pStable, SCTableObj *pCtable) { ...@@ -399,13 +419,13 @@ static void mnodeAddTableIntoStable(SSTableObj *pStable, SCTableObj *pCtable) {
if (pStable->vgHash == NULL) { if (pStable->vgHash == NULL) {
pStable->vgHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_ENTRY_LOCK); pStable->vgHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_ENTRY_LOCK);
mDebug("table:%s, create hash:%p", pStable->info.tableId, pStable->vgHash); mDebug("stable:%s, create vgId hash:%p", pStable->info.tableId, pStable->vgHash);
} }
if (pStable->vgHash != NULL) { if (pStable->vgHash != NULL) {
if (taosHashGet(pStable->vgHash, &pCtable->vgId, sizeof(pCtable->vgId)) == NULL) { if (taosHashGet(pStable->vgHash, &pCtable->vgId, sizeof(pCtable->vgId)) == NULL) {
taosHashPut(pStable->vgHash, &pCtable->vgId, sizeof(pCtable->vgId), &pCtable->vgId, sizeof(pCtable->vgId)); taosHashPut(pStable->vgHash, &pCtable->vgId, sizeof(pCtable->vgId), &pCtable->vgId, sizeof(pCtable->vgId));
mDebug("table:%s, vgId:%d is put into stable hash:%p, sizeOfVgList:%d", pStable->info.tableId, pCtable->vgId, mDebug("stable:%s, vgId:%d is put into stable vgId hash:%p, sizeOfVgList:%d", pStable->info.tableId, pCtable->vgId,
pStable->vgHash, taosHashGetSize(pStable->vgHash)); pStable->vgHash, taosHashGetSize(pStable->vgHash));
} }
} }
...@@ -443,19 +463,21 @@ static int32_t mnodeSuperTableActionDestroy(SSdbRow *pRow) { ...@@ -443,19 +463,21 @@ static int32_t mnodeSuperTableActionDestroy(SSdbRow *pRow) {
static int32_t mnodeSuperTableActionInsert(SSdbRow *pRow) { static int32_t mnodeSuperTableActionInsert(SSdbRow *pRow) {
SSTableObj *pStable = pRow->pObj; SSTableObj *pStable = pRow->pObj;
SDbObj *pDb = mnodeGetDbByTableName(pStable->info.tableId); SDbObj * pDb = mnodeGetDbByTableName(pStable->info.tableId);
if (pDb != NULL && pDb->status == TSDB_DB_STATUS_READY) { if (pDb != NULL && pDb->status == TSDB_DB_STATUS_READY) {
mnodeAddSuperTableIntoDb(pDb); mnodeAddSuperTableIntoDb(pDb);
} }
mnodeDecDbRef(pDb); mnodeDecDbRef(pDb);
taosHashPut(tsSTableUidHash, &pStable->uid, sizeof(int64_t), &pStable, sizeof(int64_t)); taosHashPut(tsSTableUidHash, &pStable->uid, sizeof(int64_t), &pStable, sizeof(int64_t));
mTrace("stable:%s, perform insert action, uid:%" PRIu64, pStable->info.tableId, pStable->uid);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
static int32_t mnodeSuperTableActionDelete(SSdbRow *pRow) { static int32_t mnodeSuperTableActionDelete(SSdbRow *pRow) {
SSTableObj *pStable = pRow->pObj; SSTableObj *pStable = pRow->pObj;
SDbObj *pDb = mnodeGetDbByTableName(pStable->info.tableId); SDbObj * pDb = mnodeGetDbByTableName(pStable->info.tableId);
if (pDb != NULL) { if (pDb != NULL) {
mnodeRemoveSuperTableFromDb(pDb); mnodeRemoveSuperTableFromDb(pDb);
mnodeDropAllChildTablesInStable((SSTableObj *)pStable); mnodeDropAllChildTablesInStable((SSTableObj *)pStable);
...@@ -463,6 +485,8 @@ static int32_t mnodeSuperTableActionDelete(SSdbRow *pRow) { ...@@ -463,6 +485,8 @@ static int32_t mnodeSuperTableActionDelete(SSdbRow *pRow) {
mnodeDecDbRef(pDb); mnodeDecDbRef(pDb);
taosHashRemove(tsSTableUidHash, &pStable->uid, sizeof(int64_t)); taosHashRemove(tsSTableUidHash, &pStable->uid, sizeof(int64_t));
mTrace("stable:%s, perform delete action, uid:%" PRIu64, pStable->info.tableId, pStable->uid);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -1889,8 +1913,7 @@ static int32_t mnodeDoCreateChildTableCb(SMnodeMsg *pMsg, int32_t code) { ...@@ -1889,8 +1913,7 @@ static int32_t mnodeDoCreateChildTableCb(SMnodeMsg *pMsg, int32_t code) {
if (pMsg->pBatchMasterMsg) { if (pMsg->pBatchMasterMsg) {
++pMsg->pBatchMasterMsg->successed; ++pMsg->pBatchMasterMsg->successed;
if (pMsg->pBatchMasterMsg->successed + pMsg->pBatchMasterMsg->received if (pMsg->pBatchMasterMsg->successed + pMsg->pBatchMasterMsg->received >= pMsg->pBatchMasterMsg->expected) {
>= pMsg->pBatchMasterMsg->expected) {
dnodeSendRpcMWriteRsp(pMsg->pBatchMasterMsg, code); dnodeSendRpcMWriteRsp(pMsg->pBatchMasterMsg, code);
} }
...@@ -1911,8 +1934,7 @@ static int32_t mnodeDoCreateChildTableCb(SMnodeMsg *pMsg, int32_t code) { ...@@ -1911,8 +1934,7 @@ static int32_t mnodeDoCreateChildTableCb(SMnodeMsg *pMsg, int32_t code) {
if (pMsg->pBatchMasterMsg) { if (pMsg->pBatchMasterMsg) {
++pMsg->pBatchMasterMsg->received; ++pMsg->pBatchMasterMsg->received;
pMsg->pBatchMasterMsg->code = code; pMsg->pBatchMasterMsg->code = code;
if (pMsg->pBatchMasterMsg->successed + pMsg->pBatchMasterMsg->received if (pMsg->pBatchMasterMsg->successed + pMsg->pBatchMasterMsg->received >= pMsg->pBatchMasterMsg->expected) {
>= pMsg->pBatchMasterMsg->expected) {
dnodeSendRpcMWriteRsp(pMsg->pBatchMasterMsg, code); dnodeSendRpcMWriteRsp(pMsg->pBatchMasterMsg, code);
} }
...@@ -2662,8 +2684,7 @@ static void mnodeProcessCreateChildTableRsp(SRpcMsg *rpcMsg) { ...@@ -2662,8 +2684,7 @@ static void mnodeProcessCreateChildTableRsp(SRpcMsg *rpcMsg) {
if (pMsg->pBatchMasterMsg) { if (pMsg->pBatchMasterMsg) {
++pMsg->pBatchMasterMsg->successed; ++pMsg->pBatchMasterMsg->successed;
if (pMsg->pBatchMasterMsg->successed + pMsg->pBatchMasterMsg->received if (pMsg->pBatchMasterMsg->successed + pMsg->pBatchMasterMsg->received >= pMsg->pBatchMasterMsg->expected) {
>= pMsg->pBatchMasterMsg->expected) {
dnodeSendRpcMWriteRsp(pMsg->pBatchMasterMsg, rpcMsg->code); dnodeSendRpcMWriteRsp(pMsg->pBatchMasterMsg, rpcMsg->code);
} }
......
...@@ -443,6 +443,7 @@ int32_t mnodeGetAvailableVgroup(SMnodeMsg *pMsg, SVgObj **ppVgroup, int32_t *pSi ...@@ -443,6 +443,7 @@ int32_t mnodeGetAvailableVgroup(SMnodeMsg *pMsg, SVgObj **ppVgroup, int32_t *pSi
mDebug("msg:%p, app:%p db:%s, no enough sid in vgId:%d", pMsg, pMsg->rpcMsg.ahandle, pDb->name, pVgroup->vgId); mDebug("msg:%p, app:%p db:%s, no enough sid in vgId:%d", pMsg, pMsg->rpcMsg.ahandle, pDb->name, pVgroup->vgId);
continue; continue;
} }
mTrace("vgId:%d, alloc tid:%d", pVgroup->vgId, sid);
*pSid = sid; *pSid = sid;
*ppVgroup = pVgroup; *ppVgroup = pVgroup;
...@@ -507,6 +508,7 @@ int32_t mnodeGetAvailableVgroup(SMnodeMsg *pMsg, SVgObj **ppVgroup, int32_t *pSi ...@@ -507,6 +508,7 @@ int32_t mnodeGetAvailableVgroup(SMnodeMsg *pMsg, SVgObj **ppVgroup, int32_t *pSi
pDb->vgListIndex = 0; pDb->vgListIndex = 0;
pthread_mutex_unlock(&pDb->mutex); pthread_mutex_unlock(&pDb->mutex);
mTrace("vgId:%d, alloc tid:%d", pVgroup->vgId, sid);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -832,26 +834,37 @@ static int32_t mnodeRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, v ...@@ -832,26 +834,37 @@ static int32_t mnodeRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, v
return numOfRows; return numOfRows;
} }
void mnodeAddTableIntoVgroup(SVgObj *pVgroup, SCTableObj *pTable) { int32_t mnodeAddTableIntoVgroup(SVgObj *pVgroup, SCTableObj *pTable, bool needCheck) {
int32_t idPoolSize = taosIdPoolMaxSize(pVgroup->idPool); int32_t idPoolSize = taosIdPoolMaxSize(pVgroup->idPool);
if (pTable->tid > idPoolSize) { if (pTable->tid > idPoolSize) {
mnodeAllocVgroupIdPool(pVgroup); mnodeAllocVgroupIdPool(pVgroup);
} }
if (pTable->tid >= 1) { if (pTable->tid >= 1) {
taosIdPoolMarkStatus(pVgroup->idPool, pTable->tid); if (taosIdPoolMarkStatus(pVgroup->idPool, pTable->tid) || !needCheck) {
pVgroup->numOfTables++; pVgroup->numOfTables++;
mTrace("table:%s, vgId:%d tid:%d, mark tid used, uid:%" PRIu64, pTable->info.tableId, pTable->vgId, pTable->tid,
pTable->uid);
// The create vgroup message may be received later than the create table message // The create vgroup message may be received later than the create table message
// and the writing order in sdb is therefore uncertain // and the writing order in sdb is therefore uncertain
// which will cause the reference count of the vgroup to be incorrect when restarting // which will cause the reference count of the vgroup to be incorrect when restarting
// mnodeIncVgroupRef(pVgroup); // mnodeIncVgroupRef(pVgroup);
} else {
mError("table:%s, vgId:%d tid:%d, failed to mark tid, uid:%" PRIu64, pTable->info.tableId, pTable->vgId,
pTable->tid, pTable->uid);
return -1;
}
} }
return 0;
} }
void mnodeRemoveTableFromVgroup(SVgObj *pVgroup, SCTableObj *pTable) { void mnodeRemoveTableFromVgroup(SVgObj *pVgroup, SCTableObj *pTable) {
if (pTable->tid >= 1) { if (pTable->tid >= 1) {
taosFreeId(pVgroup->idPool, pTable->tid); taosFreeId(pVgroup->idPool, pTable->tid);
pVgroup->numOfTables--; pVgroup->numOfTables--;
mTrace("table:%s, vgId:%d tid:%d, put tid back uid:%" PRIu64, pTable->info.tableId, pTable->vgId, pTable->tid,
pTable->uid);
// The create vgroup message may be received later than the create table message // The create vgroup message may be received later than the create table message
// and the writing order in sdb is therefore uncertain // and the writing order in sdb is therefore uncertain
// which will cause the reference count of the vgroup to be incorrect when restarting // which will cause the reference count of the vgroup to be incorrect when restarting
......
...@@ -1840,7 +1840,7 @@ static void doFreeQueryHandle(SQueryRuntimeEnv* pRuntimeEnv) { ...@@ -1840,7 +1840,7 @@ static void doFreeQueryHandle(SQueryRuntimeEnv* pRuntimeEnv) {
pRuntimeEnv->pQueryHandle = NULL; pRuntimeEnv->pQueryHandle = NULL;
SMemRef* pMemRef = &pQuery->memRef; SMemRef* pMemRef = &pQuery->memRef;
assert(pMemRef->ref == 0 && pMemRef->imem == NULL && pMemRef->mem == NULL); assert(pMemRef->ref == 0 && pMemRef->snapshot.imem == NULL && pMemRef->snapshot.mem == NULL);
} }
static void teardownQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv) { static void teardownQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv) {
......
...@@ -206,10 +206,8 @@ static SKeyword keywordTable[] = { ...@@ -206,10 +206,8 @@ static SKeyword keywordTable[] = {
{"PREV", TK_PREV}, {"PREV", TK_PREV},
{"LINEAR", TK_LINEAR}, {"LINEAR", TK_LINEAR},
{"IMPORT", TK_IMPORT}, {"IMPORT", TK_IMPORT},
{"METRIC", TK_METRIC},
{"TBNAME", TK_TBNAME}, {"TBNAME", TK_TBNAME},
{"JOIN", TK_JOIN}, {"JOIN", TK_JOIN},
{"METRICS", TK_METRICS},
{"STABLE", TK_STABLE}, {"STABLE", TK_STABLE},
{"FILE", TK_FILE}, {"FILE", TK_FILE},
{"VNODES", TK_VNODES}, {"VNODES", TK_VNODES},
......
...@@ -430,7 +430,7 @@ void qQueryMgmtNotifyClosed(void* pQMgmt) { ...@@ -430,7 +430,7 @@ void qQueryMgmtNotifyClosed(void* pQMgmt) {
} }
SQueryMgmt* pQueryMgmt = pQMgmt; SQueryMgmt* pQueryMgmt = pQMgmt;
qDebug("vgId:%d, set querymgmt closed, wait for all queries cancelled", pQueryMgmt->vgId); qInfo("vgId:%d, set querymgmt closed, wait for all queries cancelled", pQueryMgmt->vgId);
pthread_mutex_lock(&pQueryMgmt->lock); pthread_mutex_lock(&pQueryMgmt->lock);
pQueryMgmt->closed = true; pQueryMgmt->closed = true;
...@@ -445,7 +445,7 @@ void qQueryMgmtReOpen(void *pQMgmt) { ...@@ -445,7 +445,7 @@ void qQueryMgmtReOpen(void *pQMgmt) {
} }
SQueryMgmt *pQueryMgmt = pQMgmt; SQueryMgmt *pQueryMgmt = pQMgmt;
qDebug("vgId:%d, set querymgmt reopen", pQueryMgmt->vgId); qInfo("vgId:%d, set querymgmt reopen", pQueryMgmt->vgId);
pthread_mutex_lock(&pQueryMgmt->lock); pthread_mutex_lock(&pQueryMgmt->lock);
pQueryMgmt->closed = false; pQueryMgmt->closed = false;
......
...@@ -97,28 +97,28 @@ ...@@ -97,28 +97,28 @@
#endif #endif
/************* Begin control #defines *****************************************/ /************* Begin control #defines *****************************************/
#define YYCODETYPE unsigned short int #define YYCODETYPE unsigned short int
#define YYNOCODE 265 #define YYNOCODE 263
#define YYACTIONTYPE unsigned short int #define YYACTIONTYPE unsigned short int
#define ParseTOKENTYPE SStrToken #define ParseTOKENTYPE SStrToken
typedef union { typedef union {
int yyinit; int yyinit;
ParseTOKENTYPE yy0; ParseTOKENTYPE yy0;
SCreatedTableInfo yy96; SLimitVal yy18;
SFromInfo* yy162; SFromInfo* yy70;
tSqlExpr* yy178; SSessionWindowVal yy87;
SCreateAcctInfo yy187; SCreateDbInfo yy94;
SArray* yy285; int yy116;
TAOS_FIELD yy295; SSubclauseInfo* yy141;
SQuerySqlNode* yy342; tSqlExpr* yy170;
tVariant yy362; SCreateTableSql* yy194;
SIntervalVal yy376; tVariant yy218;
SLimitVal yy438; SIntervalVal yy220;
int yy460; SCreatedTableInfo yy252;
SCreateTableSql* yy470; SQuerySqlNode* yy254;
SSubclauseInfo* yy513; SCreateAcctInfo yy419;
SSessionWindowVal yy523; SArray* yy429;
int64_t yy525; TAOS_FIELD yy451;
SCreateDbInfo yy526; int64_t yy481;
} YYMINORTYPE; } YYMINORTYPE;
#ifndef YYSTACKDEPTH #ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100 #define YYSTACKDEPTH 100
...@@ -130,7 +130,7 @@ typedef union { ...@@ -130,7 +130,7 @@ typedef union {
#define YYFALLBACK 1 #define YYFALLBACK 1
#define YYNSTATE 313 #define YYNSTATE 313
#define YYNRULE 265 #define YYNRULE 265
#define YYNTOKEN 188 #define YYNTOKEN 186
#define YY_MAX_SHIFT 312 #define YY_MAX_SHIFT 312
#define YY_MIN_SHIFTREDUCE 502 #define YY_MIN_SHIFTREDUCE 502
#define YY_MAX_SHIFTREDUCE 766 #define YY_MAX_SHIFTREDUCE 766
...@@ -217,152 +217,152 @@ static const YYACTIONTYPE yy_action[] = { ...@@ -217,152 +217,152 @@ static const YYACTIONTYPE yy_action[] = {
/* 80 */ 57, 54, 969, 550, 255, 220, 46, 45, 276, 916, /* 80 */ 57, 54, 969, 550, 255, 220, 46, 45, 276, 916,
/* 90 */ 44, 43, 42, 503, 504, 505, 506, 507, 508, 509, /* 90 */ 44, 43, 42, 503, 504, 505, 506, 507, 508, 509,
/* 100 */ 510, 511, 512, 513, 514, 515, 311, 628, 84, 230, /* 100 */ 510, 511, 512, 513, 514, 515, 311, 628, 84, 230,
/* 110 */ 69, 916, 296, 47, 48, 30, 51, 52, 1013, 30, /* 110 */ 69, 916, 1013, 47, 48, 30, 51, 52, 296, 30,
/* 120 */ 213, 41, 549, 50, 260, 55, 53, 57, 54, 1012, /* 120 */ 213, 41, 549, 50, 260, 55, 53, 57, 54, 64,
/* 130 */ 550, 306, 714, 46, 45, 286, 285, 44, 43, 42, /* 130 */ 550, 306, 714, 46, 45, 286, 285, 44, 43, 42,
/* 140 */ 47, 49, 904, 51, 52, 224, 1011, 213, 41, 667, /* 140 */ 47, 49, 904, 51, 52, 224, 1012, 213, 41, 65,
/* 150 */ 50, 260, 55, 53, 57, 54, 216, 916, 902, 913, /* 150 */ 50, 260, 55, 53, 57, 54, 216, 916, 902, 913,
/* 160 */ 46, 45, 222, 912, 44, 43, 42, 23, 274, 305, /* 160 */ 46, 45, 222, 912, 44, 43, 42, 23, 274, 305,
/* 170 */ 304, 273, 272, 271, 303, 270, 302, 301, 300, 269, /* 170 */ 304, 273, 272, 271, 303, 270, 302, 301, 300, 269,
/* 180 */ 299, 298, 876, 139, 864, 865, 866, 867, 868, 869, /* 180 */ 299, 298, 876, 139, 864, 865, 866, 867, 868, 869,
/* 190 */ 870, 871, 872, 873, 874, 875, 877, 878, 51, 52, /* 190 */ 870, 871, 872, 873, 874, 875, 877, 878, 51, 52,
/* 200 */ 815, 197, 213, 41, 165, 50, 260, 55, 53, 57, /* 200 */ 815, 139, 213, 41, 165, 50, 260, 55, 53, 57,
/* 210 */ 54, 198, 18, 81, 226, 46, 45, 283, 282, 44, /* 210 */ 54, 1011, 18, 81, 226, 46, 45, 283, 282, 44,
/* 220 */ 43, 42, 212, 727, 928, 25, 718, 671, 721, 189, /* 220 */ 43, 42, 212, 727, 928, 25, 718, 68, 721, 189,
/* 230 */ 724, 223, 212, 727, 278, 190, 718, 276, 721, 203, /* 230 */ 724, 223, 212, 727, 278, 190, 718, 276, 721, 203,
/* 240 */ 724, 117, 116, 188, 899, 900, 29, 903, 257, 233, /* 240 */ 724, 117, 116, 188, 899, 900, 29, 903, 257, 233,
/* 250 */ 77, 44, 43, 42, 209, 210, 237, 236, 259, 139, /* 250 */ 77, 44, 43, 42, 209, 210, 237, 236, 259, 901,
/* 260 */ 23, 104, 305, 304, 209, 210, 296, 303, 79, 302, /* 260 */ 23, 197, 305, 304, 209, 210, 225, 303, 78, 302,
/* 270 */ 301, 300, 73, 299, 298, 884, 132, 30, 882, 883, /* 270 */ 301, 300, 73, 299, 298, 884, 104, 30, 882, 883,
/* 280 */ 36, 70, 225, 885, 824, 887, 888, 886, 165, 889, /* 280 */ 36, 296, 720, 885, 723, 887, 888, 886, 667, 889,
/* 290 */ 890, 55, 53, 57, 54, 182, 309, 308, 125, 46, /* 290 */ 890, 55, 53, 57, 54, 132, 309, 308, 125, 46,
/* 300 */ 45, 1026, 239, 44, 43, 42, 102, 107, 30, 196, /* 300 */ 45, 914, 239, 44, 43, 42, 102, 107, 30, 196,
/* 310 */ 261, 73, 96, 106, 112, 115, 105, 914, 217, 36, /* 310 */ 664, 73, 96, 106, 112, 115, 105, 24, 217, 36,
/* 320 */ 674, 913, 109, 5, 155, 56, 78, 30, 243, 33, /* 320 */ 674, 913, 109, 5, 155, 56, 261, 79, 243, 33,
/* 330 */ 154, 91, 86, 90, 30, 56, 173, 169, 726, 245, /* 330 */ 154, 91, 86, 90, 30, 56, 173, 169, 726, 30,
/* 340 */ 30, 68, 171, 168, 120, 119, 118, 12, 726, 279, /* 340 */ 70, 30, 171, 168, 120, 119, 118, 12, 726, 279,
/* 350 */ 183, 83, 913, 80, 725, 28, 46, 45, 266, 816, /* 350 */ 211, 83, 913, 80, 725, 824, 46, 45, 245, 165,
/* 360 */ 44, 43, 42, 165, 725, 1, 153, 652, 280, 716, /* 360 */ 44, 43, 42, 198, 725, 816, 671, 652, 182, 165,
/* 370 */ 649, 913, 650, 901, 651, 284, 695, 696, 913, 664, /* 370 */ 649, 719, 650, 722, 651, 280, 1, 153, 913, 716,
/* 380 */ 720, 288, 723, 241, 913, 680, 24, 31, 686, 134, /* 380 */ 284, 61, 288, 913, 183, 913, 241, 695, 696, 680,
/* 390 */ 687, 747, 60, 728, 20, 19, 211, 19, 227, 228, /* 390 */ 31, 686, 687, 134, 6, 60, 20, 747, 227, 228,
/* 400 */ 719, 61, 722, 185, 638, 717, 730, 64, 31, 263, /* 400 */ 728, 19, 638, 62, 19, 263, 31, 640, 265, 31,
/* 410 */ 640, 265, 639, 31, 60, 82, 60, 179, 95, 94, /* 410 */ 639, 60, 82, 28, 60, 717, 266, 95, 94, 14,
/* 420 */ 186, 14, 13, 62, 101, 100, 67, 65, 627, 187, /* 420 */ 13, 67, 730, 627, 185, 101, 100, 179, 16, 15,
/* 430 */ 16, 15, 656, 654, 657, 655, 114, 113, 130, 128, /* 430 */ 979, 656, 654, 657, 655, 114, 113, 130, 128, 186,
/* 440 */ 6, 193, 194, 192, 177, 191, 181, 915, 979, 131, /* 440 */ 187, 193, 194, 192, 177, 191, 181, 1026, 915, 978,
/* 450 */ 978, 214, 975, 974, 215, 287, 936, 39, 961, 944, /* 450 */ 214, 975, 974, 215, 287, 131, 39, 936, 944, 946,
/* 460 */ 946, 133, 960, 929, 244, 137, 129, 150, 911, 149, /* 460 */ 133, 137, 929, 244, 129, 150, 961, 960, 911, 909,
/* 470 */ 242, 909, 679, 246, 151, 204, 653, 247, 258, 256, /* 470 */ 149, 679, 246, 151, 204, 152, 653, 250, 258, 827,
/* 480 */ 66, 152, 827, 268, 63, 926, 37, 140, 175, 34, /* 480 */ 140, 66, 141, 268, 37, 63, 175, 926, 34, 277,
/* 490 */ 248, 253, 277, 823, 1031, 92, 58, 141, 254, 142, /* 490 */ 248, 823, 253, 142, 1031, 58, 92, 1030, 1028, 256,
/* 500 */ 1030, 1028, 156, 281, 1025, 98, 1024, 1022, 157, 845, /* 500 */ 156, 143, 281, 1025, 98, 1024, 1022, 254, 157, 845,
/* 510 */ 35, 32, 38, 176, 252, 144, 812, 108, 810, 110, /* 510 */ 35, 32, 38, 252, 176, 812, 108, 810, 110, 111,
/* 520 */ 111, 808, 807, 229, 167, 805, 804, 803, 250, 802, /* 520 */ 808, 807, 229, 167, 805, 804, 803, 802, 801, 800,
/* 530 */ 801, 800, 170, 172, 797, 795, 793, 791, 789, 174, /* 530 */ 170, 172, 797, 795, 793, 791, 789, 174, 247, 242,
/* 540 */ 40, 71, 74, 249, 962, 297, 103, 289, 290, 291, /* 540 */ 71, 74, 249, 962, 40, 297, 103, 289, 290, 291,
/* 550 */ 292, 293, 294, 295, 307, 199, 766, 221, 231, 232, /* 550 */ 292, 293, 294, 295, 199, 221, 307, 766, 231, 232,
/* 560 */ 267, 765, 234, 235, 764, 752, 200, 195, 238, 87, /* 560 */ 267, 765, 234, 235, 764, 200, 238, 87, 88, 752,
/* 570 */ 88, 243, 75, 8, 262, 659, 72, 806, 681, 121, /* 570 */ 195, 243, 75, 8, 262, 806, 72, 659, 681, 135,
/* 580 */ 206, 135, 122, 799, 160, 123, 159, 846, 158, 161, /* 580 */ 76, 121, 159, 846, 160, 161, 158, 162, 164, 122,
/* 590 */ 162, 164, 163, 798, 684, 124, 880, 790, 2, 136, /* 590 */ 163, 799, 2, 123, 880, 124, 798, 790, 684, 144,
/* 600 */ 4, 145, 143, 146, 147, 76, 148, 251, 892, 688, /* 600 */ 147, 145, 146, 4, 136, 148, 892, 206, 251, 26,
/* 610 */ 138, 26, 264, 729, 9, 10, 27, 7, 11, 21, /* 610 */ 688, 138, 9, 10, 729, 27, 7, 11, 21, 731,
/* 620 */ 731, 22, 85, 591, 83, 587, 585, 584, 583, 580, /* 620 */ 22, 85, 264, 591, 587, 83, 585, 584, 583, 580,
/* 630 */ 553, 275, 93, 89, 31, 59, 630, 97, 99, 629, /* 630 */ 553, 275, 93, 89, 31, 630, 59, 97, 629, 99,
/* 640 */ 626, 575, 573, 565, 571, 567, 569, 563, 561, 594, /* 640 */ 626, 575, 573, 565, 571, 567, 569, 563, 561, 594,
/* 650 */ 593, 592, 590, 589, 588, 586, 582, 581, 60, 519, /* 650 */ 593, 592, 590, 589, 588, 586, 582, 581, 60, 551,
/* 660 */ 551, 517, 770, 769, 769, 769, 769, 769, 769, 769, /* 660 */ 519, 517, 770, 769, 769, 769, 769, 769, 769, 769,
/* 670 */ 769, 769, 769, 769, 126, 127, /* 670 */ 769, 769, 769, 769, 126, 127,
}; };
static const YYCODETYPE yy_lookahead[] = { static const YYCODETYPE yy_lookahead[] = {
/* 0 */ 192, 1, 191, 192, 211, 192, 192, 195, 196, 9, /* 0 */ 190, 1, 189, 190, 209, 190, 190, 193, 194, 9,
/* 10 */ 189, 190, 253, 13, 14, 192, 16, 17, 192, 253, /* 10 */ 187, 188, 251, 13, 14, 190, 16, 17, 190, 251,
/* 20 */ 20, 21, 253, 23, 24, 25, 26, 27, 28, 263, /* 20 */ 20, 21, 251, 23, 24, 25, 26, 27, 28, 261,
/* 30 */ 237, 262, 263, 33, 34, 253, 253, 37, 38, 39, /* 30 */ 235, 260, 261, 33, 34, 251, 251, 37, 38, 39,
/* 40 */ 13, 14, 234, 16, 17, 262, 263, 20, 21, 1, /* 40 */ 13, 14, 232, 16, 17, 260, 261, 20, 21, 1,
/* 50 */ 23, 24, 25, 26, 27, 28, 235, 9, 253, 233, /* 50 */ 23, 24, 25, 26, 27, 28, 233, 9, 251, 231,
/* 60 */ 33, 34, 236, 211, 37, 38, 39, 14, 254, 16, /* 60 */ 33, 34, 234, 209, 37, 38, 39, 14, 252, 16,
/* 70 */ 17, 250, 259, 20, 21, 1, 23, 24, 25, 26, /* 70 */ 17, 248, 257, 20, 21, 1, 23, 24, 25, 26,
/* 80 */ 27, 28, 259, 9, 261, 211, 33, 34, 79, 237, /* 80 */ 27, 28, 257, 9, 259, 209, 33, 34, 79, 235,
/* 90 */ 37, 38, 39, 45, 46, 47, 48, 49, 50, 51, /* 90 */ 37, 38, 39, 45, 46, 47, 48, 49, 50, 51,
/* 100 */ 52, 53, 54, 55, 56, 57, 58, 5, 198, 61, /* 100 */ 52, 53, 54, 55, 56, 57, 58, 5, 196, 61,
/* 110 */ 110, 237, 81, 13, 14, 192, 16, 17, 253, 192, /* 110 */ 110, 235, 251, 13, 14, 190, 16, 17, 81, 190,
/* 120 */ 20, 21, 1, 23, 24, 25, 26, 27, 28, 253, /* 120 */ 20, 21, 1, 23, 24, 25, 26, 27, 28, 109,
/* 130 */ 9, 211, 105, 33, 34, 33, 34, 37, 38, 39, /* 130 */ 9, 209, 105, 33, 34, 33, 34, 37, 38, 39,
/* 140 */ 13, 14, 232, 16, 17, 67, 253, 20, 21, 37, /* 140 */ 13, 14, 230, 16, 17, 67, 251, 20, 21, 129,
/* 150 */ 23, 24, 25, 26, 27, 28, 233, 237, 0, 236, /* 150 */ 23, 24, 25, 26, 27, 28, 231, 235, 0, 234,
/* 160 */ 33, 34, 67, 236, 37, 38, 39, 88, 89, 90, /* 160 */ 33, 34, 67, 234, 37, 38, 39, 88, 89, 90,
/* 170 */ 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, /* 170 */ 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
/* 180 */ 101, 102, 210, 192, 212, 213, 214, 215, 216, 217, /* 180 */ 101, 102, 208, 190, 210, 211, 212, 213, 214, 215,
/* 190 */ 218, 219, 220, 221, 222, 223, 224, 225, 16, 17, /* 190 */ 216, 217, 218, 219, 220, 221, 222, 223, 16, 17,
/* 200 */ 197, 253, 20, 21, 201, 23, 24, 25, 26, 27, /* 200 */ 195, 190, 20, 21, 199, 23, 24, 25, 26, 27,
/* 210 */ 28, 253, 44, 198, 136, 33, 34, 139, 140, 37, /* 210 */ 28, 251, 44, 196, 136, 33, 34, 139, 140, 37,
/* 220 */ 38, 39, 1, 2, 235, 104, 5, 115, 7, 61, /* 220 */ 38, 39, 1, 2, 233, 104, 5, 196, 7, 61,
/* 230 */ 9, 136, 1, 2, 139, 67, 5, 79, 7, 250, /* 230 */ 9, 136, 1, 2, 139, 67, 5, 79, 7, 248,
/* 240 */ 9, 73, 74, 75, 229, 230, 231, 232, 257, 135, /* 240 */ 9, 73, 74, 75, 227, 228, 229, 230, 255, 135,
/* 250 */ 259, 37, 38, 39, 33, 34, 142, 143, 37, 192, /* 250 */ 257, 37, 38, 39, 33, 34, 142, 143, 37, 228,
/* 260 */ 88, 76, 90, 91, 33, 34, 81, 95, 238, 97, /* 260 */ 88, 251, 90, 91, 33, 34, 190, 95, 257, 97,
/* 270 */ 98, 99, 104, 101, 102, 210, 192, 192, 213, 214, /* 270 */ 98, 99, 104, 101, 102, 208, 76, 190, 211, 212,
/* 280 */ 112, 251, 192, 218, 197, 220, 221, 222, 201, 224, /* 280 */ 112, 81, 5, 216, 7, 218, 219, 220, 37, 222,
/* 290 */ 225, 25, 26, 27, 28, 253, 64, 65, 66, 33, /* 290 */ 223, 25, 26, 27, 28, 190, 64, 65, 66, 33,
/* 300 */ 34, 237, 134, 37, 38, 39, 62, 63, 192, 141, /* 300 */ 34, 225, 134, 37, 38, 39, 62, 63, 190, 141,
/* 310 */ 15, 104, 68, 69, 70, 71, 72, 227, 233, 112, /* 310 */ 109, 104, 68, 69, 70, 71, 72, 116, 231, 112,
/* 320 */ 105, 236, 78, 62, 63, 104, 259, 192, 113, 68, /* 320 */ 105, 234, 78, 62, 63, 104, 15, 236, 113, 68,
/* 330 */ 69, 70, 71, 72, 192, 104, 62, 63, 117, 255, /* 330 */ 69, 70, 71, 72, 190, 104, 62, 63, 117, 190,
/* 340 */ 192, 198, 68, 69, 70, 71, 72, 104, 117, 233, /* 340 */ 249, 190, 68, 69, 70, 71, 72, 104, 117, 231,
/* 350 */ 253, 108, 236, 110, 133, 104, 33, 34, 107, 197, /* 350 */ 60, 108, 234, 110, 133, 195, 33, 34, 253, 199,
/* 360 */ 37, 38, 39, 201, 133, 199, 200, 2, 233, 1, /* 360 */ 37, 38, 39, 251, 133, 195, 115, 2, 251, 199,
/* 370 */ 5, 236, 7, 230, 9, 233, 124, 125, 236, 109, /* 370 */ 5, 5, 7, 7, 9, 231, 197, 198, 234, 1,
/* 380 */ 5, 233, 7, 105, 236, 105, 116, 109, 105, 109, /* 380 */ 231, 109, 231, 234, 251, 234, 105, 124, 125, 105,
/* 390 */ 105, 105, 109, 105, 109, 109, 60, 109, 33, 34, /* 390 */ 109, 105, 105, 109, 104, 109, 109, 105, 33, 34,
/* 400 */ 5, 109, 7, 253, 105, 37, 111, 109, 109, 105, /* 400 */ 105, 109, 105, 131, 109, 105, 109, 105, 105, 109,
/* 410 */ 105, 105, 105, 109, 109, 109, 109, 253, 137, 138, /* 410 */ 105, 109, 109, 104, 109, 37, 107, 137, 138, 137,
/* 420 */ 253, 137, 138, 131, 137, 138, 104, 129, 106, 253, /* 420 */ 138, 104, 111, 106, 251, 137, 138, 251, 137, 138,
/* 430 */ 137, 138, 5, 5, 7, 7, 76, 77, 62, 63, /* 430 */ 226, 5, 5, 7, 7, 76, 77, 62, 63, 251,
/* 440 */ 104, 253, 253, 253, 253, 253, 253, 237, 228, 192, /* 440 */ 251, 251, 251, 251, 251, 251, 251, 235, 235, 226,
/* 450 */ 228, 228, 228, 228, 228, 228, 192, 252, 260, 192, /* 450 */ 226, 226, 226, 226, 226, 190, 250, 190, 190, 190,
/* 460 */ 192, 192, 260, 235, 235, 192, 60, 192, 235, 239, /* 460 */ 190, 190, 233, 233, 60, 190, 258, 258, 233, 190,
/* 470 */ 193, 192, 117, 256, 192, 256, 111, 118, 122, 126, /* 470 */ 237, 117, 254, 190, 254, 190, 111, 119, 122, 190,
/* 480 */ 128, 192, 192, 192, 130, 249, 192, 248, 192, 192, /* 480 */ 246, 128, 245, 190, 190, 130, 190, 247, 190, 190,
/* 490 */ 256, 256, 192, 192, 192, 192, 127, 247, 121, 246, /* 490 */ 254, 190, 254, 244, 190, 127, 190, 190, 190, 126,
/* 500 */ 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, /* 500 */ 190, 243, 190, 190, 190, 190, 190, 121, 190, 190,
/* 510 */ 192, 192, 192, 192, 120, 244, 192, 192, 192, 192, /* 510 */ 190, 190, 190, 120, 190, 190, 190, 190, 190, 190,
/* 520 */ 192, 192, 192, 192, 192, 192, 192, 192, 119, 192, /* 520 */ 190, 190, 190, 190, 190, 190, 190, 190, 190, 190,
/* 530 */ 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, /* 530 */ 190, 190, 190, 190, 190, 190, 190, 190, 118, 191,
/* 540 */ 132, 193, 193, 193, 193, 103, 87, 86, 50, 83, /* 540 */ 191, 191, 191, 191, 132, 103, 87, 86, 50, 83,
/* 550 */ 85, 54, 84, 82, 79, 193, 5, 193, 144, 5, /* 550 */ 85, 54, 84, 82, 191, 191, 79, 5, 144, 5,
/* 560 */ 193, 5, 144, 5, 5, 89, 193, 193, 135, 198, /* 560 */ 191, 5, 144, 5, 5, 191, 135, 196, 196, 89,
/* 570 */ 198, 113, 109, 104, 107, 105, 114, 193, 105, 194, /* 570 */ 191, 113, 109, 104, 107, 191, 114, 105, 105, 104,
/* 580 */ 1, 104, 194, 193, 203, 194, 207, 209, 208, 206, /* 580 */ 104, 192, 205, 207, 201, 204, 206, 202, 200, 192,
/* 590 */ 204, 202, 205, 193, 105, 194, 226, 193, 199, 109, /* 590 */ 203, 191, 197, 192, 224, 192, 191, 191, 105, 242,
/* 600 */ 195, 243, 245, 242, 241, 104, 240, 104, 226, 105, /* 600 */ 239, 241, 240, 193, 109, 238, 224, 1, 104, 109,
/* 610 */ 104, 109, 107, 105, 123, 123, 109, 104, 104, 104, /* 610 */ 105, 104, 123, 123, 105, 109, 104, 104, 104, 111,
/* 620 */ 111, 104, 76, 9, 108, 5, 5, 5, 5, 5, /* 620 */ 104, 76, 107, 9, 5, 108, 5, 5, 5, 5,
/* 630 */ 80, 15, 138, 76, 109, 16, 5, 138, 138, 5, /* 630 */ 80, 15, 138, 76, 109, 5, 16, 138, 5, 138,
/* 640 */ 105, 5, 5, 5, 5, 5, 5, 5, 5, 5, /* 640 */ 105, 5, 5, 5, 5, 5, 5, 5, 5, 5,
/* 650 */ 5, 5, 5, 5, 5, 5, 5, 5, 109, 60, /* 650 */ 5, 5, 5, 5, 5, 5, 5, 5, 109, 80,
/* 660 */ 80, 59, 0, 264, 264, 264, 264, 264, 264, 264, /* 660 */ 60, 59, 0, 262, 262, 262, 262, 262, 262, 262,
/* 670 */ 264, 264, 264, 264, 21, 21, 264, 264, 264, 264, /* 670 */ 262, 262, 262, 262, 21, 21, 262, 262, 262, 262,
/* 680 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, /* 680 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 690 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, /* 690 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 700 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, /* 700 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 710 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, /* 710 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 720 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, /* 720 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 730 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, /* 730 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 740 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, /* 740 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 750 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, /* 750 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 760 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, /* 760 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 770 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, /* 770 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 780 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, /* 780 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 790 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, /* 790 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 800 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, /* 800 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 810 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, /* 810 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 820 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, /* 820 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 830 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, /* 830 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 840 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, /* 840 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 850 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, /* 850 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 860 */ 264, 264, 264, 264, /* 860 */ 262, 262,
}; };
#define YY_SHIFT_COUNT (312) #define YY_SHIFT_COUNT (312)
#define YY_SHIFT_MIN (0) #define YY_SHIFT_MIN (0)
...@@ -371,58 +371,58 @@ static const unsigned short int yy_shift_ofst[] = { ...@@ -371,58 +371,58 @@ static const unsigned short int yy_shift_ofst[] = {
/* 0 */ 168, 79, 79, 172, 172, 9, 221, 231, 74, 74, /* 0 */ 168, 79, 79, 172, 172, 9, 221, 231, 74, 74,
/* 10 */ 74, 74, 74, 74, 74, 74, 74, 0, 48, 231, /* 10 */ 74, 74, 74, 74, 74, 74, 74, 0, 48, 231,
/* 20 */ 365, 365, 365, 365, 121, 207, 74, 74, 74, 158, /* 20 */ 365, 365, 365, 365, 121, 207, 74, 74, 74, 158,
/* 30 */ 74, 74, 185, 9, 31, 31, 676, 676, 676, 231, /* 30 */ 74, 74, 200, 9, 37, 37, 676, 676, 676, 231,
/* 40 */ 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, /* 40 */ 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
/* 50 */ 231, 231, 231, 231, 231, 231, 231, 231, 231, 365, /* 50 */ 231, 231, 231, 231, 231, 231, 231, 231, 231, 365,
/* 60 */ 365, 102, 102, 102, 102, 102, 102, 102, 74, 74, /* 60 */ 365, 102, 102, 102, 102, 102, 102, 102, 74, 74,
/* 70 */ 112, 74, 207, 207, 74, 74, 74, 252, 252, 270, /* 70 */ 251, 74, 207, 207, 74, 74, 74, 263, 263, 201,
/* 80 */ 207, 74, 74, 74, 74, 74, 74, 74, 74, 74, /* 80 */ 207, 74, 74, 74, 74, 74, 74, 74, 74, 74,
/* 90 */ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, /* 90 */ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
/* 100 */ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, /* 100 */ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
/* 110 */ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, /* 110 */ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
/* 120 */ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, /* 120 */ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
/* 130 */ 74, 406, 406, 406, 355, 355, 355, 406, 355, 406, /* 130 */ 74, 404, 404, 404, 354, 354, 354, 404, 354, 404,
/* 140 */ 352, 354, 369, 356, 353, 377, 394, 409, 359, 408, /* 140 */ 353, 355, 368, 356, 373, 386, 393, 358, 420, 412,
/* 150 */ 406, 406, 406, 442, 9, 9, 406, 406, 459, 461, /* 150 */ 404, 404, 404, 442, 9, 9, 404, 404, 459, 461,
/* 160 */ 498, 466, 465, 497, 468, 471, 442, 406, 475, 475, /* 160 */ 498, 466, 465, 497, 468, 471, 442, 404, 477, 477,
/* 170 */ 406, 475, 406, 475, 406, 676, 676, 27, 100, 127, /* 170 */ 404, 477, 404, 477, 404, 676, 676, 27, 100, 127,
/* 180 */ 100, 100, 53, 182, 266, 266, 266, 266, 244, 261, /* 180 */ 100, 100, 53, 182, 266, 266, 266, 266, 244, 261,
/* 190 */ 274, 323, 323, 323, 323, 78, 114, 214, 214, 243, /* 190 */ 274, 323, 323, 323, 323, 78, 114, 214, 214, 243,
/* 200 */ 95, 232, 278, 215, 280, 283, 285, 286, 288, 375, /* 200 */ 95, 232, 281, 215, 284, 286, 287, 292, 295, 277,
/* 210 */ 395, 368, 336, 295, 292, 298, 299, 304, 305, 306, /* 210 */ 366, 378, 290, 311, 272, 20, 297, 300, 302, 303,
/* 220 */ 307, 251, 281, 284, 287, 322, 293, 427, 428, 360, /* 220 */ 305, 309, 280, 282, 288, 317, 291, 426, 427, 359,
/* 230 */ 376, 551, 414, 554, 556, 418, 558, 559, 476, 433, /* 230 */ 375, 552, 414, 554, 556, 418, 558, 559, 480, 431,
/* 240 */ 458, 467, 469, 462, 470, 463, 473, 477, 489, 490, /* 240 */ 458, 467, 469, 462, 472, 463, 473, 475, 493, 495,
/* 250 */ 501, 579, 503, 504, 506, 502, 491, 507, 492, 508, /* 250 */ 476, 606, 504, 505, 507, 500, 489, 506, 490, 509,
/* 260 */ 513, 509, 514, 467, 515, 505, 517, 516, 546, 614, /* 260 */ 512, 508, 513, 467, 514, 515, 516, 517, 545, 614,
/* 270 */ 620, 621, 622, 623, 624, 550, 616, 557, 494, 525, /* 270 */ 619, 621, 622, 623, 624, 550, 616, 557, 494, 525,
/* 280 */ 525, 619, 499, 500, 525, 631, 634, 535, 525, 636, /* 280 */ 525, 620, 499, 501, 525, 630, 633, 535, 525, 636,
/* 290 */ 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, /* 290 */ 637, 638, 639, 640, 641, 642, 643, 644, 645, 646,
/* 300 */ 647, 648, 649, 650, 651, 652, 549, 580, 653, 654, /* 300 */ 647, 648, 649, 650, 651, 652, 549, 579, 653, 654,
/* 310 */ 599, 602, 662, /* 310 */ 600, 602, 662,
}; };
#define YY_REDUCE_COUNT (176) #define YY_REDUCE_COUNT (176)
#define YY_REDUCE_MIN (-241) #define YY_REDUCE_MIN (-239)
#define YY_REDUCE_MAX (405) #define YY_REDUCE_MAX (410)
static const short yy_reduce_ofst[] = { static const short yy_reduce_ofst[] = {
/* 0 */ -179, -28, -28, 65, 65, 15, -231, -217, -174, -177, /* 0 */ -177, -26, -26, 67, 67, 17, -229, -215, -172, -175,
/* 10 */ -9, -77, 85, 116, 135, 142, 148, -186, -189, -234, /* 10 */ -7, -75, 87, 118, 144, 149, 151, -184, -187, -232,
/* 20 */ -207, -148, -126, -80, 84, -11, -187, 67, -192, -90, /* 20 */ -205, -146, -124, -78, 105, -9, -185, 11, -190, -88,
/* 30 */ 90, -73, 3, 143, 87, 162, 30, 166, -188, -241, /* 30 */ 76, -71, 5, 31, 160, 170, 91, 179, -186, -239,
/* 40 */ -218, -195, -135, -124, -107, -52, -42, 42, 97, 150, /* 40 */ -216, -193, -139, -105, -40, 10, 112, 117, 133, 173,
/* 50 */ 164, 167, 176, 188, 189, 190, 191, 192, 193, 64, /* 50 */ 176, 188, 189, 190, 191, 192, 193, 194, 195, 212,
/* 60 */ 210, 220, 222, 223, 224, 225, 226, 227, 257, 264, /* 60 */ 213, 204, 223, 224, 225, 226, 227, 228, 265, 267,
/* 70 */ 205, 267, 228, 229, 268, 269, 273, 198, 202, 230, /* 70 */ 206, 268, 229, 230, 269, 270, 271, 208, 209, 233,
/* 80 */ 233, 275, 279, 282, 289, 290, 291, 294, 296, 297, /* 80 */ 235, 275, 279, 283, 285, 289, 293, 294, 296, 298,
/* 90 */ 300, 301, 302, 303, 308, 309, 310, 311, 312, 313, /* 90 */ 299, 301, 304, 306, 307, 308, 310, 312, 313, 314,
/* 100 */ 314, 315, 316, 317, 318, 319, 320, 321, 324, 325, /* 100 */ 315, 316, 318, 319, 320, 321, 322, 324, 325, 326,
/* 110 */ 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, /* 110 */ 327, 328, 329, 330, 331, 332, 333, 334, 335, 336,
/* 120 */ 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, /* 120 */ 337, 338, 339, 340, 341, 342, 343, 344, 345, 346,
/* 130 */ 347, 277, 348, 349, 217, 219, 234, 350, 235, 351, /* 130 */ 347, 348, 349, 350, 218, 220, 236, 351, 238, 352,
/* 140 */ 236, 239, 250, 253, 357, 271, 358, 361, 363, 366, /* 140 */ 240, 234, 237, 249, 258, 357, 360, 362, 361, 367,
/* 150 */ 362, 364, 367, 370, 371, 372, 373, 374, 378, 380, /* 150 */ 363, 364, 369, 370, 371, 372, 374, 379, 376, 380,
/* 160 */ 379, 381, 383, 386, 387, 389, 382, 384, 385, 388, /* 160 */ 377, 383, 381, 385, 387, 388, 382, 384, 389, 397,
/* 170 */ 390, 391, 400, 401, 404, 399, 405, /* 170 */ 400, 401, 405, 403, 406, 395, 410,
}; };
static const YYACTIONTYPE yy_default[] = { static const YYACTIONTYPE yy_default[] = {
/* 0 */ 767, 879, 825, 891, 813, 822, 1019, 1019, 767, 767, /* 0 */ 767, 879, 825, 891, 813, 822, 1019, 1019, 767, 767,
...@@ -657,10 +657,8 @@ static const YYCODETYPE yyFallback[] = { ...@@ -657,10 +657,8 @@ static const YYCODETYPE yyFallback[] = {
1, /* PREV => ID */ 1, /* PREV => ID */
1, /* LINEAR => ID */ 1, /* LINEAR => ID */
1, /* IMPORT => ID */ 1, /* IMPORT => ID */
1, /* METRIC => ID */
1, /* TBNAME => ID */ 1, /* TBNAME => ID */
1, /* JOIN => ID */ 1, /* JOIN => ID */
1, /* METRICS => ID */
1, /* INSERT => ID */ 1, /* INSERT => ID */
1, /* INTO => ID */ 1, /* INTO => ID */
1, /* VALUES => ID */ 1, /* VALUES => ID */
...@@ -931,89 +929,87 @@ static const char *const yyTokenName[] = { ...@@ -931,89 +929,87 @@ static const char *const yyTokenName[] = {
/* 178 */ "PREV", /* 178 */ "PREV",
/* 179 */ "LINEAR", /* 179 */ "LINEAR",
/* 180 */ "IMPORT", /* 180 */ "IMPORT",
/* 181 */ "METRIC", /* 181 */ "TBNAME",
/* 182 */ "TBNAME", /* 182 */ "JOIN",
/* 183 */ "JOIN", /* 183 */ "INSERT",
/* 184 */ "METRICS", /* 184 */ "INTO",
/* 185 */ "INSERT", /* 185 */ "VALUES",
/* 186 */ "INTO", /* 186 */ "error",
/* 187 */ "VALUES", /* 187 */ "program",
/* 188 */ "error", /* 188 */ "cmd",
/* 189 */ "program", /* 189 */ "dbPrefix",
/* 190 */ "cmd", /* 190 */ "ids",
/* 191 */ "dbPrefix", /* 191 */ "cpxName",
/* 192 */ "ids", /* 192 */ "ifexists",
/* 193 */ "cpxName", /* 193 */ "alter_db_optr",
/* 194 */ "ifexists", /* 194 */ "alter_topic_optr",
/* 195 */ "alter_db_optr", /* 195 */ "acct_optr",
/* 196 */ "alter_topic_optr", /* 196 */ "ifnotexists",
/* 197 */ "acct_optr", /* 197 */ "db_optr",
/* 198 */ "ifnotexists", /* 198 */ "topic_optr",
/* 199 */ "db_optr", /* 199 */ "pps",
/* 200 */ "topic_optr", /* 200 */ "tseries",
/* 201 */ "pps", /* 201 */ "dbs",
/* 202 */ "tseries", /* 202 */ "streams",
/* 203 */ "dbs", /* 203 */ "storage",
/* 204 */ "streams", /* 204 */ "qtime",
/* 205 */ "storage", /* 205 */ "users",
/* 206 */ "qtime", /* 206 */ "conns",
/* 207 */ "users", /* 207 */ "state",
/* 208 */ "conns", /* 208 */ "keep",
/* 209 */ "state", /* 209 */ "tagitemlist",
/* 210 */ "keep", /* 210 */ "cache",
/* 211 */ "tagitemlist", /* 211 */ "replica",
/* 212 */ "cache", /* 212 */ "quorum",
/* 213 */ "replica", /* 213 */ "days",
/* 214 */ "quorum", /* 214 */ "minrows",
/* 215 */ "days", /* 215 */ "maxrows",
/* 216 */ "minrows", /* 216 */ "blocks",
/* 217 */ "maxrows", /* 217 */ "ctime",
/* 218 */ "blocks", /* 218 */ "wal",
/* 219 */ "ctime", /* 219 */ "fsync",
/* 220 */ "wal", /* 220 */ "comp",
/* 221 */ "fsync", /* 221 */ "prec",
/* 222 */ "comp", /* 222 */ "update",
/* 223 */ "prec", /* 223 */ "cachelast",
/* 224 */ "update", /* 224 */ "partitions",
/* 225 */ "cachelast", /* 225 */ "typename",
/* 226 */ "partitions", /* 226 */ "signed",
/* 227 */ "typename", /* 227 */ "create_table_args",
/* 228 */ "signed", /* 228 */ "create_stable_args",
/* 229 */ "create_table_args", /* 229 */ "create_table_list",
/* 230 */ "create_stable_args", /* 230 */ "create_from_stable",
/* 231 */ "create_table_list", /* 231 */ "columnlist",
/* 232 */ "create_from_stable", /* 232 */ "tagNamelist",
/* 233 */ "columnlist", /* 233 */ "select",
/* 234 */ "tagNamelist", /* 234 */ "column",
/* 235 */ "select", /* 235 */ "tagitem",
/* 236 */ "column", /* 236 */ "selcollist",
/* 237 */ "tagitem", /* 237 */ "from",
/* 238 */ "selcollist", /* 238 */ "where_opt",
/* 239 */ "from", /* 239 */ "interval_opt",
/* 240 */ "where_opt", /* 240 */ "session_option",
/* 241 */ "interval_opt", /* 241 */ "fill_opt",
/* 242 */ "session_option", /* 242 */ "sliding_opt",
/* 243 */ "fill_opt", /* 243 */ "groupby_opt",
/* 244 */ "sliding_opt", /* 244 */ "orderby_opt",
/* 245 */ "groupby_opt", /* 245 */ "having_opt",
/* 246 */ "orderby_opt", /* 246 */ "slimit_opt",
/* 247 */ "having_opt", /* 247 */ "limit_opt",
/* 248 */ "slimit_opt", /* 248 */ "union",
/* 249 */ "limit_opt", /* 249 */ "sclp",
/* 250 */ "union", /* 250 */ "distinct",
/* 251 */ "sclp", /* 251 */ "expr",
/* 252 */ "distinct", /* 252 */ "as",
/* 253 */ "expr", /* 253 */ "tablelist",
/* 254 */ "as", /* 254 */ "tmvar",
/* 255 */ "tablelist", /* 255 */ "sortlist",
/* 256 */ "tmvar", /* 256 */ "sortitem",
/* 257 */ "sortlist", /* 257 */ "item",
/* 258 */ "sortitem", /* 258 */ "sortorder",
/* 259 */ "item", /* 259 */ "grouplist",
/* 260 */ "sortorder", /* 260 */ "exprlist",
/* 261 */ "grouplist", /* 261 */ "expritem",
/* 262 */ "exprlist",
/* 263 */ "expritem",
}; };
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
...@@ -1406,52 +1402,52 @@ static void yy_destructor( ...@@ -1406,52 +1402,52 @@ static void yy_destructor(
** inside the C code. ** inside the C code.
*/ */
/********* Begin destructor definitions ***************************************/ /********* Begin destructor definitions ***************************************/
case 210: /* keep */ case 208: /* keep */
case 211: /* tagitemlist */ case 209: /* tagitemlist */
case 233: /* columnlist */ case 231: /* columnlist */
case 234: /* tagNamelist */ case 232: /* tagNamelist */
case 243: /* fill_opt */ case 241: /* fill_opt */
case 245: /* groupby_opt */ case 243: /* groupby_opt */
case 246: /* orderby_opt */ case 244: /* orderby_opt */
case 257: /* sortlist */ case 255: /* sortlist */
case 261: /* grouplist */ case 259: /* grouplist */
{ {
taosArrayDestroy((yypminor->yy285)); taosArrayDestroy((yypminor->yy429));
} }
break; break;
case 231: /* create_table_list */ case 229: /* create_table_list */
{ {
destroyCreateTableSql((yypminor->yy470)); destroyCreateTableSql((yypminor->yy194));
} }
break; break;
case 235: /* select */ case 233: /* select */
{ {
destroyQuerySqlNode((yypminor->yy342)); destroyQuerySqlNode((yypminor->yy254));
} }
break; break;
case 238: /* selcollist */ case 236: /* selcollist */
case 251: /* sclp */ case 249: /* sclp */
case 262: /* exprlist */ case 260: /* exprlist */
{ {
tSqlExprListDestroy((yypminor->yy285)); tSqlExprListDestroy((yypminor->yy429));
} }
break; break;
case 240: /* where_opt */ case 238: /* where_opt */
case 247: /* having_opt */ case 245: /* having_opt */
case 253: /* expr */ case 251: /* expr */
case 263: /* expritem */ case 261: /* expritem */
{ {
tSqlExprDestroy((yypminor->yy178)); tSqlExprDestroy((yypminor->yy170));
} }
break; break;
case 250: /* union */ case 248: /* union */
{ {
destroyAllSelectClause((yypminor->yy513)); destroyAllSelectClause((yypminor->yy141));
} }
break; break;
case 258: /* sortitem */ case 256: /* sortitem */
{ {
tVariantDestroy(&(yypminor->yy362)); tVariantDestroy(&(yypminor->yy218));
} }
break; break;
/********* End destructor definitions *****************************************/ /********* End destructor definitions *****************************************/
...@@ -1745,271 +1741,271 @@ static const struct { ...@@ -1745,271 +1741,271 @@ static const struct {
YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
signed char nrhs; /* Negative of the number of RHS symbols in the rule */ signed char nrhs; /* Negative of the number of RHS symbols in the rule */
} yyRuleInfo[] = { } yyRuleInfo[] = {
{ 189, -1 }, /* (0) program ::= cmd */ { 187, -1 }, /* (0) program ::= cmd */
{ 190, -2 }, /* (1) cmd ::= SHOW DATABASES */ { 188, -2 }, /* (1) cmd ::= SHOW DATABASES */
{ 190, -2 }, /* (2) cmd ::= SHOW TOPICS */ { 188, -2 }, /* (2) cmd ::= SHOW TOPICS */
{ 190, -2 }, /* (3) cmd ::= SHOW MNODES */ { 188, -2 }, /* (3) cmd ::= SHOW MNODES */
{ 190, -2 }, /* (4) cmd ::= SHOW DNODES */ { 188, -2 }, /* (4) cmd ::= SHOW DNODES */
{ 190, -2 }, /* (5) cmd ::= SHOW ACCOUNTS */ { 188, -2 }, /* (5) cmd ::= SHOW ACCOUNTS */
{ 190, -2 }, /* (6) cmd ::= SHOW USERS */ { 188, -2 }, /* (6) cmd ::= SHOW USERS */
{ 190, -2 }, /* (7) cmd ::= SHOW MODULES */ { 188, -2 }, /* (7) cmd ::= SHOW MODULES */
{ 190, -2 }, /* (8) cmd ::= SHOW QUERIES */ { 188, -2 }, /* (8) cmd ::= SHOW QUERIES */
{ 190, -2 }, /* (9) cmd ::= SHOW CONNECTIONS */ { 188, -2 }, /* (9) cmd ::= SHOW CONNECTIONS */
{ 190, -2 }, /* (10) cmd ::= SHOW STREAMS */ { 188, -2 }, /* (10) cmd ::= SHOW STREAMS */
{ 190, -2 }, /* (11) cmd ::= SHOW VARIABLES */ { 188, -2 }, /* (11) cmd ::= SHOW VARIABLES */
{ 190, -2 }, /* (12) cmd ::= SHOW SCORES */ { 188, -2 }, /* (12) cmd ::= SHOW SCORES */
{ 190, -2 }, /* (13) cmd ::= SHOW GRANTS */ { 188, -2 }, /* (13) cmd ::= SHOW GRANTS */
{ 190, -2 }, /* (14) cmd ::= SHOW VNODES */ { 188, -2 }, /* (14) cmd ::= SHOW VNODES */
{ 190, -3 }, /* (15) cmd ::= SHOW VNODES IPTOKEN */ { 188, -3 }, /* (15) cmd ::= SHOW VNODES IPTOKEN */
{ 191, 0 }, /* (16) dbPrefix ::= */ { 189, 0 }, /* (16) dbPrefix ::= */
{ 191, -2 }, /* (17) dbPrefix ::= ids DOT */ { 189, -2 }, /* (17) dbPrefix ::= ids DOT */
{ 193, 0 }, /* (18) cpxName ::= */ { 191, 0 }, /* (18) cpxName ::= */
{ 193, -2 }, /* (19) cpxName ::= DOT ids */ { 191, -2 }, /* (19) cpxName ::= DOT ids */
{ 190, -5 }, /* (20) cmd ::= SHOW CREATE TABLE ids cpxName */ { 188, -5 }, /* (20) cmd ::= SHOW CREATE TABLE ids cpxName */
{ 190, -4 }, /* (21) cmd ::= SHOW CREATE DATABASE ids */ { 188, -4 }, /* (21) cmd ::= SHOW CREATE DATABASE ids */
{ 190, -3 }, /* (22) cmd ::= SHOW dbPrefix TABLES */ { 188, -3 }, /* (22) cmd ::= SHOW dbPrefix TABLES */
{ 190, -5 }, /* (23) cmd ::= SHOW dbPrefix TABLES LIKE ids */ { 188, -5 }, /* (23) cmd ::= SHOW dbPrefix TABLES LIKE ids */
{ 190, -3 }, /* (24) cmd ::= SHOW dbPrefix STABLES */ { 188, -3 }, /* (24) cmd ::= SHOW dbPrefix STABLES */
{ 190, -5 }, /* (25) cmd ::= SHOW dbPrefix STABLES LIKE ids */ { 188, -5 }, /* (25) cmd ::= SHOW dbPrefix STABLES LIKE ids */
{ 190, -3 }, /* (26) cmd ::= SHOW dbPrefix VGROUPS */ { 188, -3 }, /* (26) cmd ::= SHOW dbPrefix VGROUPS */
{ 190, -4 }, /* (27) cmd ::= SHOW dbPrefix VGROUPS ids */ { 188, -4 }, /* (27) cmd ::= SHOW dbPrefix VGROUPS ids */
{ 190, -5 }, /* (28) cmd ::= DROP TABLE ifexists ids cpxName */ { 188, -5 }, /* (28) cmd ::= DROP TABLE ifexists ids cpxName */
{ 190, -5 }, /* (29) cmd ::= DROP STABLE ifexists ids cpxName */ { 188, -5 }, /* (29) cmd ::= DROP STABLE ifexists ids cpxName */
{ 190, -4 }, /* (30) cmd ::= DROP DATABASE ifexists ids */ { 188, -4 }, /* (30) cmd ::= DROP DATABASE ifexists ids */
{ 190, -4 }, /* (31) cmd ::= DROP TOPIC ifexists ids */ { 188, -4 }, /* (31) cmd ::= DROP TOPIC ifexists ids */
{ 190, -3 }, /* (32) cmd ::= DROP DNODE ids */ { 188, -3 }, /* (32) cmd ::= DROP DNODE ids */
{ 190, -3 }, /* (33) cmd ::= DROP USER ids */ { 188, -3 }, /* (33) cmd ::= DROP USER ids */
{ 190, -3 }, /* (34) cmd ::= DROP ACCOUNT ids */ { 188, -3 }, /* (34) cmd ::= DROP ACCOUNT ids */
{ 190, -2 }, /* (35) cmd ::= USE ids */ { 188, -2 }, /* (35) cmd ::= USE ids */
{ 190, -3 }, /* (36) cmd ::= DESCRIBE ids cpxName */ { 188, -3 }, /* (36) cmd ::= DESCRIBE ids cpxName */
{ 190, -5 }, /* (37) cmd ::= ALTER USER ids PASS ids */ { 188, -5 }, /* (37) cmd ::= ALTER USER ids PASS ids */
{ 190, -5 }, /* (38) cmd ::= ALTER USER ids PRIVILEGE ids */ { 188, -5 }, /* (38) cmd ::= ALTER USER ids PRIVILEGE ids */
{ 190, -4 }, /* (39) cmd ::= ALTER DNODE ids ids */ { 188, -4 }, /* (39) cmd ::= ALTER DNODE ids ids */
{ 190, -5 }, /* (40) cmd ::= ALTER DNODE ids ids ids */ { 188, -5 }, /* (40) cmd ::= ALTER DNODE ids ids ids */
{ 190, -3 }, /* (41) cmd ::= ALTER LOCAL ids */ { 188, -3 }, /* (41) cmd ::= ALTER LOCAL ids */
{ 190, -4 }, /* (42) cmd ::= ALTER LOCAL ids ids */ { 188, -4 }, /* (42) cmd ::= ALTER LOCAL ids ids */
{ 190, -4 }, /* (43) cmd ::= ALTER DATABASE ids alter_db_optr */ { 188, -4 }, /* (43) cmd ::= ALTER DATABASE ids alter_db_optr */
{ 190, -4 }, /* (44) cmd ::= ALTER TOPIC ids alter_topic_optr */ { 188, -4 }, /* (44) cmd ::= ALTER TOPIC ids alter_topic_optr */
{ 190, -4 }, /* (45) cmd ::= ALTER ACCOUNT ids acct_optr */ { 188, -4 }, /* (45) cmd ::= ALTER ACCOUNT ids acct_optr */
{ 190, -6 }, /* (46) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ { 188, -6 }, /* (46) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
{ 192, -1 }, /* (47) ids ::= ID */ { 190, -1 }, /* (47) ids ::= ID */
{ 192, -1 }, /* (48) ids ::= STRING */ { 190, -1 }, /* (48) ids ::= STRING */
{ 194, -2 }, /* (49) ifexists ::= IF EXISTS */ { 192, -2 }, /* (49) ifexists ::= IF EXISTS */
{ 194, 0 }, /* (50) ifexists ::= */ { 192, 0 }, /* (50) ifexists ::= */
{ 198, -3 }, /* (51) ifnotexists ::= IF NOT EXISTS */ { 196, -3 }, /* (51) ifnotexists ::= IF NOT EXISTS */
{ 198, 0 }, /* (52) ifnotexists ::= */ { 196, 0 }, /* (52) ifnotexists ::= */
{ 190, -3 }, /* (53) cmd ::= CREATE DNODE ids */ { 188, -3 }, /* (53) cmd ::= CREATE DNODE ids */
{ 190, -6 }, /* (54) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ { 188, -6 }, /* (54) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
{ 190, -5 }, /* (55) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ { 188, -5 }, /* (55) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
{ 190, -5 }, /* (56) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ { 188, -5 }, /* (56) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
{ 190, -5 }, /* (57) cmd ::= CREATE USER ids PASS ids */ { 188, -5 }, /* (57) cmd ::= CREATE USER ids PASS ids */
{ 201, 0 }, /* (58) pps ::= */ { 199, 0 }, /* (58) pps ::= */
{ 201, -2 }, /* (59) pps ::= PPS INTEGER */ { 199, -2 }, /* (59) pps ::= PPS INTEGER */
{ 202, 0 }, /* (60) tseries ::= */ { 200, 0 }, /* (60) tseries ::= */
{ 202, -2 }, /* (61) tseries ::= TSERIES INTEGER */ { 200, -2 }, /* (61) tseries ::= TSERIES INTEGER */
{ 203, 0 }, /* (62) dbs ::= */ { 201, 0 }, /* (62) dbs ::= */
{ 203, -2 }, /* (63) dbs ::= DBS INTEGER */ { 201, -2 }, /* (63) dbs ::= DBS INTEGER */
{ 204, 0 }, /* (64) streams ::= */ { 202, 0 }, /* (64) streams ::= */
{ 204, -2 }, /* (65) streams ::= STREAMS INTEGER */ { 202, -2 }, /* (65) streams ::= STREAMS INTEGER */
{ 205, 0 }, /* (66) storage ::= */ { 203, 0 }, /* (66) storage ::= */
{ 205, -2 }, /* (67) storage ::= STORAGE INTEGER */ { 203, -2 }, /* (67) storage ::= STORAGE INTEGER */
{ 206, 0 }, /* (68) qtime ::= */ { 204, 0 }, /* (68) qtime ::= */
{ 206, -2 }, /* (69) qtime ::= QTIME INTEGER */ { 204, -2 }, /* (69) qtime ::= QTIME INTEGER */
{ 207, 0 }, /* (70) users ::= */ { 205, 0 }, /* (70) users ::= */
{ 207, -2 }, /* (71) users ::= USERS INTEGER */ { 205, -2 }, /* (71) users ::= USERS INTEGER */
{ 208, 0 }, /* (72) conns ::= */ { 206, 0 }, /* (72) conns ::= */
{ 208, -2 }, /* (73) conns ::= CONNS INTEGER */ { 206, -2 }, /* (73) conns ::= CONNS INTEGER */
{ 209, 0 }, /* (74) state ::= */ { 207, 0 }, /* (74) state ::= */
{ 209, -2 }, /* (75) state ::= STATE ids */ { 207, -2 }, /* (75) state ::= STATE ids */
{ 197, -9 }, /* (76) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ { 195, -9 }, /* (76) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
{ 210, -2 }, /* (77) keep ::= KEEP tagitemlist */ { 208, -2 }, /* (77) keep ::= KEEP tagitemlist */
{ 212, -2 }, /* (78) cache ::= CACHE INTEGER */ { 210, -2 }, /* (78) cache ::= CACHE INTEGER */
{ 213, -2 }, /* (79) replica ::= REPLICA INTEGER */ { 211, -2 }, /* (79) replica ::= REPLICA INTEGER */
{ 214, -2 }, /* (80) quorum ::= QUORUM INTEGER */ { 212, -2 }, /* (80) quorum ::= QUORUM INTEGER */
{ 215, -2 }, /* (81) days ::= DAYS INTEGER */ { 213, -2 }, /* (81) days ::= DAYS INTEGER */
{ 216, -2 }, /* (82) minrows ::= MINROWS INTEGER */ { 214, -2 }, /* (82) minrows ::= MINROWS INTEGER */
{ 217, -2 }, /* (83) maxrows ::= MAXROWS INTEGER */ { 215, -2 }, /* (83) maxrows ::= MAXROWS INTEGER */
{ 218, -2 }, /* (84) blocks ::= BLOCKS INTEGER */ { 216, -2 }, /* (84) blocks ::= BLOCKS INTEGER */
{ 219, -2 }, /* (85) ctime ::= CTIME INTEGER */ { 217, -2 }, /* (85) ctime ::= CTIME INTEGER */
{ 220, -2 }, /* (86) wal ::= WAL INTEGER */ { 218, -2 }, /* (86) wal ::= WAL INTEGER */
{ 221, -2 }, /* (87) fsync ::= FSYNC INTEGER */ { 219, -2 }, /* (87) fsync ::= FSYNC INTEGER */
{ 222, -2 }, /* (88) comp ::= COMP INTEGER */ { 220, -2 }, /* (88) comp ::= COMP INTEGER */
{ 223, -2 }, /* (89) prec ::= PRECISION STRING */ { 221, -2 }, /* (89) prec ::= PRECISION STRING */
{ 224, -2 }, /* (90) update ::= UPDATE INTEGER */ { 222, -2 }, /* (90) update ::= UPDATE INTEGER */
{ 225, -2 }, /* (91) cachelast ::= CACHELAST INTEGER */ { 223, -2 }, /* (91) cachelast ::= CACHELAST INTEGER */
{ 226, -2 }, /* (92) partitions ::= PARTITIONS INTEGER */ { 224, -2 }, /* (92) partitions ::= PARTITIONS INTEGER */
{ 199, 0 }, /* (93) db_optr ::= */ { 197, 0 }, /* (93) db_optr ::= */
{ 199, -2 }, /* (94) db_optr ::= db_optr cache */ { 197, -2 }, /* (94) db_optr ::= db_optr cache */
{ 199, -2 }, /* (95) db_optr ::= db_optr replica */ { 197, -2 }, /* (95) db_optr ::= db_optr replica */
{ 199, -2 }, /* (96) db_optr ::= db_optr quorum */ { 197, -2 }, /* (96) db_optr ::= db_optr quorum */
{ 199, -2 }, /* (97) db_optr ::= db_optr days */ { 197, -2 }, /* (97) db_optr ::= db_optr days */
{ 199, -2 }, /* (98) db_optr ::= db_optr minrows */ { 197, -2 }, /* (98) db_optr ::= db_optr minrows */
{ 199, -2 }, /* (99) db_optr ::= db_optr maxrows */ { 197, -2 }, /* (99) db_optr ::= db_optr maxrows */
{ 199, -2 }, /* (100) db_optr ::= db_optr blocks */ { 197, -2 }, /* (100) db_optr ::= db_optr blocks */
{ 199, -2 }, /* (101) db_optr ::= db_optr ctime */ { 197, -2 }, /* (101) db_optr ::= db_optr ctime */
{ 199, -2 }, /* (102) db_optr ::= db_optr wal */ { 197, -2 }, /* (102) db_optr ::= db_optr wal */
{ 199, -2 }, /* (103) db_optr ::= db_optr fsync */ { 197, -2 }, /* (103) db_optr ::= db_optr fsync */
{ 199, -2 }, /* (104) db_optr ::= db_optr comp */ { 197, -2 }, /* (104) db_optr ::= db_optr comp */
{ 199, -2 }, /* (105) db_optr ::= db_optr prec */ { 197, -2 }, /* (105) db_optr ::= db_optr prec */
{ 199, -2 }, /* (106) db_optr ::= db_optr keep */ { 197, -2 }, /* (106) db_optr ::= db_optr keep */
{ 199, -2 }, /* (107) db_optr ::= db_optr update */ { 197, -2 }, /* (107) db_optr ::= db_optr update */
{ 199, -2 }, /* (108) db_optr ::= db_optr cachelast */ { 197, -2 }, /* (108) db_optr ::= db_optr cachelast */
{ 200, -1 }, /* (109) topic_optr ::= db_optr */ { 198, -1 }, /* (109) topic_optr ::= db_optr */
{ 200, -2 }, /* (110) topic_optr ::= topic_optr partitions */ { 198, -2 }, /* (110) topic_optr ::= topic_optr partitions */
{ 195, 0 }, /* (111) alter_db_optr ::= */ { 193, 0 }, /* (111) alter_db_optr ::= */
{ 195, -2 }, /* (112) alter_db_optr ::= alter_db_optr replica */ { 193, -2 }, /* (112) alter_db_optr ::= alter_db_optr replica */
{ 195, -2 }, /* (113) alter_db_optr ::= alter_db_optr quorum */ { 193, -2 }, /* (113) alter_db_optr ::= alter_db_optr quorum */
{ 195, -2 }, /* (114) alter_db_optr ::= alter_db_optr keep */ { 193, -2 }, /* (114) alter_db_optr ::= alter_db_optr keep */
{ 195, -2 }, /* (115) alter_db_optr ::= alter_db_optr blocks */ { 193, -2 }, /* (115) alter_db_optr ::= alter_db_optr blocks */
{ 195, -2 }, /* (116) alter_db_optr ::= alter_db_optr comp */ { 193, -2 }, /* (116) alter_db_optr ::= alter_db_optr comp */
{ 195, -2 }, /* (117) alter_db_optr ::= alter_db_optr wal */ { 193, -2 }, /* (117) alter_db_optr ::= alter_db_optr wal */
{ 195, -2 }, /* (118) alter_db_optr ::= alter_db_optr fsync */ { 193, -2 }, /* (118) alter_db_optr ::= alter_db_optr fsync */
{ 195, -2 }, /* (119) alter_db_optr ::= alter_db_optr update */ { 193, -2 }, /* (119) alter_db_optr ::= alter_db_optr update */
{ 195, -2 }, /* (120) alter_db_optr ::= alter_db_optr cachelast */ { 193, -2 }, /* (120) alter_db_optr ::= alter_db_optr cachelast */
{ 196, -1 }, /* (121) alter_topic_optr ::= alter_db_optr */ { 194, -1 }, /* (121) alter_topic_optr ::= alter_db_optr */
{ 196, -2 }, /* (122) alter_topic_optr ::= alter_topic_optr partitions */ { 194, -2 }, /* (122) alter_topic_optr ::= alter_topic_optr partitions */
{ 227, -1 }, /* (123) typename ::= ids */ { 225, -1 }, /* (123) typename ::= ids */
{ 227, -4 }, /* (124) typename ::= ids LP signed RP */ { 225, -4 }, /* (124) typename ::= ids LP signed RP */
{ 227, -2 }, /* (125) typename ::= ids UNSIGNED */ { 225, -2 }, /* (125) typename ::= ids UNSIGNED */
{ 228, -1 }, /* (126) signed ::= INTEGER */ { 226, -1 }, /* (126) signed ::= INTEGER */
{ 228, -2 }, /* (127) signed ::= PLUS INTEGER */ { 226, -2 }, /* (127) signed ::= PLUS INTEGER */
{ 228, -2 }, /* (128) signed ::= MINUS INTEGER */ { 226, -2 }, /* (128) signed ::= MINUS INTEGER */
{ 190, -3 }, /* (129) cmd ::= CREATE TABLE create_table_args */ { 188, -3 }, /* (129) cmd ::= CREATE TABLE create_table_args */
{ 190, -3 }, /* (130) cmd ::= CREATE TABLE create_stable_args */ { 188, -3 }, /* (130) cmd ::= CREATE TABLE create_stable_args */
{ 190, -3 }, /* (131) cmd ::= CREATE STABLE create_stable_args */ { 188, -3 }, /* (131) cmd ::= CREATE STABLE create_stable_args */
{ 190, -3 }, /* (132) cmd ::= CREATE TABLE create_table_list */ { 188, -3 }, /* (132) cmd ::= CREATE TABLE create_table_list */
{ 231, -1 }, /* (133) create_table_list ::= create_from_stable */ { 229, -1 }, /* (133) create_table_list ::= create_from_stable */
{ 231, -2 }, /* (134) create_table_list ::= create_table_list create_from_stable */ { 229, -2 }, /* (134) create_table_list ::= create_table_list create_from_stable */
{ 229, -6 }, /* (135) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ { 227, -6 }, /* (135) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
{ 230, -10 }, /* (136) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ { 228, -10 }, /* (136) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
{ 232, -10 }, /* (137) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ { 230, -10 }, /* (137) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
{ 232, -13 }, /* (138) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ { 230, -13 }, /* (138) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
{ 234, -3 }, /* (139) tagNamelist ::= tagNamelist COMMA ids */ { 232, -3 }, /* (139) tagNamelist ::= tagNamelist COMMA ids */
{ 234, -1 }, /* (140) tagNamelist ::= ids */ { 232, -1 }, /* (140) tagNamelist ::= ids */
{ 229, -5 }, /* (141) create_table_args ::= ifnotexists ids cpxName AS select */ { 227, -5 }, /* (141) create_table_args ::= ifnotexists ids cpxName AS select */
{ 233, -3 }, /* (142) columnlist ::= columnlist COMMA column */ { 231, -3 }, /* (142) columnlist ::= columnlist COMMA column */
{ 233, -1 }, /* (143) columnlist ::= column */ { 231, -1 }, /* (143) columnlist ::= column */
{ 236, -2 }, /* (144) column ::= ids typename */ { 234, -2 }, /* (144) column ::= ids typename */
{ 211, -3 }, /* (145) tagitemlist ::= tagitemlist COMMA tagitem */ { 209, -3 }, /* (145) tagitemlist ::= tagitemlist COMMA tagitem */
{ 211, -1 }, /* (146) tagitemlist ::= tagitem */ { 209, -1 }, /* (146) tagitemlist ::= tagitem */
{ 237, -1 }, /* (147) tagitem ::= INTEGER */ { 235, -1 }, /* (147) tagitem ::= INTEGER */
{ 237, -1 }, /* (148) tagitem ::= FLOAT */ { 235, -1 }, /* (148) tagitem ::= FLOAT */
{ 237, -1 }, /* (149) tagitem ::= STRING */ { 235, -1 }, /* (149) tagitem ::= STRING */
{ 237, -1 }, /* (150) tagitem ::= BOOL */ { 235, -1 }, /* (150) tagitem ::= BOOL */
{ 237, -1 }, /* (151) tagitem ::= NULL */ { 235, -1 }, /* (151) tagitem ::= NULL */
{ 237, -2 }, /* (152) tagitem ::= MINUS INTEGER */ { 235, -2 }, /* (152) tagitem ::= MINUS INTEGER */
{ 237, -2 }, /* (153) tagitem ::= MINUS FLOAT */ { 235, -2 }, /* (153) tagitem ::= MINUS FLOAT */
{ 237, -2 }, /* (154) tagitem ::= PLUS INTEGER */ { 235, -2 }, /* (154) tagitem ::= PLUS INTEGER */
{ 237, -2 }, /* (155) tagitem ::= PLUS FLOAT */ { 235, -2 }, /* (155) tagitem ::= PLUS FLOAT */
{ 235, -13 }, /* (156) select ::= SELECT selcollist from where_opt interval_opt session_option fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ { 233, -13 }, /* (156) select ::= SELECT selcollist from where_opt interval_opt session_option fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */
{ 235, -3 }, /* (157) select ::= LP select RP */ { 233, -3 }, /* (157) select ::= LP select RP */
{ 250, -1 }, /* (158) union ::= select */ { 248, -1 }, /* (158) union ::= select */
{ 250, -4 }, /* (159) union ::= union UNION ALL select */ { 248, -4 }, /* (159) union ::= union UNION ALL select */
{ 190, -1 }, /* (160) cmd ::= union */ { 188, -1 }, /* (160) cmd ::= union */
{ 235, -2 }, /* (161) select ::= SELECT selcollist */ { 233, -2 }, /* (161) select ::= SELECT selcollist */
{ 251, -2 }, /* (162) sclp ::= selcollist COMMA */ { 249, -2 }, /* (162) sclp ::= selcollist COMMA */
{ 251, 0 }, /* (163) sclp ::= */ { 249, 0 }, /* (163) sclp ::= */
{ 238, -4 }, /* (164) selcollist ::= sclp distinct expr as */ { 236, -4 }, /* (164) selcollist ::= sclp distinct expr as */
{ 238, -2 }, /* (165) selcollist ::= sclp STAR */ { 236, -2 }, /* (165) selcollist ::= sclp STAR */
{ 254, -2 }, /* (166) as ::= AS ids */ { 252, -2 }, /* (166) as ::= AS ids */
{ 254, -1 }, /* (167) as ::= ids */ { 252, -1 }, /* (167) as ::= ids */
{ 254, 0 }, /* (168) as ::= */ { 252, 0 }, /* (168) as ::= */
{ 252, -1 }, /* (169) distinct ::= DISTINCT */ { 250, -1 }, /* (169) distinct ::= DISTINCT */
{ 252, 0 }, /* (170) distinct ::= */ { 250, 0 }, /* (170) distinct ::= */
{ 239, -2 }, /* (171) from ::= FROM tablelist */ { 237, -2 }, /* (171) from ::= FROM tablelist */
{ 239, -4 }, /* (172) from ::= FROM LP union RP */ { 237, -4 }, /* (172) from ::= FROM LP union RP */
{ 255, -2 }, /* (173) tablelist ::= ids cpxName */ { 253, -2 }, /* (173) tablelist ::= ids cpxName */
{ 255, -3 }, /* (174) tablelist ::= ids cpxName ids */ { 253, -3 }, /* (174) tablelist ::= ids cpxName ids */
{ 255, -4 }, /* (175) tablelist ::= tablelist COMMA ids cpxName */ { 253, -4 }, /* (175) tablelist ::= tablelist COMMA ids cpxName */
{ 255, -5 }, /* (176) tablelist ::= tablelist COMMA ids cpxName ids */ { 253, -5 }, /* (176) tablelist ::= tablelist COMMA ids cpxName ids */
{ 256, -1 }, /* (177) tmvar ::= VARIABLE */ { 254, -1 }, /* (177) tmvar ::= VARIABLE */
{ 241, -4 }, /* (178) interval_opt ::= INTERVAL LP tmvar RP */ { 239, -4 }, /* (178) interval_opt ::= INTERVAL LP tmvar RP */
{ 241, -6 }, /* (179) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ { 239, -6 }, /* (179) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */
{ 241, 0 }, /* (180) interval_opt ::= */ { 239, 0 }, /* (180) interval_opt ::= */
{ 242, 0 }, /* (181) session_option ::= */ { 240, 0 }, /* (181) session_option ::= */
{ 242, -7 }, /* (182) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ { 240, -7 }, /* (182) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
{ 243, 0 }, /* (183) fill_opt ::= */ { 241, 0 }, /* (183) fill_opt ::= */
{ 243, -6 }, /* (184) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ { 241, -6 }, /* (184) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
{ 243, -4 }, /* (185) fill_opt ::= FILL LP ID RP */ { 241, -4 }, /* (185) fill_opt ::= FILL LP ID RP */
{ 244, -4 }, /* (186) sliding_opt ::= SLIDING LP tmvar RP */ { 242, -4 }, /* (186) sliding_opt ::= SLIDING LP tmvar RP */
{ 244, 0 }, /* (187) sliding_opt ::= */ { 242, 0 }, /* (187) sliding_opt ::= */
{ 246, 0 }, /* (188) orderby_opt ::= */ { 244, 0 }, /* (188) orderby_opt ::= */
{ 246, -3 }, /* (189) orderby_opt ::= ORDER BY sortlist */ { 244, -3 }, /* (189) orderby_opt ::= ORDER BY sortlist */
{ 257, -4 }, /* (190) sortlist ::= sortlist COMMA item sortorder */ { 255, -4 }, /* (190) sortlist ::= sortlist COMMA item sortorder */
{ 257, -2 }, /* (191) sortlist ::= item sortorder */ { 255, -2 }, /* (191) sortlist ::= item sortorder */
{ 259, -2 }, /* (192) item ::= ids cpxName */ { 257, -2 }, /* (192) item ::= ids cpxName */
{ 260, -1 }, /* (193) sortorder ::= ASC */ { 258, -1 }, /* (193) sortorder ::= ASC */
{ 260, -1 }, /* (194) sortorder ::= DESC */ { 258, -1 }, /* (194) sortorder ::= DESC */
{ 260, 0 }, /* (195) sortorder ::= */ { 258, 0 }, /* (195) sortorder ::= */
{ 245, 0 }, /* (196) groupby_opt ::= */ { 243, 0 }, /* (196) groupby_opt ::= */
{ 245, -3 }, /* (197) groupby_opt ::= GROUP BY grouplist */ { 243, -3 }, /* (197) groupby_opt ::= GROUP BY grouplist */
{ 261, -3 }, /* (198) grouplist ::= grouplist COMMA item */ { 259, -3 }, /* (198) grouplist ::= grouplist COMMA item */
{ 261, -1 }, /* (199) grouplist ::= item */ { 259, -1 }, /* (199) grouplist ::= item */
{ 247, 0 }, /* (200) having_opt ::= */ { 245, 0 }, /* (200) having_opt ::= */
{ 247, -2 }, /* (201) having_opt ::= HAVING expr */ { 245, -2 }, /* (201) having_opt ::= HAVING expr */
{ 249, 0 }, /* (202) limit_opt ::= */ { 247, 0 }, /* (202) limit_opt ::= */
{ 249, -2 }, /* (203) limit_opt ::= LIMIT signed */ { 247, -2 }, /* (203) limit_opt ::= LIMIT signed */
{ 249, -4 }, /* (204) limit_opt ::= LIMIT signed OFFSET signed */ { 247, -4 }, /* (204) limit_opt ::= LIMIT signed OFFSET signed */
{ 249, -4 }, /* (205) limit_opt ::= LIMIT signed COMMA signed */ { 247, -4 }, /* (205) limit_opt ::= LIMIT signed COMMA signed */
{ 248, 0 }, /* (206) slimit_opt ::= */ { 246, 0 }, /* (206) slimit_opt ::= */
{ 248, -2 }, /* (207) slimit_opt ::= SLIMIT signed */ { 246, -2 }, /* (207) slimit_opt ::= SLIMIT signed */
{ 248, -4 }, /* (208) slimit_opt ::= SLIMIT signed SOFFSET signed */ { 246, -4 }, /* (208) slimit_opt ::= SLIMIT signed SOFFSET signed */
{ 248, -4 }, /* (209) slimit_opt ::= SLIMIT signed COMMA signed */ { 246, -4 }, /* (209) slimit_opt ::= SLIMIT signed COMMA signed */
{ 240, 0 }, /* (210) where_opt ::= */ { 238, 0 }, /* (210) where_opt ::= */
{ 240, -2 }, /* (211) where_opt ::= WHERE expr */ { 238, -2 }, /* (211) where_opt ::= WHERE expr */
{ 253, -3 }, /* (212) expr ::= LP expr RP */ { 251, -3 }, /* (212) expr ::= LP expr RP */
{ 253, -1 }, /* (213) expr ::= ID */ { 251, -1 }, /* (213) expr ::= ID */
{ 253, -3 }, /* (214) expr ::= ID DOT ID */ { 251, -3 }, /* (214) expr ::= ID DOT ID */
{ 253, -3 }, /* (215) expr ::= ID DOT STAR */ { 251, -3 }, /* (215) expr ::= ID DOT STAR */
{ 253, -1 }, /* (216) expr ::= INTEGER */ { 251, -1 }, /* (216) expr ::= INTEGER */
{ 253, -2 }, /* (217) expr ::= MINUS INTEGER */ { 251, -2 }, /* (217) expr ::= MINUS INTEGER */
{ 253, -2 }, /* (218) expr ::= PLUS INTEGER */ { 251, -2 }, /* (218) expr ::= PLUS INTEGER */
{ 253, -1 }, /* (219) expr ::= FLOAT */ { 251, -1 }, /* (219) expr ::= FLOAT */
{ 253, -2 }, /* (220) expr ::= MINUS FLOAT */ { 251, -2 }, /* (220) expr ::= MINUS FLOAT */
{ 253, -2 }, /* (221) expr ::= PLUS FLOAT */ { 251, -2 }, /* (221) expr ::= PLUS FLOAT */
{ 253, -1 }, /* (222) expr ::= STRING */ { 251, -1 }, /* (222) expr ::= STRING */
{ 253, -1 }, /* (223) expr ::= NOW */ { 251, -1 }, /* (223) expr ::= NOW */
{ 253, -1 }, /* (224) expr ::= VARIABLE */ { 251, -1 }, /* (224) expr ::= VARIABLE */
{ 253, -1 }, /* (225) expr ::= BOOL */ { 251, -1 }, /* (225) expr ::= BOOL */
{ 253, -4 }, /* (226) expr ::= ID LP exprlist RP */ { 251, -4 }, /* (226) expr ::= ID LP exprlist RP */
{ 253, -4 }, /* (227) expr ::= ID LP STAR RP */ { 251, -4 }, /* (227) expr ::= ID LP STAR RP */
{ 253, -3 }, /* (228) expr ::= expr IS NULL */ { 251, -3 }, /* (228) expr ::= expr IS NULL */
{ 253, -4 }, /* (229) expr ::= expr IS NOT NULL */ { 251, -4 }, /* (229) expr ::= expr IS NOT NULL */
{ 253, -3 }, /* (230) expr ::= expr LT expr */ { 251, -3 }, /* (230) expr ::= expr LT expr */
{ 253, -3 }, /* (231) expr ::= expr GT expr */ { 251, -3 }, /* (231) expr ::= expr GT expr */
{ 253, -3 }, /* (232) expr ::= expr LE expr */ { 251, -3 }, /* (232) expr ::= expr LE expr */
{ 253, -3 }, /* (233) expr ::= expr GE expr */ { 251, -3 }, /* (233) expr ::= expr GE expr */
{ 253, -3 }, /* (234) expr ::= expr NE expr */ { 251, -3 }, /* (234) expr ::= expr NE expr */
{ 253, -3 }, /* (235) expr ::= expr EQ expr */ { 251, -3 }, /* (235) expr ::= expr EQ expr */
{ 253, -5 }, /* (236) expr ::= expr BETWEEN expr AND expr */ { 251, -5 }, /* (236) expr ::= expr BETWEEN expr AND expr */
{ 253, -3 }, /* (237) expr ::= expr AND expr */ { 251, -3 }, /* (237) expr ::= expr AND expr */
{ 253, -3 }, /* (238) expr ::= expr OR expr */ { 251, -3 }, /* (238) expr ::= expr OR expr */
{ 253, -3 }, /* (239) expr ::= expr PLUS expr */ { 251, -3 }, /* (239) expr ::= expr PLUS expr */
{ 253, -3 }, /* (240) expr ::= expr MINUS expr */ { 251, -3 }, /* (240) expr ::= expr MINUS expr */
{ 253, -3 }, /* (241) expr ::= expr STAR expr */ { 251, -3 }, /* (241) expr ::= expr STAR expr */
{ 253, -3 }, /* (242) expr ::= expr SLASH expr */ { 251, -3 }, /* (242) expr ::= expr SLASH expr */
{ 253, -3 }, /* (243) expr ::= expr REM expr */ { 251, -3 }, /* (243) expr ::= expr REM expr */
{ 253, -3 }, /* (244) expr ::= expr LIKE expr */ { 251, -3 }, /* (244) expr ::= expr LIKE expr */
{ 253, -5 }, /* (245) expr ::= expr IN LP exprlist RP */ { 251, -5 }, /* (245) expr ::= expr IN LP exprlist RP */
{ 262, -3 }, /* (246) exprlist ::= exprlist COMMA expritem */ { 260, -3 }, /* (246) exprlist ::= exprlist COMMA expritem */
{ 262, -1 }, /* (247) exprlist ::= expritem */ { 260, -1 }, /* (247) exprlist ::= expritem */
{ 263, -1 }, /* (248) expritem ::= expr */ { 261, -1 }, /* (248) expritem ::= expr */
{ 263, 0 }, /* (249) expritem ::= */ { 261, 0 }, /* (249) expritem ::= */
{ 190, -3 }, /* (250) cmd ::= RESET QUERY CACHE */ { 188, -3 }, /* (250) cmd ::= RESET QUERY CACHE */
{ 190, -7 }, /* (251) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ { 188, -7 }, /* (251) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
{ 190, -7 }, /* (252) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ { 188, -7 }, /* (252) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
{ 190, -7 }, /* (253) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ { 188, -7 }, /* (253) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
{ 190, -7 }, /* (254) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ { 188, -7 }, /* (254) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
{ 190, -8 }, /* (255) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ { 188, -8 }, /* (255) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
{ 190, -9 }, /* (256) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ { 188, -9 }, /* (256) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
{ 190, -7 }, /* (257) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ { 188, -7 }, /* (257) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
{ 190, -7 }, /* (258) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ { 188, -7 }, /* (258) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
{ 190, -7 }, /* (259) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ { 188, -7 }, /* (259) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
{ 190, -7 }, /* (260) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ { 188, -7 }, /* (260) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
{ 190, -8 }, /* (261) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ { 188, -8 }, /* (261) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
{ 190, -3 }, /* (262) cmd ::= KILL CONNECTION INTEGER */ { 188, -3 }, /* (262) cmd ::= KILL CONNECTION INTEGER */
{ 190, -5 }, /* (263) cmd ::= KILL STREAM INTEGER COLON INTEGER */ { 188, -5 }, /* (263) cmd ::= KILL STREAM INTEGER COLON INTEGER */
{ 190, -5 }, /* (264) cmd ::= KILL QUERY INTEGER COLON INTEGER */ { 188, -5 }, /* (264) cmd ::= KILL QUERY INTEGER COLON INTEGER */
}; };
static void yy_accept(yyParser*); /* Forward Declaration */ static void yy_accept(yyParser*); /* Forward Declaration */
...@@ -2256,13 +2252,13 @@ static void yy_reduce( ...@@ -2256,13 +2252,13 @@ static void yy_reduce(
break; break;
case 43: /* cmd ::= ALTER DATABASE ids alter_db_optr */ case 43: /* cmd ::= ALTER DATABASE ids alter_db_optr */
case 44: /* cmd ::= ALTER TOPIC ids alter_topic_optr */ yytestcase(yyruleno==44); case 44: /* cmd ::= ALTER TOPIC ids alter_topic_optr */ yytestcase(yyruleno==44);
{ SStrToken t = {0}; setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy526, &t);} { SStrToken t = {0}; setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy94, &t);}
break; break;
case 45: /* cmd ::= ALTER ACCOUNT ids acct_optr */ case 45: /* cmd ::= ALTER ACCOUNT ids acct_optr */
{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy187);} { setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy419);}
break; break;
case 46: /* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ case 46: /* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy187);} { setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy419);}
break; break;
case 47: /* ids ::= ID */ case 47: /* ids ::= ID */
case 48: /* ids ::= STRING */ yytestcase(yyruleno==48); case 48: /* ids ::= STRING */ yytestcase(yyruleno==48);
...@@ -2284,11 +2280,11 @@ static void yy_reduce( ...@@ -2284,11 +2280,11 @@ static void yy_reduce(
{ setDCLSqlElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);} { setDCLSqlElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);}
break; break;
case 54: /* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ case 54: /* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
{ setCreateAcctSql(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy187);} { setCreateAcctSql(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy419);}
break; break;
case 55: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */ case 55: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */
case 56: /* cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ yytestcase(yyruleno==56); case 56: /* cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ yytestcase(yyruleno==56);
{ setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy526, &yymsp[-2].minor.yy0);} { setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy94, &yymsp[-2].minor.yy0);}
break; break;
case 57: /* cmd ::= CREATE USER ids PASS ids */ case 57: /* cmd ::= CREATE USER ids PASS ids */
{ setCreateUserSql(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);} { setCreateUserSql(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);}
...@@ -2317,20 +2313,20 @@ static void yy_reduce( ...@@ -2317,20 +2313,20 @@ static void yy_reduce(
break; break;
case 76: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */ case 76: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */
{ {
yylhsminor.yy187.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1; yylhsminor.yy419.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1;
yylhsminor.yy187.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1; yylhsminor.yy419.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1;
yylhsminor.yy187.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1; yylhsminor.yy419.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1;
yylhsminor.yy187.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1; yylhsminor.yy419.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1;
yylhsminor.yy187.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1; yylhsminor.yy419.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1;
yylhsminor.yy187.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1; yylhsminor.yy419.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1;
yylhsminor.yy187.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1; yylhsminor.yy419.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1;
yylhsminor.yy187.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1; yylhsminor.yy419.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1;
yylhsminor.yy187.stat = yymsp[0].minor.yy0; yylhsminor.yy419.stat = yymsp[0].minor.yy0;
} }
yymsp[-8].minor.yy187 = yylhsminor.yy187; yymsp[-8].minor.yy419 = yylhsminor.yy419;
break; break;
case 77: /* keep ::= KEEP tagitemlist */ case 77: /* keep ::= KEEP tagitemlist */
{ yymsp[-1].minor.yy285 = yymsp[0].minor.yy285; } { yymsp[-1].minor.yy429 = yymsp[0].minor.yy429; }
break; break;
case 78: /* cache ::= CACHE INTEGER */ case 78: /* cache ::= CACHE INTEGER */
case 79: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==79); case 79: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==79);
...@@ -2350,234 +2346,234 @@ static void yy_reduce( ...@@ -2350,234 +2346,234 @@ static void yy_reduce(
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
break; break;
case 93: /* db_optr ::= */ case 93: /* db_optr ::= */
{setDefaultCreateDbOption(&yymsp[1].minor.yy526); yymsp[1].minor.yy526.dbType = TSDB_DB_TYPE_DEFAULT;} {setDefaultCreateDbOption(&yymsp[1].minor.yy94); yymsp[1].minor.yy94.dbType = TSDB_DB_TYPE_DEFAULT;}
break; break;
case 94: /* db_optr ::= db_optr cache */ case 94: /* db_optr ::= db_optr cache */
{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy526 = yylhsminor.yy526; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 95: /* db_optr ::= db_optr replica */ case 95: /* db_optr ::= db_optr replica */
case 112: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==112); case 112: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==112);
{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy526 = yylhsminor.yy526; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 96: /* db_optr ::= db_optr quorum */ case 96: /* db_optr ::= db_optr quorum */
case 113: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==113); case 113: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==113);
{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy526 = yylhsminor.yy526; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 97: /* db_optr ::= db_optr days */ case 97: /* db_optr ::= db_optr days */
{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy526 = yylhsminor.yy526; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 98: /* db_optr ::= db_optr minrows */ case 98: /* db_optr ::= db_optr minrows */
{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
yymsp[-1].minor.yy526 = yylhsminor.yy526; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 99: /* db_optr ::= db_optr maxrows */ case 99: /* db_optr ::= db_optr maxrows */
{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
yymsp[-1].minor.yy526 = yylhsminor.yy526; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 100: /* db_optr ::= db_optr blocks */ case 100: /* db_optr ::= db_optr blocks */
case 115: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==115); case 115: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==115);
{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy526 = yylhsminor.yy526; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 101: /* db_optr ::= db_optr ctime */ case 101: /* db_optr ::= db_optr ctime */
{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy526 = yylhsminor.yy526; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 102: /* db_optr ::= db_optr wal */ case 102: /* db_optr ::= db_optr wal */
case 117: /* alter_db_optr ::= alter_db_optr wal */ yytestcase(yyruleno==117); case 117: /* alter_db_optr ::= alter_db_optr wal */ yytestcase(yyruleno==117);
{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy526 = yylhsminor.yy526; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 103: /* db_optr ::= db_optr fsync */ case 103: /* db_optr ::= db_optr fsync */
case 118: /* alter_db_optr ::= alter_db_optr fsync */ yytestcase(yyruleno==118); case 118: /* alter_db_optr ::= alter_db_optr fsync */ yytestcase(yyruleno==118);
{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy526 = yylhsminor.yy526; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 104: /* db_optr ::= db_optr comp */ case 104: /* db_optr ::= db_optr comp */
case 116: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==116); case 116: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==116);
{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy526 = yylhsminor.yy526; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 105: /* db_optr ::= db_optr prec */ case 105: /* db_optr ::= db_optr prec */
{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.precision = yymsp[0].minor.yy0; } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.precision = yymsp[0].minor.yy0; }
yymsp[-1].minor.yy526 = yylhsminor.yy526; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 106: /* db_optr ::= db_optr keep */ case 106: /* db_optr ::= db_optr keep */
case 114: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==114); case 114: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==114);
{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.keep = yymsp[0].minor.yy285; } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.keep = yymsp[0].minor.yy429; }
yymsp[-1].minor.yy526 = yylhsminor.yy526; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 107: /* db_optr ::= db_optr update */ case 107: /* db_optr ::= db_optr update */
case 119: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==119); case 119: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==119);
{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy526 = yylhsminor.yy526; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 108: /* db_optr ::= db_optr cachelast */ case 108: /* db_optr ::= db_optr cachelast */
case 120: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==120); case 120: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==120);
{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy526 = yylhsminor.yy526; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 109: /* topic_optr ::= db_optr */ case 109: /* topic_optr ::= db_optr */
case 121: /* alter_topic_optr ::= alter_db_optr */ yytestcase(yyruleno==121); case 121: /* alter_topic_optr ::= alter_db_optr */ yytestcase(yyruleno==121);
{ yylhsminor.yy526 = yymsp[0].minor.yy526; yylhsminor.yy526.dbType = TSDB_DB_TYPE_TOPIC; } { yylhsminor.yy94 = yymsp[0].minor.yy94; yylhsminor.yy94.dbType = TSDB_DB_TYPE_TOPIC; }
yymsp[0].minor.yy526 = yylhsminor.yy526; yymsp[0].minor.yy94 = yylhsminor.yy94;
break; break;
case 110: /* topic_optr ::= topic_optr partitions */ case 110: /* topic_optr ::= topic_optr partitions */
case 122: /* alter_topic_optr ::= alter_topic_optr partitions */ yytestcase(yyruleno==122); case 122: /* alter_topic_optr ::= alter_topic_optr partitions */ yytestcase(yyruleno==122);
{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy526 = yylhsminor.yy526; yymsp[-1].minor.yy94 = yylhsminor.yy94;
break; break;
case 111: /* alter_db_optr ::= */ case 111: /* alter_db_optr ::= */
{ setDefaultCreateDbOption(&yymsp[1].minor.yy526); yymsp[1].minor.yy526.dbType = TSDB_DB_TYPE_DEFAULT;} { setDefaultCreateDbOption(&yymsp[1].minor.yy94); yymsp[1].minor.yy94.dbType = TSDB_DB_TYPE_DEFAULT;}
break; break;
case 123: /* typename ::= ids */ case 123: /* typename ::= ids */
{ {
yymsp[0].minor.yy0.type = 0; yymsp[0].minor.yy0.type = 0;
tSetColumnType (&yylhsminor.yy295, &yymsp[0].minor.yy0); tSetColumnType (&yylhsminor.yy451, &yymsp[0].minor.yy0);
} }
yymsp[0].minor.yy295 = yylhsminor.yy295; yymsp[0].minor.yy451 = yylhsminor.yy451;
break; break;
case 124: /* typename ::= ids LP signed RP */ case 124: /* typename ::= ids LP signed RP */
{ {
if (yymsp[-1].minor.yy525 <= 0) { if (yymsp[-1].minor.yy481 <= 0) {
yymsp[-3].minor.yy0.type = 0; yymsp[-3].minor.yy0.type = 0;
tSetColumnType(&yylhsminor.yy295, &yymsp[-3].minor.yy0); tSetColumnType(&yylhsminor.yy451, &yymsp[-3].minor.yy0);
} else { } else {
yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy525; // negative value of name length yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy481; // negative value of name length
tSetColumnType(&yylhsminor.yy295, &yymsp[-3].minor.yy0); tSetColumnType(&yylhsminor.yy451, &yymsp[-3].minor.yy0);
} }
} }
yymsp[-3].minor.yy295 = yylhsminor.yy295; yymsp[-3].minor.yy451 = yylhsminor.yy451;
break; break;
case 125: /* typename ::= ids UNSIGNED */ case 125: /* typename ::= ids UNSIGNED */
{ {
yymsp[-1].minor.yy0.type = 0; yymsp[-1].minor.yy0.type = 0;
yymsp[-1].minor.yy0.n = ((yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z); yymsp[-1].minor.yy0.n = ((yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z);
tSetColumnType (&yylhsminor.yy295, &yymsp[-1].minor.yy0); tSetColumnType (&yylhsminor.yy451, &yymsp[-1].minor.yy0);
} }
yymsp[-1].minor.yy295 = yylhsminor.yy295; yymsp[-1].minor.yy451 = yylhsminor.yy451;
break; break;
case 126: /* signed ::= INTEGER */ case 126: /* signed ::= INTEGER */
{ yylhsminor.yy525 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy481 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[0].minor.yy525 = yylhsminor.yy525; yymsp[0].minor.yy481 = yylhsminor.yy481;
break; break;
case 127: /* signed ::= PLUS INTEGER */ case 127: /* signed ::= PLUS INTEGER */
{ yymsp[-1].minor.yy525 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yymsp[-1].minor.yy481 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
break; break;
case 128: /* signed ::= MINUS INTEGER */ case 128: /* signed ::= MINUS INTEGER */
{ yymsp[-1].minor.yy525 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);} { yymsp[-1].minor.yy481 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);}
break; break;
case 132: /* cmd ::= CREATE TABLE create_table_list */ case 132: /* cmd ::= CREATE TABLE create_table_list */
{ pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy470;} { pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy194;}
break; break;
case 133: /* create_table_list ::= create_from_stable */ case 133: /* create_table_list ::= create_from_stable */
{ {
SCreateTableSql* pCreateTable = calloc(1, sizeof(SCreateTableSql)); SCreateTableSql* pCreateTable = calloc(1, sizeof(SCreateTableSql));
pCreateTable->childTableInfo = taosArrayInit(4, sizeof(SCreatedTableInfo)); pCreateTable->childTableInfo = taosArrayInit(4, sizeof(SCreatedTableInfo));
taosArrayPush(pCreateTable->childTableInfo, &yymsp[0].minor.yy96); taosArrayPush(pCreateTable->childTableInfo, &yymsp[0].minor.yy252);
pCreateTable->type = TSQL_CREATE_TABLE_FROM_STABLE; pCreateTable->type = TSQL_CREATE_TABLE_FROM_STABLE;
yylhsminor.yy470 = pCreateTable; yylhsminor.yy194 = pCreateTable;
} }
yymsp[0].minor.yy470 = yylhsminor.yy470; yymsp[0].minor.yy194 = yylhsminor.yy194;
break; break;
case 134: /* create_table_list ::= create_table_list create_from_stable */ case 134: /* create_table_list ::= create_table_list create_from_stable */
{ {
taosArrayPush(yymsp[-1].minor.yy470->childTableInfo, &yymsp[0].minor.yy96); taosArrayPush(yymsp[-1].minor.yy194->childTableInfo, &yymsp[0].minor.yy252);
yylhsminor.yy470 = yymsp[-1].minor.yy470; yylhsminor.yy194 = yymsp[-1].minor.yy194;
} }
yymsp[-1].minor.yy470 = yylhsminor.yy470; yymsp[-1].minor.yy194 = yylhsminor.yy194;
break; break;
case 135: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ case 135: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
{ {
yylhsminor.yy470 = tSetCreateTableInfo(yymsp[-1].minor.yy285, NULL, NULL, TSQL_CREATE_TABLE); yylhsminor.yy194 = tSetCreateTableInfo(yymsp[-1].minor.yy429, NULL, NULL, TSQL_CREATE_TABLE);
setSqlInfo(pInfo, yylhsminor.yy470, NULL, TSDB_SQL_CREATE_TABLE); setSqlInfo(pInfo, yylhsminor.yy194, NULL, TSDB_SQL_CREATE_TABLE);
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
setCreatedTableName(pInfo, &yymsp[-4].minor.yy0, &yymsp[-5].minor.yy0); setCreatedTableName(pInfo, &yymsp[-4].minor.yy0, &yymsp[-5].minor.yy0);
} }
yymsp[-5].minor.yy470 = yylhsminor.yy470; yymsp[-5].minor.yy194 = yylhsminor.yy194;
break; break;
case 136: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ case 136: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
{ {
yylhsminor.yy470 = tSetCreateTableInfo(yymsp[-5].minor.yy285, yymsp[-1].minor.yy285, NULL, TSQL_CREATE_STABLE); yylhsminor.yy194 = tSetCreateTableInfo(yymsp[-5].minor.yy429, yymsp[-1].minor.yy429, NULL, TSQL_CREATE_STABLE);
setSqlInfo(pInfo, yylhsminor.yy470, NULL, TSDB_SQL_CREATE_TABLE); setSqlInfo(pInfo, yylhsminor.yy194, NULL, TSDB_SQL_CREATE_TABLE);
yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n; yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n;
setCreatedTableName(pInfo, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0); setCreatedTableName(pInfo, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0);
} }
yymsp[-9].minor.yy470 = yylhsminor.yy470; yymsp[-9].minor.yy194 = yylhsminor.yy194;
break; break;
case 137: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ case 137: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
{ {
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n; yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n;
yylhsminor.yy96 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy285, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0); yylhsminor.yy252 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy429, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0);
} }
yymsp[-9].minor.yy96 = yylhsminor.yy96; yymsp[-9].minor.yy252 = yylhsminor.yy252;
break; break;
case 138: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ case 138: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
{ {
yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n; yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n;
yymsp[-11].minor.yy0.n += yymsp[-10].minor.yy0.n; yymsp[-11].minor.yy0.n += yymsp[-10].minor.yy0.n;
yylhsminor.yy96 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy285, yymsp[-1].minor.yy285, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0); yylhsminor.yy252 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy429, yymsp[-1].minor.yy429, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0);
} }
yymsp[-12].minor.yy96 = yylhsminor.yy96; yymsp[-12].minor.yy252 = yylhsminor.yy252;
break; break;
case 139: /* tagNamelist ::= tagNamelist COMMA ids */ case 139: /* tagNamelist ::= tagNamelist COMMA ids */
{taosArrayPush(yymsp[-2].minor.yy285, &yymsp[0].minor.yy0); yylhsminor.yy285 = yymsp[-2].minor.yy285; } {taosArrayPush(yymsp[-2].minor.yy429, &yymsp[0].minor.yy0); yylhsminor.yy429 = yymsp[-2].minor.yy429; }
yymsp[-2].minor.yy285 = yylhsminor.yy285; yymsp[-2].minor.yy429 = yylhsminor.yy429;
break; break;
case 140: /* tagNamelist ::= ids */ case 140: /* tagNamelist ::= ids */
{yylhsminor.yy285 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yylhsminor.yy285, &yymsp[0].minor.yy0);} {yylhsminor.yy429 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yylhsminor.yy429, &yymsp[0].minor.yy0);}
yymsp[0].minor.yy285 = yylhsminor.yy285; yymsp[0].minor.yy429 = yylhsminor.yy429;
break; break;
case 141: /* create_table_args ::= ifnotexists ids cpxName AS select */ case 141: /* create_table_args ::= ifnotexists ids cpxName AS select */
{ {
yylhsminor.yy470 = tSetCreateTableInfo(NULL, NULL, yymsp[0].minor.yy342, TSQL_CREATE_STREAM); yylhsminor.yy194 = tSetCreateTableInfo(NULL, NULL, yymsp[0].minor.yy254, TSQL_CREATE_STREAM);
setSqlInfo(pInfo, yylhsminor.yy470, NULL, TSDB_SQL_CREATE_TABLE); setSqlInfo(pInfo, yylhsminor.yy194, NULL, TSDB_SQL_CREATE_TABLE);
yymsp[-3].minor.yy0.n += yymsp[-2].minor.yy0.n; yymsp[-3].minor.yy0.n += yymsp[-2].minor.yy0.n;
setCreatedTableName(pInfo, &yymsp[-3].minor.yy0, &yymsp[-4].minor.yy0); setCreatedTableName(pInfo, &yymsp[-3].minor.yy0, &yymsp[-4].minor.yy0);
} }
yymsp[-4].minor.yy470 = yylhsminor.yy470; yymsp[-4].minor.yy194 = yylhsminor.yy194;
break; break;
case 142: /* columnlist ::= columnlist COMMA column */ case 142: /* columnlist ::= columnlist COMMA column */
{taosArrayPush(yymsp[-2].minor.yy285, &yymsp[0].minor.yy295); yylhsminor.yy285 = yymsp[-2].minor.yy285; } {taosArrayPush(yymsp[-2].minor.yy429, &yymsp[0].minor.yy451); yylhsminor.yy429 = yymsp[-2].minor.yy429; }
yymsp[-2].minor.yy285 = yylhsminor.yy285; yymsp[-2].minor.yy429 = yylhsminor.yy429;
break; break;
case 143: /* columnlist ::= column */ case 143: /* columnlist ::= column */
{yylhsminor.yy285 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy285, &yymsp[0].minor.yy295);} {yylhsminor.yy429 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy429, &yymsp[0].minor.yy451);}
yymsp[0].minor.yy285 = yylhsminor.yy285; yymsp[0].minor.yy429 = yylhsminor.yy429;
break; break;
case 144: /* column ::= ids typename */ case 144: /* column ::= ids typename */
{ {
tSetColumnInfo(&yylhsminor.yy295, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy295); tSetColumnInfo(&yylhsminor.yy451, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy451);
} }
yymsp[-1].minor.yy295 = yylhsminor.yy295; yymsp[-1].minor.yy451 = yylhsminor.yy451;
break; break;
case 145: /* tagitemlist ::= tagitemlist COMMA tagitem */ case 145: /* tagitemlist ::= tagitemlist COMMA tagitem */
{ yylhsminor.yy285 = tVariantListAppend(yymsp[-2].minor.yy285, &yymsp[0].minor.yy362, -1); } { yylhsminor.yy429 = tVariantListAppend(yymsp[-2].minor.yy429, &yymsp[0].minor.yy218, -1); }
yymsp[-2].minor.yy285 = yylhsminor.yy285; yymsp[-2].minor.yy429 = yylhsminor.yy429;
break; break;
case 146: /* tagitemlist ::= tagitem */ case 146: /* tagitemlist ::= tagitem */
{ yylhsminor.yy285 = tVariantListAppend(NULL, &yymsp[0].minor.yy362, -1); } { yylhsminor.yy429 = tVariantListAppend(NULL, &yymsp[0].minor.yy218, -1); }
yymsp[0].minor.yy285 = yylhsminor.yy285; yymsp[0].minor.yy429 = yylhsminor.yy429;
break; break;
case 147: /* tagitem ::= INTEGER */ case 147: /* tagitem ::= INTEGER */
case 148: /* tagitem ::= FLOAT */ yytestcase(yyruleno==148); case 148: /* tagitem ::= FLOAT */ yytestcase(yyruleno==148);
case 149: /* tagitem ::= STRING */ yytestcase(yyruleno==149); case 149: /* tagitem ::= STRING */ yytestcase(yyruleno==149);
case 150: /* tagitem ::= BOOL */ yytestcase(yyruleno==150); case 150: /* tagitem ::= BOOL */ yytestcase(yyruleno==150);
{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy362, &yymsp[0].minor.yy0); } { toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy218, &yymsp[0].minor.yy0); }
yymsp[0].minor.yy362 = yylhsminor.yy362; yymsp[0].minor.yy218 = yylhsminor.yy218;
break; break;
case 151: /* tagitem ::= NULL */ case 151: /* tagitem ::= NULL */
{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy362, &yymsp[0].minor.yy0); } { yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy218, &yymsp[0].minor.yy0); }
yymsp[0].minor.yy362 = yylhsminor.yy362; yymsp[0].minor.yy218 = yylhsminor.yy218;
break; break;
case 152: /* tagitem ::= MINUS INTEGER */ case 152: /* tagitem ::= MINUS INTEGER */
case 153: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==153); case 153: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==153);
...@@ -2587,56 +2583,56 @@ static void yy_reduce( ...@@ -2587,56 +2583,56 @@ static void yy_reduce(
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
yymsp[-1].minor.yy0.type = yymsp[0].minor.yy0.type; yymsp[-1].minor.yy0.type = yymsp[0].minor.yy0.type;
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
tVariantCreate(&yylhsminor.yy362, &yymsp[-1].minor.yy0); tVariantCreate(&yylhsminor.yy218, &yymsp[-1].minor.yy0);
} }
yymsp[-1].minor.yy362 = yylhsminor.yy362; yymsp[-1].minor.yy218 = yylhsminor.yy218;
break; break;
case 156: /* select ::= SELECT selcollist from where_opt interval_opt session_option fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ case 156: /* select ::= SELECT selcollist from where_opt interval_opt session_option fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */
{ {
yylhsminor.yy342 = tSetQuerySqlNode(&yymsp[-12].minor.yy0, yymsp[-11].minor.yy285, yymsp[-10].minor.yy162, yymsp[-9].minor.yy178, yymsp[-4].minor.yy285, yymsp[-3].minor.yy285, &yymsp[-8].minor.yy376, &yymsp[-7].minor.yy523, &yymsp[-5].minor.yy0, yymsp[-6].minor.yy285, &yymsp[0].minor.yy438, &yymsp[-1].minor.yy438); yylhsminor.yy254 = tSetQuerySqlNode(&yymsp[-12].minor.yy0, yymsp[-11].minor.yy429, yymsp[-10].minor.yy70, yymsp[-9].minor.yy170, yymsp[-4].minor.yy429, yymsp[-3].minor.yy429, &yymsp[-8].minor.yy220, &yymsp[-7].minor.yy87, &yymsp[-5].minor.yy0, yymsp[-6].minor.yy429, &yymsp[0].minor.yy18, &yymsp[-1].minor.yy18);
} }
yymsp[-12].minor.yy342 = yylhsminor.yy342; yymsp[-12].minor.yy254 = yylhsminor.yy254;
break; break;
case 157: /* select ::= LP select RP */ case 157: /* select ::= LP select RP */
{yymsp[-2].minor.yy342 = yymsp[-1].minor.yy342;} {yymsp[-2].minor.yy254 = yymsp[-1].minor.yy254;}
break; break;
case 158: /* union ::= select */ case 158: /* union ::= select */
{ yylhsminor.yy513 = setSubclause(NULL, yymsp[0].minor.yy342); } { yylhsminor.yy141 = setSubclause(NULL, yymsp[0].minor.yy254); }
yymsp[0].minor.yy513 = yylhsminor.yy513; yymsp[0].minor.yy141 = yylhsminor.yy141;
break; break;
case 159: /* union ::= union UNION ALL select */ case 159: /* union ::= union UNION ALL select */
{ yylhsminor.yy513 = appendSelectClause(yymsp[-3].minor.yy513, yymsp[0].minor.yy342); } { yylhsminor.yy141 = appendSelectClause(yymsp[-3].minor.yy141, yymsp[0].minor.yy254); }
yymsp[-3].minor.yy513 = yylhsminor.yy513; yymsp[-3].minor.yy141 = yylhsminor.yy141;
break; break;
case 160: /* cmd ::= union */ case 160: /* cmd ::= union */
{ setSqlInfo(pInfo, yymsp[0].minor.yy513, NULL, TSDB_SQL_SELECT); } { setSqlInfo(pInfo, yymsp[0].minor.yy141, NULL, TSDB_SQL_SELECT); }
break; break;
case 161: /* select ::= SELECT selcollist */ case 161: /* select ::= SELECT selcollist */
{ {
yylhsminor.yy342 = tSetQuerySqlNode(&yymsp[-1].minor.yy0, yymsp[0].minor.yy285, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); yylhsminor.yy254 = tSetQuerySqlNode(&yymsp[-1].minor.yy0, yymsp[0].minor.yy429, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
} }
yymsp[-1].minor.yy342 = yylhsminor.yy342; yymsp[-1].minor.yy254 = yylhsminor.yy254;
break; break;
case 162: /* sclp ::= selcollist COMMA */ case 162: /* sclp ::= selcollist COMMA */
{yylhsminor.yy285 = yymsp[-1].minor.yy285;} {yylhsminor.yy429 = yymsp[-1].minor.yy429;}
yymsp[-1].minor.yy285 = yylhsminor.yy285; yymsp[-1].minor.yy429 = yylhsminor.yy429;
break; break;
case 163: /* sclp ::= */ case 163: /* sclp ::= */
case 188: /* orderby_opt ::= */ yytestcase(yyruleno==188); case 188: /* orderby_opt ::= */ yytestcase(yyruleno==188);
{yymsp[1].minor.yy285 = 0;} {yymsp[1].minor.yy429 = 0;}
break; break;
case 164: /* selcollist ::= sclp distinct expr as */ case 164: /* selcollist ::= sclp distinct expr as */
{ {
yylhsminor.yy285 = tSqlExprListAppend(yymsp[-3].minor.yy285, yymsp[-1].minor.yy178, yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0); yylhsminor.yy429 = tSqlExprListAppend(yymsp[-3].minor.yy429, yymsp[-1].minor.yy170, yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0);
} }
yymsp[-3].minor.yy285 = yylhsminor.yy285; yymsp[-3].minor.yy429 = yylhsminor.yy429;
break; break;
case 165: /* selcollist ::= sclp STAR */ case 165: /* selcollist ::= sclp STAR */
{ {
tSqlExpr *pNode = tSqlExprCreateIdValue(NULL, TK_ALL); tSqlExpr *pNode = tSqlExprCreateIdValue(NULL, TK_ALL);
yylhsminor.yy285 = tSqlExprListAppend(yymsp[-1].minor.yy285, pNode, 0, 0); yylhsminor.yy429 = tSqlExprListAppend(yymsp[-1].minor.yy429, pNode, 0, 0);
} }
yymsp[-1].minor.yy285 = yylhsminor.yy285; yymsp[-1].minor.yy429 = yylhsminor.yy429;
break; break;
case 166: /* as ::= AS ids */ case 166: /* as ::= AS ids */
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
...@@ -2653,35 +2649,35 @@ static void yy_reduce( ...@@ -2653,35 +2649,35 @@ static void yy_reduce(
yymsp[0].minor.yy0 = yylhsminor.yy0; yymsp[0].minor.yy0 = yylhsminor.yy0;
break; break;
case 171: /* from ::= FROM tablelist */ case 171: /* from ::= FROM tablelist */
{yymsp[-1].minor.yy162 = yymsp[0].minor.yy285;} {yymsp[-1].minor.yy70 = yymsp[0].minor.yy429;}
break; break;
case 172: /* from ::= FROM LP union RP */ case 172: /* from ::= FROM LP union RP */
{yymsp[-3].minor.yy162 = yymsp[-1].minor.yy513;} {yymsp[-3].minor.yy70 = yymsp[-1].minor.yy141;}
break; break;
case 173: /* tablelist ::= ids cpxName */ case 173: /* tablelist ::= ids cpxName */
{ {
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
yylhsminor.yy285 = setTableNameList(NULL, &yymsp[-1].minor.yy0, NULL); yylhsminor.yy429 = setTableNameList(NULL, &yymsp[-1].minor.yy0, NULL);
} }
yymsp[-1].minor.yy285 = yylhsminor.yy285; yymsp[-1].minor.yy429 = yylhsminor.yy429;
break; break;
case 174: /* tablelist ::= ids cpxName ids */ case 174: /* tablelist ::= ids cpxName ids */
{ {
toTSDBType(yymsp[-2].minor.yy0.type); toTSDBType(yymsp[-2].minor.yy0.type);
toTSDBType(yymsp[0].minor.yy0.type); toTSDBType(yymsp[0].minor.yy0.type);
yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n;
yylhsminor.yy285 = setTableNameList(NULL, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); yylhsminor.yy429 = setTableNameList(NULL, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
} }
yymsp[-2].minor.yy285 = yylhsminor.yy285; yymsp[-2].minor.yy429 = yylhsminor.yy429;
break; break;
case 175: /* tablelist ::= tablelist COMMA ids cpxName */ case 175: /* tablelist ::= tablelist COMMA ids cpxName */
{ {
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
yylhsminor.yy285 = setTableNameList(yymsp[-3].minor.yy285, &yymsp[-1].minor.yy0, NULL); yylhsminor.yy429 = setTableNameList(yymsp[-3].minor.yy429, &yymsp[-1].minor.yy0, NULL);
} }
yymsp[-3].minor.yy285 = yylhsminor.yy285; yymsp[-3].minor.yy429 = yylhsminor.yy429;
break; break;
case 176: /* tablelist ::= tablelist COMMA ids cpxName ids */ case 176: /* tablelist ::= tablelist COMMA ids cpxName ids */
{ {
...@@ -2689,35 +2685,35 @@ static void yy_reduce( ...@@ -2689,35 +2685,35 @@ static void yy_reduce(
toTSDBType(yymsp[0].minor.yy0.type); toTSDBType(yymsp[0].minor.yy0.type);
yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n;
yylhsminor.yy285 = setTableNameList(yymsp[-4].minor.yy285, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); yylhsminor.yy429 = setTableNameList(yymsp[-4].minor.yy429, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
} }
yymsp[-4].minor.yy285 = yylhsminor.yy285; yymsp[-4].minor.yy429 = yylhsminor.yy429;
break; break;
case 177: /* tmvar ::= VARIABLE */ case 177: /* tmvar ::= VARIABLE */
{yylhsminor.yy0 = yymsp[0].minor.yy0;} {yylhsminor.yy0 = yymsp[0].minor.yy0;}
yymsp[0].minor.yy0 = yylhsminor.yy0; yymsp[0].minor.yy0 = yylhsminor.yy0;
break; break;
case 178: /* interval_opt ::= INTERVAL LP tmvar RP */ case 178: /* interval_opt ::= INTERVAL LP tmvar RP */
{yymsp[-3].minor.yy376.interval = yymsp[-1].minor.yy0; yymsp[-3].minor.yy376.offset.n = 0;} {yymsp[-3].minor.yy220.interval = yymsp[-1].minor.yy0; yymsp[-3].minor.yy220.offset.n = 0;}
break; break;
case 179: /* interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ case 179: /* interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */
{yymsp[-5].minor.yy376.interval = yymsp[-3].minor.yy0; yymsp[-5].minor.yy376.offset = yymsp[-1].minor.yy0;} {yymsp[-5].minor.yy220.interval = yymsp[-3].minor.yy0; yymsp[-5].minor.yy220.offset = yymsp[-1].minor.yy0;}
break; break;
case 180: /* interval_opt ::= */ case 180: /* interval_opt ::= */
{memset(&yymsp[1].minor.yy376, 0, sizeof(yymsp[1].minor.yy376));} {memset(&yymsp[1].minor.yy220, 0, sizeof(yymsp[1].minor.yy220));}
break; break;
case 181: /* session_option ::= */ case 181: /* session_option ::= */
{yymsp[1].minor.yy523.col.n = 0; yymsp[1].minor.yy523.gap.n = 0;} {yymsp[1].minor.yy87.col.n = 0; yymsp[1].minor.yy87.gap.n = 0;}
break; break;
case 182: /* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ case 182: /* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
yymsp[-6].minor.yy523.col = yymsp[-4].minor.yy0; yymsp[-6].minor.yy87.col = yymsp[-4].minor.yy0;
yymsp[-6].minor.yy523.gap = yymsp[-1].minor.yy0; yymsp[-6].minor.yy87.gap = yymsp[-1].minor.yy0;
} }
break; break;
case 183: /* fill_opt ::= */ case 183: /* fill_opt ::= */
{ yymsp[1].minor.yy285 = 0; } { yymsp[1].minor.yy429 = 0; }
break; break;
case 184: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */ case 184: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */
{ {
...@@ -2725,14 +2721,14 @@ static void yy_reduce( ...@@ -2725,14 +2721,14 @@ static void yy_reduce(
toTSDBType(yymsp[-3].minor.yy0.type); toTSDBType(yymsp[-3].minor.yy0.type);
tVariantCreate(&A, &yymsp[-3].minor.yy0); tVariantCreate(&A, &yymsp[-3].minor.yy0);
tVariantListInsert(yymsp[-1].minor.yy285, &A, -1, 0); tVariantListInsert(yymsp[-1].minor.yy429, &A, -1, 0);
yymsp[-5].minor.yy285 = yymsp[-1].minor.yy285; yymsp[-5].minor.yy429 = yymsp[-1].minor.yy429;
} }
break; break;
case 185: /* fill_opt ::= FILL LP ID RP */ case 185: /* fill_opt ::= FILL LP ID RP */
{ {
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-3].minor.yy285 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); yymsp[-3].minor.yy429 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);
} }
break; break;
case 186: /* sliding_opt ::= SLIDING LP tmvar RP */ case 186: /* sliding_opt ::= SLIDING LP tmvar RP */
...@@ -2742,226 +2738,226 @@ static void yy_reduce( ...@@ -2742,226 +2738,226 @@ static void yy_reduce(
{yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = NULL; yymsp[1].minor.yy0.type = 0; } {yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = NULL; yymsp[1].minor.yy0.type = 0; }
break; break;
case 189: /* orderby_opt ::= ORDER BY sortlist */ case 189: /* orderby_opt ::= ORDER BY sortlist */
{yymsp[-2].minor.yy285 = yymsp[0].minor.yy285;} {yymsp[-2].minor.yy429 = yymsp[0].minor.yy429;}
break; break;
case 190: /* sortlist ::= sortlist COMMA item sortorder */ case 190: /* sortlist ::= sortlist COMMA item sortorder */
{ {
yylhsminor.yy285 = tVariantListAppend(yymsp[-3].minor.yy285, &yymsp[-1].minor.yy362, yymsp[0].minor.yy460); yylhsminor.yy429 = tVariantListAppend(yymsp[-3].minor.yy429, &yymsp[-1].minor.yy218, yymsp[0].minor.yy116);
} }
yymsp[-3].minor.yy285 = yylhsminor.yy285; yymsp[-3].minor.yy429 = yylhsminor.yy429;
break; break;
case 191: /* sortlist ::= item sortorder */ case 191: /* sortlist ::= item sortorder */
{ {
yylhsminor.yy285 = tVariantListAppend(NULL, &yymsp[-1].minor.yy362, yymsp[0].minor.yy460); yylhsminor.yy429 = tVariantListAppend(NULL, &yymsp[-1].minor.yy218, yymsp[0].minor.yy116);
} }
yymsp[-1].minor.yy285 = yylhsminor.yy285; yymsp[-1].minor.yy429 = yylhsminor.yy429;
break; break;
case 192: /* item ::= ids cpxName */ case 192: /* item ::= ids cpxName */
{ {
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
tVariantCreate(&yylhsminor.yy362, &yymsp[-1].minor.yy0); tVariantCreate(&yylhsminor.yy218, &yymsp[-1].minor.yy0);
} }
yymsp[-1].minor.yy362 = yylhsminor.yy362; yymsp[-1].minor.yy218 = yylhsminor.yy218;
break; break;
case 193: /* sortorder ::= ASC */ case 193: /* sortorder ::= ASC */
{ yymsp[0].minor.yy460 = TSDB_ORDER_ASC; } { yymsp[0].minor.yy116 = TSDB_ORDER_ASC; }
break; break;
case 194: /* sortorder ::= DESC */ case 194: /* sortorder ::= DESC */
{ yymsp[0].minor.yy460 = TSDB_ORDER_DESC;} { yymsp[0].minor.yy116 = TSDB_ORDER_DESC;}
break; break;
case 195: /* sortorder ::= */ case 195: /* sortorder ::= */
{ yymsp[1].minor.yy460 = TSDB_ORDER_ASC; } { yymsp[1].minor.yy116 = TSDB_ORDER_ASC; }
break; break;
case 196: /* groupby_opt ::= */ case 196: /* groupby_opt ::= */
{ yymsp[1].minor.yy285 = 0;} { yymsp[1].minor.yy429 = 0;}
break; break;
case 197: /* groupby_opt ::= GROUP BY grouplist */ case 197: /* groupby_opt ::= GROUP BY grouplist */
{ yymsp[-2].minor.yy285 = yymsp[0].minor.yy285;} { yymsp[-2].minor.yy429 = yymsp[0].minor.yy429;}
break; break;
case 198: /* grouplist ::= grouplist COMMA item */ case 198: /* grouplist ::= grouplist COMMA item */
{ {
yylhsminor.yy285 = tVariantListAppend(yymsp[-2].minor.yy285, &yymsp[0].minor.yy362, -1); yylhsminor.yy429 = tVariantListAppend(yymsp[-2].minor.yy429, &yymsp[0].minor.yy218, -1);
} }
yymsp[-2].minor.yy285 = yylhsminor.yy285; yymsp[-2].minor.yy429 = yylhsminor.yy429;
break; break;
case 199: /* grouplist ::= item */ case 199: /* grouplist ::= item */
{ {
yylhsminor.yy285 = tVariantListAppend(NULL, &yymsp[0].minor.yy362, -1); yylhsminor.yy429 = tVariantListAppend(NULL, &yymsp[0].minor.yy218, -1);
} }
yymsp[0].minor.yy285 = yylhsminor.yy285; yymsp[0].minor.yy429 = yylhsminor.yy429;
break; break;
case 200: /* having_opt ::= */ case 200: /* having_opt ::= */
case 210: /* where_opt ::= */ yytestcase(yyruleno==210); case 210: /* where_opt ::= */ yytestcase(yyruleno==210);
case 249: /* expritem ::= */ yytestcase(yyruleno==249); case 249: /* expritem ::= */ yytestcase(yyruleno==249);
{yymsp[1].minor.yy178 = 0;} {yymsp[1].minor.yy170 = 0;}
break; break;
case 201: /* having_opt ::= HAVING expr */ case 201: /* having_opt ::= HAVING expr */
case 211: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==211); case 211: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==211);
{yymsp[-1].minor.yy178 = yymsp[0].minor.yy178;} {yymsp[-1].minor.yy170 = yymsp[0].minor.yy170;}
break; break;
case 202: /* limit_opt ::= */ case 202: /* limit_opt ::= */
case 206: /* slimit_opt ::= */ yytestcase(yyruleno==206); case 206: /* slimit_opt ::= */ yytestcase(yyruleno==206);
{yymsp[1].minor.yy438.limit = -1; yymsp[1].minor.yy438.offset = 0;} {yymsp[1].minor.yy18.limit = -1; yymsp[1].minor.yy18.offset = 0;}
break; break;
case 203: /* limit_opt ::= LIMIT signed */ case 203: /* limit_opt ::= LIMIT signed */
case 207: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==207); case 207: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==207);
{yymsp[-1].minor.yy438.limit = yymsp[0].minor.yy525; yymsp[-1].minor.yy438.offset = 0;} {yymsp[-1].minor.yy18.limit = yymsp[0].minor.yy481; yymsp[-1].minor.yy18.offset = 0;}
break; break;
case 204: /* limit_opt ::= LIMIT signed OFFSET signed */ case 204: /* limit_opt ::= LIMIT signed OFFSET signed */
{ yymsp[-3].minor.yy438.limit = yymsp[-2].minor.yy525; yymsp[-3].minor.yy438.offset = yymsp[0].minor.yy525;} { yymsp[-3].minor.yy18.limit = yymsp[-2].minor.yy481; yymsp[-3].minor.yy18.offset = yymsp[0].minor.yy481;}
break; break;
case 205: /* limit_opt ::= LIMIT signed COMMA signed */ case 205: /* limit_opt ::= LIMIT signed COMMA signed */
{ yymsp[-3].minor.yy438.limit = yymsp[0].minor.yy525; yymsp[-3].minor.yy438.offset = yymsp[-2].minor.yy525;} { yymsp[-3].minor.yy18.limit = yymsp[0].minor.yy481; yymsp[-3].minor.yy18.offset = yymsp[-2].minor.yy481;}
break; break;
case 208: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ case 208: /* slimit_opt ::= SLIMIT signed SOFFSET signed */
{yymsp[-3].minor.yy438.limit = yymsp[-2].minor.yy525; yymsp[-3].minor.yy438.offset = yymsp[0].minor.yy525;} {yymsp[-3].minor.yy18.limit = yymsp[-2].minor.yy481; yymsp[-3].minor.yy18.offset = yymsp[0].minor.yy481;}
break; break;
case 209: /* slimit_opt ::= SLIMIT signed COMMA signed */ case 209: /* slimit_opt ::= SLIMIT signed COMMA signed */
{yymsp[-3].minor.yy438.limit = yymsp[0].minor.yy525; yymsp[-3].minor.yy438.offset = yymsp[-2].minor.yy525;} {yymsp[-3].minor.yy18.limit = yymsp[0].minor.yy481; yymsp[-3].minor.yy18.offset = yymsp[-2].minor.yy481;}
break; break;
case 212: /* expr ::= LP expr RP */ case 212: /* expr ::= LP expr RP */
{yylhsminor.yy178 = yymsp[-1].minor.yy178; yylhsminor.yy178->token.z = yymsp[-2].minor.yy0.z; yylhsminor.yy178->token.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);} {yylhsminor.yy170 = yymsp[-1].minor.yy170; yylhsminor.yy170->token.z = yymsp[-2].minor.yy0.z; yylhsminor.yy170->token.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);}
yymsp[-2].minor.yy178 = yylhsminor.yy178; yymsp[-2].minor.yy170 = yylhsminor.yy170;
break; break;
case 213: /* expr ::= ID */ case 213: /* expr ::= ID */
{ yylhsminor.yy178 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_ID);} { yylhsminor.yy170 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_ID);}
yymsp[0].minor.yy178 = yylhsminor.yy178; yymsp[0].minor.yy170 = yylhsminor.yy170;
break; break;
case 214: /* expr ::= ID DOT ID */ case 214: /* expr ::= ID DOT ID */
{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy178 = tSqlExprCreateIdValue(&yymsp[-2].minor.yy0, TK_ID);} { yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy170 = tSqlExprCreateIdValue(&yymsp[-2].minor.yy0, TK_ID);}
yymsp[-2].minor.yy178 = yylhsminor.yy178; yymsp[-2].minor.yy170 = yylhsminor.yy170;
break; break;
case 215: /* expr ::= ID DOT STAR */ case 215: /* expr ::= ID DOT STAR */
{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy178 = tSqlExprCreateIdValue(&yymsp[-2].minor.yy0, TK_ALL);} { yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy170 = tSqlExprCreateIdValue(&yymsp[-2].minor.yy0, TK_ALL);}
yymsp[-2].minor.yy178 = yylhsminor.yy178; yymsp[-2].minor.yy170 = yylhsminor.yy170;
break; break;
case 216: /* expr ::= INTEGER */ case 216: /* expr ::= INTEGER */
{ yylhsminor.yy178 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_INTEGER);} { yylhsminor.yy170 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_INTEGER);}
yymsp[0].minor.yy178 = yylhsminor.yy178; yymsp[0].minor.yy170 = yylhsminor.yy170;
break; break;
case 217: /* expr ::= MINUS INTEGER */ case 217: /* expr ::= MINUS INTEGER */
case 218: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==218); case 218: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==218);
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy178 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_INTEGER);} { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy170 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_INTEGER);}
yymsp[-1].minor.yy178 = yylhsminor.yy178; yymsp[-1].minor.yy170 = yylhsminor.yy170;
break; break;
case 219: /* expr ::= FLOAT */ case 219: /* expr ::= FLOAT */
{ yylhsminor.yy178 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_FLOAT);} { yylhsminor.yy170 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_FLOAT);}
yymsp[0].minor.yy178 = yylhsminor.yy178; yymsp[0].minor.yy170 = yylhsminor.yy170;
break; break;
case 220: /* expr ::= MINUS FLOAT */ case 220: /* expr ::= MINUS FLOAT */
case 221: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==221); case 221: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==221);
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy178 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_FLOAT);} { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy170 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_FLOAT);}
yymsp[-1].minor.yy178 = yylhsminor.yy178; yymsp[-1].minor.yy170 = yylhsminor.yy170;
break; break;
case 222: /* expr ::= STRING */ case 222: /* expr ::= STRING */
{ yylhsminor.yy178 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_STRING);} { yylhsminor.yy170 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_STRING);}
yymsp[0].minor.yy178 = yylhsminor.yy178; yymsp[0].minor.yy170 = yylhsminor.yy170;
break; break;
case 223: /* expr ::= NOW */ case 223: /* expr ::= NOW */
{ yylhsminor.yy178 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_NOW); } { yylhsminor.yy170 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_NOW); }
yymsp[0].minor.yy178 = yylhsminor.yy178; yymsp[0].minor.yy170 = yylhsminor.yy170;
break; break;
case 224: /* expr ::= VARIABLE */ case 224: /* expr ::= VARIABLE */
{ yylhsminor.yy178 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_VARIABLE);} { yylhsminor.yy170 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_VARIABLE);}
yymsp[0].minor.yy178 = yylhsminor.yy178; yymsp[0].minor.yy170 = yylhsminor.yy170;
break; break;
case 225: /* expr ::= BOOL */ case 225: /* expr ::= BOOL */
{ yylhsminor.yy178 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_BOOL);} { yylhsminor.yy170 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_BOOL);}
yymsp[0].minor.yy178 = yylhsminor.yy178; yymsp[0].minor.yy170 = yylhsminor.yy170;
break; break;
case 226: /* expr ::= ID LP exprlist RP */ case 226: /* expr ::= ID LP exprlist RP */
{ yylhsminor.yy178 = tSqlExprCreateFunction(yymsp[-1].minor.yy285, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } { yylhsminor.yy170 = tSqlExprCreateFunction(yymsp[-1].minor.yy429, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
yymsp[-3].minor.yy178 = yylhsminor.yy178; yymsp[-3].minor.yy170 = yylhsminor.yy170;
break; break;
case 227: /* expr ::= ID LP STAR RP */ case 227: /* expr ::= ID LP STAR RP */
{ yylhsminor.yy178 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } { yylhsminor.yy170 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
yymsp[-3].minor.yy178 = yylhsminor.yy178; yymsp[-3].minor.yy170 = yylhsminor.yy170;
break; break;
case 228: /* expr ::= expr IS NULL */ case 228: /* expr ::= expr IS NULL */
{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, NULL, TK_ISNULL);} {yylhsminor.yy170 = tSqlExprCreate(yymsp[-2].minor.yy170, NULL, TK_ISNULL);}
yymsp[-2].minor.yy178 = yylhsminor.yy178; yymsp[-2].minor.yy170 = yylhsminor.yy170;
break; break;
case 229: /* expr ::= expr IS NOT NULL */ case 229: /* expr ::= expr IS NOT NULL */
{yylhsminor.yy178 = tSqlExprCreate(yymsp[-3].minor.yy178, NULL, TK_NOTNULL);} {yylhsminor.yy170 = tSqlExprCreate(yymsp[-3].minor.yy170, NULL, TK_NOTNULL);}
yymsp[-3].minor.yy178 = yylhsminor.yy178; yymsp[-3].minor.yy170 = yylhsminor.yy170;
break; break;
case 230: /* expr ::= expr LT expr */ case 230: /* expr ::= expr LT expr */
{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_LT);} {yylhsminor.yy170 = tSqlExprCreate(yymsp[-2].minor.yy170, yymsp[0].minor.yy170, TK_LT);}
yymsp[-2].minor.yy178 = yylhsminor.yy178; yymsp[-2].minor.yy170 = yylhsminor.yy170;
break; break;
case 231: /* expr ::= expr GT expr */ case 231: /* expr ::= expr GT expr */
{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_GT);} {yylhsminor.yy170 = tSqlExprCreate(yymsp[-2].minor.yy170, yymsp[0].minor.yy170, TK_GT);}
yymsp[-2].minor.yy178 = yylhsminor.yy178; yymsp[-2].minor.yy170 = yylhsminor.yy170;
break; break;
case 232: /* expr ::= expr LE expr */ case 232: /* expr ::= expr LE expr */
{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_LE);} {yylhsminor.yy170 = tSqlExprCreate(yymsp[-2].minor.yy170, yymsp[0].minor.yy170, TK_LE);}
yymsp[-2].minor.yy178 = yylhsminor.yy178; yymsp[-2].minor.yy170 = yylhsminor.yy170;
break; break;
case 233: /* expr ::= expr GE expr */ case 233: /* expr ::= expr GE expr */
{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_GE);} {yylhsminor.yy170 = tSqlExprCreate(yymsp[-2].minor.yy170, yymsp[0].minor.yy170, TK_GE);}
yymsp[-2].minor.yy178 = yylhsminor.yy178; yymsp[-2].minor.yy170 = yylhsminor.yy170;
break; break;
case 234: /* expr ::= expr NE expr */ case 234: /* expr ::= expr NE expr */
{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_NE);} {yylhsminor.yy170 = tSqlExprCreate(yymsp[-2].minor.yy170, yymsp[0].minor.yy170, TK_NE);}
yymsp[-2].minor.yy178 = yylhsminor.yy178; yymsp[-2].minor.yy170 = yylhsminor.yy170;
break; break;
case 235: /* expr ::= expr EQ expr */ case 235: /* expr ::= expr EQ expr */
{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_EQ);} {yylhsminor.yy170 = tSqlExprCreate(yymsp[-2].minor.yy170, yymsp[0].minor.yy170, TK_EQ);}
yymsp[-2].minor.yy178 = yylhsminor.yy178; yymsp[-2].minor.yy170 = yylhsminor.yy170;
break; break;
case 236: /* expr ::= expr BETWEEN expr AND expr */ case 236: /* expr ::= expr BETWEEN expr AND expr */
{ tSqlExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy178); yylhsminor.yy178 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy178, yymsp[-2].minor.yy178, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy178, TK_LE), TK_AND);} { tSqlExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy170); yylhsminor.yy170 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy170, yymsp[-2].minor.yy170, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy170, TK_LE), TK_AND);}
yymsp[-4].minor.yy178 = yylhsminor.yy178; yymsp[-4].minor.yy170 = yylhsminor.yy170;
break; break;
case 237: /* expr ::= expr AND expr */ case 237: /* expr ::= expr AND expr */
{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_AND);} {yylhsminor.yy170 = tSqlExprCreate(yymsp[-2].minor.yy170, yymsp[0].minor.yy170, TK_AND);}
yymsp[-2].minor.yy178 = yylhsminor.yy178; yymsp[-2].minor.yy170 = yylhsminor.yy170;
break; break;
case 238: /* expr ::= expr OR expr */ case 238: /* expr ::= expr OR expr */
{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_OR); } {yylhsminor.yy170 = tSqlExprCreate(yymsp[-2].minor.yy170, yymsp[0].minor.yy170, TK_OR); }
yymsp[-2].minor.yy178 = yylhsminor.yy178; yymsp[-2].minor.yy170 = yylhsminor.yy170;
break; break;
case 239: /* expr ::= expr PLUS expr */ case 239: /* expr ::= expr PLUS expr */
{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_PLUS); } {yylhsminor.yy170 = tSqlExprCreate(yymsp[-2].minor.yy170, yymsp[0].minor.yy170, TK_PLUS); }
yymsp[-2].minor.yy178 = yylhsminor.yy178; yymsp[-2].minor.yy170 = yylhsminor.yy170;
break; break;
case 240: /* expr ::= expr MINUS expr */ case 240: /* expr ::= expr MINUS expr */
{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_MINUS); } {yylhsminor.yy170 = tSqlExprCreate(yymsp[-2].minor.yy170, yymsp[0].minor.yy170, TK_MINUS); }
yymsp[-2].minor.yy178 = yylhsminor.yy178; yymsp[-2].minor.yy170 = yylhsminor.yy170;
break; break;
case 241: /* expr ::= expr STAR expr */ case 241: /* expr ::= expr STAR expr */
{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_STAR); } {yylhsminor.yy170 = tSqlExprCreate(yymsp[-2].minor.yy170, yymsp[0].minor.yy170, TK_STAR); }
yymsp[-2].minor.yy178 = yylhsminor.yy178; yymsp[-2].minor.yy170 = yylhsminor.yy170;
break; break;
case 242: /* expr ::= expr SLASH expr */ case 242: /* expr ::= expr SLASH expr */
{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_DIVIDE);} {yylhsminor.yy170 = tSqlExprCreate(yymsp[-2].minor.yy170, yymsp[0].minor.yy170, TK_DIVIDE);}
yymsp[-2].minor.yy178 = yylhsminor.yy178; yymsp[-2].minor.yy170 = yylhsminor.yy170;
break; break;
case 243: /* expr ::= expr REM expr */ case 243: /* expr ::= expr REM expr */
{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_REM); } {yylhsminor.yy170 = tSqlExprCreate(yymsp[-2].minor.yy170, yymsp[0].minor.yy170, TK_REM); }
yymsp[-2].minor.yy178 = yylhsminor.yy178; yymsp[-2].minor.yy170 = yylhsminor.yy170;
break; break;
case 244: /* expr ::= expr LIKE expr */ case 244: /* expr ::= expr LIKE expr */
{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_LIKE); } {yylhsminor.yy170 = tSqlExprCreate(yymsp[-2].minor.yy170, yymsp[0].minor.yy170, TK_LIKE); }
yymsp[-2].minor.yy178 = yylhsminor.yy178; yymsp[-2].minor.yy170 = yylhsminor.yy170;
break; break;
case 245: /* expr ::= expr IN LP exprlist RP */ case 245: /* expr ::= expr IN LP exprlist RP */
{yylhsminor.yy178 = tSqlExprCreate(yymsp[-4].minor.yy178, (tSqlExpr*)yymsp[-1].minor.yy285, TK_IN); } {yylhsminor.yy170 = tSqlExprCreate(yymsp[-4].minor.yy170, (tSqlExpr*)yymsp[-1].minor.yy429, TK_IN); }
yymsp[-4].minor.yy178 = yylhsminor.yy178; yymsp[-4].minor.yy170 = yylhsminor.yy170;
break; break;
case 246: /* exprlist ::= exprlist COMMA expritem */ case 246: /* exprlist ::= exprlist COMMA expritem */
{yylhsminor.yy285 = tSqlExprListAppend(yymsp[-2].minor.yy285,yymsp[0].minor.yy178,0, 0);} {yylhsminor.yy429 = tSqlExprListAppend(yymsp[-2].minor.yy429,yymsp[0].minor.yy170,0, 0);}
yymsp[-2].minor.yy285 = yylhsminor.yy285; yymsp[-2].minor.yy429 = yylhsminor.yy429;
break; break;
case 247: /* exprlist ::= expritem */ case 247: /* exprlist ::= expritem */
{yylhsminor.yy285 = tSqlExprListAppend(0,yymsp[0].minor.yy178,0, 0);} {yylhsminor.yy429 = tSqlExprListAppend(0,yymsp[0].minor.yy170,0, 0);}
yymsp[0].minor.yy285 = yylhsminor.yy285; yymsp[0].minor.yy429 = yylhsminor.yy429;
break; break;
case 248: /* expritem ::= expr */ case 248: /* expritem ::= expr */
{yylhsminor.yy178 = yymsp[0].minor.yy178;} {yylhsminor.yy170 = yymsp[0].minor.yy170;}
yymsp[0].minor.yy178 = yylhsminor.yy178; yymsp[0].minor.yy170 = yylhsminor.yy170;
break; break;
case 250: /* cmd ::= RESET QUERY CACHE */ case 250: /* cmd ::= RESET QUERY CACHE */
{ setDCLSqlElems(pInfo, TSDB_SQL_RESET_CACHE, 0);} { setDCLSqlElems(pInfo, TSDB_SQL_RESET_CACHE, 0);}
...@@ -2969,7 +2965,7 @@ static void yy_reduce( ...@@ -2969,7 +2965,7 @@ static void yy_reduce(
case 251: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ case 251: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy285, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy429, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
...@@ -2987,7 +2983,7 @@ static void yy_reduce( ...@@ -2987,7 +2983,7 @@ static void yy_reduce(
case 253: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ case 253: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy285, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy429, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
...@@ -3022,7 +3018,7 @@ static void yy_reduce( ...@@ -3022,7 +3018,7 @@ static void yy_reduce(
toTSDBType(yymsp[-2].minor.yy0.type); toTSDBType(yymsp[-2].minor.yy0.type);
SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1); SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1);
A = tVariantListAppend(A, &yymsp[0].minor.yy362, -1); A = tVariantListAppend(A, &yymsp[0].minor.yy218, -1);
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
...@@ -3031,7 +3027,7 @@ static void yy_reduce( ...@@ -3031,7 +3027,7 @@ static void yy_reduce(
case 257: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ case 257: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy285, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy429, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
...@@ -3049,7 +3045,7 @@ static void yy_reduce( ...@@ -3049,7 +3045,7 @@ static void yy_reduce(
case 259: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ case 259: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy285, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy429, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
......
...@@ -29,7 +29,7 @@ static int32_t syncGetWalVersion(SSyncNode *pNode, SSyncPeer *pPeer) { ...@@ -29,7 +29,7 @@ static int32_t syncGetWalVersion(SSyncNode *pNode, SSyncPeer *pPeer) {
uint64_t fver, wver; uint64_t fver, wver;
int32_t code = (*pNode->getVersionFp)(pNode->vgId, &fver, &wver); int32_t code = (*pNode->getVersionFp)(pNode->vgId, &fver, &wver);
if (code != 0) { if (code != 0) {
sDebug("%s, vnode is commiting while retrieve, last wver:%" PRIu64, pPeer->id, pPeer->lastWalVer); sInfo("%s, vnode is commiting while retrieve, last wver:%" PRIu64, pPeer->id, pPeer->lastWalVer);
return -1; return -1;
} }
...@@ -41,12 +41,12 @@ static bool syncIsWalModified(SSyncNode *pNode, SSyncPeer *pPeer) { ...@@ -41,12 +41,12 @@ static bool syncIsWalModified(SSyncNode *pNode, SSyncPeer *pPeer) {
uint64_t fver, wver; uint64_t fver, wver;
int32_t code = (*pNode->getVersionFp)(pNode->vgId, &fver, &wver); int32_t code = (*pNode->getVersionFp)(pNode->vgId, &fver, &wver);
if (code != 0) { if (code != 0) {
sDebug("%s, vnode is commiting while retrieve, last wver:%" PRIu64, pPeer->id, pPeer->lastWalVer); sInfo("%s, vnode is commiting while retrieve, last wver:%" PRIu64, pPeer->id, pPeer->lastWalVer);
return true; return true;
} }
if (wver != pPeer->lastWalVer) { if (wver != pPeer->lastWalVer) {
sDebug("%s, wal is modified while retrieve, wver:%" PRIu64 ", last:%" PRIu64, pPeer->id, wver, pPeer->lastWalVer); sInfo("%s, wal is modified while retrieve, wver:%" PRIu64 ", last:%" PRIu64, pPeer->id, wver, pPeer->lastWalVer);
return true; return true;
} }
...@@ -57,7 +57,7 @@ static int32_t syncGetFileVersion(SSyncNode *pNode, SSyncPeer *pPeer) { ...@@ -57,7 +57,7 @@ static int32_t syncGetFileVersion(SSyncNode *pNode, SSyncPeer *pPeer) {
uint64_t fver, wver; uint64_t fver, wver;
int32_t code = (*pNode->getVersionFp)(pNode->vgId, &fver, &wver); int32_t code = (*pNode->getVersionFp)(pNode->vgId, &fver, &wver);
if (code != 0) { if (code != 0) {
sDebug("%s, vnode is commiting while get fver for retrieve, last fver:%" PRIu64, pPeer->id, pPeer->lastFileVer); sInfo("%s, vnode is commiting while get fver for retrieve, last fver:%" PRIu64, pPeer->id, pPeer->lastFileVer);
return -1; return -1;
} }
...@@ -69,13 +69,13 @@ static bool syncAreFilesModified(SSyncNode *pNode, SSyncPeer *pPeer) { ...@@ -69,13 +69,13 @@ static bool syncAreFilesModified(SSyncNode *pNode, SSyncPeer *pPeer) {
uint64_t fver, wver; uint64_t fver, wver;
int32_t code = (*pNode->getVersionFp)(pNode->vgId, &fver, &wver); int32_t code = (*pNode->getVersionFp)(pNode->vgId, &fver, &wver);
if (code != 0) { if (code != 0) {
sDebug("%s, vnode is commiting while retrieve, last fver:%" PRIu64, pPeer->id, pPeer->lastFileVer); sInfo("%s, vnode is commiting while retrieve, last fver:%" PRIu64, pPeer->id, pPeer->lastFileVer);
pPeer->fileChanged = 1; pPeer->fileChanged = 1;
return true; return true;
} }
if (fver != pPeer->lastFileVer) { if (fver != pPeer->lastFileVer) {
sDebug("%s, files are modified while retrieve, fver:%" PRIu64 ", last:%" PRIu64, pPeer->id, fver, pPeer->lastFileVer); sInfo("%s, files are modified while retrieve, fver:%" PRIu64 ", last:%" PRIu64, pPeer->id, fver, pPeer->lastFileVer);
pPeer->fileChanged = 1; pPeer->fileChanged = 1;
return true; return true;
} }
...@@ -143,13 +143,13 @@ static int32_t syncReadOneWalRecord(int32_t sfd, SWalHead *pHead) { ...@@ -143,13 +143,13 @@ static int32_t syncReadOneWalRecord(int32_t sfd, SWalHead *pHead) {
} }
if (ret == 0) { if (ret == 0) {
sDebug("sfd:%d, read to the end of file, ret:%d", sfd, ret); sInfo("sfd:%d, read to the end of file, ret:%d", sfd, ret);
return 0; return 0;
} }
if (ret != sizeof(SWalHead)) { if (ret != sizeof(SWalHead)) {
// file is not at end yet, it shall be reloaded // file is not at end yet, it shall be reloaded
sDebug("sfd:%d, a partial wal head is read out, ret:%d", sfd, ret); sInfo("sfd:%d, a partial wal head is read out, ret:%d", sfd, ret);
return 0; return 0;
} }
...@@ -163,7 +163,7 @@ static int32_t syncReadOneWalRecord(int32_t sfd, SWalHead *pHead) { ...@@ -163,7 +163,7 @@ static int32_t syncReadOneWalRecord(int32_t sfd, SWalHead *pHead) {
if (ret != pHead->len) { if (ret != pHead->len) {
// file is not at end yet, it shall be reloaded // file is not at end yet, it shall be reloaded
sDebug("sfd:%d, a partial wal conetnt is read out, ret:%d", sfd, ret); sInfo("sfd:%d, a partial wal conetnt is read out, ret:%d", sfd, ret);
return 0; return 0;
} }
...@@ -184,7 +184,7 @@ static int64_t syncRetrieveLastWal(SSyncPeer *pPeer, char *name, uint64_t fversi ...@@ -184,7 +184,7 @@ static int64_t syncRetrieveLastWal(SSyncPeer *pPeer, char *name, uint64_t fversi
return -1; return -1;
} }
sDebug("%s, retrieve last wal:%s, offset:%" PRId64 " fver:%" PRIu64, pPeer->id, name, offset, fversion); sInfo("%s, retrieve last wal:%s, offset:%" PRId64 " fver:%" PRIu64, pPeer->id, name, offset, fversion);
SWalHead *pHead = malloc(SYNC_MAX_SIZE); SWalHead *pHead = malloc(SYNC_MAX_SIZE);
int64_t bytes = 0; int64_t bytes = 0;
...@@ -198,7 +198,7 @@ static int64_t syncRetrieveLastWal(SSyncPeer *pPeer, char *name, uint64_t fversi ...@@ -198,7 +198,7 @@ static int64_t syncRetrieveLastWal(SSyncPeer *pPeer, char *name, uint64_t fversi
if (code == 0) { if (code == 0) {
code = bytes; code = bytes;
sDebug("%s, read to the end of wal, bytes:%" PRId64, pPeer->id, bytes); sInfo("%s, read to the end of wal, bytes:%" PRId64, pPeer->id, bytes);
break; break;
} }
...@@ -217,7 +217,7 @@ static int64_t syncRetrieveLastWal(SSyncPeer *pPeer, char *name, uint64_t fversi ...@@ -217,7 +217,7 @@ static int64_t syncRetrieveLastWal(SSyncPeer *pPeer, char *name, uint64_t fversi
if (pHead->version >= fversion && fversion > 0) { if (pHead->version >= fversion && fversion > 0) {
code = 0; code = 0;
sDebug("%s, retrieve wal finished, hver:%" PRIu64 " fver:%" PRIu64, pPeer->id, pHead->version, fversion); sInfo("%s, retrieve wal finished, hver:%" PRIu64 " fver:%" PRIu64, pPeer->id, pHead->version, fversion);
break; break;
} }
} }
...@@ -237,7 +237,7 @@ static int64_t syncProcessLastWal(SSyncPeer *pPeer, char *wname, int64_t index) ...@@ -237,7 +237,7 @@ static int64_t syncProcessLastWal(SSyncPeer *pPeer, char *wname, int64_t index)
// get full path to wal file // get full path to wal file
snprintf(fname, sizeof(fname), "%s/%s", pNode->path, wname); snprintf(fname, sizeof(fname), "%s/%s", pNode->path, wname);
sDebug("%s, start to retrieve last wal:%s", pPeer->id, fname); sInfo("%s, start to retrieve last wal:%s", pPeer->id, fname);
while (1) { while (1) {
if (syncAreFilesModified(pNode, pPeer)) return -1; if (syncAreFilesModified(pNode, pPeer)) return -1;
...@@ -245,7 +245,7 @@ static int64_t syncProcessLastWal(SSyncPeer *pPeer, char *wname, int64_t index) ...@@ -245,7 +245,7 @@ static int64_t syncProcessLastWal(SSyncPeer *pPeer, char *wname, int64_t index)
int64_t bytes = syncRetrieveLastWal(pPeer, fname, fversion, offset); int64_t bytes = syncRetrieveLastWal(pPeer, fname, fversion, offset);
if (bytes < 0) { if (bytes < 0) {
sDebug("%s, failed to retrieve last wal, bytes:%" PRId64, pPeer->id, bytes); sInfo("%s, failed to retrieve last wal, bytes:%" PRId64, pPeer->id, bytes);
return bytes; return bytes;
} }
...@@ -257,13 +257,13 @@ static int64_t syncProcessLastWal(SSyncPeer *pPeer, char *wname, int64_t index) ...@@ -257,13 +257,13 @@ static int64_t syncProcessLastWal(SSyncPeer *pPeer, char *wname, int64_t index)
if (fversion == 0) { if (fversion == 0) {
pPeer->sstatus = TAOS_SYNC_STATUS_CACHE; // start to forward pkt pPeer->sstatus = TAOS_SYNC_STATUS_CACHE; // start to forward pkt
fversion = nodeVersion; // must read data to fversion fversion = nodeVersion; // must read data to fversion
sDebug("%s, set sstatus:%s and fver:%" PRIu64, pPeer->id, syncStatus[pPeer->sstatus], fversion); sInfo("%s, set sstatus:%s and fver:%" PRIu64, pPeer->id, syncStatus[pPeer->sstatus], fversion);
} }
} }
// if all data up to fversion is read out, it is over // if all data up to fversion is read out, it is over
if (pPeer->sversion >= fversion && fversion > 0) { if (pPeer->sversion >= fversion && fversion > 0) {
sDebug("%s, data up to fver:%" PRIu64 " has been read out, bytes:%" PRId64 " sver:%" PRIu64, pPeer->id, fversion, bytes, sInfo("%s, data up to fver:%" PRIu64 " has been read out, bytes:%" PRId64 " sver:%" PRIu64, pPeer->id, fversion, bytes,
pPeer->sversion); pPeer->sversion);
return 0; return 0;
} }
...@@ -277,7 +277,7 @@ static int64_t syncProcessLastWal(SSyncPeer *pPeer, char *wname, int64_t index) ...@@ -277,7 +277,7 @@ static int64_t syncProcessLastWal(SSyncPeer *pPeer, char *wname, int64_t index)
// if bytes > 0, file is updated, or fversion is not reached but file still open, read again // if bytes > 0, file is updated, or fversion is not reached but file still open, read again
once = 1; once = 1;
offset += bytes; offset += bytes;
sDebug("%s, continue retrieve last wal, bytes:%" PRId64 " offset:%" PRId64 " sver:%" PRIu64 " fver:%" PRIu64, pPeer->id, sInfo("%s, continue retrieve last wal, bytes:%" PRId64 " offset:%" PRId64 " sver:%" PRIu64 " fver:%" PRIu64, pPeer->id,
bytes, offset, pPeer->sversion, fversion); bytes, offset, pPeer->sversion, fversion);
} }
...@@ -303,7 +303,7 @@ static int64_t syncRetrieveWal(SSyncPeer *pPeer) { ...@@ -303,7 +303,7 @@ static int64_t syncRetrieveWal(SSyncPeer *pPeer) {
if (wname[0] == 0) { // no wal file if (wname[0] == 0) { // no wal file
code = 0; code = 0;
sDebug("%s, no wal file anymore", pPeer->id); sInfo("%s, no wal file anymore", pPeer->id);
break; break;
} }
...@@ -320,12 +320,12 @@ static int64_t syncRetrieveWal(SSyncPeer *pPeer) { ...@@ -320,12 +320,12 @@ static int64_t syncRetrieveWal(SSyncPeer *pPeer) {
struct stat fstat; struct stat fstat;
if (stat(fname, &fstat) < 0) { if (stat(fname, &fstat) < 0) {
code = -1; code = -1;
sDebug("%s, failed to stat wal:%s for retrieve since %s, code:0x%" PRIx64, pPeer->id, fname, strerror(errno), code); sInfo("%s, failed to stat wal:%s for retrieve since %s, code:0x%" PRIx64, pPeer->id, fname, strerror(errno), code);
break; break;
} }
size = fstat.st_size; size = fstat.st_size;
sDebug("%s, retrieve wal:%s size:%d", pPeer->id, fname, size); sInfo("%s, retrieve wal:%s size:%d", pPeer->id, fname, size);
int32_t sfd = open(fname, O_RDONLY | O_BINARY); int32_t sfd = open(fname, O_RDONLY | O_BINARY);
if (sfd < 0) { if (sfd < 0) {
...@@ -334,7 +334,7 @@ static int64_t syncRetrieveWal(SSyncPeer *pPeer) { ...@@ -334,7 +334,7 @@ static int64_t syncRetrieveWal(SSyncPeer *pPeer) {
break; break;
} }
code = (int32_t)taosSendFile(pPeer->syncFd, sfd, NULL, size); code = taosSendFile(pPeer->syncFd, sfd, NULL, size);
close(sfd); close(sfd);
if (code < 0) { if (code < 0) {
sError("%s, failed to send wal:%s for retrieve since %s, code:0x%" PRIx64, pPeer->id, fname, strerror(errno), code); sError("%s, failed to send wal:%s for retrieve since %s, code:0x%" PRIx64, pPeer->id, fname, strerror(errno), code);
...@@ -374,7 +374,7 @@ static int32_t syncRetrieveFirstPkt(SSyncPeer *pPeer) { ...@@ -374,7 +374,7 @@ static int32_t syncRetrieveFirstPkt(SSyncPeer *pPeer) {
sError("%s, failed to send sync-data msg since %s, tranId:%u", pPeer->id, strerror(errno), msg.tranId); sError("%s, failed to send sync-data msg since %s, tranId:%u", pPeer->id, strerror(errno), msg.tranId);
return -1; return -1;
} }
sDebug("%s, send sync-data msg to peer, tranId:%u", pPeer->id, msg.tranId); sInfo("%s, send sync-data msg to peer, tranId:%u", pPeer->id, msg.tranId);
SSyncRsp rsp; SSyncRsp rsp;
if (taosReadMsg(pPeer->syncFd, &rsp, sizeof(SSyncRsp)) != sizeof(SSyncRsp)) { if (taosReadMsg(pPeer->syncFd, &rsp, sizeof(SSyncRsp)) != sizeof(SSyncRsp)) {
...@@ -382,7 +382,7 @@ static int32_t syncRetrieveFirstPkt(SSyncPeer *pPeer) { ...@@ -382,7 +382,7 @@ static int32_t syncRetrieveFirstPkt(SSyncPeer *pPeer) {
return -1; return -1;
} }
sDebug("%s, recv sync-data rsp from peer, tranId:%u rsp-tranId:%u", pPeer->id, msg.tranId, rsp.tranId); sInfo("%s, recv sync-data rsp from peer, tranId:%u rsp-tranId:%u", pPeer->id, msg.tranId, rsp.tranId);
return 0; return 0;
} }
......
...@@ -31,29 +31,14 @@ typedef struct { ...@@ -31,29 +31,14 @@ typedef struct {
SSkipListIterator *pIter; SSkipListIterator *pIter;
} SCommitIter; } SCommitIter;
typedef struct { struct STableData {
uint64_t uid; uint64_t uid;
TSKEY keyFirst; TSKEY keyFirst;
TSKEY keyLast; TSKEY keyLast;
int64_t numOfRows; int64_t numOfRows;
SSkipList* pData; SSkipList* pData;
T_REF_DECLARE() T_REF_DECLARE()
} STableData; };
typedef struct {
T_REF_DECLARE()
SRWLatch latch;
TSKEY keyFirst;
TSKEY keyLast;
int64_t numOfRows;
int32_t maxTables;
STableData** tData;
SList* actList;
SList* extraBuffList;
SList* bufBlockList;
int64_t pointsAdd; // TODO
int64_t storageAdd; // TODO
} SMemTable;
enum { TSDB_UPDATE_META, TSDB_DROP_META }; enum { TSDB_UPDATE_META, TSDB_DROP_META };
...@@ -77,8 +62,8 @@ typedef struct { ...@@ -77,8 +62,8 @@ typedef struct {
int tsdbRefMemTable(STsdbRepo* pRepo, SMemTable* pMemTable); int tsdbRefMemTable(STsdbRepo* pRepo, SMemTable* pMemTable);
int tsdbUnRefMemTable(STsdbRepo* pRepo, SMemTable* pMemTable); int tsdbUnRefMemTable(STsdbRepo* pRepo, SMemTable* pMemTable);
int tsdbTakeMemSnapshot(STsdbRepo* pRepo, SMemTable** pMem, SMemTable** pIMem, SArray* pATable); int tsdbTakeMemSnapshot(STsdbRepo* pRepo, SMemSnapshot* pSnapshot, SArray* pATable);
void tsdbUnTakeMemSnapShot(STsdbRepo* pRepo, SMemTable* pMem, SMemTable* pIMem); void tsdbUnTakeMemSnapShot(STsdbRepo* pRepo, SMemSnapshot* pSnapshot);
void* tsdbAllocBytes(STsdbRepo* pRepo, int bytes); void* tsdbAllocBytes(STsdbRepo* pRepo, int bytes);
int tsdbAsyncCommit(STsdbRepo* pRepo); int tsdbAsyncCommit(STsdbRepo* pRepo);
int tsdbLoadDataFromCache(STable* pTable, SSkipListIterator* pIter, TSKEY maxKey, int maxRowsToRead, SDataCols* pCols, int tsdbLoadDataFromCache(STable* pTable, SSkipListIterator* pIter, TSKEY maxKey, int maxRowsToRead, SDataCols* pCols,
......
...@@ -124,88 +124,80 @@ int tsdbUnRefMemTable(STsdbRepo *pRepo, SMemTable *pMemTable) { ...@@ -124,88 +124,80 @@ int tsdbUnRefMemTable(STsdbRepo *pRepo, SMemTable *pMemTable) {
return 0; return 0;
} }
int tsdbTakeMemSnapshot(STsdbRepo *pRepo, SMemTable **pMem, SMemTable **pIMem, SArray *pATable) { int tsdbTakeMemSnapshot(STsdbRepo *pRepo, SMemSnapshot *pSnapshot, SArray *pATable) {
SMemTable *tmem; memset(pSnapshot, 0, sizeof(*pSnapshot));
// Get snap object
if (tsdbLockRepo(pRepo) < 0) return -1; if (tsdbLockRepo(pRepo) < 0) return -1;
tmem = pRepo->mem; pSnapshot->omem = pRepo->mem;
*pIMem = pRepo->imem; pSnapshot->imem = pRepo->imem;
tsdbRefMemTable(pRepo, tmem); tsdbRefMemTable(pRepo, pRepo->mem);
tsdbRefMemTable(pRepo, *pIMem); tsdbRefMemTable(pRepo, pRepo->imem);
if (tsdbUnlockRepo(pRepo) < 0) return -1; if (tsdbUnlockRepo(pRepo) < 0) return -1;
// Copy mem objects and ref needed STableData if (pSnapshot->omem) {
if (tmem) { taosRLockLatch(&(pSnapshot->omem->latch));
taosRLockLatch(&(tmem->latch));
*pMem = (SMemTable *)calloc(1, sizeof(**pMem)); pSnapshot->mem = &(pSnapshot->mtable);
if (*pMem == NULL) {
terrno = TSDB_CODE_TDB_OUT_OF_MEMORY;
taosRUnLockLatch(&(tmem->latch));
tsdbUnRefMemTable(pRepo, tmem);
tsdbUnRefMemTable(pRepo, *pIMem);
*pMem = NULL;
*pIMem = NULL;
return -1;
}
(*pMem)->tData = (STableData **)calloc(tmem->maxTables, sizeof(STableData *)); pSnapshot->mem->tData = (STableData **)calloc(pSnapshot->omem->maxTables, sizeof(STableData *));
if ((*pMem)->tData == NULL) { if (pSnapshot->mem->tData == NULL) {
terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; terrno = TSDB_CODE_TDB_OUT_OF_MEMORY;
taosRUnLockLatch(&(tmem->latch)); taosRUnLockLatch(&(pSnapshot->omem->latch));
free(*pMem); tsdbUnRefMemTable(pRepo, pSnapshot->omem);
tsdbUnRefMemTable(pRepo, tmem); tsdbUnRefMemTable(pRepo, pSnapshot->imem);
tsdbUnRefMemTable(pRepo, *pIMem); pSnapshot->mem = NULL;
*pMem = NULL; pSnapshot->imem = NULL;
*pIMem = NULL; pSnapshot->omem = NULL;
return -1; return -1;
} }
(*pMem)->keyFirst = tmem->keyFirst; pSnapshot->mem->keyFirst = pSnapshot->omem->keyFirst;
(*pMem)->keyLast = tmem->keyLast; pSnapshot->mem->keyLast = pSnapshot->omem->keyLast;
(*pMem)->numOfRows = tmem->numOfRows; pSnapshot->mem->numOfRows = pSnapshot->omem->numOfRows;
(*pMem)->maxTables = tmem->maxTables; pSnapshot->mem->maxTables = pSnapshot->omem->maxTables;
for (size_t i = 0; i < taosArrayGetSize(pATable); i++) { for (size_t i = 0; i < taosArrayGetSize(pATable); i++) {
STable * pTable = *(STable **)taosArrayGet(pATable, i); STable * pTable = *(STable **)taosArrayGet(pATable, i);
int32_t tid = TABLE_TID(pTable); int32_t tid = TABLE_TID(pTable);
STableData *pTableData = (tid < tmem->maxTables) ? tmem->tData[tid] : NULL; STableData *pTableData = (tid < pSnapshot->omem->maxTables) ? pSnapshot->omem->tData[tid] : NULL;
if ((pTableData == NULL) || (TABLE_UID(pTable) != pTableData->uid)) continue; if ((pTableData == NULL) || (TABLE_UID(pTable) != pTableData->uid)) continue;
(*pMem)->tData[tid] = tmem->tData[tid]; pSnapshot->mem->tData[tid] = pTableData;
T_REF_INC(tmem->tData[tid]); T_REF_INC(pTableData);
} }
taosRUnLockLatch(&(tmem->latch)); taosRUnLockLatch(&(pSnapshot->omem->latch));
} }
tsdbUnRefMemTable(pRepo, tmem); tsdbDebug("vgId:%d take memory snapshot, pMem %p pIMem %p", REPO_ID(pRepo), pSnapshot->omem, pSnapshot->imem);
tsdbDebug("vgId:%d take memory snapshot, pMem %p pIMem %p", REPO_ID(pRepo), *pMem, *pIMem);
return 0; return 0;
} }
void tsdbUnTakeMemSnapShot(STsdbRepo *pRepo, SMemTable *pMem, SMemTable *pIMem) { void tsdbUnTakeMemSnapShot(STsdbRepo *pRepo, SMemSnapshot *pSnapshot) {
tsdbDebug("vgId:%d untake memory snapshot, pMem %p pIMem %p", REPO_ID(pRepo), pMem, pIMem); tsdbDebug("vgId:%d untake memory snapshot, pMem %p pIMem %p", REPO_ID(pRepo), pSnapshot->omem, pSnapshot->imem);
if (pMem != NULL) { if (pSnapshot->mem) {
for (size_t i = 0; i < pMem->maxTables; i++) { ASSERT(pSnapshot->omem != NULL);
STableData *pTableData = pMem->tData[i];
for (size_t i = 0; i < pSnapshot->mem->maxTables; i++) {
STableData *pTableData = pSnapshot->mem->tData[i];
if (pTableData) { if (pTableData) {
tsdbFreeTableData(pTableData); tsdbFreeTableData(pTableData);
} }
} }
free(pMem->tData); tfree(pSnapshot->mem->tData);
free(pMem);
}
if (pIMem != NULL) { tsdbUnRefMemTable(pRepo, pSnapshot->omem);
tsdbUnRefMemTable(pRepo, pIMem);
} }
tsdbUnRefMemTable(pRepo, pSnapshot->imem);
pSnapshot->mem = NULL;
pSnapshot->imem = NULL;
pSnapshot->omem = NULL;
} }
void *tsdbAllocBytes(STsdbRepo *pRepo, int bytes) { void *tsdbAllocBytes(STsdbRepo *pRepo, int bytes) {
......
...@@ -213,9 +213,9 @@ void *tsdbGetTableTagVal(const void* pTable, int32_t colId, int16_t type, int16_ ...@@ -213,9 +213,9 @@ void *tsdbGetTableTagVal(const void* pTable, int32_t colId, int16_t type, int16_
char *val = tdGetKVRowValOfCol(((STable*)pTable)->tagVal, colId); char *val = tdGetKVRowValOfCol(((STable*)pTable)->tagVal, colId);
assert(type == pCol->type && bytes == pCol->bytes); assert(type == pCol->type && bytes == pCol->bytes);
if (val != NULL && IS_VAR_DATA_TYPE(type)) { // if (val != NULL && IS_VAR_DATA_TYPE(type)) {
assert(varDataLen(val) < pCol->bytes); // assert(varDataLen(val) < pCol->bytes);
} // }
return val; return val;
} }
......
...@@ -194,7 +194,7 @@ static void tsdbMayTakeMemSnapshot(STsdbQueryHandle* pQueryHandle, SArray* psTab ...@@ -194,7 +194,7 @@ static void tsdbMayTakeMemSnapshot(STsdbQueryHandle* pQueryHandle, SArray* psTab
SMemRef* pMemRef = pQueryHandle->pMemRef; SMemRef* pMemRef = pQueryHandle->pMemRef;
if (pQueryHandle->pMemRef->ref++ == 0) { if (pQueryHandle->pMemRef->ref++ == 0) {
tsdbTakeMemSnapshot(pQueryHandle->pTsdb, (SMemTable**)&(pMemRef->mem), (SMemTable**)&(pMemRef->imem), psTable); tsdbTakeMemSnapshot(pQueryHandle->pTsdb, &(pMemRef->snapshot), psTable);
} }
taosArrayDestroy(psTable); taosArrayDestroy(psTable);
...@@ -208,9 +208,7 @@ static void tsdbMayUnTakeMemSnapshot(STsdbQueryHandle* pQueryHandle) { ...@@ -208,9 +208,7 @@ static void tsdbMayUnTakeMemSnapshot(STsdbQueryHandle* pQueryHandle) {
} }
if (--pMemRef->ref == 0) { if (--pMemRef->ref == 0) {
tsdbUnTakeMemSnapShot(pQueryHandle->pTsdb, pMemRef->mem, pMemRef->imem); tsdbUnTakeMemSnapShot(pQueryHandle->pTsdb, &(pMemRef->snapshot));
pMemRef->mem = NULL;
pMemRef->imem = NULL;
} }
pQueryHandle->pMemRef = NULL; pQueryHandle->pMemRef = NULL;
...@@ -231,8 +229,8 @@ int64_t tsdbGetNumOfRowsInMemTable(TsdbQueryHandleT* pHandle) { ...@@ -231,8 +229,8 @@ int64_t tsdbGetNumOfRowsInMemTable(TsdbQueryHandleT* pHandle) {
STableData* pMem = NULL; STableData* pMem = NULL;
STableData* pIMem = NULL; STableData* pIMem = NULL;
SMemTable *pMemT = (SMemTable *)(pMemRef->mem); SMemTable* pMemT = pMemRef->snapshot.mem;
SMemTable *pIMemT = (SMemTable *)(pMemRef->imem); SMemTable* pIMemT = pMemRef->snapshot.imem;
if (pMemT && pCheckInfo->tableId.tid < pMemT->maxTables) { if (pMemT && pCheckInfo->tableId.tid < pMemT->maxTables) {
pMem = pMemT->tData[pCheckInfo->tableId.tid]; pMem = pMemT->tData[pCheckInfo->tableId.tid];
...@@ -605,7 +603,7 @@ static bool initTableMemIterator(STsdbQueryHandle* pHandle, STableCheckInfo* pCh ...@@ -605,7 +603,7 @@ static bool initTableMemIterator(STsdbQueryHandle* pHandle, STableCheckInfo* pCh
int32_t order = pHandle->order; int32_t order = pHandle->order;
// no data in buffer, abort // no data in buffer, abort
if (pHandle->pMemRef->mem == NULL && pHandle->pMemRef->imem == NULL) { if (pHandle->pMemRef->snapshot.mem == NULL && pHandle->pMemRef->snapshot.imem == NULL) {
return false; return false;
} }
...@@ -614,8 +612,8 @@ static bool initTableMemIterator(STsdbQueryHandle* pHandle, STableCheckInfo* pCh ...@@ -614,8 +612,8 @@ static bool initTableMemIterator(STsdbQueryHandle* pHandle, STableCheckInfo* pCh
STableData* pMem = NULL; STableData* pMem = NULL;
STableData* pIMem = NULL; STableData* pIMem = NULL;
SMemTable* pMemT = pHandle->pMemRef->mem; SMemTable* pMemT = pHandle->pMemRef->snapshot.mem;
SMemTable* pIMemT = pHandle->pMemRef->imem; SMemTable* pIMemT = pHandle->pMemRef->snapshot.imem;
if (pMemT && pCheckInfo->tableId.tid < pMemT->maxTables) { if (pMemT && pCheckInfo->tableId.tid < pMemT->maxTables) {
pMem = pMemT->tData[pCheckInfo->tableId.tid]; pMem = pMemT->tData[pCheckInfo->tableId.tid];
......
...@@ -152,14 +152,14 @@ static int32_t tsdbSyncSendMeta(SSyncH *pSynch) { ...@@ -152,14 +152,14 @@ static int32_t tsdbSyncSendMeta(SSyncH *pSynch) {
return -1; return -1;
} }
int32_t writeLen = (int32_t)mf.info.size; int64_t writeLen = mf.info.size;
tsdbInfo("vgId:%d, metafile:%s will be sent, size:%d", REPO_ID(pRepo), mf.f.aname, writeLen); tsdbInfo("vgId:%d, metafile:%s will be sent, size:%" PRId64, REPO_ID(pRepo), mf.f.aname, writeLen);
int32_t ret = (int32_t)taosSendFile(pSynch->socketFd, TSDB_FILE_FD(&mf), 0, writeLen); int64_t ret = taosSendFile(pSynch->socketFd, TSDB_FILE_FD(&mf), 0, writeLen);
if (ret != writeLen) { if (ret != writeLen) {
terrno = TAOS_SYSTEM_ERROR(errno); terrno = TAOS_SYSTEM_ERROR(errno);
tsdbError("vgId:%d, failed to send metafile since %s, ret:%d writeLen:%d", REPO_ID(pRepo), tstrerror(terrno), ret, tsdbError("vgId:%d, failed to send metafile since %s, ret:%" PRId64 " writeLen:%" PRId64, REPO_ID(pRepo),
writeLen); tstrerror(terrno), ret, writeLen);
tsdbCloseMFile(&mf); tsdbCloseMFile(&mf);
return -1; return -1;
} }
...@@ -217,18 +217,18 @@ static int32_t tsdbSyncRecvMeta(SSyncH *pSynch) { ...@@ -217,18 +217,18 @@ static int32_t tsdbSyncRecvMeta(SSyncH *pSynch) {
tsdbInfo("vgId:%d, metafile:%s is created", REPO_ID(pRepo), mf.f.aname); tsdbInfo("vgId:%d, metafile:%s is created", REPO_ID(pRepo), mf.f.aname);
int32_t readLen = (int32_t)pSynch->pmf->info.size; int64_t readLen = pSynch->pmf->info.size;
int32_t ret = taosCopyFds(pSynch->socketFd, TSDB_FILE_FD(&mf), readLen); int64_t ret = taosCopyFds(pSynch->socketFd, TSDB_FILE_FD(&mf), readLen);
if (ret != readLen) { if (ret != readLen) {
terrno = TAOS_SYSTEM_ERROR(errno); terrno = TAOS_SYSTEM_ERROR(errno);
tsdbError("vgId:%d, failed to recv metafile since %s, ret:%d readLen:%d", REPO_ID(pRepo), tstrerror(terrno), ret, tsdbError("vgId:%d, failed to recv metafile since %s, ret:%" PRId64 " readLen:%" PRId64, REPO_ID(pRepo),
readLen); tstrerror(terrno), ret, readLen);
tsdbCloseMFile(&mf); tsdbCloseMFile(&mf);
tsdbRemoveMFile(&mf); tsdbRemoveMFile(&mf);
return -1; return -1;
} }
tsdbInfo("vgId:%d, metafile is received, size:%d", REPO_ID(pRepo), readLen); tsdbInfo("vgId:%d, metafile is received, size:%" PRId64, REPO_ID(pRepo), readLen);
mf.info = pSynch->pmf->info; mf.info = pSynch->pmf->info;
tsdbCloseMFile(&mf); tsdbCloseMFile(&mf);
...@@ -463,12 +463,12 @@ static int32_t tsdbSyncRecvDFileSetArray(SSyncH *pSynch) { ...@@ -463,12 +463,12 @@ static int32_t tsdbSyncRecvDFileSetArray(SSyncH *pSynch) {
tsdbInfo("vgId:%d, file:%s will be received, osize:%" PRIu64 " rsize:%" PRIu64, REPO_ID(pRepo), tsdbInfo("vgId:%d, file:%s will be received, osize:%" PRIu64 " rsize:%" PRIu64, REPO_ID(pRepo),
pDFile->f.aname, pDFile->info.size, pRDFile->info.size); pDFile->f.aname, pDFile->info.size, pRDFile->info.size);
int32_t writeLen = (int32_t)pRDFile->info.size; int64_t writeLen = pRDFile->info.size;
int32_t ret = taosCopyFds(pSynch->socketFd, pDFile->fd, writeLen); int64_t ret = taosCopyFds(pSynch->socketFd, pDFile->fd, writeLen);
if (ret != writeLen) { if (ret != writeLen) {
terrno = TAOS_SYSTEM_ERROR(errno); terrno = TAOS_SYSTEM_ERROR(errno);
tsdbError("vgId:%d, failed to recv file:%s since %s, ret:%d writeLen:%d", REPO_ID(pRepo), pDFile->f.aname, tsdbError("vgId:%d, failed to recv file:%s since %s, ret:%" PRId64 " writeLen:%" PRId64, REPO_ID(pRepo),
tstrerror(terrno), ret, writeLen); pDFile->f.aname, tstrerror(terrno), ret, writeLen);
tsdbCloseDFileSet(&fset); tsdbCloseDFileSet(&fset);
tsdbRemoveDFileSet(&fset); tsdbRemoveDFileSet(&fset);
return -1; return -1;
...@@ -476,7 +476,7 @@ static int32_t tsdbSyncRecvDFileSetArray(SSyncH *pSynch) { ...@@ -476,7 +476,7 @@ static int32_t tsdbSyncRecvDFileSetArray(SSyncH *pSynch) {
// Update new file info // Update new file info
pDFile->info = pRDFile->info; pDFile->info = pRDFile->info;
tsdbInfo("vgId:%d, file:%s is received, size:%d", REPO_ID(pRepo), pDFile->f.aname, writeLen); tsdbInfo("vgId:%d, file:%s is received, size:%" PRId64, REPO_ID(pRepo), pDFile->f.aname, writeLen);
} }
tsdbCloseDFileSet(&fset); tsdbCloseDFileSet(&fset);
...@@ -575,14 +575,14 @@ static int32_t tsdbSyncSendDFileSet(SSyncH *pSynch, SDFileSet *pSet) { ...@@ -575,14 +575,14 @@ static int32_t tsdbSyncSendDFileSet(SSyncH *pSynch, SDFileSet *pSet) {
return -1; return -1;
} }
int32_t writeLen = (int32_t)df.info.size; int64_t writeLen = df.info.size;
tsdbInfo("vgId:%d, file:%s will be sent, size:%d", REPO_ID(pRepo), df.f.aname, writeLen); tsdbInfo("vgId:%d, file:%s will be sent, size:%" PRId64, REPO_ID(pRepo), df.f.aname, writeLen);
int32_t ret = (int32_t)taosSendFile(pSynch->socketFd, TSDB_FILE_FD(&df), 0, writeLen); int64_t ret = taosSendFile(pSynch->socketFd, TSDB_FILE_FD(&df), 0, writeLen);
if (ret != writeLen) { if (ret != writeLen) {
terrno = TAOS_SYSTEM_ERROR(errno); terrno = TAOS_SYSTEM_ERROR(errno);
tsdbError("vgId:%d, failed to send file:%s since %s, ret:%d writeLen:%d", REPO_ID(pRepo), df.f.aname, tsdbError("vgId:%d, failed to send file:%s since %s, ret:%" PRId64 " writeLen:%" PRId64, REPO_ID(pRepo),
tstrerror(terrno), ret, writeLen); df.f.aname, tstrerror(terrno), ret, writeLen);
tsdbCloseDFile(&df); tsdbCloseDFile(&df);
return -1; return -1;
} }
...@@ -677,13 +677,13 @@ static int32_t tsdbRecvDFileSetInfo(SSyncH *pSynch) { ...@@ -677,13 +677,13 @@ static int32_t tsdbRecvDFileSetInfo(SSyncH *pSynch) {
static int tsdbReload(STsdbRepo *pRepo, bool isMfChanged) { static int tsdbReload(STsdbRepo *pRepo, bool isMfChanged) {
// TODO: may need to stop and restart stream // TODO: may need to stop and restart stream
if (isMfChanged) { // if (isMfChanged) {
tsdbCloseMeta(pRepo); tsdbCloseMeta(pRepo);
tsdbFreeMeta(pRepo->tsdbMeta); tsdbFreeMeta(pRepo->tsdbMeta);
pRepo->tsdbMeta = tsdbNewMeta(REPO_CFG(pRepo)); pRepo->tsdbMeta = tsdbNewMeta(REPO_CFG(pRepo));
tsdbOpenMeta(pRepo); tsdbOpenMeta(pRepo);
tsdbLoadMetaCache(pRepo, true); tsdbLoadMetaCache(pRepo, true);
} // }
tsdbUnRefMemTable(pRepo, pRepo->mem); tsdbUnRefMemTable(pRepo, pRepo->mem);
tsdbUnRefMemTable(pRepo, pRepo->imem); tsdbUnRefMemTable(pRepo, pRepo->imem);
......
...@@ -34,7 +34,7 @@ void taosIdPoolCleanUp(void *handle); ...@@ -34,7 +34,7 @@ void taosIdPoolCleanUp(void *handle);
int taosIdPoolNumOfUsed(void *handle); int taosIdPoolNumOfUsed(void *handle);
void taosIdPoolMarkStatus(void *handle, int id); bool taosIdPoolMarkStatus(void *handle, int id);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -28,7 +28,7 @@ int32_t taosReadn(SOCKET sock, char *buffer, int32_t len); ...@@ -28,7 +28,7 @@ int32_t taosReadn(SOCKET sock, char *buffer, int32_t len);
int32_t taosWriteMsg(SOCKET fd, void *ptr, int32_t nbytes); int32_t taosWriteMsg(SOCKET fd, void *ptr, int32_t nbytes);
int32_t taosReadMsg(SOCKET fd, void *ptr, int32_t nbytes); int32_t taosReadMsg(SOCKET fd, void *ptr, int32_t nbytes);
int32_t taosNonblockwrite(SOCKET fd, char *ptr, int32_t nbytes); int32_t taosNonblockwrite(SOCKET fd, char *ptr, int32_t nbytes);
int32_t taosCopyFds(SOCKET sfd, int32_t dfd, int64_t len); int64_t taosCopyFds(SOCKET sfd, int32_t dfd, int64_t len);
int32_t taosSetNonblocking(SOCKET sock, int32_t on); int32_t taosSetNonblocking(SOCKET sock, int32_t on);
SOCKET taosOpenUdpSocket(uint32_t localIp, uint16_t localPort); SOCKET taosOpenUdpSocket(uint32_t localIp, uint16_t localPort);
......
...@@ -104,10 +104,16 @@ void taosIdPoolCleanUp(void *handle) { ...@@ -104,10 +104,16 @@ void taosIdPoolCleanUp(void *handle) {
int taosIdPoolNumOfUsed(void *handle) { int taosIdPoolNumOfUsed(void *handle) {
id_pool_t *pIdPool = handle; id_pool_t *pIdPool = handle;
return pIdPool->maxId - pIdPool->numOfFree;
pthread_mutex_lock(&pIdPool->mutex);
int ret = pIdPool->maxId - pIdPool->numOfFree;
pthread_mutex_unlock(&pIdPool->mutex);
return ret;
} }
void taosIdPoolMarkStatus(void *handle, int id) { bool taosIdPoolMarkStatus(void *handle, int id) {
bool ret = false;
id_pool_t *pIdPool = handle; id_pool_t *pIdPool = handle;
pthread_mutex_lock(&pIdPool->mutex); pthread_mutex_lock(&pIdPool->mutex);
...@@ -115,9 +121,13 @@ void taosIdPoolMarkStatus(void *handle, int id) { ...@@ -115,9 +121,13 @@ void taosIdPoolMarkStatus(void *handle, int id) {
if (!pIdPool->freeList[slot]) { if (!pIdPool->freeList[slot]) {
pIdPool->freeList[slot] = true; pIdPool->freeList[slot] = true;
pIdPool->numOfFree--; pIdPool->numOfFree--;
ret = true;
} else {
ret = false;
} }
pthread_mutex_unlock(&pIdPool->mutex); pthread_mutex_unlock(&pIdPool->mutex);
return ret;
} }
int taosUpdateIdPool(id_pool_t *handle, int maxId) { int taosUpdateIdPool(id_pool_t *handle, int maxId) {
...@@ -147,6 +157,11 @@ int taosUpdateIdPool(id_pool_t *handle, int maxId) { ...@@ -147,6 +157,11 @@ int taosUpdateIdPool(id_pool_t *handle, int maxId) {
} }
int taosIdPoolMaxSize(void *handle) { int taosIdPoolMaxSize(void *handle) {
id_pool_t *pIdPool = (id_pool_t*)handle; id_pool_t *pIdPool = (id_pool_t *)handle;
return pIdPool->maxId;
pthread_mutex_lock(&pIdPool->mutex);
int ret = pIdPool->maxId;
pthread_mutex_unlock(&pIdPool->mutex);
return ret;
} }
\ No newline at end of file
...@@ -465,36 +465,36 @@ void tinet_ntoa(char *ipstr, uint32_t ip) { ...@@ -465,36 +465,36 @@ void tinet_ntoa(char *ipstr, uint32_t ip) {
#define COPY_SIZE 32768 #define COPY_SIZE 32768
// sendfile shall be used // sendfile shall be used
int32_t taosCopyFds(SOCKET sfd, int32_t dfd, int64_t len) { int64_t taosCopyFds(SOCKET sfd, int32_t dfd, int64_t len) {
int64_t leftLen; int64_t leftLen;
int32_t readLen, writeLen; int64_t readLen, writeLen;
char temp[COPY_SIZE]; char temp[COPY_SIZE];
leftLen = len; leftLen = len;
while (leftLen > 0) { while (leftLen > 0) {
if (leftLen < COPY_SIZE) if (leftLen < COPY_SIZE)
readLen = (int32_t)leftLen; readLen = leftLen;
else else
readLen = COPY_SIZE; // 4K readLen = COPY_SIZE; // 4K
int32_t retLen = taosReadMsg(sfd, temp, (int32_t)readLen); int64_t retLen = taosReadMsg(sfd, temp, (int32_t)readLen);
if (readLen != retLen) { if (readLen != retLen) {
uError("read error, readLen:%d retLen:%d len:%" PRId64 " leftLen:%" PRId64 ", reason:%s", readLen, retLen, len, uError("read error, readLen:%" PRId64 " retLen:%" PRId64 " len:%" PRId64 " leftLen:%" PRId64 ", reason:%s",
leftLen, strerror(errno)); readLen, retLen, len, leftLen, strerror(errno));
return -1; return -1;
} }
writeLen = taosWriteMsg(dfd, temp, readLen); writeLen = taosWriteMsg(dfd, temp, (int32_t)readLen);
if (readLen != writeLen) { if (readLen != writeLen) {
uError("copy error, readLen:%d writeLen:%d len:%" PRId64 " leftLen:%" PRId64 ", reason:%s", readLen, writeLen, uError("copy error, readLen:%" PRId64 " writeLen:%" PRId64 " len:%" PRId64 " leftLen:%" PRId64 ", reason:%s",
len, leftLen, strerror(errno)); readLen, writeLen, len, leftLen, strerror(errno));
return -1; return -1;
} }
leftLen -= readLen; leftLen -= readLen;
} }
return (int32_t)len; return len;
} }
...@@ -40,7 +40,7 @@ typedef struct { ...@@ -40,7 +40,7 @@ typedef struct {
int32_t queuedWMsg; int32_t queuedWMsg;
int32_t queuedRMsg; int32_t queuedRMsg;
int32_t flowctrlLevel; int32_t flowctrlLevel;
int32_t sequence; // for topic int64_t sequence; // for topic
int8_t status; int8_t status;
int8_t role; int8_t role;
int8_t accessState; int8_t accessState;
......
...@@ -147,7 +147,7 @@ static int32_t vnodeAlterImp(SVnodeObj *pVnode, SCreateVnodeMsg *pVnodeCfg) { ...@@ -147,7 +147,7 @@ static int32_t vnodeAlterImp(SVnodeObj *pVnode, SCreateVnodeMsg *pVnodeCfg) {
vDebug("vgId:%d, tsdbchanged:%d syncchanged:%d while alter vnode", pVnode->vgId, tsdbCfgChanged, syncCfgChanged); vDebug("vgId:%d, tsdbchanged:%d syncchanged:%d while alter vnode", pVnode->vgId, tsdbCfgChanged, syncCfgChanged);
if (tsdbCfgChanged || syncCfgChanged) { if (/*tsdbCfgChanged || */syncCfgChanged) {
// vnode in non-ready state and still needs to return success instead of TSDB_CODE_VND_INVALID_STATUS // vnode in non-ready state and still needs to return success instead of TSDB_CODE_VND_INVALID_STATUS
// dbCfgVersion can be corrected by status msg // dbCfgVersion can be corrected by status msg
if (!vnodeSetUpdatingStatus(pVnode)) { if (!vnodeSetUpdatingStatus(pVnode)) {
...@@ -482,7 +482,7 @@ static int32_t vnodeProcessTsdbStatus(void *arg, int32_t status, int32_t eno) { ...@@ -482,7 +482,7 @@ static int32_t vnodeProcessTsdbStatus(void *arg, int32_t status, int32_t eno) {
if (status == TSDB_STATUS_COMMIT_START) { if (status == TSDB_STATUS_COMMIT_START) {
pVnode->isCommiting = 1; pVnode->isCommiting = 1;
pVnode->cversion = pVnode->version; pVnode->cversion = pVnode->version;
vDebug("vgId:%d, start commit, fver:%" PRIu64 " vver:%" PRIu64, pVnode->vgId, pVnode->fversion, pVnode->version); vInfo("vgId:%d, start commit, fver:%" PRIu64 " vver:%" PRIu64, pVnode->vgId, pVnode->fversion, pVnode->version);
if (!vnodeInInitStatus(pVnode)) { if (!vnodeInInitStatus(pVnode)) {
return walRenew(pVnode->wal); return walRenew(pVnode->wal);
} }
...@@ -493,7 +493,7 @@ static int32_t vnodeProcessTsdbStatus(void *arg, int32_t status, int32_t eno) { ...@@ -493,7 +493,7 @@ static int32_t vnodeProcessTsdbStatus(void *arg, int32_t status, int32_t eno) {
pVnode->isCommiting = 0; pVnode->isCommiting = 0;
pVnode->isFull = 0; pVnode->isFull = 0;
pVnode->fversion = pVnode->cversion; pVnode->fversion = pVnode->cversion;
vDebug("vgId:%d, commit over, fver:%" PRIu64 " vver:%" PRIu64, pVnode->vgId, pVnode->fversion, pVnode->version); vInfo("vgId:%d, commit over, fver:%" PRIu64 " vver:%" PRIu64, pVnode->vgId, pVnode->fversion, pVnode->version);
if (!vnodeInInitStatus(pVnode)) { if (!vnodeInInitStatus(pVnode)) {
walRemoveOneOldFile(pVnode->wal); walRemoveOneOldFile(pVnode->wal);
} }
......
...@@ -128,7 +128,7 @@ static void vnodeBuildVloadMsg(SVnodeObj *pVnode, SStatusMsg *pStatus) { ...@@ -128,7 +128,7 @@ static void vnodeBuildVloadMsg(SVnodeObj *pVnode, SStatusMsg *pStatus) {
int64_t compStorage = 0; int64_t compStorage = 0;
int64_t pointsWritten = 0; int64_t pointsWritten = 0;
if (!vnodeInReadyStatus(pVnode)) return; if (vnodeInClosingStatus(pVnode)) return;
if (pStatus->openVnodes >= TSDB_MAX_VNODES) return; if (pStatus->openVnodes >= TSDB_MAX_VNODES) return;
if (pVnode->tsdb) { if (pVnode->tsdb) {
......
...@@ -109,6 +109,8 @@ bool vnodeSetResetStatus(SVnodeObj* pVnode) { ...@@ -109,6 +109,8 @@ bool vnodeSetResetStatus(SVnodeObj* pVnode) {
taosMsleep(1); taosMsleep(1);
} }
vInfo("vgId:%d, set to reset status", pVnode->vgId);
// release local resources only after cutting off outside connections // release local resources only after cutting off outside connections
qQueryMgmtNotifyClosed(pVnode->qMgmt); qQueryMgmtNotifyClosed(pVnode->qMgmt);
vnodeWaitReadCompleted(pVnode); vnodeWaitReadCompleted(pVnode);
...@@ -153,6 +155,18 @@ bool vnodeInReadyOrUpdatingStatus(SVnodeObj* pVnode) { ...@@ -153,6 +155,18 @@ bool vnodeInReadyOrUpdatingStatus(SVnodeObj* pVnode) {
return in; return in;
} }
bool vnodeInClosingStatus(SVnodeObj* pVnode) {
bool in = false;
pthread_mutex_lock(&pVnode->statusMutex);
if (pVnode->status == TAOS_VN_STATUS_CLOSING) {
in = true;
}
pthread_mutex_unlock(&pVnode->statusMutex);
return in;
}
bool vnodeInResetStatus(SVnodeObj* pVnode) { bool vnodeInResetStatus(SVnodeObj* pVnode) {
bool in = false; bool in = false;
pthread_mutex_lock(&pVnode->statusMutex); pthread_mutex_lock(&pVnode->statusMutex);
......
...@@ -91,7 +91,7 @@ void vnodeStartSyncFile(int32_t vgId) { ...@@ -91,7 +91,7 @@ void vnodeStartSyncFile(int32_t vgId) {
return; return;
} }
vDebug("vgId:%d, datafile will be synced", vgId); vInfo("vgId:%d, datafile will be synced", vgId);
vnodeSetResetStatus(pVnode); vnodeSetResetStatus(pVnode);
vnodeRelease(pVnode); vnodeRelease(pVnode);
...@@ -147,7 +147,7 @@ int32_t vnodeGetVersion(int32_t vgId, uint64_t *fver, uint64_t *wver) { ...@@ -147,7 +147,7 @@ int32_t vnodeGetVersion(int32_t vgId, uint64_t *fver, uint64_t *wver) {
int32_t code = 0; int32_t code = 0;
if (pVnode->isCommiting) { if (pVnode->isCommiting) {
vDebug("vgId:%d, vnode is commiting while get version", vgId); vInfo("vgId:%d, vnode is commiting while get version", vgId);
code = -1; code = -1;
} else { } else {
*fver = pVnode->fversion; *fver = pVnode->fversion;
...@@ -168,7 +168,7 @@ int32_t vnodeResetVersion(int32_t vgId, uint64_t fver) { ...@@ -168,7 +168,7 @@ int32_t vnodeResetVersion(int32_t vgId, uint64_t fver) {
pVnode->fversion = fver; pVnode->fversion = fver;
pVnode->version = fver; pVnode->version = fver;
walResetVersion(pVnode->wal, fver); walResetVersion(pVnode->wal, fver);
vDebug("vgId:%d, version reset to %" PRIu64, vgId, fver); vInfo("vgId:%d, version reset to %" PRIu64, vgId, fver);
vnodeRelease(pVnode); vnodeRelease(pVnode);
return 0; return 0;
......
...@@ -142,7 +142,7 @@ static int32_t vnodeProcessSubmitMsg(SVnodeObj *pVnode, void *pCont, SRspRet *pR ...@@ -142,7 +142,7 @@ static int32_t vnodeProcessSubmitMsg(SVnodeObj *pVnode, void *pCont, SRspRet *pR
vTrace("vgId:%d, submit msg is processed", pVnode->vgId); vTrace("vgId:%d, submit msg is processed", pVnode->vgId);
if (pVnode->dbType == TSDB_DB_TYPE_TOPIC && pVnode->role == TAOS_SYNC_ROLE_MASTER) { if (pVnode->dbType == TSDB_DB_TYPE_TOPIC && pVnode->role == TAOS_SYNC_ROLE_MASTER) {
tpUpdateTs(&pVnode->sequence, pCont); tpUpdateTs(pVnode->vgId, &pVnode->sequence, pCont);
} }
// save insert result into item // save insert result into item
......
...@@ -455,7 +455,7 @@ uint64_t walGetVersion(twalh param) { ...@@ -455,7 +455,7 @@ uint64_t walGetVersion(twalh param) {
void walResetVersion(twalh param, uint64_t newVer) { void walResetVersion(twalh param, uint64_t newVer) {
SWal *pWal = param; SWal *pWal = param;
if (pWal == 0) return; if (pWal == 0) return;
wDebug("vgId:%d, version reset from %" PRIu64 " to %" PRIu64, pWal->vgId, pWal->version, newVer); wInfo("vgId:%d, version reset from %" PRIu64 " to %" PRIu64, pWal->vgId, pWal->version, newVer);
pWal->version = newVer; pWal->version = newVer;
} }
\ No newline at end of file
...@@ -18,13 +18,15 @@ import argparse ...@@ -18,13 +18,15 @@ import argparse
class BuildDockerCluser: class BuildDockerCluser:
def __init__(self, hostName, user, password, configDir, numOfNodes, clusterVersion): def __init__(self, hostName, user, password, configDir, numOfNodes, clusterVersion, dockerDir, removeFlag):
self.hostName = hostName self.hostName = hostName
self.user = user self.user = user
self.password = password self.password = password
self.configDir = configDir self.configDir = configDir
self.numOfNodes = numOfNodes self.numOfNodes = numOfNodes
self.clusterVersion = clusterVersion self.clusterVersion = clusterVersion
self.dockerDir = dockerDir
self.removeFlag = removeFlag
def getConnection(self): def getConnection(self):
self.conn = taos.connect( self.conn = taos.connect(
...@@ -46,7 +48,10 @@ class BuildDockerCluser: ...@@ -46,7 +48,10 @@ class BuildDockerCluser:
if self.numOfNodes < 2 or self.numOfNodes > 5: if self.numOfNodes < 2 or self.numOfNodes > 5:
print("the number of nodes must be between 2 and 5") print("the number of nodes must be between 2 and 5")
exit(0) exit(0)
os.system("./buildClusterEnv.sh -n %d -v %s" % (self.numOfNodes, self.clusterVersion)) print("remove Flag value %s" % self.removeFlag)
if self.removeFlag == False:
os.system("./cleanClusterEnv.sh -d %s" % self.dockerDir)
os.system("./buildClusterEnv.sh -n %d -v %s -d %s" % (self.numOfNodes, self.clusterVersion, self.dockerDir))
self.getConnection() self.getConnection()
self.createDondes() self.createDondes()
self.startArbitrator() self.startArbitrator()
...@@ -91,10 +96,24 @@ parser.add_argument( ...@@ -91,10 +96,24 @@ parser.add_argument(
'-v', '-v',
'--version', '--version',
action='store', action='store',
default='2.0.14.1', default='2.0.17.1',
type=str, type=str,
help='the version of the cluster to be build, Default is 2.0.14.1') help='the version of the cluster to be build, Default is 2.0.17.1')
parser.add_argument(
'-d',
'--docker-dir',
action='store',
default='/data',
type=str,
help='the data dir for docker, default is /data')
parser.add_argument(
'--flag',
action='store_true',
help='remove docker containers flag, default: True')
args = parser.parse_args() args = parser.parse_args()
cluster = BuildDockerCluser(args.host, args.user, args.password, args.config_dir, args.num_of_nodes, args.version) cluster = BuildDockerCluser(args.host, args.user, args.password, args.config_dir, args.num_of_nodes, args.version, args.docker_dir, args.flag)
cluster.run() cluster.run()
# usage 1: python3 basic.py -n 2 --flag (flag is True)
# usage 2: python3 basic.py -n 2 (flag should be False when it is not specified)
\ No newline at end of file
#!/bin/bash #!/bin/bash
echo "Executing buildClusterEnv.sh" echo "Executing buildClusterEnv.sh"
DOCKER_DIR=/data
CURR_DIR=`pwd` CURR_DIR=`pwd`
if [ $# != 4 ]; then if [ $# != 6 ]; then
echo "argument list need input : " echo "argument list need input : "
echo " -n numOfNodes" echo " -n numOfNodes"
echo " -v version" echo " -v version"
echo " -d docker dir"
exit 1 exit 1
fi fi
NUM_OF_NODES= NUM_OF_NODES=
VERSION= VERSION=
while getopts "n:v:" arg DOCKER_DIR=
while getopts "n:v:d:" arg
do do
case $arg in case $arg in
n) n)
...@@ -21,6 +22,9 @@ do ...@@ -21,6 +22,9 @@ do
v) v)
VERSION=$OPTARG VERSION=$OPTARG
;; ;;
d)
DOCKER_DIR=$OPTARG
;;
?) ?)
echo "unkonwn argument" echo "unkonwn argument"
;; ;;
...@@ -30,30 +34,29 @@ done ...@@ -30,30 +34,29 @@ done
function addTaoscfg { function addTaoscfg {
for i in {1..5} for i in {1..5}
do do
touch /data/node$i/cfg/taos.cfg touch $DOCKER_DIR/node$i/cfg/taos.cfg
echo 'firstEp tdnode1:6030' > /data/node$i/cfg/taos.cfg echo 'firstEp tdnode1:6030' > $DOCKER_DIR/node$i/cfg/taos.cfg
echo 'fqdn tdnode'$i >> /data/node$i/cfg/taos.cfg echo 'fqdn tdnode'$i >> $DOCKER_DIR/node$i/cfg/taos.cfg
echo 'arbitrator tdnode1:6042' >> /data/node$i/cfg/taos.cfg echo 'arbitrator tdnode1:6042' >> $DOCKER_DIR/node$i/cfg/taos.cfg
done done
} }
function createDIR { function createDIR {
for i in {1..5} for i in {1..5}
do do
mkdir -p /data/node$i/data mkdir -p $DOCKER_DIR/node$i/data
mkdir -p /data/node$i/log mkdir -p $DOCKER_DIR/node$i/log
mkdir -p /data/node$i/cfg mkdir -p $DOCKER_DIR/node$i/cfg
mkdir -p /data/node$i/core mkdir -p $DOCKER_DIR/node$i/core
done done
} }
function cleanEnv { function cleanEnv {
echo "Clean up docker environment"
for i in {1..5} for i in {1..5}
do do
echo /data/node$i/data/* rm -rf $DOCKER_DIR/node$i/data/*
rm -rf /data/node$i/data/* rm -rf $DOCKER_DIR/node$i/log/*
echo /data/node$i/log/*
rm -rf /data/node$i/log/*
done done
} }
...@@ -98,19 +101,19 @@ function clusterUp { ...@@ -98,19 +101,19 @@ function clusterUp {
if [ $NUM_OF_NODES -eq 2 ]; then if [ $NUM_OF_NODES -eq 2 ]; then
echo "create 2 dnodes" echo "create 2 dnodes"
PACKAGE=TDengine-server-$VERSION-Linux-x64.tar.gz DIR=TDengine-server-$VERSION DIR2=TDengine-arbitrator-$VERSION VERSION=$VERSION docker-compose up -d PACKAGE=TDengine-server-$VERSION-Linux-x64.tar.gz TARBITRATORPKG=TDengine-arbitrator-$VERSION-Linux-x64.tar.gz DIR=TDengine-server-$VERSION DIR2=TDengine-arbitrator-$VERSION VERSION=$VERSION DATADIR=$DOCKER_DIR docker-compose up -d
fi fi
if [ $NUM_OF_NODES -eq 3 ]; then if [ $NUM_OF_NODES -eq 3 ]; then
PACKAGE=TDengine-server-$VERSION-Linux-x64.tar.gz DIR=TDengine-server-$VERSION DIR2=TDengine-arbitrator-$VERSION VERSION=$VERSION docker-compose -f docker-compose.yml -f node3.yml up -d PACKAGE=TDengine-server-$VERSION-Linux-x64.tar.gz TARBITRATORPKG=TDengine-arbitrator-$VERSION-Linux-x64.tar.gz DIR=TDengine-server-$VERSION DIR2=TDengine-arbitrator-$VERSION VERSION=$VERSION DATADIR=$DOCKER_DIR docker-compose -f docker-compose.yml -f node3.yml up -d
fi fi
if [ $NUM_OF_NODES -eq 4 ]; then if [ $NUM_OF_NODES -eq 4 ]; then
PACKAGE=TDengine-server-$VERSION-Linux-x64.tar.gz DIR=TDengine-server-$VERSION DIR2=TDengine-arbitrator-$VERSION VERSION=$VERSION docker-compose -f docker-compose.yml -f node3.yml -f node4.yml up -d PACKAGE=TDengine-server-$VERSION-Linux-x64.tar.gz TARBITRATORPKG=TDengine-arbitrator-$VERSION-Linux-x64.tar.gz DIR=TDengine-server-$VERSION DIR2=TDengine-arbitrator-$VERSION VERSION=$VERSION DATADIR=$DOCKER_DIR docker-compose -f docker-compose.yml -f node3.yml -f node4.yml up -d
fi fi
if [ $NUM_OF_NODES -eq 5 ]; then if [ $NUM_OF_NODES -eq 5 ]; then
PACKAGE=TDengine-server-$VERSION-Linux-x64.tar.gz DIR=TDengine-server-$VERSION DIR2=TDengine-arbitrator-$VERSION VERSION=$VERSION docker-compose -f docker-compose.yml -f node3.yml -f node4.yml -f node5.yml up -d PACKAGE=TDengine-server-$VERSION-Linux-x64.tar.gz TARBITRATORPKG=TDengine-arbitrator-$VERSION-Linux-x64.tar.gz DIR=TDengine-server-$VERSION DIR2=TDengine-arbitrator-$VERSION VERSION=$VERSION DATADIR=$DOCKER_DIR docker-compose -f docker-compose.yml -f node3.yml -f node4.yml -f node5.yml up -d
fi fi
echo "docker compose finish" echo "docker compose finish"
......
#!/bin/bash
echo "Executing cleanClusterEnv.sh"
CURR_DIR=`pwd`
if [ $# != 2 ]; then
echo "argument list need input : "
echo " -d docker dir"
exit 1
fi
DOCKER_DIR=
while getopts "d:" arg
do
case $arg in
d)
DOCKER_DIR=$OPTARG
;;
?)
echo "unkonwn argument"
;;
esac
done
function removeDockerContainers {
cd $DOCKER_DIR
docker-compose down --remove-orphans
}
function cleanEnv {
echo "Clean up docker environment"
for i in {1..5}
do
rm -rf $DOCKER_DIR/node$i/data/*
rm -rf $DOCKER_DIR/node$i/log/*
done
}
removeDockerContainers
cleanEnv
\ No newline at end of file
...@@ -9,6 +9,7 @@ services: ...@@ -9,6 +9,7 @@ services:
- TARBITRATORPKG=${TARBITRATORPKG} - TARBITRATORPKG=${TARBITRATORPKG}
- EXTRACTDIR=${DIR} - EXTRACTDIR=${DIR}
- EXTRACTDIR2=${DIR2} - EXTRACTDIR2=${DIR2}
- DATADIR=${DATADIR}
image: 'tdengine:${VERSION}' image: 'tdengine:${VERSION}'
container_name: 'tdnode1' container_name: 'tdnode1'
cap_add: cap_add:
...@@ -32,19 +33,19 @@ services: ...@@ -32,19 +33,19 @@ services:
volumes: volumes:
# bind data directory # bind data directory
- type: bind - type: bind
source: /data/node1/data source: ${DATADIR}/node1/data
target: /var/lib/taos target: /var/lib/taos
# bind log directory # bind log directory
- type: bind - type: bind
source: /data/node1/log source: ${DATADIR}/node1/log
target: /var/log/taos target: /var/log/taos
# bind configuration # bind configuration
- type: bind - type: bind
source: /data/node1/cfg source: ${DATADIR}/node1/cfg
target: /etc/taos target: /etc/taos
# bind core dump path # bind core dump path
- type: bind - type: bind
source: /data/node1/core source: ${DATADIR}/node1/core
target: /coredump target: /coredump
- type: bind - type: bind
source: /data source: /data
...@@ -61,6 +62,7 @@ services: ...@@ -61,6 +62,7 @@ services:
args: args:
- PACKAGE=${PACKAGE} - PACKAGE=${PACKAGE}
- EXTRACTDIR=${DIR} - EXTRACTDIR=${DIR}
- DATADIR=${DATADIR}
image: 'tdengine:${VERSION}' image: 'tdengine:${VERSION}'
container_name: 'tdnode2' container_name: 'tdnode2'
cap_add: cap_add:
...@@ -84,22 +86,22 @@ services: ...@@ -84,22 +86,22 @@ services:
volumes: volumes:
# bind data directory # bind data directory
- type: bind - type: bind
source: /data/node2/data source: ${DATADIR}/node2/data
target: /var/lib/taos target: /var/lib/taos
# bind log directory # bind log directory
- type: bind - type: bind
source: /data/node2/log source: ${DATADIR}/node2/log
target: /var/log/taos target: /var/log/taos
# bind configuration # bind configuration
- type: bind - type: bind
source: /data/node2/cfg source: ${DATADIR}/node2/cfg
target: /etc/taos target: /etc/taos
# bind core dump path # bind core dump path
- type: bind - type: bind
source: /data/node2/core source: ${DATADIR}/node2/core
target: /coredump target: /coredump
- type: bind - type: bind
source: /data source: ${DATADIR}
target: /root target: /root
hostname: tdnode2 hostname: tdnode2
networks: networks:
......
...@@ -7,6 +7,7 @@ services: ...@@ -7,6 +7,7 @@ services:
args: args:
- PACKAGE=${PACKAGE} - PACKAGE=${PACKAGE}
- EXTRACTDIR=${DIR} - EXTRACTDIR=${DIR}
- DATADIR=${DATADIR}
image: 'tdengine:${VERSION}' image: 'tdengine:${VERSION}'
container_name: 'tdnode3' container_name: 'tdnode3'
cap_add: cap_add:
...@@ -30,22 +31,22 @@ services: ...@@ -30,22 +31,22 @@ services:
volumes: volumes:
# bind data directory # bind data directory
- type: bind - type: bind
source: /data/node3/data source: ${DATADIR}/node3/data
target: /var/lib/taos target: /var/lib/taos
# bind log directory # bind log directory
- type: bind - type: bind
source: /data/node3/log source: ${DATADIR}/node3/log
target: /var/log/taos target: /var/log/taos
# bind configuration # bind configuration
- type: bind - type: bind
source: /data/node3/cfg source: ${DATADIR}/node3/cfg
target: /etc/taos target: /etc/taos
# bind core dump path # bind core dump path
- type: bind - type: bind
source: /data/node3/core source: ${DATADIR}/node3/core
target: /coredump target: /coredump
- type: bind - type: bind
source: /data source: ${DATADIR}
target: /root target: /root
hostname: tdnode3 hostname: tdnode3
networks: networks:
......
...@@ -7,6 +7,7 @@ services: ...@@ -7,6 +7,7 @@ services:
args: args:
- PACKAGE=${PACKAGE} - PACKAGE=${PACKAGE}
- EXTRACTDIR=${DIR} - EXTRACTDIR=${DIR}
- DATADIR=${DATADIR}
image: 'tdengine:${VERSION}' image: 'tdengine:${VERSION}'
container_name: 'tdnode4' container_name: 'tdnode4'
cap_add: cap_add:
...@@ -30,22 +31,22 @@ services: ...@@ -30,22 +31,22 @@ services:
volumes: volumes:
# bind data directory # bind data directory
- type: bind - type: bind
source: /data/node4/data source: ${DATADIR}/node4/data
target: /var/lib/taos target: /var/lib/taos
# bind log directory # bind log directory
- type: bind - type: bind
source: /data/node4/log source: ${DATADIR}/node4/log
target: /var/log/taos target: /var/log/taos
# bind configuration # bind configuration
- type: bind - type: bind
source: /data/node4/cfg source: ${DATADIR}/node4/cfg
target: /etc/taos target: /etc/taos
# bind core dump path # bind core dump path
- type: bind - type: bind
source: /data/node4/core source: ${DATADIR}/node4/core
target: /coredump target: /coredump
- type: bind - type: bind
source: /data source: ${DATADIR}
target: /root target: /root
hostname: tdnode4 hostname: tdnode4
networks: networks:
......
...@@ -7,6 +7,7 @@ services: ...@@ -7,6 +7,7 @@ services:
args: args:
- PACKAGE=${PACKAGE} - PACKAGE=${PACKAGE}
- EXTRACTDIR=${DIR} - EXTRACTDIR=${DIR}
- DATADIR=${DATADIR}
image: 'tdengine:${VERSION}' image: 'tdengine:${VERSION}'
container_name: 'tdnode5' container_name: 'tdnode5'
cap_add: cap_add:
...@@ -30,22 +31,22 @@ services: ...@@ -30,22 +31,22 @@ services:
volumes: volumes:
# bind data directory # bind data directory
- type: bind - type: bind
source: /data/node5/data source: ${DATADIR}/node5/data
target: /var/lib/taos target: /var/lib/taos
# bind log directory # bind log directory
- type: bind - type: bind
source: /data/node5/log source: ${DATADIR}/node5/log
target: /var/log/taos target: /var/log/taos
# bind configuration # bind configuration
- type: bind - type: bind
source: /data/node5/cfg source: ${DATADIR}/node5/cfg
target: /etc/taos target: /etc/taos
# bind core dump path # bind core dump path
- type: bind - type: bind
source: /data/node5/core source: ${DATADIR}/node5/core
target: /coredump target: /coredump
- type: bind - type: bind
source: /data source: ${DATADIR}
target: /root target: /root
hostname: tdnode5 hostname: tdnode5
networks: networks:
......
#!/bin/bash #!/bin/bash
ulimit -c unlimited ulimit -c unlimited
#======================p1-start===============
python3 ./test.py -f insert/basic.py python3 ./test.py -f insert/basic.py
python3 ./test.py -f insert/int.py python3 ./test.py -f insert/int.py
python3 ./test.py -f insert/unsignedInt.py
python3 ./test.py -f insert/float.py python3 ./test.py -f insert/float.py
python3 ./test.py -f insert/bigint.py python3 ./test.py -f insert/bigint.py
python3 ./test.py -f insert/unsignedBigint.py
python3 ./test.py -f insert/bool.py python3 ./test.py -f insert/bool.py
python3 ./test.py -f insert/double.py python3 ./test.py -f insert/double.py
python3 ./test.py -f insert/smallint.py python3 ./test.py -f insert/smallint.py
python3 ./test.py -f insert/unsignedSmallint.py
python3 ./test.py -f insert/tinyint.py python3 ./test.py -f insert/tinyint.py
python3 ./test.py -f insert/unsignedTinyint.py
python3 ./test.py -f insert/date.py python3 ./test.py -f insert/date.py
python3 ./test.py -f insert/binary.py python3 ./test.py -f insert/binary.py
python3 ./test.py -f insert/nchar.py python3 ./test.py -f insert/nchar.py
...@@ -23,10 +20,8 @@ python3 ./test.py -f insert/randomNullCommit.py ...@@ -23,10 +20,8 @@ python3 ./test.py -f insert/randomNullCommit.py
python3 insert/retentionpolicy.py python3 insert/retentionpolicy.py
python3 ./test.py -f insert/alterTableAndInsert.py python3 ./test.py -f insert/alterTableAndInsert.py
python3 ./test.py -f insert/insertIntoTwoTables.py python3 ./test.py -f insert/insertIntoTwoTables.py
#python3 ./test.py -f insert/before_1970.py python3 ./test.py -f insert/before_1970.py
python3 ./test.py -f insert/metadataUpdate.py
python3 bug2265.py python3 bug2265.py
python3 ./test.py -f insert/boundary2.py
#table #table
python3 ./test.py -f table/alter_wal0.py python3 ./test.py -f table/alter_wal0.py
...@@ -71,7 +66,7 @@ python3 ./test.py -f tag_lite/int.py ...@@ -71,7 +66,7 @@ python3 ./test.py -f tag_lite/int.py
python3 ./test.py -f tag_lite/set.py python3 ./test.py -f tag_lite/set.py
python3 ./test.py -f tag_lite/smallint.py python3 ./test.py -f tag_lite/smallint.py
python3 ./test.py -f tag_lite/tinyint.py python3 ./test.py -f tag_lite/tinyint.py
python3 ./test.py -f tag_lite/alter_tag.py
#python3 ./test.py -f dbmgmt/database-name-boundary.py #python3 ./test.py -f dbmgmt/database-name-boundary.py
python3 ./test.py -f import_merge/importBlock1HO.py python3 ./test.py -f import_merge/importBlock1HO.py
...@@ -142,6 +137,26 @@ python3 ./test.py -f import_merge/importTPORestart.py ...@@ -142,6 +137,26 @@ python3 ./test.py -f import_merge/importTPORestart.py
python3 ./test.py -f import_merge/importTRestart.py python3 ./test.py -f import_merge/importTRestart.py
python3 ./test.py -f import_merge/importInsertThenImport.py python3 ./test.py -f import_merge/importInsertThenImport.py
python3 ./test.py -f import_merge/importCSV.py python3 ./test.py -f import_merge/importCSV.py
#======================p1-end===============
#======================p2-start===============
# update
python3 ./test.py -f update/allow_update.py
python3 ./test.py -f update/allow_update-0.py
python3 ./test.py -f update/append_commit_data.py
python3 ./test.py -f update/append_commit_last-0.py
python3 ./test.py -f update/append_commit_last.py
python3 ./test.py -f update/merge_commit_data.py
python3 ./test.py -f update/merge_commit_data2.py
python3 ./test.py -f update/merge_commit_data2_update0.py
python3 ./test.py -f update/merge_commit_last-0.py
python3 ./test.py -f update/merge_commit_last.py
python3 ./test.py -f update/bug_td2279.py
#======================p2-end===============
#======================p3-start===============
# user # user
python3 ./test.py -f user/user_create.py python3 ./test.py -f user/user_create.py
python3 ./test.py -f user/pass_len.py python3 ./test.py -f user/pass_len.py
...@@ -155,7 +170,6 @@ python3 ./test.py -f query/filterCombo.py ...@@ -155,7 +170,6 @@ python3 ./test.py -f query/filterCombo.py
python3 ./test.py -f query/queryNormal.py python3 ./test.py -f query/queryNormal.py
python3 ./test.py -f query/queryError.py python3 ./test.py -f query/queryError.py
python3 ./test.py -f query/filterAllIntTypes.py python3 ./test.py -f query/filterAllIntTypes.py
python3 ./test.py -f query/filterAllUnsignedIntTypes.py
python3 ./test.py -f query/filterFloatAndDouble.py python3 ./test.py -f query/filterFloatAndDouble.py
python3 ./test.py -f query/filterOtherTypes.py python3 ./test.py -f query/filterOtherTypes.py
python3 ./test.py -f query/querySort.py python3 ./test.py -f query/querySort.py
...@@ -182,8 +196,6 @@ python3 ./test.py -f query/bug2119.py ...@@ -182,8 +196,6 @@ python3 ./test.py -f query/bug2119.py
python3 ./test.py -f query/isNullTest.py python3 ./test.py -f query/isNullTest.py
python3 ./test.py -f query/queryWithTaosdKilled.py python3 ./test.py -f query/queryWithTaosdKilled.py
python3 ./test.py -f query/floatCompare.py python3 ./test.py -f query/floatCompare.py
python3 ./test.py -f query/queryGroupbySort.py
python3 ./test.py -f query/queryBetweenAnd.py
#stream #stream
python3 ./test.py -f stream/metric_1.py python3 ./test.py -f stream/metric_1.py
...@@ -199,8 +211,6 @@ python3 ./test.py -f stream/table_n.py ...@@ -199,8 +211,6 @@ python3 ./test.py -f stream/table_n.py
#alter table #alter table
python3 ./test.py -f alter/alter_table_crash.py python3 ./test.py -f alter/alter_table_crash.py
python3 ./test.py -f alter/alter_table.py
python3 ./test.py -f alter/alter_debugFlag.py
# client # client
python3 ./test.py -f client/client.py python3 ./test.py -f client/client.py
...@@ -213,6 +223,37 @@ python3 testCompress.py ...@@ -213,6 +223,37 @@ python3 testCompress.py
python3 testNoCompress.py python3 testNoCompress.py
python3 testMinTablesPerVnode.py python3 testMinTablesPerVnode.py
python3 queryCount.py
python3 ./test.py -f query/queryGroupbyWithInterval.py
python3 client/twoClients.py
python3 test.py -f query/queryInterval.py
python3 test.py -f query/queryFillTest.py
# tools
python3 test.py -f tools/taosdemoTest.py
python3 test.py -f tools/taosdemoTestWithoutMetric.py
python3 test.py -f tools/taosdemoTestWithJson.py
python3 test.py -f tools/taosdemoTestLimitOffset.py
python3 test.py -f tools/taosdumpTest.py
python3 test.py -f tools/taosdemoTest2.py
python3 test.py -f tools/taosdemoTestSampleData.py
# subscribe
python3 test.py -f subscribe/singlemeter.py
#python3 test.py -f subscribe/stability.py
python3 test.py -f subscribe/supertable.py
#======================p3-end===============
#======================p4-start===============
python3 ./test.py -f update/merge_commit_data-0.py
# wal
python3 ./test.py -f wal/addOldWalTest.py
# function
python3 ./test.py -f functions/all_null_value.py
# functions # functions
python3 ./test.py -f functions/function_avg.py -r 1 python3 ./test.py -f functions/function_avg.py -r 1
python3 ./test.py -f functions/function_bottom.py -r 1 python3 ./test.py -f functions/function_bottom.py -r 1
...@@ -232,47 +273,24 @@ python3 ./test.py -f functions/function_sum.py -r 1 ...@@ -232,47 +273,24 @@ python3 ./test.py -f functions/function_sum.py -r 1
python3 ./test.py -f functions/function_top.py -r 1 python3 ./test.py -f functions/function_top.py -r 1
python3 ./test.py -f functions/function_twa.py -r 1 python3 ./test.py -f functions/function_twa.py -r 1
python3 ./test.py -f functions/function_twa_test2.py python3 ./test.py -f functions/function_twa_test2.py
python3 ./test.py -f functions/all_null_value.py python3 ./test.py -f functions/function_stddev_td2555.py
python3 ./test.py -f functions/function_percentile2.py python3 ./test.py -f insert/metadataUpdate.py
python3 queryCount.py #python3 ./test.py -f query/last_cache.py
python3 ./test.py -f query/queryGroupbyWithInterval.py
python3 client/twoClients.py
python3 ./test.py -f query/queryInterval.py
python3 ./test.py -f query/queryFillTest.py
python3 ./test.py -f query/last_row_cache.py python3 ./test.py -f query/last_row_cache.py
python3 ./test.py -f query/last_cache.py python3 ./test.py -f account/account_create.py
python3 ./test.py -f alter/alter_table.py
# tools python3 ./test.py -f query/queryGroupbySort.py
python3 test.py -f tools/taosdumpTest.py
python3 test.py -f tools/lowaTest.py
python3 test.py -f tools/taosdemoTest.py
python3 test.py -f tools/taosdemoTest2.py
python3 test.py -f tools/taosdemoTestWithoutMetric.py
python3 test.py -f tools/taosdemoTestLimitOffset.py
python3 test.py -f tools/taosdemoTestSampleData.py
# subscribe
python3 test.py -f subscribe/singlemeter.py
#python3 test.py -f subscribe/stability.py
python3 test.py -f subscribe/supertable.py
# update python3 ./test.py -f insert/unsignedInt.py
python3 ./test.py -f update/allow_update.py python3 ./test.py -f insert/unsignedBigint.py
python3 ./test.py -f update/allow_update-0.py python3 ./test.py -f insert/unsignedSmallint.py
python3 ./test.py -f update/append_commit_data.py python3 ./test.py -f insert/unsignedTinyint.py
python3 ./test.py -f update/append_commit_last-0.py python3 ./test.py -f query/filterAllUnsignedIntTypes.py
python3 ./test.py -f update/append_commit_last.py
python3 ./test.py -f update/merge_commit_data.py
python3 ./test.py -f update/merge_commit_data-0.py
python3 ./test.py -f update/merge_commit_data2.py
python3 ./test.py -f update/merge_commit_data2_update0.py
python3 ./test.py -f update/merge_commit_last-0.py
python3 ./test.py -f update/merge_commit_last.py
python3 ./test.py -f update/bug_td2279.py
# wal python3 ./test.py -f functions/function_percentile2.py
python3 ./test.py -f wal/addOldWalTest.py python3 ./test.py -f insert/boundary2.py
python3 ./test.py -f alter/alter_debugFlag.py
python3 ./test.py -f query/queryBetweenAnd.py
python3 ./test.py -f tag_lite/alter_tag.py
# account #======================p4-end===============
python3 ./test.py -f account/account_create.py
...@@ -92,10 +92,12 @@ class TDTestCase: ...@@ -92,10 +92,12 @@ class TDTestCase:
col_list = [ 'col1' , 'col2' , 'col3' , 'col4' , 'col5' , 'col6' , 'col7' , 'col8' , 'col9' , 'col11' , 'col12' , 'col13' , 'col14' , '1' , '1.1' , 'NULL' ] col_list = [ 'col1' , 'col2' , 'col3' , 'col4' , 'col5' , 'col6' , 'col7' , 'col8' , 'col9' , 'col11' , 'col12' , 'col13' , 'col14' , '1' , '1.1' , 'NULL' ]
op_list = [ '+' , '-' , '*' , '/' , '%' ] op_list = [ '+' , '-' , '*' , '/' , '%' ]
err_list = [ 'col7' , 'col8' , 'col9' , 'NULL' ] err_list = [ 'col7' , 'col8' , 'col9' , 'NULL' ]
order_lsit = [ ' order by ts ', ' order by ts desc ', ' order by ts asc ']
for i in col_list : for i in col_list :
for j in col_list : for j in col_list :
for k in op_list : for k in op_list :
sql = " select %s %s %s from test1 " % ( i , k , j ) for l in order_lsit :
sql = " select %s %s %s from test1 %s" % ( i , k , j , l )
if i in err_list or j in err_list: if i in err_list or j in err_list:
tdSql.error(sql) tdSql.error(sql)
else: else:
......
...@@ -118,7 +118,11 @@ class TDTestCase: ...@@ -118,7 +118,11 @@ class TDTestCase:
if i == 1 or i == 5 or i == 6 or i == 7 or i == 9 or i == 8 :continue if i == 1 or i == 5 or i == 6 or i == 7 or i == 9 or i == 8 :continue
tdSql.query('select stddev(c%d),stddev(c%d) from s group by c%d' %( i+1 , i+1 , i+1 ) ) tdSql.query('select stddev(c%d),stddev(c%d) from s group by c%d' %( i+1 , i+1 , i+1 ) )
#add for TD-3318
tdSql.execute('create table t1(ts timestamp, k int, b binary(12));')
tdSql.execute("insert into t1 values(now, 1, 'abc');")
tdLog.info("select stddev(k) from t1 where b <> 'abc' interval(1s);")
tdSql.query("select stddev(k) from t1 where b <> 'abc' interval(1s);")
def stop(self): def stop(self):
......
...@@ -16,7 +16,7 @@ TOP_DIR=`pwd` ...@@ -16,7 +16,7 @@ TOP_DIR=`pwd`
TAOSD_DIR=`find . -name "taosd"|grep -v community|head -n1` TAOSD_DIR=`find . -name "taosd"|grep -v community|head -n1`
nohup $TAOSD_DIR >/dev/null & nohup $TAOSD_DIR >/dev/null &
cd - cd -
./crash_gen.sh --valgrind -p -t 10 -s 500 -b 4 ./crash_gen.sh --valgrind -p -t 10 -s 1000 -b 4
pidof taosd|xargs kill -9 pidof taosd|xargs kill -9
grep 'start to execute\|ERROR SUMMARY' valgrind.err|grep -v 'grep'|uniq|tee crash_gen_mem_err.log grep 'start to execute\|ERROR SUMMARY' valgrind.err|grep -v 'grep'|uniq|tee crash_gen_mem_err.log
......
#!/bin/bash
ulimit -c unlimited
python3 ./test.py -f insert/basic.py
python3 ./test.py -f insert/int.py
python3 ./test.py -f insert/float.py
python3 ./test.py -f insert/bigint.py
python3 ./test.py -f insert/bool.py
python3 ./test.py -f insert/double.py
python3 ./test.py -f insert/smallint.py
python3 ./test.py -f insert/tinyint.py
python3 ./test.py -f insert/date.py
python3 ./test.py -f insert/binary.py
python3 ./test.py -f insert/nchar.py
#python3 ./test.py -f insert/nchar-boundary.py
python3 ./test.py -f insert/nchar-unicode.py
python3 ./test.py -f insert/multi.py
python3 ./test.py -f insert/randomNullCommit.py
python3 insert/retentionpolicy.py
python3 ./test.py -f insert/alterTableAndInsert.py
python3 ./test.py -f insert/insertIntoTwoTables.py
python3 ./test.py -f insert/before_1970.py
python3 bug2265.py
#table
python3 ./test.py -f table/alter_wal0.py
python3 ./test.py -f table/column_name.py
python3 ./test.py -f table/column_num.py
python3 ./test.py -f table/db_table.py
python3 ./test.py -f table/create_sensitive.py
#python3 ./test.py -f table/tablename-boundary.py
python3 ./test.py -f table/max_table_length.py
python3 ./test.py -f table/alter_column.py
python3 ./test.py -f table/boundary.py
python3 ./test.py -f table/create.py
python3 ./test.py -f table/del_stable.py
# tag
python3 ./test.py -f tag_lite/filter.py
python3 ./test.py -f tag_lite/create-tags-boundary.py
python3 ./test.py -f tag_lite/3.py
python3 ./test.py -f tag_lite/4.py
python3 ./test.py -f tag_lite/5.py
python3 ./test.py -f tag_lite/6.py
python3 ./test.py -f tag_lite/add.py
python3 ./test.py -f tag_lite/bigint.py
python3 ./test.py -f tag_lite/binary_binary.py
python3 ./test.py -f tag_lite/binary.py
python3 ./test.py -f tag_lite/bool_binary.py
python3 ./test.py -f tag_lite/bool_int.py
python3 ./test.py -f tag_lite/bool.py
python3 ./test.py -f tag_lite/change.py
python3 ./test.py -f tag_lite/column.py
python3 ./test.py -f tag_lite/commit.py
python3 ./test.py -f tag_lite/create.py
python3 ./test.py -f tag_lite/datatype.py
python3 ./test.py -f tag_lite/datatype-without-alter.py
python3 ./test.py -f tag_lite/delete.py
python3 ./test.py -f tag_lite/double.py
python3 ./test.py -f tag_lite/float.py
python3 ./test.py -f tag_lite/int_binary.py
python3 ./test.py -f tag_lite/int_float.py
python3 ./test.py -f tag_lite/int.py
python3 ./test.py -f tag_lite/set.py
python3 ./test.py -f tag_lite/smallint.py
python3 ./test.py -f tag_lite/tinyint.py
#python3 ./test.py -f dbmgmt/database-name-boundary.py
python3 ./test.py -f import_merge/importBlock1HO.py
python3 ./test.py -f import_merge/importBlock1HPO.py
python3 ./test.py -f import_merge/importBlock1H.py
python3 ./test.py -f import_merge/importBlock1S.py
python3 ./test.py -f import_merge/importBlock1Sub.py
python3 ./test.py -f import_merge/importBlock1TO.py
python3 ./test.py -f import_merge/importBlock1TPO.py
python3 ./test.py -f import_merge/importBlock1T.py
python3 ./test.py -f import_merge/importBlock2HO.py
python3 ./test.py -f import_merge/importBlock2HPO.py
python3 ./test.py -f import_merge/importBlock2H.py
python3 ./test.py -f import_merge/importBlock2S.py
python3 ./test.py -f import_merge/importBlock2Sub.py
python3 ./test.py -f import_merge/importBlock2TO.py
python3 ./test.py -f import_merge/importBlock2TPO.py
python3 ./test.py -f import_merge/importBlock2T.py
python3 ./test.py -f import_merge/importBlockbetween.py
python3 ./test.py -f import_merge/importCacheFileHO.py
python3 ./test.py -f import_merge/importCacheFileHPO.py
python3 ./test.py -f import_merge/importCacheFileH.py
python3 ./test.py -f import_merge/importCacheFileS.py
python3 ./test.py -f import_merge/importCacheFileSub.py
python3 ./test.py -f import_merge/importCacheFileTO.py
python3 ./test.py -f import_merge/importCacheFileTPO.py
python3 ./test.py -f import_merge/importCacheFileT.py
python3 ./test.py -f import_merge/importDataH2.py
python3 ./test.py -f import_merge/importDataHO2.py
python3 ./test.py -f import_merge/importDataHO.py
python3 ./test.py -f import_merge/importDataHPO.py
python3 ./test.py -f import_merge/importDataLastHO.py
python3 ./test.py -f import_merge/importDataLastHPO.py
python3 ./test.py -f import_merge/importDataLastH.py
python3 ./test.py -f import_merge/importDataLastS.py
python3 ./test.py -f import_merge/importDataLastSub.py
python3 ./test.py -f import_merge/importDataLastTO.py
python3 ./test.py -f import_merge/importDataLastTPO.py
python3 ./test.py -f import_merge/importDataLastT.py
python3 ./test.py -f import_merge/importDataS.py
python3 ./test.py -f import_merge/importDataSub.py
python3 ./test.py -f import_merge/importDataTO.py
python3 ./test.py -f import_merge/importDataTPO.py
python3 ./test.py -f import_merge/importDataT.py
python3 ./test.py -f import_merge/importHeadOverlap.py
python3 ./test.py -f import_merge/importHeadPartOverlap.py
python3 ./test.py -f import_merge/importHead.py
python3 ./test.py -f import_merge/importHORestart.py
python3 ./test.py -f import_merge/importHPORestart.py
python3 ./test.py -f import_merge/importHRestart.py
python3 ./test.py -f import_merge/importLastHO.py
python3 ./test.py -f import_merge/importLastHPO.py
python3 ./test.py -f import_merge/importLastH.py
python3 ./test.py -f import_merge/importLastS.py
python3 ./test.py -f import_merge/importLastSub.py
python3 ./test.py -f import_merge/importLastTO.py
python3 ./test.py -f import_merge/importLastTPO.py
python3 ./test.py -f import_merge/importLastT.py
python3 ./test.py -f import_merge/importSpan.py
python3 ./test.py -f import_merge/importSRestart.py
python3 ./test.py -f import_merge/importSubRestart.py
python3 ./test.py -f import_merge/importTailOverlap.py
python3 ./test.py -f import_merge/importTailPartOverlap.py
python3 ./test.py -f import_merge/importTail.py
python3 ./test.py -f import_merge/importToCommit.py
python3 ./test.py -f import_merge/importTORestart.py
python3 ./test.py -f import_merge/importTPORestart.py
python3 ./test.py -f import_merge/importTRestart.py
python3 ./test.py -f import_merge/importInsertThenImport.py
python3 ./test.py -f import_merge/importCSV.py
\ No newline at end of file
# update
python3 ./test.py -f update/allow_update.py
python3 ./test.py -f update/allow_update-0.py
python3 ./test.py -f update/append_commit_data.py
python3 ./test.py -f update/append_commit_last-0.py
python3 ./test.py -f update/append_commit_last.py
python3 ./test.py -f update/merge_commit_data.py
python3 ./test.py -f update/merge_commit_data2.py
python3 ./test.py -f update/merge_commit_data2_update0.py
python3 ./test.py -f update/merge_commit_last-0.py
python3 ./test.py -f update/merge_commit_last.py
python3 ./test.py -f update/bug_td2279.py
#!/bin/bash
ulimit -c unlimited
python3 ./test.py -f insert/randomNullCommit.py
# user
python3 ./test.py -f user/user_create.py
python3 ./test.py -f user/pass_len.py
# stable
python3 ./test.py -f stable/query_after_reset.py
#query
python3 ./test.py -f query/filter.py
python3 ./test.py -f query/filterCombo.py
python3 ./test.py -f query/queryNormal.py
python3 ./test.py -f query/queryError.py
python3 ./test.py -f query/filterAllIntTypes.py
python3 ./test.py -f query/filterFloatAndDouble.py
python3 ./test.py -f query/filterOtherTypes.py
python3 ./test.py -f query/querySort.py
python3 ./test.py -f query/queryJoin.py
python3 ./test.py -f query/select_last_crash.py
python3 ./test.py -f query/queryNullValueTest.py
python3 ./test.py -f query/queryInsertValue.py
python3 ./test.py -f query/queryConnection.py
python3 ./test.py -f query/queryCountCSVData.py
python3 ./test.py -f query/natualInterval.py
python3 ./test.py -f query/bug1471.py
#python3 ./test.py -f query/dataLossTest.py
python3 ./test.py -f query/bug1874.py
python3 ./test.py -f query/bug1875.py
python3 ./test.py -f query/bug1876.py
python3 ./test.py -f query/bug2218.py
python3 ./test.py -f query/bug2117.py
python3 ./test.py -f query/bug2118.py
python3 ./test.py -f query/bug2143.py
python3 ./test.py -f query/sliding.py
python3 ./test.py -f query/unionAllTest.py
python3 ./test.py -f query/bug2281.py
python3 ./test.py -f query/bug2119.py
python3 ./test.py -f query/isNullTest.py
python3 ./test.py -f query/queryWithTaosdKilled.py
python3 ./test.py -f query/floatCompare.py
#stream
python3 ./test.py -f stream/metric_1.py
python3 ./test.py -f stream/metric_n.py
python3 ./test.py -f stream/new.py
python3 ./test.py -f stream/stream1.py
python3 ./test.py -f stream/stream2.py
#python3 ./test.py -f stream/parser.py
python3 ./test.py -f stream/history.py
python3 ./test.py -f stream/sys.py
python3 ./test.py -f stream/table_1.py
python3 ./test.py -f stream/table_n.py
#alter table
python3 ./test.py -f alter/alter_table_crash.py
# client
python3 ./test.py -f client/client.py
python3 ./test.py -f client/version.py
python3 ./test.py -f client/alterDatabase.py
python3 ./test.py -f client/noConnectionErrorTest.py
# Misc
python3 testCompress.py
python3 testNoCompress.py
python3 testMinTablesPerVnode.py
python3 queryCount.py
python3 ./test.py -f query/queryGroupbyWithInterval.py
python3 client/twoClients.py
python3 test.py -f query/queryInterval.py
python3 test.py -f query/queryFillTest.py
# tools
python3 test.py -f tools/lowaTest.py
python3 test.py -f tools/taosdemoTest.py
python3 test.py -f tools/taosdemoTestWithoutMetric.py
python3 test.py -f tools/taosdemoTestLimitOffset.py
python3 test.py -f tools/taosdemoTestSampleData.py
python3 test.py -f tools/taosdumpTest.py
#python3 test.py -f tools/taosdemoTest2.py
# subscribe
python3 test.py -f subscribe/singlemeter.py
#python3 test.py -f subscribe/stability.py
python3 test.py -f subscribe/supertable.py
python3 ./test.py -f update/merge_commit_data-0.py
# wal
python3 ./test.py -f wal/addOldWalTest.py
# function
python3 ./test.py -f functions/all_null_value.py
# functions
python3 ./test.py -f functions/function_avg.py -r 1
python3 ./test.py -f functions/function_bottom.py -r 1
python3 ./test.py -f functions/function_count.py -r 1
python3 ./test.py -f functions/function_diff.py -r 1
python3 ./test.py -f functions/function_first.py -r 1
python3 ./test.py -f functions/function_last.py -r 1
python3 ./test.py -f functions/function_last_row.py -r 1
python3 ./test.py -f functions/function_leastsquares.py -r 1
python3 ./test.py -f functions/function_max.py -r 1
python3 ./test.py -f functions/function_min.py -r 1
python3 ./test.py -f functions/function_operations.py -r 1
python3 ./test.py -f functions/function_percentile.py -r 1
python3 ./test.py -f functions/function_spread.py -r 1
python3 ./test.py -f functions/function_stddev.py -r 1
python3 ./test.py -f functions/function_sum.py -r 1
python3 ./test.py -f functions/function_top.py -r 1
python3 ./test.py -f functions/function_twa.py -r 1
python3 ./test.py -f functions/function_twa_test2.py
python3 ./test.py -f functions/function_stddev_td2555.py
python3 ./test.py -f insert/metadataUpdate.py
python3 ./test.py -f tools/taosdemoTest2.py
python3 ./test.py -f query/last_cache.py
python3 ./test.py -f query/last_row_cache.py
python3 ./test.py -f account/account_create.py
python3 ./test.py -f alter/alter_table.py
python3 ./test.py -f query/queryGroupbySort.py
python3 ./test.py -f insert/unsignedInt.py
python3 ./test.py -f insert/unsignedBigint.py
python3 ./test.py -f insert/unsignedSmallint.py
python3 ./test.py -f insert/unsignedTinyint.py
python3 ./test.py -f query/filterAllUnsignedIntTypes.py
\ No newline at end of file
...@@ -28,18 +28,18 @@ class TDTestCase: ...@@ -28,18 +28,18 @@ class TDTestCase:
print("==============step1") print("==============step1")
tdSql.execute( tdSql.execute(
"create table if not exists st (ts timestamp, tagtype int, name nchar(16)) tags(dev nchar(50))") "create table if not exists st (ts timestamp, tagtype int, name nchar(16), col4 binary(16)) tags(dev nchar(50), tag2 binary(16))")
tdSql.execute( tdSql.execute(
'CREATE TABLE if not exists dev_001 using st tags("dev_01")') 'CREATE TABLE if not exists dev_001 using st tags("dev_01", "tag_01")')
tdSql.execute( tdSql.execute(
'CREATE TABLE if not exists dev_002 using st tags("dev_02")') 'CREATE TABLE if not exists dev_002 using st tags("dev_02", "tag_02")')
print("==============step2") print("==============step2")
tdSql.execute( tdSql.execute(
"""INSERT INTO dev_001(ts, tagtype, name) VALUES('2020-05-13 10:00:00.000', 1, 'first'),('2020-05-13 10:00:00.001', 2, 'second'), """INSERT INTO dev_001 VALUES('2020-05-13 10:00:00.000', 1, 'first', 'binary1'),('2020-05-13 10:00:00.001', 2, 'second', 'binary2'),
('2020-05-13 10:00:00.002', 3, 'third') dev_002 VALUES('2020-05-13 10:00:00.003', 1, 'first'), ('2020-05-13 10:00:00.004', 2, 'second'), ('2020-05-13 10:00:00.002', 3, 'third' , 'binary3') dev_002 VALUES('2020-05-13 10:00:00.003', 1, 'first', 'binary4'), ('2020-05-13 10:00:00.004', 2, 'second', 'binary5'),
('2020-05-13 10:00:00.005', 3, 'third')""") ('2020-05-13 10:00:00.005', 3, 'third', 'binary6')""")
# > for timestamp type # > for timestamp type
tdSql.query("select * from db.st where ts > '2020-05-13 10:00:00.002'") tdSql.query("select * from db.st where ts > '2020-05-13 10:00:00.002'")
...@@ -85,6 +85,12 @@ class TDTestCase: ...@@ -85,6 +85,12 @@ class TDTestCase:
tdSql.query("select * from db.st where name = 'first'") tdSql.query("select * from db.st where name = 'first'")
tdSql.checkRows(2) tdSql.checkRows(2)
tdSql.query("select * from db.st where col4 = 1231231")
tdSql.checkRows(0)
tdSql.query("select * from db.st where name = 1231231")
tdSql.checkRows(0)
# <> for timestamp type # <> for timestamp type
tdSql.query("select * from db.st where ts <> '2020-05-13 10:00:00.002'") tdSql.query("select * from db.st where ts <> '2020-05-13 10:00:00.002'")
# tdSql.checkRows(4) # tdSql.checkRows(4)
...@@ -105,6 +111,13 @@ class TDTestCase: ...@@ -105,6 +111,13 @@ class TDTestCase:
tdSql.query("select * from db.st where name like '_econd'") tdSql.query("select * from db.st where name like '_econd'")
tdSql.checkRows(2) tdSql.checkRows(2)
# for tag
tdSql.query("select * from db.st where dev=1")
tdSql.checkRows(0)
tdSql.query("select * from db.st where tag2=1")
tdSql.checkRows(0)
def stop(self): def stop(self):
tdSql.close() tdSql.close()
tdLog.success("%s successfully executed" % __file__) tdLog.success("%s successfully executed" % __file__)
......
{
"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": 5000,
"rows_per_tbl": 50,
"num_of_records_per_req": 100,
"max_sql_len": 1024000,
"databases": [{
"dbinfo": {
"name": "db",
"drop": "yes",
"replica": 1,
"days": 10,
"cache": 16,
"blocks": 8,
"precision": "ms",
"keep": 365,
"minRows": 100,
"maxRows": 4096,
"comp":2,
"walLevel":1,
"cachelast":0,
"quorum":1,
"fsync":3000,
"update": 0
},
"super_tables": [{
"name": "stb",
"child_table_exists":"no",
"childtable_count": 9,
"childtable_prefix": "stb_",
"auto_create_table": "no",
"data_source": "rand",
"insert_mode": "taosc",
"insert_rows": 250,
"multi_thread_write_one_tbl": "no",
"rows_per_tbl": 80,
"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": "INT", "count":1}]
}]
}]
}
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
"childtable_offset": 0, "childtable_offset": 0,
"multi_thread_write_one_tbl": "no", "multi_thread_write_one_tbl": "no",
"number_of_tbl_in_one_sql": 0, "number_of_tbl_in_one_sql": 0,
"rows_per_tbl": 100,
"max_sql_len": 1024000, "max_sql_len": 1024000,
"disorder_ratio": 0, "disorder_ratio": 0,
"disorder_range": 1000, "disorder_range": 1000,
......
{
"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,
"num_of_records_per_req": 100,
"max_sql_len": 1024000,
"databases": [{
"dbinfo": {
"name": "db",
"drop": "yes",
"replica": 1,
"days": 10,
"cache": 16,
"blocks": 8,
"precision": "ms",
"keep": 365,
"minRows": 100,
"maxRows": 4096,
"comp":2,
"walLevel":1,
"cachelast":0,
"quorum":1,
"fsync":3000,
"update": 0
},
"super_tables": [{
"name": "stb",
"child_table_exists":"no",
"childtable_count": 100,
"childtable_prefix": "stb_",
"auto_create_table": "no",
"data_source": "rand",
"insert_mode": "taosc",
"insert_rows": 1000,
"childtable_limit": 1,
"childtable_offset": 50,
"multi_thread_write_one_tbl": "no",
"number_of_tbl_in_one_sql": 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":1}]
}]
}]
}
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
"port": 6030, "port": 6030,
"user": "root", "user": "root",
"password": "taosdata", "password": "taosdata",
"thread_count": 1, "thread_count": 4,
"thread_count_create_tbl": 4,
"databases": [{ "databases": [{
"dbinfo": { "dbinfo": {
"name": "db01", "name": "db01",
......
###################################################################
# 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 *
class TDTestCase:
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
self.numberOfTables = 10000
self.numberOfRecords = 100
def getBuildPath(self):
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
projPath = selfPath[:selfPath.find("community")]
else:
projPath = selfPath[:selfPath.find("tests")]
for root, dirs, files in os.walk(projPath):
if ("taosd" 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()
buildPath = self.getBuildPath()
if (buildPath == ""):
tdLog.exit("taosd not found!")
else:
tdLog.info("taosd found in %s" % buildPath)
binPath = buildPath+ "/build/bin/"
os.system("%staosdemo -f tools/insert-interlace.json" % binPath)
tdSql.execute("use db")
tdSql.query("select count(tbname) from db.stb")
tdSql.checkData(0, 0, 100)
tdSql.query("select count(*) from db.stb")
tdSql.checkData(0, 0, 33000)
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
...@@ -68,6 +68,15 @@ class TDTestCase: ...@@ -68,6 +68,15 @@ class TDTestCase:
tdSql.query("select count(*) from db.stb") tdSql.query("select count(*) from db.stb")
tdSql.checkData(0, 0, 20000) tdSql.checkData(0, 0, 20000)
os.system("%staosdemo -f tools/insert-tblimit1-tboffset.json" % binPath)
tdSql.execute("reset query cache")
tdSql.execute("use db")
tdSql.query("select count(tbname) from db.stb")
tdSql.checkData(0, 0, 100)
tdSql.query("select count(*) from db.stb")
tdSql.checkData(0, 0, 1000)
def stop(self): def stop(self):
tdSql.close() tdSql.close()
tdLog.success("%s successfully executed" % __file__) tdLog.success("%s successfully executed" % __file__)
......
...@@ -126,8 +126,7 @@ $tb_ = table ...@@ -126,8 +126,7 @@ $tb_ = table
$tbs = tables $tbs = tables
$db_ = database $db_ = database
$dbs = databases $dbs = databases
$mt_ = metric $ses = session
$mts = metrics
$int = int $int = int
$bint = bigint $bint = bigint
$binary = binary $binary = binary
...@@ -145,8 +144,7 @@ sql_error create table $mt (ts timestamp, col1 int) tags ( $tb_ int) ...@@ -145,8 +144,7 @@ sql_error create table $mt (ts timestamp, col1 int) tags ( $tb_ int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $tbs int) sql_error create table $mt (ts timestamp, col1 int) tags ( $tbs int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $db_ int) sql_error create table $mt (ts timestamp, col1 int) tags ( $db_ int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $dbs int) sql_error create table $mt (ts timestamp, col1 int) tags ( $dbs int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $mt_ int) sql_error create table $mt (ts timestamp, col1 int) tags ( $ses int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $mts int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $int int) sql_error create table $mt (ts timestamp, col1 int) tags ( $int int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $bint int) sql_error create table $mt (ts timestamp, col1 int) tags ( $bint int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $binary int) sql_error create table $mt (ts timestamp, col1 int) tags ( $binary int)
......
...@@ -90,8 +90,7 @@ $tb_ = table ...@@ -90,8 +90,7 @@ $tb_ = table
$tbs = tables $tbs = tables
$db_ = database $db_ = database
$dbs = databases $dbs = databases
$mt_ = metric $ses = session
$mts = metrics
$int = int $int = int
$bint = bigint $bint = bigint
$binary = binary $binary = binary
...@@ -106,8 +105,7 @@ sql_error create table $tb (ts timestamp, $tb_ int) ...@@ -106,8 +105,7 @@ sql_error create table $tb (ts timestamp, $tb_ int)
sql_error create table $tb (ts timestamp, $tbs int) sql_error create table $tb (ts timestamp, $tbs int)
sql_error create table $tb (ts timestamp, $db_ int) sql_error create table $tb (ts timestamp, $db_ int)
sql_error create table $tb (ts timestamp, $dbs int) sql_error create table $tb (ts timestamp, $dbs int)
sql_error create table $tb (ts timestamp, $mt_ int) sql_error create table $tb (ts timestamp, $ses int)
sql_error create table $tb (ts timestamp, $mts int)
sql_error create table $tb (ts timestamp, $int int) sql_error create table $tb (ts timestamp, $int int)
sql_error create table $tb (ts timestamp, $bint int) sql_error create table $tb (ts timestamp, $bint int)
sql_error create table $tb (ts timestamp, $binary int) sql_error create table $tb (ts timestamp, $binary int)
......
...@@ -316,4 +316,13 @@ if $data13 != @20-02-02 01:01:01.000@ then ...@@ -316,4 +316,13 @@ if $data13 != @20-02-02 01:01:01.000@ then
return -1 return -1
endi endi
print ===============================>td-3361
sql create table ttm1(ts timestamp, k int) tags(a nchar(12));
sql create table ttm1_t1 using ttm1 tags('abcdef')
sql insert into ttm1_t1 values(now, 1)
sql select * from ttm1 where a=123456789012
if $row != 0 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
cd ../../../debug; cmake .. cd ../../../debug; cmake ..
cd ../../../debug; make cd ../../../debug; make
./test.sh -f issue/TD-2677.sim #======================b1-start===============
./test.sh -f issue/TD-2680.sim
./test.sh -f issue/TD-2713.sim
./test.sh -f general/alter/cached_schema_after_alter.sim
./test.sh -f general/alter/count.sim
./test.sh -f general/alter/dnode.sim
./test.sh -f general/alter/import.sim
./test.sh -f general/alter/insert1.sim
./test.sh -f general/alter/insert2.sim
./test.sh -f general/alter/metrics.sim
./test.sh -f general/alter/table.sim
./test.sh -f general/cache/new_metrics.sim
./test.sh -f general/cache/restart_metrics.sim
./test.sh -f general/cache/restart_table.sim
./test.sh -f general/connection/connection.sim
./test.sh -f general/column/commit.sim
./test.sh -f general/column/metrics.sim
./test.sh -f general/column/table.sim
./test.sh -f general/compress/commitlog.sim
./test.sh -f general/compress/compress.sim
./test.sh -f general/compress/compress2.sim
./test.sh -f general/compress/uncompress.sim
./test.sh -f general/compute/avg.sim
./test.sh -f general/compute/bottom.sim
./test.sh -f general/compute/count.sim
./test.sh -f general/compute/diff.sim
./test.sh -f general/compute/diff2.sim
./test.sh -f general/compute/first.sim
./test.sh -f general/compute/interval.sim
./test.sh -f general/compute/last.sim
./test.sh -f general/compute/leastsquare.sim
./test.sh -f general/compute/max.sim
./test.sh -f general/compute/min.sim
./test.sh -f general/compute/null.sim
./test.sh -f general/compute/percentile.sim
./test.sh -f general/compute/stddev.sim
./test.sh -f general/compute/sum.sim
./test.sh -f general/compute/top.sim
./test.sh -f general/db/alter_option.sim
./test.sh -f general/db/alter_tables_d2.sim
./test.sh -f general/db/alter_tables_v1.sim
./test.sh -f general/db/alter_tables_v4.sim
./test.sh -f general/db/alter_vgroups.sim
./test.sh -f general/db/basic.sim
./test.sh -f general/db/basic1.sim
./test.sh -f general/db/basic2.sim
./test.sh -f general/db/basic3.sim
./test.sh -f general/db/basic4.sim
./test.sh -f general/db/basic5.sim
./test.sh -f general/db/delete_reuse1.sim
./test.sh -f general/db/delete_reuse2.sim
./test.sh -f general/db/delete_reusevnode.sim
./test.sh -f general/db/delete_reusevnode2.sim
./test.sh -f general/db/delete_writing1.sim
./test.sh -f general/db/delete_writing2.sim
./test.sh -f general/db/delete.sim
./test.sh -f general/db/len.sim
./test.sh -f general/db/repeat.sim
./test.sh -f general/db/tables.sim
./test.sh -f general/db/vnodes.sim
./test.sh -f general/db/topic1.sim
./test.sh -f general/db/topic2.sim
./test.sh -f general/db/nosuchfile.sim
./test.sh -f general/field/2.sim ./test.sh -f general/field/2.sim
./test.sh -f general/field/3.sim ./test.sh -f general/field/3.sim
...@@ -96,11 +27,6 @@ cd ../../../debug; make ...@@ -96,11 +27,6 @@ cd ../../../debug; make
./test.sh -f general/http/grafana_bug.sim ./test.sh -f general/http/grafana_bug.sim
./test.sh -f general/http/grafana.sim ./test.sh -f general/http/grafana.sim
./test.sh -f general/import/basic.sim
./test.sh -f general/import/commit.sim
./test.sh -f general/import/large.sim
./test.sh -f general/import/replica1.sim
./test.sh -f general/insert/basic.sim ./test.sh -f general/insert/basic.sim
./test.sh -f general/insert/insert_drop.sim ./test.sh -f general/insert/insert_drop.sim
./test.sh -f general/insert/query_block1_memory.sim ./test.sh -f general/insert/query_block1_memory.sim
...@@ -160,49 +86,12 @@ cd ../../../debug; make ...@@ -160,49 +86,12 @@ cd ../../../debug; make
./test.sh -f general/parser/repeatAlter.sim ./test.sh -f general/parser/repeatAlter.sim
./test.sh -f general/parser/union.sim ./test.sh -f general/parser/union.sim
./test.sh -f general/parser/topbot.sim ./test.sh -f general/parser/topbot.sim
./test.sh -f general/db/nosuchfile.sim
./test.sh -f general/parser/function.sim ./test.sh -f general/parser/function.sim
./test.sh -f general/parser/select_distinct_tag.sim ./test.sh -f unique/cluster/vgroup100.sim
./test.sh -f general/parser/join_manyblocks.sim
./test.sh -f general/parser/stableOp.sim
./test.sh -f general/parser/timestamp.sim
./test.sh -f general/parser/sliding.sim
./test.sh -f general/stable/disk.sim #======================b1-end===============
./test.sh -f general/stable/dnode3.sim #======================b2-start===============
./test.sh -f general/stable/metrics.sim
./test.sh -f general/stable/refcount.sim
./test.sh -f general/stable/show.sim
./test.sh -f general/stable/values.sim
./test.sh -f general/stable/vnode3.sim
./test.sh -f general/table/autocreate.sim
./test.sh -f general/table/basic1.sim
./test.sh -f general/table/basic2.sim
./test.sh -f general/table/basic3.sim
./test.sh -f general/table/bigint.sim
./test.sh -f general/table/binary.sim
./test.sh -f general/table/bool.sim
./test.sh -f general/table/column_name.sim
./test.sh -f general/table/column_num.sim
./test.sh -f general/table/column_value.sim
./test.sh -f general/table/column2.sim
./test.sh -f general/table/date.sim
./test.sh -f general/table/db.table.sim
./test.sh -f general/table/delete_reuse1.sim
./test.sh -f general/table/delete_reuse2.sim
./test.sh -f general/table/delete_writing.sim
./test.sh -f general/table/describe.sim
./test.sh -f general/table/double.sim
./test.sh -f general/table/fill.sim
./test.sh -f general/table/float.sim
./test.sh -f general/table/int.sim
./test.sh -f general/table/limit.sim
./test.sh -f general/table/smallint.sim
./test.sh -f general/table/table_len.sim
./test.sh -f general/table/table.sim
./test.sh -f general/table/tinyint.sim
./test.sh -f general/table/vgroup.sim
./test.sh -f general/table/createmulti.sim
./test.sh -f general/tag/3.sim ./test.sh -f general/tag/3.sim
./test.sh -f general/tag/4.sim ./test.sh -f general/tag/4.sim
...@@ -229,6 +118,9 @@ cd ../../../debug; make ...@@ -229,6 +118,9 @@ cd ../../../debug; make
./test.sh -f general/tag/set.sim ./test.sh -f general/tag/set.sim
./test.sh -f general/tag/smallint.sim ./test.sh -f general/tag/smallint.sim
./test.sh -f general/tag/tinyint.sim ./test.sh -f general/tag/tinyint.sim
./test.sh -f general/wal/sync.sim
./test.sh -f general/wal/kill.sim
./test.sh -f general/wal/maxtables.sim
./test.sh -f general/user/authority.sim ./test.sh -f general/user/authority.sim
./test.sh -f general/user/monitor.sim ./test.sh -f general/user/monitor.sim
...@@ -249,10 +141,6 @@ cd ../../../debug; make ...@@ -249,10 +141,6 @@ cd ../../../debug; make
./test.sh -f general/vector/table_query.sim ./test.sh -f general/vector/table_query.sim
./test.sh -f general/vector/table_time.sim ./test.sh -f general/vector/table_time.sim
./test.sh -f general/wal/sync.sim
./test.sh -f general/wal/kill.sim
./test.sh -f general/wal/maxtables.sim
./test.sh -f unique/account/account_create.sim ./test.sh -f unique/account/account_create.sim
./test.sh -f unique/account/account_delete.sim ./test.sh -f unique/account/account_delete.sim
./test.sh -f unique/account/account_len.sim ./test.sh -f unique/account/account_len.sim
...@@ -265,91 +153,15 @@ cd ../../../debug; make ...@@ -265,91 +153,15 @@ cd ../../../debug; make
./test.sh -f unique/account/user_create.sim ./test.sh -f unique/account/user_create.sim
./test.sh -f unique/account/user_len.sim ./test.sh -f unique/account/user_len.sim
./test.sh -f unique/big/balance.sim
./test.sh -f unique/big/maxvnodes.sim ./test.sh -f unique/big/maxvnodes.sim
./test.sh -f unique/big/tcp.sim ./test.sh -f unique/big/tcp.sim
./test.sh -f unique/cluster/alter.sim ./test.sh -f unique/cluster/alter.sim
./test.sh -f unique/cluster/balance1.sim
./test.sh -f unique/cluster/balance2.sim
./test.sh -f unique/cluster/balance3.sim
./test.sh -f unique/cluster/cache.sim ./test.sh -f unique/cluster/cache.sim
./test.sh -f unique/cluster/vgroup100.sim
./test.sh -f unique/column/replica3.sim
./test.sh -f unique/db/commit.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete_part.sim
./test.sh -f unique/db/replica_add12.sim
./test.sh -f unique/db/replica_add13.sim
./test.sh -f unique/db/replica_add23.sim
./test.sh -f unique/db/replica_reduce21.sim
./test.sh -f unique/db/replica_reduce32.sim
./test.sh -f unique/db/replica_reduce31.sim
./test.sh -f unique/db/replica_part.sim
./test.sh -f unique/dnode/alternativeRole.sim
./test.sh -f unique/dnode/monitor.sim
./test.sh -f unique/dnode/monitor_bug.sim
./test.sh -f unique/dnode/simple.sim
./test.sh -f unique/dnode/balance1.sim
./test.sh -f unique/dnode/balance2.sim
./test.sh -f unique/dnode/balance3.sim
./test.sh -f unique/dnode/balancex.sim
./test.sh -f unique/dnode/data1.sim
./test.sh -f unique/dnode/m2.sim
./test.sh -f unique/dnode/m3.sim
./test.sh -f unique/dnode/lossdata.sim
./test.sh -f unique/dnode/offline1.sim
./test.sh -f unique/dnode/offline2.sim
./test.sh -f unique/dnode/offline3.sim
./test.sh -f unique/dnode/reason.sim
./test.sh -f unique/dnode/remove1.sim
./test.sh -f unique/dnode/remove2.sim
./test.sh -f unique/dnode/vnode_clean.sim
./test.sh -f unique/http/admin.sim
./test.sh -f unique/http/opentsdb.sim
./test.sh -f unique/import/replica2.sim
./test.sh -f unique/import/replica3.sim
./test.sh -f unique/stable/balance_replica1.sim #======================b2-end===============
./test.sh -f unique/stable/dnode2_stop.sim #======================b3-start===============
./test.sh -f unique/stable/dnode2.sim
./test.sh -f unique/stable/dnode3.sim
./test.sh -f unique/stable/replica2_dnode4.sim
./test.sh -f unique/stable/replica2_vnode3.sim
./test.sh -f unique/stable/replica3_dnode6.sim
./test.sh -f unique/stable/replica3_vnode3.sim
./test.sh -f unique/mnode/mgmt20.sim
./test.sh -f unique/mnode/mgmt21.sim
./test.sh -f unique/mnode/mgmt22.sim
./test.sh -f unique/mnode/mgmt23.sim
./test.sh -f unique/mnode/mgmt24.sim
./test.sh -f unique/mnode/mgmt25.sim
./test.sh -f unique/mnode/mgmt26.sim
./test.sh -f unique/mnode/mgmt30.sim
./test.sh -f unique/mnode/mgmt33.sim
./test.sh -f unique/mnode/mgmt34.sim
./test.sh -f unique/mnode/mgmtr2.sim
./test.sh -f unique/vnode/many.sim
./test.sh -f unique/vnode/replica2_basic2.sim
./test.sh -f unique/vnode/replica2_repeat.sim
./test.sh -f unique/vnode/replica3_basic.sim
./test.sh -f unique/vnode/replica3_repeat.sim
./test.sh -f unique/vnode/replica3_vgroup.sim
./test.sh -f general/stream/metrics_del.sim
./test.sh -f general/stream/metrics_replica1_vnoden.sim
./test.sh -f general/stream/restart_stream.sim
./test.sh -f general/stream/stream_3.sim
./test.sh -f general/stream/stream_restart.sim
./test.sh -f general/stream/table_del.sim
./test.sh -f general/stream/table_replica1_vnoden.sim
./test.sh -f unique/arbitrator/check_cluster_cfg_para.sim ./test.sh -f unique/arbitrator/check_cluster_cfg_para.sim
#./test.sh -f unique/arbitrator/dn2_mn1_cache_file_sync.sim #./test.sh -f unique/arbitrator/dn2_mn1_cache_file_sync.sim
...@@ -371,7 +183,7 @@ cd ../../../debug; make ...@@ -371,7 +183,7 @@ cd ../../../debug; make
./test.sh -f unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim ./test.sh -f unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim
./test.sh -f unique/arbitrator/dn3_mn1_vnode_nomaster.sim ./test.sh -f unique/arbitrator/dn3_mn1_vnode_nomaster.sim
./test.sh -f unique/arbitrator/dn3_mn2_killDnode.sim ./test.sh -f unique/arbitrator/dn3_mn2_killDnode.sim
./test.sh -f unique/arbitrator/insert_duplicationTs.sim
./test.sh -f unique/arbitrator/offline_replica2_alterTable_online.sim ./test.sh -f unique/arbitrator/offline_replica2_alterTable_online.sim
./test.sh -f unique/arbitrator/offline_replica2_alterTag_online.sim ./test.sh -f unique/arbitrator/offline_replica2_alterTag_online.sim
./test.sh -f unique/arbitrator/offline_replica2_createTable_online.sim ./test.sh -f unique/arbitrator/offline_replica2_createTable_online.sim
...@@ -398,7 +210,220 @@ cd ../../../debug; make ...@@ -398,7 +210,220 @@ cd ../../../debug; make
./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim ./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim
./test.sh -f unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim ./test.sh -f unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim
./test.sh -f unique/stable/balance_replica1.sim
./test.sh -f unique/stable/dnode2_stop.sim
./test.sh -f unique/stable/dnode2.sim
./test.sh -f unique/stable/dnode3.sim
./test.sh -f unique/stable/replica2_dnode4.sim
./test.sh -f unique/stable/replica2_vnode3.sim
./test.sh -f unique/stable/replica3_dnode6.sim
./test.sh -f unique/stable/replica3_vnode3.sim
#======================b3-end===============
#======================b4-start===============
./test.sh -f unique/http/admin.sim
./test.sh -f unique/http/opentsdb.sim
./test.sh -f unique/import/replica2.sim
./test.sh -f unique/import/replica3.sim
./test.sh -f general/alter/cached_schema_after_alter.sim
./test.sh -f general/alter/count.sim
./test.sh -f general/alter/dnode.sim
./test.sh -f general/alter/import.sim
./test.sh -f general/alter/insert1.sim
./test.sh -f general/alter/insert2.sim
./test.sh -f general/alter/metrics.sim
./test.sh -f general/alter/table.sim
./test.sh -f general/cache/new_metrics.sim
./test.sh -f general/cache/restart_metrics.sim
./test.sh -f general/cache/restart_table.sim
./test.sh -f general/connection/connection.sim
./test.sh -f general/column/commit.sim
./test.sh -f general/column/metrics.sim
./test.sh -f general/column/table.sim
./test.sh -f general/compress/commitlog.sim
./test.sh -f general/compress/compress.sim
./test.sh -f general/compress/compress2.sim
./test.sh -f general/compress/uncompress.sim
./test.sh -f general/stable/disk.sim
./test.sh -f general/stable/dnode3.sim
./test.sh -f general/stable/metrics.sim
./test.sh -f general/stable/refcount.sim
./test.sh -f general/stable/show.sim
./test.sh -f general/stable/values.sim
./test.sh -f general/stable/vnode3.sim
./test.sh -f unique/column/replica3.sim
./test.sh -f issue/TD-2713.sim
./test.sh -f general/parser/select_distinct_tag.sim
./test.sh -f unique/mnode/mgmt30.sim
./test.sh -f issue/TD-2677.sim
./test.sh -f issue/TD-2680.sim
./test.sh -f unique/dnode/lossdata.sim
#======================b4-end===============
#======================b5-start===============
./test.sh -f unique/dnode/alternativeRole.sim
./test.sh -f unique/dnode/balance1.sim
./test.sh -f unique/dnode/balance2.sim
./test.sh -f unique/dnode/balance3.sim
./test.sh -f unique/dnode/balancex.sim
./test.sh -f unique/dnode/offline1.sim
./test.sh -f unique/dnode/offline2.sim
./test.sh -f general/stream/metrics_del.sim
./test.sh -f general/stream/metrics_replica1_vnoden.sim
./test.sh -f general/stream/restart_stream.sim
./test.sh -f general/stream/stream_3.sim
./test.sh -f general/stream/stream_restart.sim
./test.sh -f general/stream/table_del.sim
./test.sh -f general/stream/table_replica1_vnoden.sim
./test.sh -f general/connection/test_old_data.sim ./test.sh -f general/connection/test_old_data.sim
./test.sh -f unique/dnode/datatrans_3node.sim ./test.sh -f unique/dnode/datatrans_3node.sim
./test.sh -f unique/dnode/datatrans_3node_2.sim ./test.sh -f unique/dnode/datatrans_3node_2.sim
./test.sh -f general/db/alter_tables_d2.sim
./test.sh -f general/db/alter_tables_v1.sim
./test.sh -f general/db/alter_tables_v4.sim
#======================b5-end===============
#======================b6-start===============
./test.sh -f unique/dnode/reason.sim
./test.sh -f unique/dnode/remove1.sim
./test.sh -f unique/dnode/remove2.sim
./test.sh -f unique/dnode/vnode_clean.sim
./test.sh -f unique/db/commit.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete_part.sim
./test.sh -f unique/db/replica_add12.sim
./test.sh -f unique/db/replica_add13.sim
./test.sh -f unique/db/replica_add23.sim
./test.sh -f unique/db/replica_reduce21.sim
./test.sh -f unique/db/replica_reduce32.sim
./test.sh -f unique/db/replica_reduce31.sim
./test.sh -f unique/db/replica_part.sim
./test.sh -f unique/vnode/many.sim
./test.sh -f unique/vnode/replica2_basic2.sim
./test.sh -f unique/vnode/replica2_repeat.sim
./test.sh -f unique/vnode/replica3_basic.sim
./test.sh -f unique/vnode/replica3_repeat.sim
./test.sh -f unique/vnode/replica3_vgroup.sim
./test.sh -f unique/dnode/monitor.sim
./test.sh -f unique/dnode/monitor_bug.sim
./test.sh -f unique/dnode/simple.sim
./test.sh -f unique/dnode/data1.sim
./test.sh -f unique/dnode/m2.sim
./test.sh -f unique/dnode/m3.sim
./test.sh -f unique/dnode/offline3.sim
./test.sh -f general/wal/kill.sim
./test.sh -f general/wal/maxtables.sim
./test.sh -f general/import/basic.sim
./test.sh -f general/import/commit.sim
./test.sh -f general/import/large.sim
./test.sh -f general/import/replica1.sim
./test.sh -f unique/cluster/balance1.sim
./test.sh -f unique/cluster/balance2.sim
./test.sh -f unique/cluster/balance3.sim
#======================b6-end===============
#======================b7-start===============
./test.sh -f general/compute/avg.sim
./test.sh -f general/compute/bottom.sim
./test.sh -f general/compute/count.sim
./test.sh -f general/compute/diff.sim
./test.sh -f general/compute/diff2.sim
./test.sh -f general/compute/first.sim
./test.sh -f general/compute/interval.sim
./test.sh -f general/compute/last.sim
./test.sh -f general/compute/leastsquare.sim
./test.sh -f general/compute/max.sim
./test.sh -f general/compute/min.sim
./test.sh -f general/compute/null.sim
./test.sh -f general/compute/percentile.sim
./test.sh -f general/compute/stddev.sim
./test.sh -f general/compute/sum.sim
./test.sh -f general/compute/top.sim
./test.sh -f general/db/alter_option.sim
./test.sh -f general/db/alter_vgroups.sim
./test.sh -f general/db/basic.sim
./test.sh -f general/db/basic1.sim
./test.sh -f general/db/basic2.sim
./test.sh -f general/db/basic3.sim
./test.sh -f general/db/basic4.sim
./test.sh -f general/db/basic5.sim
./test.sh -f general/db/delete_reuse1.sim
./test.sh -f general/db/delete_reuse2.sim
./test.sh -f general/db/delete_reusevnode.sim
./test.sh -f general/db/delete_reusevnode2.sim
./test.sh -f general/db/delete_writing1.sim
./test.sh -f general/db/delete_writing2.sim
./test.sh -f general/db/delete.sim
./test.sh -f general/db/len.sim
./test.sh -f general/db/repeat.sim
./test.sh -f general/db/tables.sim
./test.sh -f general/db/vnodes.sim
./test.sh -f general/db/topic1.sim
./test.sh -f general/db/topic2.sim
./test.sh -f general/table/autocreate.sim
./test.sh -f general/table/basic1.sim
./test.sh -f general/table/basic2.sim
./test.sh -f general/table/basic3.sim
./test.sh -f general/table/bigint.sim
./test.sh -f general/table/binary.sim
./test.sh -f general/table/bool.sim
./test.sh -f general/table/column_name.sim
./test.sh -f general/table/column_num.sim
./test.sh -f general/table/column_value.sim
./test.sh -f general/table/column2.sim
./test.sh -f general/table/date.sim
./test.sh -f general/table/db.table.sim
./test.sh -f general/table/delete_reuse1.sim
./test.sh -f general/table/delete_reuse2.sim
./test.sh -f general/table/delete_writing.sim
./test.sh -f general/table/describe.sim
./test.sh -f general/table/double.sim
./test.sh -f general/table/fill.sim
./test.sh -f general/table/float.sim
./test.sh -f general/table/int.sim
./test.sh -f general/table/limit.sim
./test.sh -f general/table/smallint.sim
./test.sh -f general/table/table_len.sim
./test.sh -f general/table/table.sim
./test.sh -f general/table/tinyint.sim
./test.sh -f general/table/vgroup.sim
./test.sh -f general/table/createmulti.sim
./test.sh -f unique/mnode/mgmt20.sim
./test.sh -f unique/mnode/mgmt21.sim
./test.sh -f unique/mnode/mgmt22.sim
./test.sh -f unique/mnode/mgmt23.sim
./test.sh -f unique/mnode/mgmt24.sim
./test.sh -f unique/mnode/mgmt25.sim
./test.sh -f unique/mnode/mgmt26.sim
./test.sh -f unique/mnode/mgmt33.sim
./test.sh -f unique/mnode/mgmt34.sim
./test.sh -f unique/mnode/mgmtr2.sim
./test.sh -f unique/arbitrator/insert_duplicationTs.sim
./test.sh -f general/parser/join_manyblocks.sim
./test.sh -f general/parser/stableOp.sim
./test.sh -f general/parser/timestamp.sim
./test.sh -f general/parser/sliding.sim
./test.sh -f unique/big/balance.sim
#======================b7-end===============
./test.sh -f general/field/2.sim
./test.sh -f general/field/3.sim
./test.sh -f general/field/4.sim
./test.sh -f general/field/5.sim
./test.sh -f general/field/6.sim
./test.sh -f general/field/bigint.sim
./test.sh -f general/field/binary.sim
./test.sh -f general/field/bool.sim
./test.sh -f general/field/single.sim
./test.sh -f general/field/smallint.sim
./test.sh -f general/field/tinyint.sim
./test.sh -f general/http/autocreate.sim
./test.sh -f general/http/chunked.sim
./test.sh -f general/http/gzip.sim
./test.sh -f general/http/restful.sim
./test.sh -f general/http/restful_insert.sim
./test.sh -f general/http/restful_limit.sim
./test.sh -f general/http/restful_full.sim
./test.sh -f general/http/prepare.sim
./test.sh -f general/http/telegraf.sim
./test.sh -f general/http/grafana_bug.sim
./test.sh -f general/http/grafana.sim
./test.sh -f general/insert/basic.sim
./test.sh -f general/insert/insert_drop.sim
./test.sh -f general/insert/query_block1_memory.sim
./test.sh -f general/insert/query_block2_memory.sim
./test.sh -f general/insert/query_block1_file.sim
./test.sh -f general/insert/query_block2_file.sim
./test.sh -f general/insert/query_file_memory.sim
./test.sh -f general/insert/query_multi_file.sim
./test.sh -f general/insert/tcp.sim
./test.sh -f general/parser/alter.sim
./test.sh -f general/parser/alter1.sim
./test.sh -f general/parser/alter_stable.sim
./test.sh -f general/parser/auto_create_tb.sim
./test.sh -f general/parser/auto_create_tb_drop_tb.sim
./test.sh -f general/parser/col_arithmetic_operation.sim
./test.sh -f general/parser/columnValue.sim
./test.sh -f general/parser/commit.sim
./test.sh -f general/parser/create_db.sim
./test.sh -f general/parser/create_mt.sim
./test.sh -f general/parser/create_tb.sim
./test.sh -f general/parser/dbtbnameValidate.sim
./test.sh -f general/parser/import_commit1.sim
./test.sh -f general/parser/import_commit2.sim
./test.sh -f general/parser/import_commit3.sim
./test.sh -f general/parser/insert_tb.sim
./test.sh -f general/parser/first_last.sim
./test.sh -f general/parser/lastrow.sim
./test.sh -f general/parser/nchar.sim
./test.sh -f general/parser/null_char.sim
./test.sh -f general/parser/single_row_in_tb.sim
./test.sh -f general/parser/select_from_cache_disk.sim
./test.sh -f general/parser/mixed_blocks.sim
./test.sh -f general/parser/selectResNum.sim
./test.sh -f general/parser/limit.sim
./test.sh -f general/parser/limit1.sim
./test.sh -f general/parser/limit1_tblocks100.sim
./test.sh -f general/parser/select_across_vnodes.sim
./test.sh -f general/parser/slimit1.sim
./test.sh -f general/parser/tbnameIn.sim
./test.sh -f general/parser/projection_limit_offset.sim
./test.sh -f general/parser/limit2.sim
./test.sh -f general/parser/fill.sim
./test.sh -f general/parser/fill_stb.sim
./test.sh -f general/parser/where.sim
./test.sh -f general/parser/slimit.sim
./test.sh -f general/parser/select_with_tags.sim
./test.sh -f general/parser/interp.sim
./test.sh -f general/parser/tags_dynamically_specifiy.sim
./test.sh -f general/parser/groupby.sim
./test.sh -f general/parser/set_tag_vals.sim
./test.sh -f general/parser/tags_filter.sim
./test.sh -f general/parser/slimit_alter_tags.sim
./test.sh -f general/parser/join.sim
./test.sh -f general/parser/join_multivnode.sim
./test.sh -f general/parser/binary_escapeCharacter.sim
./test.sh -f general/parser/repeatAlter.sim
./test.sh -f general/parser/union.sim
./test.sh -f general/parser/topbot.sim
./test.sh -f general/db/nosuchfile.sim
./test.sh -f general/parser/function.sim
\ No newline at end of file
cd ../../../debug; cmake ..
cd ../../../debug; make
./test.sh -f general/tag/3.sim
./test.sh -f general/tag/4.sim
./test.sh -f general/tag/5.sim
./test.sh -f general/tag/6.sim
./test.sh -f general/tag/add.sim
./test.sh -f general/tag/bigint.sim
./test.sh -f general/tag/binary_binary.sim
./test.sh -f general/tag/binary.sim
./test.sh -f general/tag/bool_binary.sim
./test.sh -f general/tag/bool_int.sim
./test.sh -f general/tag/bool.sim
./test.sh -f general/tag/change.sim
./test.sh -f general/tag/column.sim
./test.sh -f general/tag/commit.sim
./test.sh -f general/tag/create.sim
./test.sh -f general/tag/delete.sim
./test.sh -f general/tag/double.sim
./test.sh -f general/tag/filter.sim
./test.sh -f general/tag/float.sim
./test.sh -f general/tag/int_binary.sim
./test.sh -f general/tag/int_float.sim
./test.sh -f general/tag/int.sim
./test.sh -f general/tag/set.sim
./test.sh -f general/tag/smallint.sim
./test.sh -f general/tag/tinyint.sim
./test.sh -f general/wal/sync.sim
./test.sh -f general/wal/kill.sim
./test.sh -f general/wal/maxtables.sim
./test.sh -f general/user/authority.sim
./test.sh -f general/user/monitor.sim
./test.sh -f general/user/pass_alter.sim
./test.sh -f general/user/pass_len.sim
./test.sh -f general/user/user_create.sim
./test.sh -f general/user/user_len.sim
./test.sh -f general/vector/metrics_field.sim
./test.sh -f general/vector/metrics_mix.sim
./test.sh -f general/vector/metrics_query.sim
./test.sh -f general/vector/metrics_tag.sim
./test.sh -f general/vector/metrics_time.sim
./test.sh -f general/vector/multi.sim
./test.sh -f general/vector/single.sim
./test.sh -f general/vector/table_field.sim
./test.sh -f general/vector/table_mix.sim
./test.sh -f general/vector/table_query.sim
./test.sh -f general/vector/table_time.sim
./test.sh -f unique/account/account_create.sim
./test.sh -f unique/account/account_delete.sim
./test.sh -f unique/account/account_len.sim
./test.sh -f unique/account/authority.sim
./test.sh -f unique/account/basic.sim
./test.sh -f unique/account/paras.sim
./test.sh -f unique/account/pass_alter.sim
./test.sh -f unique/account/pass_len.sim
./test.sh -f unique/account/usage.sim
./test.sh -f unique/account/user_create.sim
./test.sh -f unique/account/user_len.sim
./test.sh -f unique/big/balance.sim
./test.sh -f unique/big/maxvnodes.sim
./test.sh -f unique/big/tcp.sim
./test.sh -f unique/cluster/alter.sim
./test.sh -f unique/cluster/balance1.sim
./test.sh -f unique/cluster/balance2.sim
./test.sh -f unique/cluster/balance3.sim
./test.sh -f unique/cluster/cache.sim
./test.sh -f unique/cluster/vgroup100.sim
./test.sh -f unique/arbitrator/check_cluster_cfg_para.sim
#./test.sh -f unique/arbitrator/dn2_mn1_cache_file_sync.sim
./test.sh -f unique/arbitrator/dn3_mn1_full_createTableFail.sim
./test.sh -f unique/arbitrator/dn3_mn1_multiCreateDropTable.sim
#./test.sh -f unique/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim
#./test.sh -f unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim
./test.sh -f unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim
./test.sh -f unique/arbitrator/dn3_mn1_replica_change.sim
#./test.sh -f unique/arbitrator/dn3_mn1_stopDnode_timeout.sim
# lower the priority while file corruption
#./test.sh -f unique/arbitrator/dn3_mn1_vnode_change.sim
#./test.sh -f unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim
#./test.sh -f unique/arbitrator/dn3_mn1_vnode_corruptFile_online.sim
#./test.sh -f unique/arbitrator/dn3_mn1_vnode_createErrData_online.sim
./test.sh -f unique/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim
./test.sh -f unique/arbitrator/dn3_mn1_vnode_delDir.sim
./test.sh -f unique/arbitrator/dn3_mn1_r2_vnode_delDir.sim
./test.sh -f unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim
./test.sh -f unique/arbitrator/dn3_mn1_vnode_nomaster.sim
./test.sh -f unique/arbitrator/dn3_mn2_killDnode.sim
./test.sh -f unique/arbitrator/offline_replica2_alterTable_online.sim
./test.sh -f unique/arbitrator/offline_replica2_alterTag_online.sim
./test.sh -f unique/arbitrator/offline_replica2_createTable_online.sim
./test.sh -f unique/arbitrator/offline_replica2_dropDb_online.sim
./test.sh -f unique/arbitrator/offline_replica2_dropTable_online.sim
./test.sh -f unique/arbitrator/offline_replica3_alterTable_online.sim
./test.sh -f unique/arbitrator/offline_replica3_alterTag_online.sim
./test.sh -f unique/arbitrator/offline_replica3_createTable_online.sim
./test.sh -f unique/arbitrator/offline_replica3_dropDb_online.sim
./test.sh -f unique/arbitrator/offline_replica3_dropTable_online.sim
./test.sh -f unique/arbitrator/replica_changeWithArbitrator.sim
./test.sh -f unique/arbitrator/sync_replica2_alterTable_add.sim
./test.sh -f unique/arbitrator/sync_replica2_alterTable_drop.sim
./test.sh -f unique/arbitrator/sync_replica2_dropDb.sim
./test.sh -f unique/arbitrator/sync_replica2_dropTable.sim
./test.sh -f unique/arbitrator/sync_replica3_alterTable_add.sim
./test.sh -f unique/arbitrator/sync_replica3_alterTable_drop.sim
./test.sh -f unique/arbitrator/sync_replica3_dropDb.sim
./test.sh -f unique/arbitrator/sync_replica3_dropTable.sim
./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim
./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim
./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim
./test.sh -f unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim
./test.sh -f unique/stable/balance_replica1.sim
./test.sh -f unique/stable/dnode2_stop.sim
./test.sh -f unique/stable/dnode2.sim
./test.sh -f unique/stable/dnode3.sim
./test.sh -f unique/stable/replica2_dnode4.sim
./test.sh -f unique/stable/replica2_vnode3.sim
./test.sh -f unique/stable/replica3_dnode6.sim
./test.sh -f unique/stable/replica3_vnode3.sim
./test.sh -f unique/http/admin.sim
./test.sh -f unique/http/opentsdb.sim
./test.sh -f unique/import/replica2.sim
./test.sh -f unique/import/replica3.sim
./test.sh -f general/alter/cached_schema_after_alter.sim
./test.sh -f general/alter/count.sim
./test.sh -f general/alter/dnode.sim
./test.sh -f general/alter/import.sim
./test.sh -f general/alter/insert1.sim
./test.sh -f general/alter/insert2.sim
./test.sh -f general/alter/metrics.sim
./test.sh -f general/alter/table.sim
./test.sh -f general/cache/new_metrics.sim
./test.sh -f general/cache/restart_metrics.sim
./test.sh -f general/cache/restart_table.sim
./test.sh -f general/connection/connection.sim
./test.sh -f general/column/commit.sim
./test.sh -f general/column/metrics.sim
./test.sh -f general/column/table.sim
./test.sh -f general/compress/commitlog.sim
./test.sh -f general/compress/compress.sim
./test.sh -f general/compress/compress2.sim
./test.sh -f general/compress/uncompress.sim
./test.sh -f general/stable/disk.sim
./test.sh -f general/stable/dnode3.sim
./test.sh -f general/stable/metrics.sim
./test.sh -f general/stable/refcount.sim
./test.sh -f general/stable/show.sim
./test.sh -f general/stable/values.sim
./test.sh -f general/stable/vnode3.sim
./test.sh -f unique/column/replica3.sim
./test.sh -f issue/TD-2713.sim
./test.sh -f general/parser/select_distinct_tag.sim
./test.sh -f unique/mnode/mgmt30.sim
./test.sh -f issue/TD-2677.sim
./test.sh -f issue/TD-2680.sim
./test.sh -f unique/dnode/lossdata.sim
\ No newline at end of file
./test.sh -f unique/dnode/alternativeRole.sim
./test.sh -f unique/dnode/balance1.sim
./test.sh -f unique/dnode/balance2.sim
./test.sh -f unique/dnode/balance3.sim
./test.sh -f unique/dnode/balancex.sim
./test.sh -f unique/dnode/offline1.sim
./test.sh -f unique/dnode/offline2.sim
./test.sh -f general/stream/metrics_del.sim
./test.sh -f general/stream/metrics_replica1_vnoden.sim
./test.sh -f general/stream/restart_stream.sim
./test.sh -f general/stream/stream_3.sim
./test.sh -f general/stream/stream_restart.sim
./test.sh -f general/stream/table_del.sim
./test.sh -f general/stream/table_replica1_vnoden.sim
./test.sh -f general/connection/test_old_data.sim
./test.sh -f unique/dnode/datatrans_3node.sim
./test.sh -f unique/dnode/datatrans_3node_2.sim
\ No newline at end of file
./test.sh -f unique/dnode/reason.sim
./test.sh -f unique/dnode/remove1.sim
./test.sh -f unique/dnode/remove2.sim
./test.sh -f unique/dnode/vnode_clean.sim
./test.sh -f unique/db/commit.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete_part.sim
./test.sh -f unique/db/replica_add12.sim
./test.sh -f unique/db/replica_add13.sim
./test.sh -f unique/db/replica_add23.sim
./test.sh -f unique/db/replica_reduce21.sim
./test.sh -f unique/db/replica_reduce32.sim
./test.sh -f unique/db/replica_reduce31.sim
./test.sh -f unique/db/replica_part.sim
./test.sh -f unique/vnode/many.sim
./test.sh -f unique/vnode/replica2_basic2.sim
./test.sh -f unique/vnode/replica2_repeat.sim
./test.sh -f unique/vnode/replica3_basic.sim
./test.sh -f unique/vnode/replica3_repeat.sim
./test.sh -f unique/vnode/replica3_vgroup.sim
./test.sh -f unique/dnode/monitor.sim
./test.sh -f unique/dnode/monitor_bug.sim
./test.sh -f unique/dnode/simple.sim
./test.sh -f unique/dnode/data1.sim
./test.sh -f unique/dnode/m2.sim
./test.sh -f unique/dnode/m3.sim
./test.sh -f unique/dnode/offline3.sim
./test.sh -f general/wal/kill.sim
./test.sh -f general/wal/maxtables.sim
./test.sh -f general/import/basic.sim
./test.sh -f general/import/commit.sim
./test.sh -f general/import/large.sim
./test.sh -f general/import/replica1.sim
\ No newline at end of file
./test.sh -f general/compute/avg.sim
./test.sh -f general/compute/bottom.sim
./test.sh -f general/compute/count.sim
./test.sh -f general/compute/diff.sim
./test.sh -f general/compute/diff2.sim
./test.sh -f general/compute/first.sim
./test.sh -f general/compute/interval.sim
./test.sh -f general/compute/last.sim
./test.sh -f general/compute/leastsquare.sim
./test.sh -f general/compute/max.sim
./test.sh -f general/compute/min.sim
./test.sh -f general/compute/null.sim
./test.sh -f general/compute/percentile.sim
./test.sh -f general/compute/stddev.sim
./test.sh -f general/compute/sum.sim
./test.sh -f general/compute/top.sim
./test.sh -f general/db/alter_option.sim
./test.sh -f general/db/alter_tables_d2.sim
./test.sh -f general/db/alter_tables_v1.sim
./test.sh -f general/db/alter_tables_v4.sim
./test.sh -f general/db/alter_vgroups.sim
./test.sh -f general/db/basic.sim
./test.sh -f general/db/basic1.sim
./test.sh -f general/db/basic2.sim
./test.sh -f general/db/basic3.sim
./test.sh -f general/db/basic4.sim
./test.sh -f general/db/basic5.sim
./test.sh -f general/db/delete_reuse1.sim
./test.sh -f general/db/delete_reuse2.sim
./test.sh -f general/db/delete_reusevnode.sim
./test.sh -f general/db/delete_reusevnode2.sim
./test.sh -f general/db/delete_writing1.sim
./test.sh -f general/db/delete_writing2.sim
./test.sh -f general/db/delete.sim
./test.sh -f general/db/len.sim
./test.sh -f general/db/repeat.sim
./test.sh -f general/db/tables.sim
./test.sh -f general/db/vnodes.sim
./test.sh -f general/db/topic1.sim
./test.sh -f general/db/topic2.sim
./test.sh -f general/table/autocreate.sim
./test.sh -f general/table/basic1.sim
./test.sh -f general/table/basic2.sim
./test.sh -f general/table/basic3.sim
./test.sh -f general/table/bigint.sim
./test.sh -f general/table/binary.sim
./test.sh -f general/table/bool.sim
./test.sh -f general/table/column_name.sim
./test.sh -f general/table/column_num.sim
./test.sh -f general/table/column_value.sim
./test.sh -f general/table/column2.sim
./test.sh -f general/table/date.sim
./test.sh -f general/table/db.table.sim
./test.sh -f general/table/delete_reuse1.sim
./test.sh -f general/table/delete_reuse2.sim
./test.sh -f general/table/delete_writing.sim
./test.sh -f general/table/describe.sim
./test.sh -f general/table/double.sim
./test.sh -f general/table/fill.sim
./test.sh -f general/table/float.sim
./test.sh -f general/table/int.sim
./test.sh -f general/table/limit.sim
./test.sh -f general/table/smallint.sim
./test.sh -f general/table/table_len.sim
./test.sh -f general/table/table.sim
./test.sh -f general/table/tinyint.sim
./test.sh -f general/table/vgroup.sim
./test.sh -f general/table/createmulti.sim
./test.sh -f unique/mnode/mgmt20.sim
./test.sh -f unique/mnode/mgmt21.sim
./test.sh -f unique/mnode/mgmt22.sim
./test.sh -f unique/mnode/mgmt23.sim
./test.sh -f unique/mnode/mgmt24.sim
./test.sh -f unique/mnode/mgmt25.sim
./test.sh -f unique/mnode/mgmt26.sim
./test.sh -f unique/mnode/mgmt33.sim
./test.sh -f unique/mnode/mgmt34.sim
./test.sh -f unique/mnode/mgmtr2.sim
./test.sh -f unique/arbitrator/insert_duplicationTs.sim
\ No newline at end of file
...@@ -29,13 +29,14 @@ function dohavecore(){ ...@@ -29,13 +29,14 @@ function dohavecore(){
proc=`echo $corefile|cut -d "_" -f3` proc=`echo $corefile|cut -d "_" -f3`
if [ -n "$corefile" ];then if [ -n "$corefile" ];then
echo 'taosd or taos has generated core' echo 'taosd or taos has generated core'
tar -zcvPf $corepath'taos_'`date "+%Y_%m_%d_%H_%M_%S"`.tar.gz /usr/local/taos/ tar -zcPf $corepath'taos_'`date "+%Y_%m_%d_%H_%M_%S"`.tar.gz /usr/local/taos/
if [[ $1 == 1 ]];then if [[ $1 == 1 ]];then
echo '\n'|gdb /usr/local/taos/bin/$proc $core_file -ex "bt 10" -ex quit echo '\n'|gdb /usr/local/taos/bin/$proc $core_file -ex "bt 10" -ex quit
exit 8 exit 8
fi fi
fi fi
} }
function runSimCaseOneByOne { function runSimCaseOneByOne {
while read -r line; do while read -r line; do
if [[ $line =~ ^./test.sh* ]] || [[ $line =~ ^run* ]]; then if [[ $line =~ ^./test.sh* ]] || [[ $line =~ ^run* ]]; then
...@@ -66,7 +67,11 @@ function runSimCaseOneByOne { ...@@ -66,7 +67,11 @@ function runSimCaseOneByOne {
done < $1 done < $1
} }
function runSimCaseOneByOnefq { function runSimCaseOneByOnefq {
while read -r line; do
start=`sed -n "/$1-start/=" jenkins/basic.txt`
end=`sed -n "/$1-end/=" jenkins/basic.txt`
for ((i=$start;i<=$end;i++)) ; do
line=`sed -n "$i"p jenkins/basic.txt`
if [[ $line =~ ^./test.sh* ]] || [[ $line =~ ^run* ]]; then if [[ $line =~ ^./test.sh* ]] || [[ $line =~ ^run* ]]; then
case=`echo $line | grep sim$ |awk '{print $NF}'` case=`echo $line | grep sim$ |awk '{print $NF}'`
...@@ -97,9 +102,9 @@ function runSimCaseOneByOnefq { ...@@ -97,9 +102,9 @@ function runSimCaseOneByOnefq {
fi fi
end_time=`date +%s` end_time=`date +%s`
echo execution time of $case was `expr $end_time - $start_time`s. | tee -a out.log echo execution time of $case was `expr $end_time - $start_time`s. | tee -a out.log
dohavecore 1 dohavecore $2
fi fi
done < $1 done
} }
function runPyCaseOneByOne { function runPyCaseOneByOne {
...@@ -131,8 +136,17 @@ function runPyCaseOneByOne { ...@@ -131,8 +136,17 @@ function runPyCaseOneByOne {
fi fi
done < $1 done < $1
} }
function runPyCaseOneByOnefq { function runPyCaseOneByOnefq() {
while read -r line; do cd $tests_dir/pytest
if [[ $1 =~ full ]] ; then
start=1
end=`sed -n '$=' fulltest.sh`
else
start=`sed -n "/$1-start/=" fulltest.sh`
end=`sed -n "/$1-end/=" fulltest.sh`
fi
for ((i=$start;i<=$end;i++)) ; do
line=`sed -n "$i"p fulltest.sh`
if [[ $line =~ ^python.* ]]; then if [[ $line =~ ^python.* ]]; then
if [[ $line != *sleep* ]]; then if [[ $line != *sleep* ]]; then
...@@ -157,9 +171,9 @@ function runPyCaseOneByOnefq { ...@@ -157,9 +171,9 @@ function runPyCaseOneByOnefq {
else else
$line > /dev/null 2>&1 $line > /dev/null 2>&1
fi fi
dohavecore 1 dohavecore $2
fi fi
done < $1 done
} }
totalFailed=0 totalFailed=0
...@@ -181,38 +195,38 @@ if [ "$2" != "jdbc" ] && [ "$2" != "python" ] && [ "$2" != "unit" ]; then ...@@ -181,38 +195,38 @@ if [ "$2" != "jdbc" ] && [ "$2" != "python" ] && [ "$2" != "unit" ]; then
runSimCaseOneByOne jenkins/basic.txt runSimCaseOneByOne jenkins/basic.txt
elif [ "$1" == "b1" ]; then elif [ "$1" == "b1" ]; then
echo "### run TSIM b1 test ###" echo "### run TSIM b1 test ###"
runSimCaseOneByOne jenkins/basic_1.txt runSimCaseOneByOnefq b1 0
runSimCaseOneByOne jenkins/basic_4.txt runSimCaseOneByOnefq b4 0
runSimCaseOneByOne jenkins/basic_5.txt runSimCaseOneByOnefq b5 0
runSimCaseOneByOne jenkins/basic_6.txt runSimCaseOneByOnefq b6 0
runSimCaseOneByOne jenkins/basic_7.txt runSimCaseOneByOnefq b7 0
elif [ "$1" == "b2" ]; then elif [ "$1" == "b2" ]; then
echo "### run TSIM b2 test ###" echo "### run TSIM b2 test ###"
runSimCaseOneByOne jenkins/basic_2.txt runSimCaseOneByOnefq b2 0
elif [ "$1" == "b3" ]; then elif [ "$1" == "b3" ]; then
echo "### run TSIM b3 test ###" echo "### run TSIM b3 test ###"
runSimCaseOneByOne jenkins/basic_3.txt runSimCaseOneByOnefq b3 0
elif [ "$1" == "b1fq" ]; then elif [ "$1" == "b1fq" ]; then
echo "### run TSIM b1 test ###" echo "### run TSIM b1 test ###"
runSimCaseOneByOnefq jenkins/basic_1.txt runSimCaseOneByOnefq b1 1
elif [ "$1" == "b2fq" ]; then elif [ "$1" == "b2fq" ]; then
echo "### run TSIM b2 test ###" echo "### run TSIM b2 test ###"
runSimCaseOneByOnefq jenkins/basic_2.txt runSimCaseOneByOnefq b2 1
elif [ "$1" == "b3fq" ]; then elif [ "$1" == "b3fq" ]; then
echo "### run TSIM b3 test ###" echo "### run TSIM b3 test ###"
runSimCaseOneByOnefq jenkins/basic_3.txt runSimCaseOneByOnefq b3 1
elif [ "$1" == "b4fq" ]; then elif [ "$1" == "b4fq" ]; then
echo "### run TSIM b4 test ###" echo "### run TSIM b4 test ###"
runSimCaseOneByOnefq jenkins/basic_4.txt runSimCaseOneByOnefq b4 1
elif [ "$1" == "b5fq" ]; then elif [ "$1" == "b5fq" ]; then
echo "### run TSIM b5 test ###" echo "### run TSIM b5 test ###"
runSimCaseOneByOnefq jenkins/basic_5.txt runSimCaseOneByOnefq b5 1
elif [ "$1" == "b6fq" ]; then elif [ "$1" == "b6fq" ]; then
echo "### run TSIM b6 test ###" echo "### run TSIM b6 test ###"
runSimCaseOneByOnefq jenkins/basic_6.txt runSimCaseOneByOnefq b6 1
elif [ "$1" == "b7fq" ]; then elif [ "$1" == "b7fq" ]; then
echo "### run TSIM b7 test ###" echo "### run TSIM b7 test ###"
runSimCaseOneByOnefq jenkins/basic_7.txt runSimCaseOneByOnefq b7 1
elif [ "$1" == "smoke" ] || [ -z "$1" ]; then elif [ "$1" == "smoke" ] || [ -z "$1" ]; then
echo "### run TSIM smoke test ###" echo "### run TSIM smoke test ###"
runSimCaseOneByOne basicSuite.sim runSimCaseOneByOne basicSuite.sim
...@@ -273,19 +287,19 @@ if [ "$2" != "sim" ] && [ "$2" != "jdbc" ] && [ "$2" != "unit" ]; then ...@@ -273,19 +287,19 @@ if [ "$2" != "sim" ] && [ "$2" != "jdbc" ] && [ "$2" != "unit" ]; then
runPyCaseOneByOne fulltest.sh runPyCaseOneByOne fulltest.sh
elif [ "$1" == "pytestfq" ]; then elif [ "$1" == "pytestfq" ]; then
echo "### run Python full test ###" echo "### run Python full test ###"
runPyCaseOneByOnefq fulltest.sh runPyCaseOneByOnefq full 0
elif [ "$1" == "p1" ]; then elif [ "$1" == "p1" ]; then
echo "### run Python_1 test ###" echo "### run Python_1 test ###"
runPyCaseOneByOnefq pytest_1.sh runPyCaseOneByOnefq p1 1
elif [ "$1" == "p2" ]; then elif [ "$1" == "p2" ]; then
echo "### run Python_2 test ###" echo "### run Python_2 test ###"
runPyCaseOneByOnefq pytest_2.sh runPyCaseOneByOnefq p2 1
elif [ "$1" == "p3" ]; then elif [ "$1" == "p3" ]; then
echo "### run Python_3 test ###" echo "### run Python_3 test ###"
runPyCaseOneByOnefq pytest_3.sh runPyCaseOneByOnefq p3 1
elif [ "$1" == "p4" ]; then elif [ "$1" == "p4" ]; then
echo "### run Python_4 test ###" echo "### run Python_4 test ###"
runPyCaseOneByOnefq pytest_4.sh runPyCaseOneByOnefq p4 1
elif [ "$1" == "b2" ] || [ "$1" == "b3" ]; then elif [ "$1" == "b2" ] || [ "$1" == "b3" ]; then
exit $(($totalFailed + $totalPyFailed)) exit $(($totalFailed + $totalPyFailed))
elif [ "$1" == "smoke" ] || [ -z "$1" ]; then elif [ "$1" == "smoke" ] || [ -z "$1" ]; then
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册