Merge branch 'main' into merge/3.0tomain

This commit is contained in:
Shengliang Guan 2024-12-20 18:13:02 +08:00
commit d34c6cc1e5
45 changed files with 633 additions and 213 deletions

View File

@ -78,7 +78,7 @@ def check_docs(){
file_only_tdgpt_change_except = sh ( file_only_tdgpt_change_except = sh (
script: ''' script: '''
cd ${WKC} cd ${WKC}
git --no-pager diff --name-only FETCH_HEAD `git merge-base FETCH_HEAD ${CHANGE_TARGET}`|grep -v "^docs/en/"|grep -v "^docs/zh/"|grep -v ".md$" | grep -v "forecastoperator.c\\|anomalywindowoperator.c" |grep -v "tsim/analytics" |grep -v "tdgpt_cases.task" || : git --no-pager diff --name-only FETCH_HEAD `git merge-base FETCH_HEAD ${CHANGE_TARGET}`|grep -v "^docs/en/"|grep -v "^docs/zh/"|grep -v ".md$" | grep -v "forecastoperator.c\\|anomalywindowoperator.c\\|tanalytics.h\\|tanalytics.c" |grep -v "tsim/analytics" |grep -v "tdgpt_cases.task" || :
''', ''',
returnStdout: true returnStdout: true
).trim() ).trim()

View File

@ -10,8 +10,6 @@
</p> </p>
<p> <p>
[![Build Status](https://cloud.drone.io/api/badges/taosdata/TDengine/status.svg?ref=refs/heads/master)](https://cloud.drone.io/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=3.0)](https://coveralls.io/github/taosdata/TDengine?branch=3.0) [![Coverage Status](https://coveralls.io/repos/github/taosdata/TDengine/badge.svg?branch=3.0)](https://coveralls.io/github/taosdata/TDengine?branch=3.0)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4201/badge)](https://bestpractices.coreinfrastructure.org/projects/4201) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4201/badge)](https://bestpractices.coreinfrastructure.org/projects/4201)
<br /> <br />

View File

@ -22,15 +22,11 @@ import imgStep11 from '../../assets/grafana-11.png';
This document describes how to integrate the TDengine data source with the open-source data visualization system [Grafana](https://www.grafana.com/) to achieve data visualization and build a monitoring and alert system. With the TDengine plugin, you can easily display data from TDengine tables on Grafana dashboards without the need for complex development work. This document describes how to integrate the TDengine data source with the open-source data visualization system [Grafana](https://www.grafana.com/) to achieve data visualization and build a monitoring and alert system. With the TDengine plugin, you can easily display data from TDengine tables on Grafana dashboards without the need for complex development work.
## Grafana Version Requirements
TDengine currently supports Grafana version 7.5 and above. It is recommended to use the latest version. Please download and install the corresponding version of Grafana according to your system environment.
## Prerequisites ## Prerequisites
To add the TDengine data source to Grafana normally, the following preparations are needed. To add the TDengine data source to Grafana normally, the following preparations are needed.
- Grafana service has been deployed and is running normally. - Grafana service has been deployed and is running normally. TDengine currently supports Grafana version 7.5 and above. It is recommended to use the latest version.
**Note**: Ensure that the account starting Grafana has write permissions to its installation directory, otherwise you may not be able to install plugins later. **Note**: Ensure that the account starting Grafana has write permissions to its installation directory, otherwise you may not be able to install plugins later.
- TDengine cluster has been deployed and is running normally. - TDengine cluster has been deployed and is running normally.
- taosAdapter has been installed and is running normally. For details, please refer to the [taosAdapter user manual](../../../tdengine-reference/components/taosadapter/) - taosAdapter has been installed and is running normally. For details, please refer to the [taosAdapter user manual](../../../tdengine-reference/components/taosadapter/)

View File

@ -13,13 +13,11 @@ Seeq is advanced analytics software for the manufacturing and Industrial Interne
Through the TDengine Java connector, Seeq can easily support querying time-series data provided by TDengine and offer data presentation, analysis, prediction, and other functions. Through the TDengine Java connector, Seeq can easily support querying time-series data provided by TDengine and offer data presentation, analysis, prediction, and other functions.
## Seeq Installation Method ## Prerequisites
Download the relevant software from [Seeq's official website](https://www.seeq.com/customer-download), such as Seeq Server and Seeq Data Lab, etc. Seeq Data Lab needs to be installed on a different server from Seeq Server and interconnected through configuration. For detailed installation and configuration instructions, refer to the [Seeq Knowledge Base](https://support.seeq.com/kb/latest/cloud/). - Seeq has been installed. Download the relevant software from [Seeq's official website](https://www.seeq.com/customer-download), such as Seeq Server and Seeq Data Lab, etc. Seeq Data Lab needs to be installed on a different server from Seeq Server and interconnected through configuration. For detailed installation and configuration instructions, refer to the [Seeq Knowledge Base](https://support.seeq.com/kb/latest/cloud/).
### TDengine Local Instance Installation Method - TDengine local instance has been installed. Please refer to the [official documentation](../../../get-started). If using TDengine Cloud, please go to https://cloud.taosdata.com apply for an account and log in to see how to access TDengine Cloud.
Please refer to the [official documentation](../../../get-started).
## Configuring Seeq to Access TDengine ## Configuring Seeq to Access TDengine

View File

@ -14,6 +14,7 @@ The default configuration file for `Agent` is located at `/etc/taos/agent.toml`,
- `token`: Required, the Token generated when creating `Agent` in `Explorer`. - `token`: Required, the Token generated when creating `Agent` in `Explorer`.
- `instanceId`: The instance ID of the current taosx-agent service. If multiple taosx-agent instances are started on the same machine, it is necessary to ensure that the instance IDs of each instance are unique. - `instanceId`: The instance ID of the current taosx-agent service. If multiple taosx-agent instances are started on the same machine, it is necessary to ensure that the instance IDs of each instance are unique.
- `compression`: Optional, can be configured as `true` or `false`, default is `false`. If set to `true`, it enables data compression in communication between `Agent` and `taosX`. - `compression`: Optional, can be configured as `true` or `false`, default is `false`. If set to `true`, it enables data compression in communication between `Agent` and `taosX`.
- `in_memory_cache_capacity`: Optional, signifies the maximum number of message batches that can be cached in memory and can be configured as a positive integer greater than zero. The default value is set at 64.
- `log_level`: Optional, log level, default is `info`. Like `taosX`, it supports five levels: `error`, `warn`, `info`, `debug`, `trace`. Deprecated, please use `log.level` instead. - `log_level`: Optional, log level, default is `info`. Like `taosX`, it supports five levels: `error`, `warn`, `info`, `debug`, `trace`. Deprecated, please use `log.level` instead.
- `log_keep_days`: Optional, the number of days to keep logs, default is `30` days. Deprecated, please use `log.keepDays` instead. - `log_keep_days`: Optional, the number of days to keep logs, default is `30` days. Deprecated, please use `log.keepDays` instead.
- `log.path`: The directory where log files are stored. - `log.path`: The directory where log files are stored.
@ -45,6 +46,10 @@ As shown below:
# #
#compression = true #compression = true
# In-memory cache capacity
#
#in_memory_cache_capacity = 64
# log configuration # log configuration
[log] [log]
# All log files are stored in this directory # All log files are stored in this directory

View File

@ -386,7 +386,7 @@ This document details the server error codes that may be encountered when using
| 0x8000260D | Tags number not matched | Mismatched number of tag columns | Check and correct the SQL statement | | 0x8000260D | Tags number not matched | Mismatched number of tag columns | Check and correct the SQL statement |
| 0x8000260E | Invalid tag name | Invalid or non-existent tag name | Check and correct the SQL statement | | 0x8000260E | Invalid tag name | Invalid or non-existent tag name | Check and correct the SQL statement |
| 0x80002610 | Value is too long | Value length exceeds limit | Check and correct the SQL statement or API parameters | | 0x80002610 | Value is too long | Value length exceeds limit | Check and correct the SQL statement or API parameters |
| 0x80002611 | Password can not be empty | Password is empty | Use a valid password | | 0x80002611 | Password too short or empty | Password is empty or less than 8 chars | Use a valid password |
| 0x80002612 | Port should be an integer that is less than 65535 and greater than 0 | Illegal port number | Check and correct the port number | | 0x80002612 | Port should be an integer that is less than 65535 and greater than 0 | Illegal port number | Check and correct the port number |
| 0x80002613 | Endpoint should be in the format of 'fqdn:port' | Incorrect address format | Check and correct the address information | | 0x80002613 | Endpoint should be in the format of 'fqdn:port' | Incorrect address format | Check and correct the address information |
| 0x80002614 | This statement is no longer supported | Feature has been deprecated | Refer to the feature documentation | | 0x80002614 | This statement is no longer supported | Feature has been deprecated | Refer to the feature documentation |

View File

@ -10,15 +10,11 @@ import TabItem from "@theme/TabItem";
## 概述 ## 概述
本文档介绍如何将 TDengine 数据源与开源数据可视化系统 [Grafana](https://www.grafana.com/) 集成,以实现数据的可视化和监测报警系统的搭建。通过 TDengine 插件,您可以轻松地将 TDengine 数据表的数据展示在 Grafana 仪表盘上,且无需进行复杂的开发工作。 本文档介绍如何将 TDengine 数据源与开源数据可视化系统 [Grafana](https://www.grafana.com/) 集成,以实现数据的可视化和监测报警系统的搭建。通过 TDengine 插件,您可以轻松地将 TDengine 数据表的数据展示在 Grafana 仪表盘上,且无需进行复杂的开发工作。
## Grafana 版本要求
当前 TDengine 支持 Grafana 7.5 及以上版本,建议使用最新版本。请根据您的系统环境下载并安装对应版本的 Grafana。
## 前置条件 ## 前置条件
要让 Grafana 能正常添加 TDengine 数据源,需要以下几方面的准备工作。 要让 Grafana 能正常添加 TDengine 数据源,需要以下几方面的准备工作。
- Grafana 服务已经部署并正常运行。 - Grafana 服务已经部署并正常运行。当前 TDengine 支持 Grafana 7.5 及以上版本,建议使用最新版本。
**注意**:要确保启动 Grafana 的账号有其安装目录的写权限,否则可能后面无法安装插件。 **注意**:要确保启动 Grafana 的账号有其安装目录的写权限,否则可能后面无法安装插件。
- TDengine 集群已经部署并正常运行。 - TDengine 集群已经部署并正常运行。
- taosAdapter 已经安装并正常运行。具体细节请参考 [taosAdapter 的使用手册](../../../reference/components/taosadapter) - taosAdapter 已经安装并正常运行。具体细节请参考 [taosAdapter 的使用手册](../../../reference/components/taosadapter)

View File

@ -10,13 +10,10 @@ toc_max_heading_level: 4
一旦数据源配置完成永洪BI便能直接从TDengine中读取数据并利用其强大的数据处理和分析功能为用户提供丰富的数据展示、分析和预测能力。这意味着用户无须编写复杂的代码或进行烦琐的数据转换工作即可轻松获取所需的业务洞察。 一旦数据源配置完成永洪BI便能直接从TDengine中读取数据并利用其强大的数据处理和分析功能为用户提供丰富的数据展示、分析和预测能力。这意味着用户无须编写复杂的代码或进行烦琐的数据转换工作即可轻松获取所需的业务洞察。
## 安装永洪 BI ## 前置条件
确保永洪 BI 已经安装并运行(如果未安装,请到永洪科技官方下载页面下载)。 - 确保永洪 BI 已经安装并运行(如果未安装,请到永洪科技官方下载页面下载)。
- 安装JDBC驱动。从 maven.org 下载 TDengine JDBC 连接器文件 “taos-jdbcdriver-3.4.0-dist.jar”并安装在永洪 BI 的机器上。
## 安装JDBC驱动
从 maven.org 下载 TDengine JDBC 连接器文件 “taos-jdbcdriver-3.2.7-dist.jar”并安装在永洪 BI 的机器上。
## 配置JDBC数据源 ## 配置JDBC数据源

View File

@ -8,16 +8,11 @@ Seeq 是制造业和工业互联网IIOT高级分析软件。Seeq 支持在
通过 TDengine Java connector Seeq 可以轻松支持查询 TDengine 提供的时序数据,并提供数据展现、分析、预测等功能。 通过 TDengine Java connector Seeq 可以轻松支持查询 TDengine 提供的时序数据,并提供数据展现、分析、预测等功能。
## Seeq 安装方法 ## 前置条件
从 [Seeq 官网](https://www.seeq.com/customer-download)下载相关软件,例如 Seeq Server 和 Seeq Data Lab 等。Seeq Data Lab 需要安装在和 Seeq Server 不同的服务器上,并通过配置和 Seeq Server 互联。详细安装配置指令参见[Seeq 知识库]( https://support.seeq.com/kb/latest/cloud/)。 - Seeq 已经安装。从 [Seeq 官网](https://www.seeq.com/customer-download)下载相关软件,例如 Seeq Server 和 Seeq Data Lab 等。Seeq Data Lab 需要安装在和 Seeq Server 不同的服务器上,并通过配置和 Seeq Server 互联。详细安装配置指令参见[Seeq 知识库]( https://support.seeq.com/kb/latest/cloud/)。
### TDengine 本地实例安装方法 - TDengine 本地实例已安装。 请参考[官网文档](../../../get-started)。 若使用 TDengine Cloud请在 https://cloud.taosdata.com 申请帐号并登录查看如何访问 TDengine Cloud。
请参考[官网文档](../../../get-started)。
### TDengine Cloud 访问方法
如果使用 Seeq 连接 TDengine Cloud请在 https://cloud.taosdata.com 申请帐号并登录查看如何访问 TDengine Cloud。
## 配置 Seeq 访问 TDengine ## 配置 Seeq 访问 TDengine

View File

@ -12,7 +12,8 @@ sidebar_label: taosX-Agent
- `endpoint`: 必填,`taosX` 的 GRPC 服务地址。 - `endpoint`: 必填,`taosX` 的 GRPC 服务地址。
- `token`: 必填,在 `Explorer` 上创建 `Agent` 时,产生的 Token。 - `token`: 必填,在 `Explorer` 上创建 `Agent` 时,产生的 Token。
- `instanceId`:当前 taosx-agent 服务的实例 ID如果同一台机器上启动了多个 taosx-agent 实例,必须保证各个实例的实例 ID 互不相同。 - `instanceId`:当前 taosx-agent 服务的实例 ID如果同一台机器上启动了多个 taosx-agent 实例,必须保证各个实例的实例 ID 互不相同。
- `compression`: 非必填,可配置为 `ture``false`, 默认为 `false`。配置为`true`, 则开启 `Agent``taosX` 通信数据压缩。 - `compression`: 非必填,可配置为 `true``false`, 默认为 `false`。配置为`true`, 则开启 `Agent``taosX` 通信数据压缩。
- `in_memory_cache_capacity`: 非必填,表示可在内存中缓存的最大消息批次数,可配置为大于 0 的整数。默认为 `64`
- `log_level`: 非必填,日志级别,默认为 `info`, 同 `taosX` 一样,支持 `error``warn``info``debug``trace` 五级。已弃用,请使用 `log.level` 代替。 - `log_level`: 非必填,日志级别,默认为 `info`, 同 `taosX` 一样,支持 `error``warn``info``debug``trace` 五级。已弃用,请使用 `log.level` 代替。
- `log_keep_days`:非必填,日志保存天数,默认为 `30` 天。已弃用,请使用 `log.keepDays` 代替。 - `log_keep_days`:非必填,日志保存天数,默认为 `30` 天。已弃用,请使用 `log.keepDays` 代替。
- `log.path`:日志文件存放的目录。 - `log.path`:日志文件存放的目录。
@ -44,6 +45,10 @@ sidebar_label: taosX-Agent
# #
#compression = true #compression = true
# In-memory cache capacity
#
#in_memory_cache_capacity = 64
# log configuration # log configuration
[log] [log]
# All log files are stored in this directory # All log files are stored in this directory

View File

@ -403,7 +403,7 @@ description: TDengine 服务端的错误码列表和详细说明
| 0x8000260D | Tags number not matched | tag列个数不匹配 | 检查并修正SQL语句 | | 0x8000260D | Tags number not matched | tag列个数不匹配 | 检查并修正SQL语句 |
| 0x8000260E | Invalid tag name | 无效或不存在的tag名 | 检查并修正SQL语句 | | 0x8000260E | Invalid tag name | 无效或不存在的tag名 | 检查并修正SQL语句 |
| 0x80002610 | Value is too long | 值长度超出限制 | 检查并修正SQL语句或API参数 | | 0x80002610 | Value is too long | 值长度超出限制 | 检查并修正SQL语句或API参数 |
| 0x80002611 | Password can not be empty | 密码为空 | 使用合法的密码 | | 0x80002611 | Password too short or empty | 密码为空或少于 8 个字符 | 使用合法的密码 |
| 0x80002612 | Port should be an integer that is less than 65535 and greater than 0 | 端口号非法 | 检查并修正端口号 | | 0x80002612 | Port should be an integer that is less than 65535 and greater than 0 | 端口号非法 | 检查并修正端口号 |
| 0x80002613 | Endpoint should be in the format of 'fqdn:port' | 地址格式错误 | 检查并修正地址信息 | | 0x80002613 | Endpoint should be in the format of 'fqdn:port' | 地址格式错误 | 检查并修正地址信息 |
| 0x80002614 | This statement is no longer supported | 功能已经废弃 | 参考功能文档说明 | | 0x80002614 | This statement is no longer supported | 功能已经废弃 | 参考功能文档说明 |

View File

@ -28,8 +28,8 @@ extern "C" {
#define ANAL_FORECAST_DEFAULT_ROWS 10 #define ANAL_FORECAST_DEFAULT_ROWS 10
#define ANAL_FORECAST_DEFAULT_CONF 95 #define ANAL_FORECAST_DEFAULT_CONF 95
#define ANAL_FORECAST_DEFAULT_WNCHECK 1 #define ANAL_FORECAST_DEFAULT_WNCHECK 1
#define ANAL_FORECAST_MAX_ROWS 10000 #define ANAL_FORECAST_MAX_ROWS 40000
#define ANAL_ANOMALY_WINDOW_MAX_ROWS 10000 #define ANAL_ANOMALY_WINDOW_MAX_ROWS 40000
typedef struct { typedef struct {
EAnalAlgoType type; EAnalAlgoType type;

View File

@ -288,6 +288,7 @@ struct SScalarParam {
bool colAlloced; bool colAlloced;
SColumnInfoData *columnData; SColumnInfoData *columnData;
SHashObj *pHashFilter; SHashObj *pHashFilter;
SHashObj *pHashFilterOthers;
int32_t hashValueType; int32_t hashValueType;
void *param; // other parameter, such as meta handle from vnode, to extract table name/tag value void *param; // other parameter, such as meta handle from vnode, to extract table name/tag value
int32_t numOfRows; int32_t numOfRows;

View File

@ -40,7 +40,7 @@ pDst need to freed in caller
int32_t scalarCalculate(SNode *pNode, SArray *pBlockList, SScalarParam *pDst); int32_t scalarCalculate(SNode *pNode, SArray *pBlockList, SScalarParam *pDst);
int32_t scalarGetOperatorParamNum(EOperatorType type); int32_t scalarGetOperatorParamNum(EOperatorType type);
int32_t scalarGenerateSetFromList(void **data, void *pNode, uint32_t type); int32_t scalarGenerateSetFromList(void **data, void *pNode, uint32_t type, int8_t processType);
int32_t vectorGetConvertType(int32_t type1, int32_t type2); int32_t vectorGetConvertType(int32_t type1, int32_t type2);
int32_t vectorConvertSingleColImpl(const SScalarParam *pIn, SScalarParam *pOut, int32_t *overflow, int32_t startIndex, int32_t numOfRows); int32_t vectorConvertSingleColImpl(const SScalarParam *pIn, SScalarParam *pOut, int32_t *overflow, int32_t startIndex, int32_t numOfRows);

View File

@ -801,7 +801,7 @@ int32_t taosGetErrSize();
#define TSDB_CODE_PAR_TAGS_NOT_MATCHED TAOS_DEF_ERROR_CODE(0, 0x260D) #define TSDB_CODE_PAR_TAGS_NOT_MATCHED TAOS_DEF_ERROR_CODE(0, 0x260D)
#define TSDB_CODE_PAR_INVALID_TAG_NAME TAOS_DEF_ERROR_CODE(0, 0x260E) #define TSDB_CODE_PAR_INVALID_TAG_NAME TAOS_DEF_ERROR_CODE(0, 0x260E)
#define TSDB_CODE_PAR_NAME_OR_PASSWD_TOO_LONG TAOS_DEF_ERROR_CODE(0, 0x2610) #define TSDB_CODE_PAR_NAME_OR_PASSWD_TOO_LONG TAOS_DEF_ERROR_CODE(0, 0x2610)
#define TSDB_CODE_PAR_PASSWD_EMPTY TAOS_DEF_ERROR_CODE(0, 0x2611) #define TSDB_CODE_PAR_PASSWD_TOO_SHORT_OR_EMPTY TAOS_DEF_ERROR_CODE(0, 0x2611)
#define TSDB_CODE_PAR_INVALID_PORT TAOS_DEF_ERROR_CODE(0, 0x2612) #define TSDB_CODE_PAR_INVALID_PORT TAOS_DEF_ERROR_CODE(0, 0x2612)
#define TSDB_CODE_PAR_INVALID_ENDPOINT TAOS_DEF_ERROR_CODE(0, 0x2613) #define TSDB_CODE_PAR_INVALID_ENDPOINT TAOS_DEF_ERROR_CODE(0, 0x2613)
#define TSDB_CODE_PAR_EXPRIE_STATEMENT TAOS_DEF_ERROR_CODE(0, 0x2614) #define TSDB_CODE_PAR_EXPRIE_STATEMENT TAOS_DEF_ERROR_CODE(0, 0x2614)

View File

@ -44,27 +44,27 @@ mkdir -p ${pkg_dir}${install_home_path}/include
#mkdir -p ${pkg_dir}${install_home_path}/init.d #mkdir -p ${pkg_dir}${install_home_path}/init.d
mkdir -p ${pkg_dir}${install_home_path}/script mkdir -p ${pkg_dir}${install_home_path}/script
# download taoskeeper and build # # download taoskeeper and build
if [ "$cpuType" = "x64" ] || [ "$cpuType" = "x86_64" ] || [ "$cpuType" = "amd64" ]; then # if [ "$cpuType" = "x64" ] || [ "$cpuType" = "x86_64" ] || [ "$cpuType" = "amd64" ]; then
arch=amd64 # arch=amd64
elif [ "$cpuType" = "x32" ] || [ "$cpuType" = "i386" ] || [ "$cpuType" = "i686" ]; then # elif [ "$cpuType" = "x32" ] || [ "$cpuType" = "i386" ] || [ "$cpuType" = "i686" ]; then
arch=386 # arch=386
elif [ "$cpuType" = "arm" ] || [ "$cpuType" = "aarch32" ]; then # elif [ "$cpuType" = "arm" ] || [ "$cpuType" = "aarch32" ]; then
arch=arm # arch=arm
elif [ "$cpuType" = "arm64" ] || [ "$cpuType" = "aarch64" ]; then # elif [ "$cpuType" = "arm64" ] || [ "$cpuType" = "aarch64" ]; then
arch=arm64 # arch=arm64
else # else
arch=$cpuType # arch=$cpuType
fi # fi
echo "${top_dir}/../enterprise/packaging/build_taoskeeper.sh -r ${arch} -e taoskeeper -t ver-${tdengine_ver}" # echo "${top_dir}/../enterprise/packaging/build_taoskeeper.sh -r ${arch} -e taoskeeper -t ver-${tdengine_ver}"
echo "$top_dir=${top_dir}" # echo "$top_dir=${top_dir}"
taoskeeper_binary=`${top_dir}/../enterprise/packaging/build_taoskeeper.sh -r $arch -e taoskeeper -t ver-${tdengine_ver}` # taoskeeper_binary=`${top_dir}/../enterprise/packaging/build_taoskeeper.sh -r $arch -e taoskeeper -t ver-${tdengine_ver}`
echo "taoskeeper_binary: ${taoskeeper_binary}" # echo "taoskeeper_binary: ${taoskeeper_binary}"
# copy config files # copy config files
cp $(dirname ${taoskeeper_binary})/config/taoskeeper.toml ${pkg_dir}${install_home_path}/cfg # cp $(dirname ${taoskeeper_binary})/config/taoskeeper.toml ${pkg_dir}${install_home_path}/cfg
cp $(dirname ${taoskeeper_binary})/taoskeeper.service ${pkg_dir}${install_home_path}/cfg # cp $(dirname ${taoskeeper_binary})/taoskeeper.service ${pkg_dir}${install_home_path}/cfg
cp ${compile_dir}/../packaging/cfg/taos.cfg ${pkg_dir}${install_home_path}/cfg cp ${compile_dir}/../packaging/cfg/taos.cfg ${pkg_dir}${install_home_path}/cfg
cp ${compile_dir}/../packaging/cfg/taosd.service ${pkg_dir}${install_home_path}/cfg cp ${compile_dir}/../packaging/cfg/taosd.service ${pkg_dir}${install_home_path}/cfg
@ -75,7 +75,12 @@ fi
if [ -f "${compile_dir}/test/cfg/taosadapter.service" ]; then if [ -f "${compile_dir}/test/cfg/taosadapter.service" ]; then
cp ${compile_dir}/test/cfg/taosadapter.service ${pkg_dir}${install_home_path}/cfg || : cp ${compile_dir}/test/cfg/taosadapter.service ${pkg_dir}${install_home_path}/cfg || :
fi fi
if [ -f "${compile_dir}/test/cfg/taoskeeper.toml" ]; then
cp ${compile_dir}/test/cfg/taoskeeper.toml ${pkg_dir}${install_home_path}/cfg || :
fi
if [ -f "${compile_dir}/test/cfg/taoskeeper.service" ]; then
cp ${compile_dir}/test/cfg/taoskeeper.service ${pkg_dir}${install_home_path}/cfg || :
fi
if [ -f "${compile_dir}/../../../explorer/target/taos-explorer.service" ]; then if [ -f "${compile_dir}/../../../explorer/target/taos-explorer.service" ]; then
cp ${compile_dir}/../../../explorer/target/taos-explorer.service ${pkg_dir}${install_home_path}/cfg || : cp ${compile_dir}/../../../explorer/target/taos-explorer.service ${pkg_dir}${install_home_path}/cfg || :
fi fi
@ -83,7 +88,7 @@ if [ -f "${compile_dir}/../../../explorer/server/example/explorer.toml" ]; then
cp ${compile_dir}/../../../explorer/server/example/explorer.toml ${pkg_dir}${install_home_path}/cfg || : cp ${compile_dir}/../../../explorer/server/example/explorer.toml ${pkg_dir}${install_home_path}/cfg || :
fi fi
cp ${taoskeeper_binary} ${pkg_dir}${install_home_path}/bin # cp ${taoskeeper_binary} ${pkg_dir}${install_home_path}/bin
#cp ${compile_dir}/../packaging/deb/taosd ${pkg_dir}${install_home_path}/init.d #cp ${compile_dir}/../packaging/deb/taosd ${pkg_dir}${install_home_path}/init.d
cp ${compile_dir}/../packaging/tools/post.sh ${pkg_dir}${install_home_path}/script cp ${compile_dir}/../packaging/tools/post.sh ${pkg_dir}${install_home_path}/script
cp ${compile_dir}/../packaging/tools/preun.sh ${pkg_dir}${install_home_path}/script cp ${compile_dir}/../packaging/tools/preun.sh ${pkg_dir}${install_home_path}/script
@ -104,6 +109,9 @@ cp ${compile_dir}/build/bin/taosdump ${pkg_dir}${install_home_path
if [ -f "${compile_dir}/build/bin/taosadapter" ]; then if [ -f "${compile_dir}/build/bin/taosadapter" ]; then
cp ${compile_dir}/build/bin/taosadapter ${pkg_dir}${install_home_path}/bin ||: cp ${compile_dir}/build/bin/taosadapter ${pkg_dir}${install_home_path}/bin ||:
fi fi
if [ -f "${compile_dir}/build/bin/taoskeeper" ]; then
cp ${compile_dir}/build/bin/taoskeeper ${pkg_dir}${install_home_path}/bin ||:
fi
if [ -f "${compile_dir}/../../../explorer/target/release/taos-explorer" ]; then if [ -f "${compile_dir}/../../../explorer/target/release/taos-explorer" ]; then
cp ${compile_dir}/../../../explorer/target/release/taos-explorer ${pkg_dir}${install_home_path}/bin ||: cp ${compile_dir}/../../../explorer/target/release/taos-explorer ${pkg_dir}${install_home_path}/bin ||:
@ -185,7 +193,7 @@ else
exit 1 exit 1
fi fi
rm -rf ${pkg_dir}/build-taoskeeper # rm -rf ${pkg_dir}/build-taoskeeper
# make deb package # make deb package
dpkg -b ${pkg_dir} $debname dpkg -b ${pkg_dir} $debname
echo "make deb package success!" echo "make deb package success!"

View File

@ -56,24 +56,23 @@ fi
${csudo}mkdir -p ${pkg_dir} ${csudo}mkdir -p ${pkg_dir}
cd ${pkg_dir} cd ${pkg_dir}
# download taoskeeper and build # # download taoskeeper and build
if [ "$cpuType" = "x64" ] || [ "$cpuType" = "x86_64" ] || [ "$cpuType" = "amd64" ]; then # if [ "$cpuType" = "x64" ] || [ "$cpuType" = "x86_64" ] || [ "$cpuType" = "amd64" ]; then
arch=amd64 # arch=amd64
elif [ "$cpuType" = "x32" ] || [ "$cpuType" = "i386" ] || [ "$cpuType" = "i686" ]; then # elif [ "$cpuType" = "x32" ] || [ "$cpuType" = "i386" ] || [ "$cpuType" = "i686" ]; then
arch=386 # arch=386
elif [ "$cpuType" = "arm" ] || [ "$cpuType" = "aarch32" ]; then # elif [ "$cpuType" = "arm" ] || [ "$cpuType" = "aarch32" ]; then
arch=arm # arch=arm
elif [ "$cpuType" = "arm64" ] || [ "$cpuType" = "aarch64" ]; then # elif [ "$cpuType" = "arm64" ] || [ "$cpuType" = "aarch64" ]; then
arch=arm64 # arch=arm64
else # else
arch=$cpuType # arch=$cpuType
fi # fi
cd ${top_dir} # cd ${top_dir}
echo "${top_dir}/../enterprise/packaging/build_taoskeeper.sh -r ${arch} -e taoskeeper -t ver-${tdengine_ver}" # echo "${top_dir}/../enterprise/packaging/build_taoskeeper.sh -r ${arch} -e taoskeeper -t ver-${tdengine_ver}"
taoskeeper_binary=`${top_dir}/../enterprise/packaging/build_taoskeeper.sh -r $arch -e taoskeeper -t ver-${tdengine_ver}` # taoskeeper_binary=`${top_dir}/../enterprise/packaging/build_taoskeeper.sh -r $arch -e taoskeeper -t ver-${tdengine_ver}`
echo "taoskeeper_binary: ${taoskeeper_binary}" # echo "taoskeeper_binary: ${taoskeeper_binary}"
cd ${package_dir}
${csudo}mkdir -p BUILD BUILDROOT RPMS SOURCES SPECS SRPMS ${csudo}mkdir -p BUILD BUILDROOT RPMS SOURCES SPECS SRPMS
@ -106,4 +105,4 @@ mv ${output_dir}/TDengine-${tdengine_ver}.rpm ${output_dir}/${rpmname}
cd .. cd ..
${csudo}rm -rf ${pkg_dir} ${csudo}rm -rf ${pkg_dir}
rm -rf ${top_dir}/build-taoskeeper # rm -rf ${top_dir}/build-taoskeeper

View File

@ -68,12 +68,12 @@ if [ -f %{_compiledir}/test/cfg/taosadapter.service ]; then
cp %{_compiledir}/test/cfg/taosadapter.service %{buildroot}%{homepath}/cfg cp %{_compiledir}/test/cfg/taosadapter.service %{buildroot}%{homepath}/cfg
fi fi
if [ -f %{_compiledir}/../build-taoskeeper/config/taoskeeper.toml ]; then if [ -f %{_compiledir}/test/cfg/taoskeeper.toml ]; then
cp %{_compiledir}/../build-taoskeeper/config/taoskeeper.toml %{buildroot}%{homepath}/cfg ||: cp %{_compiledir}/test/cfg/taoskeeper.toml %{buildroot}%{homepath}/cfg ||:
fi fi
if [ -f %{_compiledir}/../build-taoskeeper/taoskeeper.service ]; then if [ -f %{_compiledir}/test/cfg/taoskeeper.service ]; then
cp %{_compiledir}/../build-taoskeeper/taoskeeper.service %{buildroot}%{homepath}/cfg ||: cp %{_compiledir}/test/cfg/taoskeeper.service %{buildroot}%{homepath}/cfg ||:
fi fi
if [ -f %{_compiledir}/../../../explorer/target/taos-explorer.service ]; then if [ -f %{_compiledir}/../../../explorer/target/taos-explorer.service ]; then
@ -104,8 +104,8 @@ if [ -f %{_compiledir}/../../../explorer/target/release/taos-explorer ]; then
cp %{_compiledir}/../../../explorer/target/release/taos-explorer %{buildroot}%{homepath}/bin cp %{_compiledir}/../../../explorer/target/release/taos-explorer %{buildroot}%{homepath}/bin
fi fi
if [ -f %{_compiledir}/../build-taoskeeper/taoskeeper ]; then if [ -f %{_compiledir}/build/bin//taoskeeper ]; then
cp %{_compiledir}/../build-taoskeeper/taoskeeper %{buildroot}%{homepath}/bin cp %{_compiledir}/build/bin//taoskeeper %{buildroot}%{homepath}/bin
fi fi
if [ -f %{_compiledir}/build/bin/taosadapter ]; then if [ -f %{_compiledir}/build/bin/taosadapter ]; then

View File

@ -282,5 +282,3 @@ else
rm -rf ${install_dir} ||: rm -rf ${install_dir} ||:
# mv ../"$(basename ${pkg_name}).tar.gz" . # mv ../"$(basename ${pkg_name}).tar.gz" .
fi fi
cd ${curr_dir}

View File

@ -2201,6 +2201,11 @@ int taos_stmt2_bind_param(TAOS_STMT2 *stmt, TAOS_STMT2_BINDV *bindv, int32_t col
if (code) { if (code) {
goto out; goto out;
} }
} else {
code = stmtSetTbTags2(stmt, NULL);
if (code) {
return code;
}
} }
if (bindv->bind_cols && bindv->bind_cols[i]) { if (bindv->bind_cols && bindv->bind_cols[i]) {

View File

@ -1012,10 +1012,10 @@ int stmtSetTbTags2(TAOS_STMT2* stmt, TAOS_STMT2_BIND* tags) {
} }
SBoundColInfo* tags_info = (SBoundColInfo*)pStmt->bInfo.boundTags; SBoundColInfo* tags_info = (SBoundColInfo*)pStmt->bInfo.boundTags;
if (tags_info->numOfBound <= 0 || tags_info->numOfCols <= 0) { // if (tags_info->numOfBound <= 0 || tags_info->numOfCols <= 0) {
tscWarn("no tags or cols bound in sql, will not bound tags"); // tscWarn("no tags or cols bound in sql, will not bound tags");
return TSDB_CODE_SUCCESS; // return TSDB_CODE_SUCCESS;
} // }
STableDataCxt** pDataBlock = STableDataCxt** pDataBlock =
(STableDataCxt**)taosHashGet(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName)); (STableDataCxt**)taosHashGet(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName));

View File

@ -69,6 +69,7 @@ int32_t dmStartStatusThread(SDnodeMgmt *pMgmt);
int32_t dmStartConfigThread(SDnodeMgmt *pMgmt); int32_t dmStartConfigThread(SDnodeMgmt *pMgmt);
int32_t dmStartStatusInfoThread(SDnodeMgmt *pMgmt); int32_t dmStartStatusInfoThread(SDnodeMgmt *pMgmt);
void dmStopStatusThread(SDnodeMgmt *pMgmt); void dmStopStatusThread(SDnodeMgmt *pMgmt);
void dmStopConfigThread(SDnodeMgmt *pMgmt);
void dmStopStatusInfoThread(SDnodeMgmt *pMgmt); void dmStopStatusInfoThread(SDnodeMgmt *pMgmt);
int32_t dmStartNotifyThread(SDnodeMgmt *pMgmt); int32_t dmStartNotifyThread(SDnodeMgmt *pMgmt);
void dmStopNotifyThread(SDnodeMgmt *pMgmt); void dmStopNotifyThread(SDnodeMgmt *pMgmt);

View File

@ -52,6 +52,7 @@ static void dmStopMgmt(SDnodeMgmt *pMgmt) {
dmStopMonitorThread(pMgmt); dmStopMonitorThread(pMgmt);
dmStopAuditThread(pMgmt); dmStopAuditThread(pMgmt);
dmStopStatusThread(pMgmt); dmStopStatusThread(pMgmt);
dmStopConfigThread(pMgmt);
dmStopStatusInfoThread(pMgmt); dmStopStatusInfoThread(pMgmt);
#if defined(TD_ENTERPRISE) #if defined(TD_ENTERPRISE)
dmStopNotifyThread(pMgmt); dmStopNotifyThread(pMgmt);

View File

@ -343,7 +343,7 @@ int32_t dmStartConfigThread(SDnodeMgmt *pMgmt) {
int32_t code = 0; int32_t code = 0;
TdThreadAttr thAttr; TdThreadAttr thAttr;
(void)taosThreadAttrInit(&thAttr); (void)taosThreadAttrInit(&thAttr);
(void)taosThreadAttrSetDetachState(&thAttr, PTHREAD_CREATE_DETACHED); (void)taosThreadAttrSetDetachState(&thAttr, PTHREAD_CREATE_JOINABLE);
if (taosThreadCreate(&pMgmt->configThread, &thAttr, dmConfigThreadFp, pMgmt) != 0) { if (taosThreadCreate(&pMgmt->configThread, &thAttr, dmConfigThreadFp, pMgmt) != 0) {
code = TAOS_SYSTEM_ERROR(errno); code = TAOS_SYSTEM_ERROR(errno);
dError("failed to create config thread since %s", tstrerror(code)); dError("failed to create config thread since %s", tstrerror(code));
@ -378,6 +378,13 @@ void dmStopStatusThread(SDnodeMgmt *pMgmt) {
} }
} }
void dmStopConfigThread(SDnodeMgmt *pMgmt) {
if (taosCheckPthreadValid(pMgmt->configThread)) {
(void)taosThreadJoin(pMgmt->configThread, NULL);
taosThreadClear(&pMgmt->configThread);
}
}
void dmStopStatusInfoThread(SDnodeMgmt *pMgmt) { void dmStopStatusInfoThread(SDnodeMgmt *pMgmt) {
if (taosCheckPthreadValid(pMgmt->statusInfoThread)) { if (taosCheckPthreadValid(pMgmt->statusInfoThread)) {
(void)taosThreadJoin(pMgmt->statusInfoThread, NULL); (void)taosThreadJoin(pMgmt->statusInfoThread, NULL);

View File

@ -1805,12 +1805,21 @@ _OVER:
TAOS_RETURN(code); TAOS_RETURN(code);
} }
static int32_t mndCheckPasswordFmt(const char *pwd) { static int32_t mndCheckPasswordMinLen(const char *pwd, int32_t len) {
int32_t len = strlen(pwd); if (len < TSDB_PASSWORD_MIN_LEN) {
if (len < TSDB_PASSWORD_MIN_LEN || len > TSDB_PASSWORD_MAX_LEN) {
return -1; return -1;
} }
return 0;
}
static int32_t mndCheckPasswordMaxLen(const char *pwd, int32_t len) {
if (len > TSDB_PASSWORD_MAX_LEN) {
return -1;
}
return 0;
}
static int32_t mndCheckPasswordFmt(const char *pwd, int32_t len) {
if (strcmp(pwd, "taosdata") == 0) { if (strcmp(pwd, "taosdata") == 0) {
return 0; return 0;
} }
@ -1875,14 +1884,17 @@ static int32_t mndProcessCreateUserReq(SRpcMsg *pReq) {
TAOS_CHECK_GOTO(TSDB_CODE_MND_INVALID_USER_FORMAT, &lino, _OVER); TAOS_CHECK_GOTO(TSDB_CODE_MND_INVALID_USER_FORMAT, &lino, _OVER);
} }
if (mndCheckPasswordFmt(createReq.pass) != 0) { int32_t len = strlen(createReq.pass);
TAOS_CHECK_GOTO(TSDB_CODE_MND_INVALID_PASS_FORMAT, &lino, _OVER);
}
if (createReq.isImport != 1) { if (createReq.isImport != 1) {
if (strlen(createReq.pass) >= TSDB_PASSWORD_LEN) { if (mndCheckPasswordMinLen(createReq.pass, len) != 0) {
TAOS_CHECK_GOTO(TSDB_CODE_PAR_PASSWD_TOO_SHORT_OR_EMPTY, &lino, _OVER);
}
if (mndCheckPasswordMaxLen(createReq.pass, len) != 0) {
TAOS_CHECK_GOTO(TSDB_CODE_PAR_NAME_OR_PASSWD_TOO_LONG, &lino, _OVER); TAOS_CHECK_GOTO(TSDB_CODE_PAR_NAME_OR_PASSWD_TOO_LONG, &lino, _OVER);
} }
if (mndCheckPasswordFmt(createReq.pass, len) != 0) {
TAOS_CHECK_GOTO(TSDB_CODE_MND_INVALID_PASS_FORMAT, &lino, _OVER);
}
} }
code = mndAcquireUser(pMnode, createReq.user, &pUser); code = mndAcquireUser(pMnode, createReq.user, &pUser);
@ -2364,9 +2376,18 @@ static int32_t mndProcessAlterUserReq(SRpcMsg *pReq) {
TAOS_CHECK_GOTO(TSDB_CODE_MND_INVALID_USER_FORMAT, &lino, _OVER); TAOS_CHECK_GOTO(TSDB_CODE_MND_INVALID_USER_FORMAT, &lino, _OVER);
} }
if (TSDB_ALTER_USER_PASSWD == alterReq.alterType && mndCheckPasswordFmt(alterReq.pass) != 0) { if (TSDB_ALTER_USER_PASSWD == alterReq.alterType) {
int32_t len = strlen(alterReq.pass);
if (mndCheckPasswordMinLen(alterReq.pass, len) != 0) {
TAOS_CHECK_GOTO(TSDB_CODE_PAR_PASSWD_TOO_SHORT_OR_EMPTY, &lino, _OVER);
}
if (mndCheckPasswordMaxLen(alterReq.pass, len) != 0) {
TAOS_CHECK_GOTO(TSDB_CODE_PAR_NAME_OR_PASSWD_TOO_LONG, &lino, _OVER);
}
if (mndCheckPasswordFmt(alterReq.pass, len) != 0) {
TAOS_CHECK_GOTO(TSDB_CODE_MND_INVALID_PASS_FORMAT, &lino, _OVER); TAOS_CHECK_GOTO(TSDB_CODE_MND_INVALID_PASS_FORMAT, &lino, _OVER);
} }
}
TAOS_CHECK_GOTO(mndAcquireUser(pMnode, alterReq.user, &pUser), &lino, _OVER); TAOS_CHECK_GOTO(mndAcquireUser(pMnode, alterReq.user, &pUser), &lino, _OVER);

View File

@ -72,17 +72,20 @@ static FORCE_INLINE int32_t forecastEnsureBlockCapacity(SSDataBlock* pBlock, int
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
static int32_t forecastCacheBlock(SForecastSupp* pSupp, SSDataBlock* pBlock) { static int32_t forecastCacheBlock(SForecastSupp* pSupp, SSDataBlock* pBlock, const char* id) {
if (pSupp->cachedRows > ANAL_FORECAST_MAX_ROWS) {
return TSDB_CODE_ANA_ANODE_TOO_MANY_ROWS;
}
int32_t code = TSDB_CODE_SUCCESS; int32_t code = TSDB_CODE_SUCCESS;
int32_t lino = 0; int32_t lino = 0;
SAnalyticBuf* pBuf = &pSupp->analBuf; SAnalyticBuf* pBuf = &pSupp->analBuf;
qDebug("block:%d, %p rows:%" PRId64, pSupp->numOfBlocks, pBlock, pBlock->info.rows); if (pSupp->cachedRows > ANAL_FORECAST_MAX_ROWS) {
code = TSDB_CODE_ANA_ANODE_TOO_MANY_ROWS;
qError("%s rows:%" PRId64 " for forecast cache, error happens, code:%s, upper limit:%d", id, pSupp->cachedRows,
tstrerror(code), ANAL_FORECAST_MAX_ROWS);
return code;
}
pSupp->numOfBlocks++; pSupp->numOfBlocks++;
qDebug("%s block:%d, %p rows:%" PRId64, id, pSupp->numOfBlocks, pBlock, pBlock->info.rows);
for (int32_t j = 0; j < pBlock->info.rows; ++j) { for (int32_t j = 0; j < pBlock->info.rows; ++j) {
SColumnInfoData* pValCol = taosArrayGet(pBlock->pDataBlock, pSupp->inputValSlot); SColumnInfoData* pValCol = taosArrayGet(pBlock->pDataBlock, pSupp->inputValSlot);
@ -98,10 +101,16 @@ static int32_t forecastCacheBlock(SForecastSupp* pSupp, SSDataBlock* pBlock) {
pSupp->numOfRows++; pSupp->numOfRows++;
code = taosAnalBufWriteColData(pBuf, 0, TSDB_DATA_TYPE_TIMESTAMP, &ts); code = taosAnalBufWriteColData(pBuf, 0, TSDB_DATA_TYPE_TIMESTAMP, &ts);
if (TSDB_CODE_SUCCESS != code) return code; if (TSDB_CODE_SUCCESS != code) {
qError("%s failed to write ts in buf, code:%s", id, tstrerror(code));
return code;
}
code = taosAnalBufWriteColData(pBuf, 1, valType, val); code = taosAnalBufWriteColData(pBuf, 1, valType, val);
if (TSDB_CODE_SUCCESS != code) return code; if (TSDB_CODE_SUCCESS != code) {
qError("%s failed to write val in buf, code:%s", id, tstrerror(code));
return code;
}
} }
return 0; return 0;
@ -394,7 +403,7 @@ static int32_t forecastNext(SOperatorInfo* pOperator, SSDataBlock** ppRes) {
pSupp->cachedRows += pBlock->info.rows; pSupp->cachedRows += pBlock->info.rows;
qDebug("%s group:%" PRId64 ", blocks:%d, rows:%" PRId64 ", total rows:%" PRId64, pId, pSupp->groupId, numOfBlocks, qDebug("%s group:%" PRId64 ", blocks:%d, rows:%" PRId64 ", total rows:%" PRId64, pId, pSupp->groupId, numOfBlocks,
pBlock->info.rows, pSupp->cachedRows); pBlock->info.rows, pSupp->cachedRows);
code = forecastCacheBlock(pSupp, pBlock); code = forecastCacheBlock(pSupp, pBlock, pId);
QUERY_CHECK_CODE(code, lino, _end); QUERY_CHECK_CODE(code, lino, _end);
} else { } else {
qDebug("%s group:%" PRId64 ", read finish for new group coming, blocks:%d", pId, pSupp->groupId, numOfBlocks); qDebug("%s group:%" PRId64 ", read finish for new group coming, blocks:%d", pId, pSupp->groupId, numOfBlocks);
@ -405,7 +414,7 @@ static int32_t forecastNext(SOperatorInfo* pOperator, SSDataBlock** ppRes) {
pSupp->cachedRows = pBlock->info.rows; pSupp->cachedRows = pBlock->info.rows;
qDebug("%s group:%" PRId64 ", new group, rows:%" PRId64 ", total rows:%" PRId64, pId, pSupp->groupId, qDebug("%s group:%" PRId64 ", new group, rows:%" PRId64 ", total rows:%" PRId64, pId, pSupp->groupId,
pBlock->info.rows, pSupp->cachedRows); pBlock->info.rows, pSupp->cachedRows);
code = forecastCacheBlock(pSupp, pBlock); code = forecastCacheBlock(pSupp, pBlock, pId);
QUERY_CHECK_CODE(code, lino, _end); QUERY_CHECK_CODE(code, lino, _end);
} }

View File

@ -326,7 +326,7 @@ static int32_t sifInitParam(SNode *node, SIFParam *param, SIFCtx *ctx) {
indexError("invalid length for node:%p, length: %d", node, LIST_LENGTH(nl->pNodeList)); indexError("invalid length for node:%p, length: %d", node, LIST_LENGTH(nl->pNodeList));
SIF_ERR_RET(TSDB_CODE_QRY_INVALID_INPUT); SIF_ERR_RET(TSDB_CODE_QRY_INVALID_INPUT);
} }
SIF_ERR_RET(scalarGenerateSetFromList((void **)&param->pFilter, node, nl->node.resType.type)); SIF_ERR_RET(scalarGenerateSetFromList((void **)&param->pFilter, node, nl->node.resType.type, 0));
if (taosHashPut(ctx->pRes, &node, POINTER_BYTES, param, sizeof(*param))) { if (taosHashPut(ctx->pRes, &node, POINTER_BYTES, param, sizeof(*param))) {
taosHashCleanup(param->pFilter); taosHashCleanup(param->pFilter);
param->pFilter = NULL; param->pFilter = NULL;

View File

@ -116,7 +116,7 @@ static bool checkPassword(SAstCreateContext* pCxt, const SToken* pPasswordToken,
strncpy(pPassword, pPasswordToken->z, pPasswordToken->n); strncpy(pPassword, pPasswordToken->z, pPasswordToken->n);
(void)strdequote(pPassword); (void)strdequote(pPassword);
if (strtrim(pPassword) <= 0) { if (strtrim(pPassword) <= 0) {
pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_PASSWD_EMPTY); pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_PASSWD_TOO_SHORT_OR_EMPTY);
} else if (invalidPassword(pPassword)) { } else if (invalidPassword(pPassword)) {
pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_PASSWD); pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_PASSWD);
} }

View File

@ -101,10 +101,13 @@ int32_t insCreateSName(SName* pName, SToken* pTableName, int32_t acctId, const c
return buildInvalidOperationMsg(pMsgBuf, msg1); return buildInvalidOperationMsg(pMsgBuf, msg1);
} }
} else { // get current DB name first, and then set it into path } else { // get current DB name first, and then set it into path
if (pTableName->n >= TSDB_TABLE_NAME_LEN) { char tbname[TSDB_TABLE_FNAME_LEN] = {0};
strncpy(tbname, pTableName->z, pTableName->n);
int32_t tbLen = strdequote(tbname);
if (tbLen >= TSDB_TABLE_NAME_LEN) {
return buildInvalidOperationMsg(pMsgBuf, msg1); return buildInvalidOperationMsg(pMsgBuf, msg1);
} }
if (pTableName->n == 0) { if (tbLen == 0) {
return generateSyntaxErrMsg(pMsgBuf, TSDB_CODE_PAR_INVALID_IDENTIFIER_NAME, "invalid table name"); return generateSyntaxErrMsg(pMsgBuf, TSDB_CODE_PAR_INVALID_IDENTIFIER_NAME, "invalid table name");
} }

View File

@ -57,8 +57,8 @@ static char* getSyntaxErrFormat(int32_t errCode) {
return "Invalid tag name: %s"; return "Invalid tag name: %s";
case TSDB_CODE_PAR_NAME_OR_PASSWD_TOO_LONG: case TSDB_CODE_PAR_NAME_OR_PASSWD_TOO_LONG:
return "Name or password too long"; return "Name or password too long";
case TSDB_CODE_PAR_PASSWD_EMPTY: case TSDB_CODE_PAR_PASSWD_TOO_SHORT_OR_EMPTY:
return "Password can not be empty"; return "Password too short or empty";
case TSDB_CODE_PAR_INVALID_PORT: case TSDB_CODE_PAR_INVALID_PORT:
return "Port should be an integer that is less than 65535 and greater than 0"; return "Port should be an integer that is less than 65535 and greater than 0";
case TSDB_CODE_PAR_INVALID_ENDPOINT: case TSDB_CODE_PAR_INVALID_ENDPOINT:

View File

@ -143,7 +143,7 @@ int32_t sclConvertToTsValueNode(int8_t precision, SValueNode* valueNode);
#define GET_PARAM_PRECISON(_c) ((_c)->columnData->info.precision) #define GET_PARAM_PRECISON(_c) ((_c)->columnData->info.precision)
void sclFreeParam(SScalarParam* param); void sclFreeParam(SScalarParam* param);
int32_t doVectorCompare(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam *pOut, int32_t startIndex, int32_t numOfRows, int32_t doVectorCompare(SScalarParam* pLeft, SScalarParam *pLeftVar, SScalarParam* pRight, SScalarParam *pOut, int32_t startIndex, int32_t numOfRows,
int32_t _ord, int32_t optr); int32_t _ord, int32_t optr);
int32_t vectorCompareImpl(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam *pOut, int32_t startIndex, int32_t numOfRows, int32_t vectorCompareImpl(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam *pOut, int32_t startIndex, int32_t numOfRows,
int32_t _ord, int32_t optr); int32_t _ord, int32_t optr);

View File

@ -1298,7 +1298,6 @@ int32_t fltAddGroupUnitFromNode(void *pContext, SFilterInfo *info, SNode *tree,
if (node->opType == OP_TYPE_IN && (!IS_VAR_DATA_TYPE(type))) { if (node->opType == OP_TYPE_IN && (!IS_VAR_DATA_TYPE(type))) {
SNodeListNode *listNode = (SNodeListNode *)node->pRight; SNodeListNode *listNode = (SNodeListNode *)node->pRight;
SListCell *cell = listNode->pNodeList->pHead;
SScalarParam out = {.columnData = taosMemoryCalloc(1, sizeof(SColumnInfoData))}; SScalarParam out = {.columnData = taosMemoryCalloc(1, sizeof(SColumnInfoData))};
if (out.columnData == NULL) { if (out.columnData == NULL) {
@ -1308,8 +1307,9 @@ int32_t fltAddGroupUnitFromNode(void *pContext, SFilterInfo *info, SNode *tree,
out.columnData->info.bytes = tDataTypes[TSDB_DATA_TYPE_BIGINT].bytes; // reserved space for simple_copy out.columnData->info.bytes = tDataTypes[TSDB_DATA_TYPE_BIGINT].bytes; // reserved space for simple_copy
int32_t overflowCount = 0; int32_t overflowCount = 0;
for (int32_t i = 0; i < listNode->pNodeList->length; ++i) { SNode* nodeItem = NULL;
SValueNode *valueNode = (SValueNode *)cell->pNode; FOREACH(nodeItem, listNode->pNodeList) {
SValueNode *valueNode = (SValueNode *)nodeItem;
if (valueNode->node.resType.type != type) { if (valueNode->node.resType.type != type) {
int32_t overflow = 0; int32_t overflow = 0;
code = sclConvertValueToSclParam(valueNode, &out, &overflow); code = sclConvertValueToSclParam(valueNode, &out, &overflow);
@ -1319,7 +1319,6 @@ int32_t fltAddGroupUnitFromNode(void *pContext, SFilterInfo *info, SNode *tree,
} }
if (overflow) { if (overflow) {
cell = cell->pNext;
++overflowCount; ++overflowCount;
continue; continue;
} }
@ -1358,8 +1357,6 @@ int32_t fltAddGroupUnitFromNode(void *pContext, SFilterInfo *info, SNode *tree,
code = terrno; code = terrno;
break; break;
} }
cell = cell->pNext;
} }
if(overflowCount == listNode->pNodeList->length) { if(overflowCount == listNode->pNodeList->length) {
ctx->ignore = true; ctx->ignore = true;
@ -2228,7 +2225,7 @@ int32_t fltInitValFieldData(SFilterInfo *info) {
} }
if (unit->compare.optr == OP_TYPE_IN) { if (unit->compare.optr == OP_TYPE_IN) {
FLT_ERR_RET(scalarGenerateSetFromList((void **)&fi->data, fi->desc, type)); FLT_ERR_RET(scalarGenerateSetFromList((void **)&fi->data, fi->desc, type, 0));
if (fi->data == NULL) { if (fi->data == NULL) {
fltError("failed to convert in param"); fltError("failed to convert in param");
FLT_ERR_RET(TSDB_CODE_APP_ERROR); FLT_ERR_RET(TSDB_CODE_APP_ERROR);
@ -4765,7 +4762,7 @@ EDealRes fltReviseRewriter(SNode **pNode, void *pContext) {
return DEAL_RES_CONTINUE; return DEAL_RES_CONTINUE;
} }
if (node->opType == OP_TYPE_NOT_IN || node->opType == OP_TYPE_NOT_LIKE || node->opType > OP_TYPE_IS_NOT_NULL || if (node->opType == OP_TYPE_NOT_LIKE || node->opType > OP_TYPE_IS_NOT_NULL ||
node->opType == OP_TYPE_NOT_EQUAL) { node->opType == OP_TYPE_NOT_EQUAL) {
stat->scalarMode = true; stat->scalarMode = true;
return DEAL_RES_CONTINUE; return DEAL_RES_CONTINUE;
@ -4839,7 +4836,7 @@ EDealRes fltReviseRewriter(SNode **pNode, void *pContext) {
} }
} }
if (OP_TYPE_IN == node->opType && QUERY_NODE_NODE_LIST != nodeType(node->pRight)) { if ((OP_TYPE_IN == node->opType || OP_TYPE_NOT_IN == node->opType) && QUERY_NODE_NODE_LIST != nodeType(node->pRight)) {
fltError("invalid IN operator node, rightType:%d", nodeType(node->pRight)); fltError("invalid IN operator node, rightType:%d", nodeType(node->pRight));
stat->code = TSDB_CODE_APP_ERROR; stat->code = TSDB_CODE_APP_ERROR;
return DEAL_RES_ERROR; return DEAL_RES_ERROR;
@ -4847,25 +4844,37 @@ EDealRes fltReviseRewriter(SNode **pNode, void *pContext) {
SColumnNode *refNode = (SColumnNode *)node->pLeft; SColumnNode *refNode = (SColumnNode *)node->pLeft;
SExprNode *exprNode = NULL; SExprNode *exprNode = NULL;
if (OP_TYPE_IN != node->opType) { if (OP_TYPE_IN != node->opType && OP_TYPE_NOT_IN != node->opType) {
SValueNode *valueNode = (SValueNode *)node->pRight; SValueNode *valueNode = (SValueNode *)node->pRight;
if (FILTER_GET_FLAG(stat->info->options, FLT_OPTION_TIMESTAMP) && if (FILTER_GET_FLAG(stat->info->options, FLT_OPTION_TIMESTAMP) &&
TSDB_DATA_TYPE_UBIGINT == valueNode->node.resType.type && valueNode->datum.u <= INT64_MAX) { TSDB_DATA_TYPE_UBIGINT == valueNode->node.resType.type && valueNode->datum.u <= INT64_MAX) {
valueNode->node.resType.type = TSDB_DATA_TYPE_BIGINT; valueNode->node.resType.type = TSDB_DATA_TYPE_BIGINT;
} }
exprNode = &valueNode->node; exprNode = &valueNode->node;
} else {
SNodeListNode *listNode = (SNodeListNode *)node->pRight;
if (LIST_LENGTH(listNode->pNodeList) > 10) {
stat->scalarMode = true;
return DEAL_RES_CONTINUE;
}
exprNode = &listNode->node;
}
int32_t type = vectorGetConvertType(refNode->node.resType.type, exprNode->resType.type); int32_t type = vectorGetConvertType(refNode->node.resType.type, exprNode->resType.type);
if (0 != type && type != refNode->node.resType.type) { if (0 != type && type != refNode->node.resType.type) {
stat->scalarMode = true; stat->scalarMode = true;
return DEAL_RES_CONTINUE; }
} else {
SNodeListNode *listNode = (SNodeListNode *)node->pRight;
if (LIST_LENGTH(listNode->pNodeList) > 10 || OP_TYPE_NOT_IN == node->opType) {
stat->scalarMode = true;
}
int32_t type = refNode->node.resType.type;
exprNode = &listNode->node;
SNode* nodeItem = NULL;
FOREACH(nodeItem, listNode->pNodeList) {
SValueNode *valueNode = (SValueNode *)nodeItem;
int32_t tmp = vectorGetConvertType(type, valueNode->node.resType.type);
if (tmp != 0){
stat->scalarMode = true;
type = tmp;
}
}
if (IS_NUMERIC_TYPE(type)){
exprNode->resType.type = type;
}
} }
} }
@ -5016,11 +5025,11 @@ int32_t fltSclBuildRangePoints(SFltSclOperator *oper, SArray *points) {
} }
case OP_TYPE_IN: { case OP_TYPE_IN: {
SNodeListNode *listNode = (SNodeListNode *)oper->valNode; SNodeListNode *listNode = (SNodeListNode *)oper->valNode;
SListCell *cell = listNode->pNodeList->pHead;
SFltSclDatum minDatum = {.kind = FLT_SCL_DATUM_KIND_INT64, .i = INT64_MAX, .type = oper->colNode->node.resType}; SFltSclDatum minDatum = {.kind = FLT_SCL_DATUM_KIND_INT64, .i = INT64_MAX, .type = oper->colNode->node.resType};
SFltSclDatum maxDatum = {.kind = FLT_SCL_DATUM_KIND_INT64, .i = INT64_MIN, .type = oper->colNode->node.resType}; SFltSclDatum maxDatum = {.kind = FLT_SCL_DATUM_KIND_INT64, .i = INT64_MIN, .type = oper->colNode->node.resType};
for (int32_t i = 0; i < listNode->pNodeList->length; ++i) { SNode* nodeItem = NULL;
SValueNode *valueNode = (SValueNode *)cell->pNode; FOREACH(nodeItem, listNode->pNodeList) {
SValueNode *valueNode = (SValueNode *)nodeItem;
SFltSclDatum valDatum; SFltSclDatum valDatum;
FLT_ERR_RET(fltSclBuildDatumFromValueNode(&valDatum, valueNode)); FLT_ERR_RET(fltSclBuildDatumFromValueNode(&valDatum, valueNode));
if(valueNode->node.resType.type == TSDB_DATA_TYPE_FLOAT || valueNode->node.resType.type == TSDB_DATA_TYPE_DOUBLE) { if(valueNode->node.resType.type == TSDB_DATA_TYPE_FLOAT || valueNode->node.resType.type == TSDB_DATA_TYPE_DOUBLE) {
@ -5030,7 +5039,6 @@ int32_t fltSclBuildRangePoints(SFltSclOperator *oper, SArray *points) {
minDatum.i = TMIN(minDatum.i, valDatum.i); minDatum.i = TMIN(minDatum.i, valDatum.i);
maxDatum.i = TMAX(maxDatum.i, valDatum.i); maxDatum.i = TMAX(maxDatum.i, valDatum.i);
} }
cell = cell->pNext;
} }
SFltSclPoint startPt = {.start = true, .excl = false, .val = minDatum}; SFltSclPoint startPt = {.start = true, .excl = false, .val = minDatum};
SFltSclPoint endPt = {.start = false, .excl = false, .val = maxDatum}; SFltSclPoint endPt = {.start = false, .excl = false, .val = maxDatum};

View File

@ -116,7 +116,8 @@ _return:
SCL_RET(code); SCL_RET(code);
} }
int32_t scalarGenerateSetFromList(void **data, void *pNode, uint32_t type) { // processType = 0 means all type. 1 means number, 2 means var, 3 means float, 4 means var&integer
int32_t scalarGenerateSetFromList(void **data, void *pNode, uint32_t type, int8_t processType) {
SHashObj *pObj = taosHashInit(256, taosGetDefaultHashFunction(type), true, false); SHashObj *pObj = taosHashInit(256, taosGetDefaultHashFunction(type), true, false);
if (NULL == pObj) { if (NULL == pObj) {
sclError("taosHashInit failed, size:%d", 256); sclError("taosHashInit failed, size:%d", 256);
@ -127,7 +128,6 @@ int32_t scalarGenerateSetFromList(void **data, void *pNode, uint32_t type) {
int32_t code = 0; int32_t code = 0;
SNodeListNode *nodeList = (SNodeListNode *)pNode; SNodeListNode *nodeList = (SNodeListNode *)pNode;
SListCell *cell = nodeList->pNodeList->pHead;
SScalarParam out = {.columnData = taosMemoryCalloc(1, sizeof(SColumnInfoData))}; SScalarParam out = {.columnData = taosMemoryCalloc(1, sizeof(SColumnInfoData))};
if (out.columnData == NULL) { if (out.columnData == NULL) {
SCL_ERR_JRET(terrno); SCL_ERR_JRET(terrno);
@ -135,8 +135,14 @@ int32_t scalarGenerateSetFromList(void **data, void *pNode, uint32_t type) {
int32_t len = 0; int32_t len = 0;
void *buf = NULL; void *buf = NULL;
for (int32_t i = 0; i < nodeList->pNodeList->length; ++i) { SNode* nodeItem = NULL;
SValueNode *valueNode = (SValueNode *)cell->pNode; FOREACH(nodeItem, nodeList->pNodeList) {
SValueNode *valueNode = (SValueNode *)nodeItem;
if ((IS_VAR_DATA_TYPE(valueNode->node.resType.type) && (processType == 1 || processType == 3)) ||
(IS_INTEGER_TYPE(valueNode->node.resType.type) && (processType == 2 || processType == 3)) ||
(IS_FLOAT_TYPE(valueNode->node.resType.type) && (processType == 2 || processType == 4))) {
continue;
}
if (valueNode->node.resType.type != type) { if (valueNode->node.resType.type != type) {
out.columnData->info.type = type; out.columnData->info.type = type;
@ -158,7 +164,6 @@ int32_t scalarGenerateSetFromList(void **data, void *pNode, uint32_t type) {
} }
if (overflow) { if (overflow) {
cell = cell->pNext;
continue; continue;
} }
@ -184,7 +189,6 @@ int32_t scalarGenerateSetFromList(void **data, void *pNode, uint32_t type) {
} }
colInfoDataCleanup(out.columnData, out.numOfRows); colInfoDataCleanup(out.columnData, out.numOfRows);
cell = cell->pNext;
} }
*data = pObj; *data = pObj;
@ -230,6 +234,11 @@ void sclFreeParam(SScalarParam *param) {
taosHashCleanup(param->pHashFilter); taosHashCleanup(param->pHashFilter);
param->pHashFilter = NULL; param->pHashFilter = NULL;
} }
if (param->pHashFilterOthers != NULL) {
taosHashCleanup(param->pHashFilterOthers);
param->pHashFilterOthers = NULL;
}
} }
int32_t sclCopyValueNodeValue(SValueNode *pNode, void **res) { int32_t sclCopyValueNodeValue(SValueNode *pNode, void **res) {
@ -369,17 +378,37 @@ int32_t sclInitParam(SNode *node, SScalarParam *param, SScalarCtx *ctx, int32_t
SCL_RET(TSDB_CODE_QRY_INVALID_INPUT); SCL_RET(TSDB_CODE_QRY_INVALID_INPUT);
} }
int32_t type = vectorGetConvertType(ctx->type.selfType, ctx->type.peerType); int32_t type = ctx->type.selfType;
if (type == 0) { SNode* nodeItem = NULL;
type = nodeList->node.resType.type; FOREACH(nodeItem, nodeList->pNodeList) {
SValueNode *valueNode = (SValueNode *)nodeItem;
int32_t tmp = vectorGetConvertType(type, valueNode->node.resType.type);
if (tmp != 0){
type = tmp;
}
}
if (IS_NUMERIC_TYPE(type)){
ctx->type.peerType = type;
}
type = ctx->type.peerType;
if (IS_VAR_DATA_TYPE(ctx->type.selfType) && IS_NUMERIC_TYPE(type)){
SCL_ERR_RET(scalarGenerateSetFromList((void **)&param->pHashFilter, node, type, 1));
SCL_ERR_RET(scalarGenerateSetFromList((void **)&param->pHashFilterOthers, node, ctx->type.selfType, 2));
} else if (IS_INTEGER_TYPE(ctx->type.selfType) && IS_FLOAT_TYPE(type)){
SCL_ERR_RET(scalarGenerateSetFromList((void **)&param->pHashFilter, node, type, 3));
SCL_ERR_RET(scalarGenerateSetFromList((void **)&param->pHashFilterOthers, node, ctx->type.selfType, 4));
} else {
SCL_ERR_RET(scalarGenerateSetFromList((void **)&param->pHashFilter, node, type, 0));
} }
SCL_ERR_RET(scalarGenerateSetFromList((void **)&param->pHashFilter, node, type));
param->hashValueType = type; param->hashValueType = type;
param->colAlloced = true; param->colAlloced = true;
if (taosHashPut(ctx->pRes, &node, POINTER_BYTES, param, sizeof(*param))) { if (taosHashPut(ctx->pRes, &node, POINTER_BYTES, param, sizeof(*param))) {
taosHashCleanup(param->pHashFilter); taosHashCleanup(param->pHashFilter);
param->pHashFilter = NULL; param->pHashFilter = NULL;
taosHashCleanup(param->pHashFilterOthers);
param->pHashFilterOthers = NULL;
sclError("taosHashPut nodeList failed, size:%d", (int32_t)sizeof(*param)); sclError("taosHashPut nodeList failed, size:%d", (int32_t)sizeof(*param));
return terrno; return terrno;
} }
@ -512,14 +541,15 @@ int32_t sclInitParamList(SScalarParam **pParams, SNodeList *pParamList, SScalarC
} }
if (0 == *rowNum) { if (0 == *rowNum) {
taosMemoryFreeClear(paramList); sclFreeParamList(paramList, *paramNum);
paramList = NULL;
} }
*pParams = paramList; *pParams = paramList;
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
_return: _return:
taosMemoryFreeClear(paramList); sclFreeParamList(paramList, *paramNum);
SCL_RET(code); SCL_RET(code);
} }
@ -588,7 +618,6 @@ int32_t sclInitOperatorParams(SScalarParam **pParams, SOperatorNode *node, SScal
SCL_ERR_JRET(sclInitParam(node->pLeft, &paramList[0], ctx, rowNum)); SCL_ERR_JRET(sclInitParam(node->pLeft, &paramList[0], ctx, rowNum));
setTzCharset(&paramList[0], node->tz, node->charsetCxt); setTzCharset(&paramList[0], node->tz, node->charsetCxt);
if (paramNum > 1) { if (paramNum > 1) {
TSWAP(ctx->type.selfType, ctx->type.peerType);
SCL_ERR_JRET(sclInitParam(node->pRight, &paramList[1], ctx, rowNum)); SCL_ERR_JRET(sclInitParam(node->pRight, &paramList[1], ctx, rowNum));
setTzCharset(&paramList[1], node->tz, node->charsetCxt); setTzCharset(&paramList[1], node->tz, node->charsetCxt);
} }

View File

@ -1009,14 +1009,14 @@ int32_t vectorConvertSingleColImpl(const SScalarParam *pIn, SScalarParam *pOut,
} }
int8_t gConvertTypes[TSDB_DATA_TYPE_MAX][TSDB_DATA_TYPE_MAX] = { int8_t gConvertTypes[TSDB_DATA_TYPE_MAX][TSDB_DATA_TYPE_MAX] = {
/* NULL BOOL TINY SMAL INT BIG FLOA DOUB VARC TIME NCHA UTIN USMA UINT UBIG JSON VARB DECI BLOB MEDB GEOM*/ /*NULL BOOL TINY SMAL INT BIG FLOA DOUB VARC TIME NCHA UTIN USMA UINT UBIG JSON VARB DECI BLOB MEDB GEOM*/
/*NULL*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*NULL*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/*BOOL*/ 0, 0, 2, 3, 4, 5, 6, 7, 5, 9, 7, 11, 12, 13, 14, 0, -1, 0, 0, 0, -1, /*BOOL*/ 0, 0, 2, 3, 4, 5, 6, 7, 5, 9, 5, 11, 12, 13, 14, 0, -1, 0, 0, 0, -1,
/*TINY*/ 0, 0, 0, 3, 4, 5, 6, 7, 5, 9, 7, 3, 4, 5, 7, 0, -1, 0, 0, 0, -1, /*TINY*/ 0, 0, 0, 3, 4, 5, 6, 7, 5, 9, 5, 3, 4, 5, 7, 0, -1, 0, 0, 0, -1,
/*SMAL*/ 0, 0, 0, 0, 4, 5, 6, 7, 5, 9, 7, 3, 4, 5, 7, 0, -1, 0, 0, 0, -1, /*SMAL*/ 0, 0, 0, 0, 4, 5, 6, 7, 5, 9, 5, 3, 4, 5, 7, 0, -1, 0, 0, 0, -1,
/*INT */ 0, 0, 0, 0, 0, 5, 6, 7, 5, 9, 7, 4, 4, 5, 7, 0, -1, 0, 0, 0, -1, /*INT */ 0, 0, 0, 0, 0, 5, 6, 7, 5, 9, 5, 4, 4, 5, 7, 0, -1, 0, 0, 0, -1,
/*BIGI*/ 0, 0, 0, 0, 0, 0, 6, 7, 5, 9, 7, 5, 5, 5, 7, 0, -1, 0, 0, 0, -1, /*BIGI*/ 0, 0, 0, 0, 0, 0, 6, 7, 5, 9, 5, 5, 5, 5, 7, 0, -1, 0, 0, 0, -1,
/*FLOA*/ 0, 0, 0, 0, 0, 0, 0, 7, 7, 6, 7, 6, 6, 6, 6, 0, -1, 0, 0, 0, -1, /*FLOA*/ 0, 0, 0, 0, 0, 0, 0, 7, 6, 6, 6, 6, 6, 6, 6, 0, -1, 0, 0, 0, -1,
/*DOUB*/ 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 0, -1, 0, 0, 0, -1, /*DOUB*/ 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 0, -1, 0, 0, 0, -1,
/*VARC*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 8, 7, 7, 7, 7, 0, 16, 0, 0, 0, 20, /*VARC*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 8, 7, 7, 7, 7, 0, 16, 0, 0, 0, 20,
/*TIME*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 7, 0, -1, 0, 0, 0, -1, /*TIME*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 7, 0, -1, 0, 0, 0, -1,
@ -1026,11 +1026,12 @@ int8_t gConvertTypes[TSDB_DATA_TYPE_MAX][TSDB_DATA_TYPE_MAX] = {
/*UINT*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, -1, 0, 0, 0, -1, /*UINT*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, -1, 0, 0, 0, -1,
/*UBIG*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, /*UBIG*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1,
/*JSON*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, /*JSON*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1,
/*VARB*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1,-1, -1, /*VARB*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1,
/*DECI*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, /*DECI*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1,
/*BLOB*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, /*BLOB*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1,
/*MEDB*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, /*MEDB*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1,
/*GEOM*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0}; /*GEOM*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0
};
int8_t gDisplyTypes[TSDB_DATA_TYPE_MAX][TSDB_DATA_TYPE_MAX] = { int8_t gDisplyTypes[TSDB_DATA_TYPE_MAX][TSDB_DATA_TYPE_MAX] = {
/*NULL BOOL TINY SMAL INT BIGI FLOA DOUB VARC TIM NCHA UTIN USMA UINT UBIG JSON VARB DECI BLOB MEDB GEOM*/ /*NULL BOOL TINY SMAL INT BIGI FLOA DOUB VARC TIM NCHA UTIN USMA UINT UBIG JSON VARB DECI BLOB MEDB GEOM*/
@ -1071,6 +1072,9 @@ int32_t vectorGetConvertType(int32_t type1, int32_t type2) {
int32_t vectorConvertSingleCol(SScalarParam *input, SScalarParam *output, int32_t type, int32_t startIndex, int32_t vectorConvertSingleCol(SScalarParam *input, SScalarParam *output, int32_t type, int32_t startIndex,
int32_t numOfRows) { int32_t numOfRows) {
if (input->columnData == NULL && (input->pHashFilter != NULL || input->pHashFilterOthers != NULL)){
return TSDB_CODE_SUCCESS;
}
output->numOfRows = input->numOfRows; output->numOfRows = input->numOfRows;
SDataType t = {.type = type}; SDataType t = {.type = type};
@ -1101,36 +1105,18 @@ int32_t vectorConvertCols(SScalarParam *pLeft, SScalarParam *pRight, SScalarPara
int8_t type = 0; int8_t type = 0;
int32_t code = 0; int32_t code = 0;
SScalarParam *param1 = NULL, *paramOut1 = NULL; SScalarParam *param1 = pLeft, *paramOut1 = pLeftOut;
SScalarParam *param2 = NULL, *paramOut2 = NULL; SScalarParam *param2 = pRight, *paramOut2 = pRightOut;
// always convert least data // always convert least data
if (IS_VAR_DATA_TYPE(leftType) && IS_VAR_DATA_TYPE(rightType) && (pLeft->numOfRows != pRight->numOfRows) && if (IS_VAR_DATA_TYPE(leftType) && IS_VAR_DATA_TYPE(rightType) && (pLeft->numOfRows != pRight->numOfRows) &&
leftType != TSDB_DATA_TYPE_JSON && rightType != TSDB_DATA_TYPE_JSON) { leftType != TSDB_DATA_TYPE_JSON && rightType != TSDB_DATA_TYPE_JSON) {
param1 = pLeft;
param2 = pRight;
paramOut1 = pLeftOut;
paramOut2 = pRightOut;
if (pLeft->numOfRows > pRight->numOfRows) { if (pLeft->numOfRows > pRight->numOfRows) {
type = leftType; type = leftType;
} else { } else {
type = rightType; type = rightType;
} }
} else { } else {
// we only define half value in the convert-matrix, so make sure param1 always less equal than param2
if (leftType < rightType) {
param1 = pLeft;
param2 = pRight;
paramOut1 = pLeftOut;
paramOut2 = pRightOut;
} else {
param1 = pRight;
param2 = pLeft;
paramOut1 = pRightOut;
paramOut2 = pLeftOut;
}
type = vectorGetConvertType(GET_PARAM_TYPE(param1), GET_PARAM_TYPE(param2)); type = vectorGetConvertType(GET_PARAM_TYPE(param1), GET_PARAM_TYPE(param2));
if (0 == type) { if (0 == type) {
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
@ -1986,13 +1972,14 @@ int32_t doVectorCompareImpl(SScalarParam *pLeft, SScalarParam *pRight, SScalarPa
return code; return code;
} }
int32_t doVectorCompare(SScalarParam *pLeft, SScalarParam *pRight, SScalarParam *pOut, int32_t startIndex, int32_t doVectorCompare(SScalarParam *pLeft, SScalarParam *pLeftVar, SScalarParam *pRight, SScalarParam *pOut, int32_t startIndex,
int32_t numOfRows, int32_t _ord, int32_t optr) { int32_t numOfRows, int32_t _ord, int32_t optr) {
int32_t i = 0; int32_t i = 0;
int32_t step = ((_ord) == TSDB_ORDER_ASC) ? 1 : -1; int32_t step = ((_ord) == TSDB_ORDER_ASC) ? 1 : -1;
int32_t lType = GET_PARAM_TYPE(pLeft); int32_t lType = GET_PARAM_TYPE(pLeft);
int32_t rType = GET_PARAM_TYPE(pRight); int32_t rType = GET_PARAM_TYPE(pRight);
__compar_fn_t fp = NULL; __compar_fn_t fp = NULL;
__compar_fn_t fpVar = NULL;
int32_t compRows = 0; int32_t compRows = 0;
if (lType == rType) { if (lType == rType) {
SCL_ERR_RET(filterGetCompFunc(&fp, lType, optr)); SCL_ERR_RET(filterGetCompFunc(&fp, lType, optr));
@ -2000,6 +1987,9 @@ int32_t doVectorCompare(SScalarParam *pLeft, SScalarParam *pRight, SScalarParam
fp = filterGetCompFuncEx(lType, rType, optr); fp = filterGetCompFuncEx(lType, rType, optr);
} }
if (pLeftVar != NULL) {
SCL_ERR_RET(filterGetCompFunc(&fpVar, GET_PARAM_TYPE(pLeftVar), optr));
}
if (startIndex < 0) { if (startIndex < 0) {
i = ((_ord) == TSDB_ORDER_ASC) ? 0 : TMAX(pLeft->numOfRows, pRight->numOfRows) - 1; i = ((_ord) == TSDB_ORDER_ASC) ? 0 : TMAX(pLeft->numOfRows, pRight->numOfRows) - 1;
pOut->numOfRows = TMAX(pLeft->numOfRows, pRight->numOfRows); pOut->numOfRows = TMAX(pLeft->numOfRows, pRight->numOfRows);
@ -2019,6 +2009,18 @@ int32_t doVectorCompare(SScalarParam *pLeft, SScalarParam *pRight, SScalarParam
char *pLeftData = colDataGetData(pLeft->columnData, i); char *pLeftData = colDataGetData(pLeft->columnData, i);
bool res = filterDoCompare(fp, optr, pLeftData, pRight->pHashFilter); bool res = filterDoCompare(fp, optr, pLeftData, pRight->pHashFilter);
if (pLeftVar != NULL && taosHashGetSize(pRight->pHashFilterOthers) > 0){
do{
if (optr == OP_TYPE_IN && res){
break;
}
if (optr == OP_TYPE_NOT_IN && !res){
break;
}
pLeftData = colDataGetData(pLeftVar->columnData, i);
res = filterDoCompare(fpVar, optr, pLeftData, pRight->pHashFilterOthers);
}while(0);
}
colDataSetInt8(pOut->columnData, i, (int8_t *)&res); colDataSetInt8(pOut->columnData, i, (int8_t *)&res);
if (res) { if (res) {
pOut->numOfQualified++; pOut->numOfQualified++;
@ -2036,6 +2038,7 @@ int32_t vectorCompareImpl(SScalarParam *pLeft, SScalarParam *pRight, SScalarPara
SScalarParam pRightOut = {0}; SScalarParam pRightOut = {0};
SScalarParam *param1 = NULL; SScalarParam *param1 = NULL;
SScalarParam *param2 = NULL; SScalarParam *param2 = NULL;
SScalarParam *param3 = NULL;
int32_t code = TSDB_CODE_SUCCESS; int32_t code = TSDB_CODE_SUCCESS;
setTzCharset(&pLeftOut, pLeft->tz, pLeft->charsetCxt); setTzCharset(&pLeftOut, pLeft->tz, pLeft->charsetCxt);
setTzCharset(&pRightOut, pLeft->tz, pLeft->charsetCxt); setTzCharset(&pRightOut, pLeft->tz, pLeft->charsetCxt);
@ -2046,9 +2049,12 @@ int32_t vectorCompareImpl(SScalarParam *pLeft, SScalarParam *pRight, SScalarPara
SCL_ERR_JRET(vectorConvertCols(pLeft, pRight, &pLeftOut, &pRightOut, startIndex, numOfRows)); SCL_ERR_JRET(vectorConvertCols(pLeft, pRight, &pLeftOut, &pRightOut, startIndex, numOfRows));
param1 = (pLeftOut.columnData != NULL) ? &pLeftOut : pLeft; param1 = (pLeftOut.columnData != NULL) ? &pLeftOut : pLeft;
param2 = (pRightOut.columnData != NULL) ? &pRightOut : pRight; param2 = (pRightOut.columnData != NULL) ? &pRightOut : pRight;
if (pRight->pHashFilterOthers != NULL){
param3 = pLeft;
}
} }
SCL_ERR_JRET(doVectorCompare(param1, param2, pOut, startIndex, numOfRows, _ord, optr)); SCL_ERR_JRET(doVectorCompare(param1, param3, param2, pOut, startIndex, numOfRows, _ord, optr));
_return: _return:
sclFreeParam(&pLeftOut); sclFreeParam(&pLeftOut);

View File

@ -2106,7 +2106,7 @@ TEST(columnTest, int_column_in_double_list) {
SNode *pLeft = NULL, *pRight = NULL, *listNode = NULL, *opNode = NULL; SNode *pLeft = NULL, *pRight = NULL, *listNode = NULL, *opNode = NULL;
int32_t leftv[5] = {1, 2, 3, 4, 5}; int32_t leftv[5] = {1, 2, 3, 4, 5};
double rightv1 = 1.1, rightv2 = 2.2, rightv3 = 3.3; double rightv1 = 1.1, rightv2 = 2.2, rightv3 = 3.3;
bool eRes[5] = {true, true, true, false, false}; bool eRes[5] = {false, false, false, false, false};
SSDataBlock *src = NULL; SSDataBlock *src = NULL;
int32_t rowNum = sizeof(leftv) / sizeof(leftv[0]); int32_t rowNum = sizeof(leftv) / sizeof(leftv[0]);
int32_t code = TSDB_CODE_SUCCESS; int32_t code = TSDB_CODE_SUCCESS;

View File

@ -648,7 +648,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_PAR_NOT_SINGLE_GROUP, "Not a single-group g
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_TAGS_NOT_MATCHED, "Tags number not matched") TAOS_DEFINE_ERROR(TSDB_CODE_PAR_TAGS_NOT_MATCHED, "Tags number not matched")
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_TAG_NAME, "Invalid tag name") TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_TAG_NAME, "Invalid tag name")
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_NAME_OR_PASSWD_TOO_LONG, "Name or password too long") TAOS_DEFINE_ERROR(TSDB_CODE_PAR_NAME_OR_PASSWD_TOO_LONG, "Name or password too long")
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_PASSWD_EMPTY, "Password can not be empty") TAOS_DEFINE_ERROR(TSDB_CODE_PAR_PASSWD_TOO_SHORT_OR_EMPTY, "Password too short or empty")
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_PORT, "Port should be an integer that is less than 65535 and greater than 0") TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_PORT, "Port should be an integer that is less than 65535 and greater than 0")
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_ENDPOINT, "Endpoint should be in the format of 'fqdn:port'") TAOS_DEFINE_ERROR(TSDB_CODE_PAR_INVALID_ENDPOINT, "Endpoint should be in the format of 'fqdn:port'")
TAOS_DEFINE_ERROR(TSDB_CODE_PAR_EXPRIE_STATEMENT, "This statement is no longer supported") TAOS_DEFINE_ERROR(TSDB_CODE_PAR_EXPRIE_STATEMENT, "This statement is no longer supported")

View File

@ -463,7 +463,7 @@ TSDB_CODE_PAR_NOT_SINGLE_GROUP = 0x8000260C
TSDB_CODE_PAR_TAGS_NOT_MATCHED = 0x8000260D TSDB_CODE_PAR_TAGS_NOT_MATCHED = 0x8000260D
TSDB_CODE_PAR_INVALID_TAG_NAME = 0x8000260E TSDB_CODE_PAR_INVALID_TAG_NAME = 0x8000260E
TSDB_CODE_PAR_NAME_OR_PASSWD_TOO_LONG = 0x80002610 TSDB_CODE_PAR_NAME_OR_PASSWD_TOO_LONG = 0x80002610
TSDB_CODE_PAR_PASSWD_EMPTY = 0x80002611 TSDB_CODE_PAR_PASSWD_TOO_SHORT_OR_EMPTY = 0x80002611
TSDB_CODE_PAR_INVALID_PORT = 0x80002612 TSDB_CODE_PAR_INVALID_PORT = 0x80002612
TSDB_CODE_PAR_INVALID_ENDPOINT = 0x80002613 TSDB_CODE_PAR_INVALID_ENDPOINT = 0x80002613
TSDB_CODE_PAR_EXPRIE_STATEMENT = 0x80002614 TSDB_CODE_PAR_EXPRIE_STATEMENT = 0x80002614

View File

@ -218,6 +218,8 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/slimit.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/slimit.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/slimit.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/slimit.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/slimit.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/slimit.py -Q 4
,,n,system-test,./pytest.sh python3 ./test.py -f 2-query/ts-5761.py
,,n,system-test,./pytest.sh python3 ./test.py -f 2-query/ts-5761-scalemode.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ts-5712.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ts-5712.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ts-4233.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ts-4233.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ts-4233.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ts-4233.py -Q 2

View File

@ -5,9 +5,9 @@
#include <unistd.h> #include <unistd.h>
#include "taos.h" #include "taos.h"
int CTB_NUMS = 1000; int CTB_NUMS = 2;
int ROW_NUMS = 10; int ROW_NUMS = 2;
int CYC_NUMS = 5; int CYC_NUMS = 2;
void do_query(TAOS* taos, const char* sql) { void do_query(TAOS* taos, const char* sql) {
TAOS_RES* result = taos_query(taos, sql); TAOS_RES* result = taos_query(taos, sql);
@ -57,7 +57,7 @@ void do_stmt(TAOS* taos, const char* sql) {
return; return;
} }
int fieldNum = 0; int fieldNum = 0;
TAOS_FIELD_STB* pFields = NULL; TAOS_FIELD_ALL* pFields = NULL;
// code = taos_stmt2_get_stb_fields(stmt, &fieldNum, &pFields); // code = taos_stmt2_get_stb_fields(stmt, &fieldNum, &pFields);
// if (code != 0) { // if (code != 0) {
// printf("failed get col,ErrCode: 0x%x, ErrMessage: %s.\n", code, taos_stmt2_error(stmt)); // printf("failed get col,ErrCode: 0x%x, ErrMessage: %s.\n", code, taos_stmt2_error(stmt));
@ -74,7 +74,7 @@ void do_stmt(TAOS* taos, const char* sql) {
for (int i = 0; i < CTB_NUMS; i++) { for (int i = 0; i < CTB_NUMS; i++) {
tbs[i] = (char*)malloc(sizeof(char) * 20); tbs[i] = (char*)malloc(sizeof(char) * 20);
sprintf(tbs[i], "ctb_%d", i); sprintf(tbs[i], "ctb_%d", i);
createCtb(taos, tbs[i]); // createCtb(taos, tbs[i]);
} }
for (int r = 0; r < CYC_NUMS; r++) { for (int r = 0; r < CYC_NUMS; r++) {
// col params // col params
@ -138,7 +138,24 @@ void do_stmt(TAOS* taos, const char* sql) {
end = clock(); end = clock();
cpu_time_used = ((double)(end - start)) / CLOCKS_PER_SEC; cpu_time_used = ((double)(end - start)) / CLOCKS_PER_SEC;
printf("stmt2-exec [%s] insert Time used: %f seconds\n", sql, cpu_time_used); printf("stmt2-exec [%s] insert Time used: %f seconds\n", sql, cpu_time_used);
for (int i = 0; i < CTB_NUMS; i++) {
free(tags[i]);
free(paramv[i]);
free(ts[i]);
free(b[i]);
} }
free(ts);
free(b);
free(ts_len);
free(b_len);
free(paramv);
free(tags);
}
for (int i = 0; i < CTB_NUMS; i++) {
free(tbs[i]);
}
free(tbs);
// taos_stmt2_free_fields(stmt, pFields); // taos_stmt2_free_fields(stmt, pFields);
taos_stmt2_close(stmt); taos_stmt2_close(stmt);
@ -200,10 +217,9 @@ int main() {
exit(1); exit(1);
} }
sleep(3);
do_stmt(taos, "insert into db.stb(tbname,ts,b,t1,t2) values(?,?,?,?,?)"); do_stmt(taos, "insert into db.stb(tbname,ts,b,t1,t2) values(?,?,?,?,?)");
// do_stmt(taos, "insert into db.? using db.stb tags(?,?)values(?,?)"); // do_stmt(taos, "insert into db.? using db.stb tags(?,?)values(?,?)");
do_taosc(taos); // do_taosc(taos);
taos_close(taos); taos_close(taos);
taos_cleanup(); taos_cleanup();
} }

View File

@ -44,7 +44,7 @@ if $data20 != @ Time Range: [-9223372036854775808, 9223372036854775807]@ th
endi endi
sql select * from tb1 where fbool in (0, 3); sql select * from tb1 where fbool in (0, 3);
if $rows != 5 then if $rows != 3 then
return -1 return -1
endi endi
@ -69,7 +69,7 @@ if $rows != 10 then
endi endi
sql select * from st1 where tbool in (0, 3); sql select * from st1 where tbool in (0, 3);
if $rows != 15 then if $rows != 5 then
return -1 return -1
endi endi

View File

@ -271,5 +271,16 @@ sql create user u25 pass 'taosdata1~'
sql create user u26 pass 'taosdata1,' sql create user u26 pass 'taosdata1,'
sql create user u27 pass 'taosdata1.' sql create user u27 pass 'taosdata1.'
return sql CREATE USER `_xTest1` PASS '2729c41a99b2c5222aa7dd9fc1ce3de7' SYSINFO 1 CREATEDB 0 IS_IMPORT 1 HOST '127.0.0.1';
sql_error CREATE USER `_xTest2` PASS '2729c41a99b2c5222aa7dd9fc1ce3de7' SYSINFO 1 CREATEDB 0 IS_IMPORT 0 HOST '127.0.0.1';
sql CREATE USER `_xTest3` PASS '2729c41' SYSINFO 1 CREATEDB 0 IS_IMPORT 1 HOST '127.0.0.1';
sql_error CREATE USER `_xTest4` PASS '2729c417' SYSINFO 1 CREATEDB 0 IS_IMPORT 0 HOST '127.0.0.1';
sql CREATE USER `_xTest5` PASS '2xF' SYSINFO 1 CREATEDB 0 IS_IMPORT 1 HOST '127.0.0.1';
sql_error CREATE USER `_xTest6` PASS '2xF' SYSINFO 1 CREATEDB 0 IS_IMPORT 0 HOST '127.0.0.1';
sql_error alter USER `_xTest1` PASS '2729c41a99b2c5222aa7dd9fc1ce3de7';
sql_error alter USER `_xTest1` PASS '2729c417';
sql_error alter USER `_xTest1` PASS '2xF';
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT

View File

@ -106,8 +106,8 @@ class TDTestCase:
my_file = Path(f"{packagePath}/{packageName}") my_file = Path(f"{packagePath}/{packageName}")
if not my_file.exists(): if not my_file.exists():
print(f"{packageName} is not exists") print(f"{packageName} is not exists")
tdLog.info(f"cd {packagePath} && wget https://www.tdengine.com/assets-download/3.0/{packageName}") tdLog.info(f"cd {packagePath} && wget https://www.taosdata.com/assets-download/3.0/{packageName}")
os.system(f"cd {packagePath} && wget https://www.tdengine.com/assets-download/3.0/{packageName}") os.system(f"cd {packagePath} && wget https://www.taosdata.com/assets-download/3.0/{packageName}")
else: else:
print(f"{packageName} has been exists") print(f"{packageName} has been exists")
os.system(f" cd {packagePath} && tar xvf {packageName} && cd {packageTPath} && ./install.sh -e no " ) os.system(f" cd {packagePath} && tar xvf {packageName} && cd {packageTPath} && ./install.sh -e no " )

View File

@ -130,6 +130,8 @@ class TDTestCase:
tdSql.error(f'create user {username} pass "test123@#$"') tdSql.error(f'create user {username} pass "test123@#$"')
if "Name or password too long" in tdSql.error_info: if "Name or password too long" in tdSql.error_info:
tdLog.info("error info is true!") tdLog.info("error info is true!")
elif "Password too short or empty" in tdSql.error_info:
tdLog.info("error info is true!")
else: else:
tdLog.exit("error info is not true") tdLog.exit("error info is not true")
@ -146,6 +148,10 @@ class TDTestCase:
tdSql.error(f'create user {username} pass "{password}@1"') tdSql.error(f'create user {username} pass "{password}@1"')
if "Invalid password format" in tdSql.error_info: if "Invalid password format" in tdSql.error_info:
tdLog.info("error info is true!") tdLog.info("error info is true!")
elif "Name or password too long" in tdSql.error_info:
tdLog.info("error info is true!")
elif "Password too short or empty" in tdSql.error_info:
tdLog.info("error info is true!")
else: else:
tdLog.exit("error info is not true") tdLog.exit("error info is not true")
def sql_length_check(self): def sql_length_check(self):

View File

@ -0,0 +1,150 @@
import taos
from util.log import *
from util.sql import *
from util.cases import *
from util.dnodes import *
from util.common import *
class TDTestCase:
updatecfgDict = {'filterScalarMode':1}
def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), True)
self.dbname = 'db'
self.stbname = 'st'
def prepareData(self):
# db
tdSql.execute(f"create database db;")
tdSql.execute(f"use db")
# super tableUNSIGNED
tdSql.execute("CREATE TABLE st( time TIMESTAMP, c1 BIGINT, c2 smallint, c3 double, c4 int UNSIGNED, c5 bool, c6 binary(32), c7 nchar(32)) tags(t1 binary(32), t2 nchar(32))")
tdSql.execute("create table t1 using st tags('1', '1.7')")
tdSql.execute("create table t2 using st tags('0', '')")
tdSql.execute("create table t3 using st tags('1', 'er')")
# create index for all tags
tdSql.execute("INSERT INTO t1 VALUES (1641024000000, 1, 1, 1, 1, 1, '1', '1.7')")
tdSql.execute("INSERT INTO t1 VALUES (1641024000001, 0, 0, 1.7, 0, 0, '0', '')")
tdSql.execute("INSERT INTO t1 VALUES (1641024000002, 1, 1, 1, 1, 1, '1', 'er')")
tdSql.execute("INSERT INTO t2 VALUES (1641024000002, 1, 1, 1, 1, 1, '1', 'er')")
tdSql.execute("INSERT INTO t3 VALUES (1641024000002, 1, 1, 1, 1, 1, '1', 'er')")
tdSql.execute("CREATE TABLE stt( time TIMESTAMP, c1 BIGINT, c2 timestamp, c3 int, c4 int UNSIGNED, c5 bool, c6 binary(32), c7 nchar(32)) tags(t1 binary(32), t2 nchar(32))")
tdSql.execute("create table tt1 using stt tags('1', '1.7')")
# create index for all tags
tdSql.execute("INSERT INTO tt1 VALUES (1641024000000, 9223372036854775807, 1641024000000, 1, 1, 1, '1', '1.7')")
def check(self):
tdSql.query(f"SELECT * FROM tt1 WHERE c1 in (1.7, 9223372036854775803, '')")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM tt1 WHERE c1 = 9223372036854775803")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM t1 WHERE c1 = 1.7")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM t1 WHERE c1 in (1.7, 2)")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM t1 WHERE c1 not in (1.7, 2)")
tdSql.checkRows(3)
tdSql.query(f"SELECT * FROM t1 WHERE c2 = 1.7")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM t1 WHERE c2 in (1.7, 2)")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM t1 WHERE c2 not in (1.7, 2)")
tdSql.checkRows(3)
tdSql.query(f"SELECT * FROM t1 WHERE c3 = 1.7")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM t1 WHERE c3 in (1.7, 2)")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM t1 WHERE c3 not in (1.7, 2)")
tdSql.checkRows(2)
tdSql.query(f"SELECT * FROM t1 WHERE c4 = 1.7")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM t1 WHERE c4 in (1.7, 2)")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM t1 WHERE c4 not in (1.7, 2)")
tdSql.checkRows(3)
tdSql.query(f"SELECT * FROM t1 WHERE c5 = 1.7")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM t1 WHERE c5 in (1.7, 2)")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM t1 WHERE c5 not in (1.7, 2)")
tdSql.checkRows(3)
tdSql.query(f"SELECT * FROM t1 WHERE c6 = 1.7")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM t1 WHERE c6 in (1.7, 2)")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM t1 WHERE c6 not in (1.7, 2)")
tdSql.checkRows(3)
tdSql.query(f"SELECT * FROM t1 WHERE c6 = 1")
tdSql.checkRows(2)
tdSql.query(f"SELECT * FROM t1 WHERE c6 in (1, 2)")
tdSql.checkRows(2)
tdSql.query(f"SELECT * FROM t1 WHERE c6 not in (1, 2)")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM t1 WHERE c6 = 0")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM t1 WHERE c6 in (0, 2)")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM t1 WHERE c6 not in (0, 2)")
tdSql.checkRows(2)
tdSql.query(f"SELECT * FROM t1 WHERE c6 not in (0, 2, 'sef')")
tdSql.checkRows(2)
tdSql.query(f"SELECT * FROM t1 WHERE c7 = 1.7")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM t1 WHERE c7 in (1.7, 2)")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM t1 WHERE c7 not in (1.7, 2)")
tdSql.checkRows(2)
tdSql.query(f"SELECT * FROM t1 WHERE c7 = 0")
tdSql.checkRows(2)
tdSql.query(f"SELECT * FROM t1 WHERE c7 in (0, 2)")
tdSql.checkRows(2)
tdSql.query(f"SELECT * FROM t1 WHERE c7 not in (0, 2)")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM t1 WHERE c7 = ''")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM t1 WHERE c7 in ('', 2)")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM t1 WHERE c7 not in ('', 2)")
tdSql.checkRows(2)
tdSql.query(f"SELECT * FROM st WHERE t2 in ('', 2)")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM st WHERE t2 not in ('', 2)")
tdSql.checkRows(4)
tdSql.query(f"SELECT * FROM st WHERE t1 in ('d343', 0, 2)")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM st WHERE t1 in (0, 2)")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM st WHERE t1 not in (0, 2)")
tdSql.checkRows(4)
def run(self):
self.prepareData()
self.check()
def stop(self):
tdSql.close()
tdLog.success(f"{__file__} successfully executed")
tdCases.addLinux(__file__, TDTestCase())
tdCases.addWindows(__file__, TDTestCase())

View File

@ -0,0 +1,149 @@
import taos
from util.log import *
from util.sql import *
from util.cases import *
from util.dnodes import *
from util.common import *
class TDTestCase:
def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), True)
self.dbname = 'db'
self.stbname = 'st'
def prepareData(self):
# db
tdSql.execute(f"create database db;")
tdSql.execute(f"use db")
# super tableUNSIGNED
tdSql.execute("CREATE TABLE st( time TIMESTAMP, c1 BIGINT, c2 smallint, c3 double, c4 int UNSIGNED, c5 bool, c6 binary(32), c7 nchar(32)) tags(t1 binary(32), t2 nchar(32))")
tdSql.execute("create table t1 using st tags('1', '1.7')")
tdSql.execute("create table t2 using st tags('0', '')")
tdSql.execute("create table t3 using st tags('1', 'er')")
# create index for all tags
tdSql.execute("INSERT INTO t1 VALUES (1641024000000, 1, 1, 1, 1, 1, '1', '1.7')")
tdSql.execute("INSERT INTO t1 VALUES (1641024000001, 0, 0, 1.7, 0, 0, '0', '')")
tdSql.execute("INSERT INTO t1 VALUES (1641024000002, 1, 1, 1, 1, 1, '1', 'er')")
tdSql.execute("INSERT INTO t2 VALUES (1641024000002, 1, 1, 1, 1, 1, '1', 'er')")
tdSql.execute("INSERT INTO t3 VALUES (1641024000002, 1, 1, 1, 1, 1, '1', 'er')")
tdSql.execute("CREATE TABLE stt( time TIMESTAMP, c1 BIGINT, c2 timestamp, c3 int, c4 int UNSIGNED, c5 bool, c6 binary(32), c7 nchar(32)) tags(t1 binary(32), t2 nchar(32))")
tdSql.execute("create table tt1 using stt tags('1', '1.7')")
# create index for all tags
tdSql.execute("INSERT INTO tt1 VALUES (1641024000000, 9223372036854775807, 1641024000000, 1, 1, 1, '1', '1.7')")
def check(self):
tdSql.query(f"SELECT * FROM tt1 WHERE c1 in (1.7, 9223372036854775803, '')")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM tt1 WHERE c1 = 9223372036854775803")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM t1 WHERE c1 = 1.7")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM t1 WHERE c1 in (1.7, 2)")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM t1 WHERE c1 not in (1.7, 2)")
tdSql.checkRows(3)
tdSql.query(f"SELECT * FROM t1 WHERE c2 = 1.7")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM t1 WHERE c2 in (1.7, 2)")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM t1 WHERE c2 not in (1.7, 2)")
tdSql.checkRows(3)
tdSql.query(f"SELECT * FROM t1 WHERE c3 = 1.7")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM t1 WHERE c3 in (1.7, 2)")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM t1 WHERE c3 not in (1.7, 2)")
tdSql.checkRows(2)
tdSql.query(f"SELECT * FROM t1 WHERE c4 = 1.7")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM t1 WHERE c4 in (1.7, 2)")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM t1 WHERE c4 not in (1.7, 2)")
tdSql.checkRows(3)
tdSql.query(f"SELECT * FROM t1 WHERE c5 = 1.7")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM t1 WHERE c5 in (1.7, 2)")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM t1 WHERE c5 not in (1.7, 2)")
tdSql.checkRows(3)
tdSql.query(f"SELECT * FROM t1 WHERE c6 = 1.7")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM t1 WHERE c6 in (1.7, 2)")
tdSql.checkRows(0)
tdSql.query(f"SELECT * FROM t1 WHERE c6 not in (1.7, 2)")
tdSql.checkRows(3)
tdSql.query(f"SELECT * FROM t1 WHERE c6 = 1")
tdSql.checkRows(2)
tdSql.query(f"SELECT * FROM t1 WHERE c6 in (1, 2)")
tdSql.checkRows(2)
tdSql.query(f"SELECT * FROM t1 WHERE c6 not in (1, 2)")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM t1 WHERE c6 = 0")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM t1 WHERE c6 in (0, 2)")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM t1 WHERE c6 not in (0, 2)")
tdSql.checkRows(2)
tdSql.query(f"SELECT * FROM t1 WHERE c6 not in (0, 2, 'sef')")
tdSql.checkRows(2)
tdSql.query(f"SELECT * FROM t1 WHERE c7 = 1.7")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM t1 WHERE c7 in (1.7, 2)")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM t1 WHERE c7 not in (1.7, 2)")
tdSql.checkRows(2)
tdSql.query(f"SELECT * FROM t1 WHERE c7 = 0")
tdSql.checkRows(2)
tdSql.query(f"SELECT * FROM t1 WHERE c7 in (0, 2)")
tdSql.checkRows(2)
tdSql.query(f"SELECT * FROM t1 WHERE c7 not in (0, 2)")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM t1 WHERE c7 = ''")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM t1 WHERE c7 in ('', 2)")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM t1 WHERE c7 not in ('', 2)")
tdSql.checkRows(2)
tdSql.query(f"SELECT * FROM st WHERE t2 in ('', 2)")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM st WHERE t2 not in ('', 2)")
tdSql.checkRows(4)
tdSql.query(f"SELECT * FROM st WHERE t1 in ('d343', 0, 2)")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM st WHERE t1 in (0, 2)")
tdSql.checkRows(1)
tdSql.query(f"SELECT * FROM st WHERE t1 not in (0, 2)")
tdSql.checkRows(4)
def run(self):
self.prepareData()
self.check()
def stop(self):
tdSql.close()
tdLog.success(f"{__file__} successfully executed")
tdCases.addLinux(__file__, TDTestCase())
tdCases.addWindows(__file__, TDTestCase())