Merge branch '3.0' of https://github.com/taosdata/TDengine into fix/TD-30837
This commit is contained in:
commit
d4062efa1c
|
@ -17,7 +17,7 @@
|
|||
<dependency>
|
||||
<groupId>com.taosdata.jdbc</groupId>
|
||||
<artifactId>taos-jdbcdriver</artifactId>
|
||||
<version>3.2.1</version>
|
||||
<version>3.3.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
|
|
|
@ -51,7 +51,7 @@ taosd 命令行参数如下
|
|||
|
||||
| 参数名称 | 参数说明 |
|
||||
| :--------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
||||
| queryPolicy | 查询策略,1: 只使用 vnode,不使用 qnode; 2: 没有扫描算子的子任务在 qnode 执行,带扫描算子的子任务在 vnode 执行; 3: vnode 只运行扫描算子,其余算子均在 qnode 执行 ;缺省值:1 |
|
||||
| queryPolicy | 查询策略,1: 只使用 vnode,不使用 qnode; 2: 没有扫描算子的子任务在 qnode 执行,带扫描算子的子任务在 vnode 执行; 3: vnode 只运行扫描算子,其余算子均在 qnode 执行 ;4: 使用客户端聚合模式;缺省值:1 |
|
||||
| maxNumOfDistinctRes | 允许返回的 distinct 结果最大行数,默认值 10 万,最大允许值 1 亿 |
|
||||
| countAlwaysReturnValue | count/hyperloglog函数在输入数据为空或者NULL的情况下是否返回值,0: 返回空行,1: 返回;该参数设置为 1 时,如果查询中含有 INTERVAL 子句或者该查询使用了TSMA时, 且相应的组或窗口内数据为空或者NULL, 对应的组或窗口将不返回查询结果. 注意此参数客户端和服务端值应保持一致. |
|
||||
|
||||
|
|
|
@ -293,6 +293,212 @@ taos_cluster_info_first_ep{cluster_id="554014120921134497",value="tdengine:6030"
|
|||
taos_cluster_info_first_ep_dnode_id{cluster_id="554014120921134497"} 1
|
||||
```
|
||||
|
||||
### 监控指标详情
|
||||
|
||||
#### taosd 集群
|
||||
|
||||
##### 监控信息支持的标签
|
||||
- `cluster_id`: 集群 id
|
||||
|
||||
##### 相关指标及其含义
|
||||
| 指标名称 | 类型 | 含义 |
|
||||
| ----------------------------------- | ------- | ------------------------------------- |
|
||||
| taos_cluster_info_connections_total | counter | 总连接数 |
|
||||
| taos_cluster_info_dbs_total | counter | 数据库总数 |
|
||||
| taos_cluster_info_dnodes_alive | counter | 存活的 dnode 数量 |
|
||||
| taos_cluster_info_dnodes_total | counter | dnode 总数 |
|
||||
| taos_cluster_info_first_ep | gauge | 第一个端点,标签 value 表示端点值 |
|
||||
| taos_cluster_info_first_ep_dnode_id | counter | 第一个端点的 dnode id |
|
||||
| taos_cluster_info_master_uptime | gauge | 主节点运行时间,单位天 |
|
||||
| taos_cluster_info_mnodes_alive | counter | 存活的 mnode 数量 |
|
||||
| taos_cluster_info_mnodes_total | counter | mnode 总数 |
|
||||
| taos_cluster_info_stbs_total | counter | 超级表总数 |
|
||||
| taos_cluster_info_streams_total | counter | 流总数 |
|
||||
| taos_cluster_info_tbs_total | counter | 表总数 |
|
||||
| taos_cluster_info_topics_total | counter | 主题总数 |
|
||||
| taos_cluster_info_version | gauge | 版本信息,标签 value 表示版本号 |
|
||||
| taos_cluster_info_vgroups_alive | counter | 存活的虚拟组数量 |
|
||||
| taos_cluster_info_vgroups_total | counter | 虚拟组总数 |
|
||||
| taos_cluster_info_vnodes_alive | counter | 存活的虚拟节点数量 |
|
||||
| taos_cluster_info_vnodes_total | counter | 虚拟节点总数 |
|
||||
| taos_grants_info_expire_time | counter | 集群授权过期剩余时间(单位 秒) |
|
||||
| taos_grants_info_timeseries_total | counter | 集群授权允许使用 time series 的总数量 |
|
||||
| taos_grants_info_timeseries_used | counter | 集群已拥有的 time series 的数量 |
|
||||
|
||||
#### dnode
|
||||
|
||||
##### 监控信息支持的标签
|
||||
- `cluster_id`: 集群 id
|
||||
- `dnode_ep`: dnode 端点
|
||||
- `dnode_id`:dnode id
|
||||
|
||||
##### 相关指标及其含义
|
||||
| 指标名称 | 类型 | 含义 |
|
||||
| ------------------------------ | ------- | ---------------------------------------------------------------------------------------- |
|
||||
| taos_d_info_status | gauge | dnode 状态,标签 value 表示状态, ready 表示正常, offline 表示下线, unknown 表示未知。 |
|
||||
| taos_dnodes_info_cpu_cores | gauge | CPU 核心数 |
|
||||
| taos_dnodes_info_cpu_engine | gauge | 该 dnode 的进程所使用的 CPU 百分比(取值范围 0~100) |
|
||||
| taos_dnodes_info_cpu_system | gauge | 该 dnode 所在节点的系统使用的 CPU 百分比(取值范围 0~100) |
|
||||
| taos_dnodes_info_disk_engine | counter | 该 dnode 的进程使用的磁盘容量(单位 Byte) |
|
||||
| taos_dnodes_info_disk_total | counter | 该 dnode 所在节点的磁盘总容量(单位 Byte) |
|
||||
| taos_dnodes_info_disk_used | counter | 该 dnode 所在节点的磁盘已使用的容量(单位 Byte) |
|
||||
| taos_dnodes_info_has_mnode | counter | 是否有 mnode |
|
||||
| taos_dnodes_info_has_qnode | counter | 是否有 qnode |
|
||||
| taos_dnodes_info_has_snode | counter | 是否有 snode |
|
||||
| taos_dnodes_info_io_read | gauge | 该 dnode 所在节点的 io 读取速率(单位 Byte/s) |
|
||||
| taos_dnodes_info_io_read_disk | gauge | 该 dnode 所在节点的磁盘 io 写入取速率(单位 Byte/s) |
|
||||
| taos_dnodes_info_io_write | gauge | 该 dnode 所在节点的 io 写入取速率(单位 Byte/s) |
|
||||
| taos_dnodes_info_io_write_disk | gauge | 该 dnode 所在节点的磁盘 io 写入取速率(单位 Byte/s) |
|
||||
| taos_dnodes_info_masters | counter | 主节点数量 |
|
||||
| taos_dnodes_info_mem_engine | counter | 该 dnode 的进程所使用的内存(单位 KB) |
|
||||
| taos_dnodes_info_mem_system | counter | 该 dnode 所在节的系统所使用的内存(单位 KB) |
|
||||
| taos_dnodes_info_mem_total | counter | 该 dnode 所在节点的总内存(单位 KB) |
|
||||
| taos_dnodes_info_net_in | gauge | 该 dnode 所在节点的网络传入速率(单位 Byte/s) |
|
||||
| taos_dnodes_info_net_out | gauge | 该 dnode 所在节点的网络传出速率(单位 Byte/s) |
|
||||
| taos_dnodes_info_uptime | gauge | 该 dnode 的启动时间(单位 秒) |
|
||||
| taos_dnodes_info_vnodes_num | counter | 该 dnode 所在节点的 vnode 数量 |
|
||||
|
||||
#### 数据目录
|
||||
|
||||
##### 监控信息支持的标签
|
||||
- `cluster_id`: 集群 id
|
||||
- `dnode_ep`: dnode 端点
|
||||
- `dnode_id`:dnode id
|
||||
- `data_dir_name`:数据目录名
|
||||
- `data_dir_level`:数据目录级别
|
||||
|
||||
##### 相关指标及其含义
|
||||
| 指标名称 | 类型 | 含义 |
|
||||
| --------------------------------- | ----- | -------------------- |
|
||||
| taos_taosd_dnodes_data_dirs_avail | gauge | 可用空间(单位 Byte) |
|
||||
| taos_taosd_dnodes_data_dirs_total | gauge | 总空间(单位 Byte) |
|
||||
| taos_taosd_dnodes_data_dirs_used | gauge | 已用空间(单位 Byte) |
|
||||
|
||||
#### 日志目录
|
||||
|
||||
##### 监控信息支持的标签
|
||||
- `cluster_id`: 集群 id
|
||||
- `dnode_ep`: dnode 端点
|
||||
- `dnode_id`:dnode id
|
||||
- `log_dir_name`:日志目录名
|
||||
|
||||
##### 相关指标及其含义
|
||||
| 指标名称 | 类型 | 含义 |
|
||||
| -------------------------------- | ----- | -------------------- |
|
||||
| taos_taosd_dnodes_log_dirs_avail | gauge | 可用空间(单位 Byte) |
|
||||
| taos_taosd_dnodes_log_dirs_total | gauge | 总空间(单位 Byte) |
|
||||
| taos_taosd_dnodes_log_dirs_used | gauge | 已用空间(单位 Byte) |
|
||||
|
||||
#### 日志数量
|
||||
|
||||
##### 监控信息支持的标签
|
||||
- `cluster_id`: 集群 id
|
||||
- `dnode_ep`: dnode 端点
|
||||
- `dnode_id`:dnode id
|
||||
|
||||
##### 相关指标及其含义
|
||||
| 指标名称 | 类型 | 含义 |
|
||||
| ---------------------- | ------- | ------------ |
|
||||
| taos_log_summary_debug | counter | 调试日志数量 |
|
||||
| taos_log_summary_error | counter | 错误日志数量 |
|
||||
| taos_log_summary_info | counter | 信息日志数量 |
|
||||
| taos_log_summary_trace | counter | 跟踪日志数量 |
|
||||
|
||||
|
||||
#### taosadapter
|
||||
|
||||
##### 监控信息支持的标签
|
||||
- `endpoint`:端点
|
||||
- `req_type`:请求类型,0 表示 rest,1 表示 websocket
|
||||
|
||||
##### 相关指标及其含义
|
||||
| 指标名称 | 类型 | 含义 |
|
||||
| -------------------------------------- | ------- | -------------------- |
|
||||
| taos_adapter_requests_fail | counter | 失败的请求数 |
|
||||
| taos_adapter_requests_in_process | counter | 正在处理的请求数 |
|
||||
| taos_adapter_requests_other | counter | 其他类型的请求数 |
|
||||
| taos_adapter_requests_other_fail | counter | 其他类型的失败请求数 |
|
||||
| taos_adapter_requests_other_success | counter | 其他类型的成功请求数 |
|
||||
| taos_adapter_requests_query | counter | 查询请求数 |
|
||||
| taos_adapter_requests_query_fail | counter | 查询失败请求数 |
|
||||
| taos_adapter_requests_query_in_process | counter | 正在处理的查询请求数 |
|
||||
| taos_adapter_requests_query_success | counter | 查询成功请求数 |
|
||||
| taos_adapter_requests_success | counter | 成功的请求数 |
|
||||
| taos_adapter_requests_total | counter | 总请求数 |
|
||||
| taos_adapter_requests_write | counter | 写请求数 |
|
||||
| taos_adapter_requests_write_fail | counter | 写失败请求数 |
|
||||
| taos_adapter_requests_write_in_process | counter | 正在处理的写请求数 |
|
||||
| taos_adapter_requests_write_success | counter | 写成功请求数 |
|
||||
|
||||
#### taoskeeper
|
||||
|
||||
##### 监控信息支持的标签
|
||||
- `identify`: 节点 endpoint
|
||||
|
||||
##### 相关指标及其含义
|
||||
| 指标名称 | 类型 | 含义 |
|
||||
| ----------------------- | ----- | ------------------------------------- |
|
||||
| taos_keeper_monitor_cpu | gauge | taoskeeper CPU 使用率(取值范围 0~1) |
|
||||
| taos_keeper_monitor_mem | gauge | taoskeeper 内存使用率(取值范围 0~1) |
|
||||
|
||||
#### 其他 taosd 集群监控项
|
||||
|
||||
##### taos_m_info_role
|
||||
- **标签**:
|
||||
- `cluster_id`: 集群 id
|
||||
- `mnode_ep`: mnode 端点
|
||||
- `mnode_id`: mnode id
|
||||
- `value`: 角色值(该 mnode 的状态,取值范围:offline, follower, candidate, leader, error, learner)
|
||||
- **类型**: gauge
|
||||
- **含义**: mnode 角色
|
||||
|
||||
##### taos_taos_sql_req_count
|
||||
- **标签**:
|
||||
- `cluster_id`: 集群 id
|
||||
- `result`: 请求结果(取值范围: Success, Failed)
|
||||
- `sql_type`: SQL 类型(取值范围:select, insert,inserted_rows, delete)
|
||||
- `username`: 用户名
|
||||
- **类型**: gauge
|
||||
- **含义**: SQL 请求数量
|
||||
|
||||
##### taos_taosd_sql_req_count
|
||||
- **标签**:
|
||||
- `cluster_id`: 集群 id
|
||||
- `dnode_ep`: dnode 端点
|
||||
- `dnode_id`: dnode id
|
||||
- `result`: 请求结果(取值范围: Success, Failed)
|
||||
- `sql_type`: SQL 类型(取值范围:select, insert,inserted_rows, delete)
|
||||
- `username`: 用户名
|
||||
- `vgroup_id`: 虚拟组 id
|
||||
- **类型**: gauge
|
||||
- **含义**: SQL 请求数量
|
||||
|
||||
##### taos_taosd_vgroups_info_status
|
||||
- **标签**:
|
||||
- `cluster_id`: 集群 id
|
||||
- `database_name`: 数据库名称
|
||||
- `vgroup_id`: 虚拟组 id
|
||||
- **类型**: gauge
|
||||
- **含义**: 虚拟组状态。 0 为 unsynced,表示没有leader选出;1 为 ready。
|
||||
|
||||
##### taos_taosd_vgroups_info_tables_num
|
||||
- **标签**:
|
||||
- `cluster_id`: 集群 id
|
||||
- `database_name`: 数据库名称
|
||||
- `vgroup_id`: 虚拟组 id
|
||||
- **类型**: gauge
|
||||
- **含义**: 虚拟组表数量
|
||||
|
||||
##### taos_taosd_vnodes_info_role
|
||||
- **标签**:
|
||||
- `cluster_id`: 集群 id
|
||||
- `database_name`: 数据库名称
|
||||
- `dnode_id`: dnode id
|
||||
- `value`: 角色值(取值范围:offline, follower, candidate, leader, error, learner)
|
||||
- `vgroup_id`: 虚拟组 id
|
||||
- **类型**: gauge
|
||||
- **含义**: 虚拟节点角色
|
||||
|
||||
|
||||
### 抽取配置
|
||||
|
||||
|
|
|
@ -390,12 +390,12 @@ curl -X DELETE http://localhost:8083/connectors/TDengineSourceConnector
|
|||
|
||||
## 其他说明
|
||||
|
||||
1. 关于如何在独立安装的 Kafka 环境使用 Kafka Connect 插件, 请参考官方文档:<https://kafka.apache.org/documentation/#connect>。
|
||||
1. 关于如何在独立安装的 Kafka 环境使用 Kafka Connect 插件, 请参考官方文档:[https://kafka.apache.org/documentation/#connect](https://kafka.apache.org/documentation/#connect)。
|
||||
|
||||
## 问题反馈
|
||||
|
||||
无论遇到任何问题,都欢迎在本项目的 Github 仓库反馈:<https://github.com/taosdata/kafka-connect-tdengine/issues>。
|
||||
无论遇到任何问题,都欢迎在本项目的 Github 仓库反馈:[https://github.com/taosdata/kafka-connect-tdengine/issues](https://github.com/taosdata/kafka-connect-tdengine/issues)。
|
||||
|
||||
## 参考
|
||||
|
||||
1. <https://kafka.apache.org/documentation/>
|
||||
1. [https://kafka.apache.org/documentation/](https://kafka.apache.org/documentation/)
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
|
||||
#define TSDB_CL_COMMENT_LEN 1025
|
||||
#define TSDB_CL_COMPRESS_OPTION_LEN 12
|
||||
#define TSDB_CL_OPTION_LEN 9
|
||||
|
||||
extern const char* supportedEncode[5];
|
||||
extern const char* supportedCompress[6];
|
||||
|
|
|
@ -398,10 +398,6 @@
|
|||
#define TK_VALUES 380
|
||||
#define TK_VARIABLE 381
|
||||
#define TK_WAL 382
|
||||
#define TK_ENCODE 383
|
||||
#define TK_COMPRESS 384
|
||||
#define TK_LEVEL 385
|
||||
|
||||
|
||||
|
||||
#define TK_NK_SPACE 600
|
||||
|
|
|
@ -168,7 +168,7 @@ int64_t smlGetTimeValue(const char *value, int32_t len, uint8_t fromPrecision, u
|
|||
int32_t smlBuildTableInfo(int numRows, const char *measure, int32_t measureLen, SSmlTableInfo** tInfo) {
|
||||
SSmlTableInfo *tag = (SSmlTableInfo *)taosMemoryCalloc(sizeof(SSmlTableInfo), 1);
|
||||
if (!tag) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
tag->sTableName = measure;
|
||||
|
@ -609,7 +609,7 @@ int32_t getTableUid(SSmlHandle *info, SSmlLineInfo *currElement, SSmlTableInfo *
|
|||
int32_t smlBuildSTableMeta(bool isDataFormat, SSmlSTableMeta **sMeta) {
|
||||
SSmlSTableMeta *meta = (SSmlSTableMeta *)taosMemoryCalloc(sizeof(SSmlSTableMeta), 1);
|
||||
if (!meta) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
if (unlikely(!isDataFormat)) {
|
||||
|
@ -1625,7 +1625,7 @@ int32_t smlBuildSmlInfo(TAOS *taos, SSmlHandle **handle) {
|
|||
int32_t code = TSDB_CODE_SUCCESS;
|
||||
SSmlHandle *info = (SSmlHandle *)taosMemoryCalloc(1, sizeof(SSmlHandle));
|
||||
if (NULL == info) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
if (taos != NULL) {
|
||||
info->taos = acquireTscObj(*(int64_t *)taos);
|
||||
|
|
|
@ -704,7 +704,7 @@ static int32_t s3PutObjectFromFileWithoutCp(S3BucketContext *bucket_context, cha
|
|||
|
||||
manager.etags = (char **)taosMemoryCalloc(totalSeq, sizeof(char *));
|
||||
if (!manager.etags) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
||||
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||
}
|
||||
manager.next_etags_pos = 0;
|
||||
do {
|
||||
|
@ -810,7 +810,7 @@ static int32_t s3PutObjectFromFileWithCp(S3BucketContext *bucket_context, const
|
|||
SCheckpoint cp = {0};
|
||||
cp.parts = taosMemoryCalloc(max_part_num, sizeof(SCheckpointPart));
|
||||
if (!cp.parts) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
||||
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||
}
|
||||
|
||||
if (taosCheckExistFile(file_cp_path)) {
|
||||
|
@ -858,7 +858,7 @@ static int32_t s3PutObjectFromFileWithCp(S3BucketContext *bucket_context, const
|
|||
|
||||
manager.etags = (char **)taosMemoryCalloc(totalSeq, sizeof(char *));
|
||||
if (!manager.etags) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
||||
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||
}
|
||||
|
||||
manager.next_etags_pos = 0;
|
||||
|
@ -1831,7 +1831,7 @@ int32_t s3GetObjectBlock(const char *object_name, int64_t offset, int64_t block_
|
|||
// char *buf = cos_pcalloc(p, (apr_size_t)(len + 1));
|
||||
char *buf = taosMemoryCalloc(1, (apr_size_t)(len));
|
||||
if (!buf) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
||||
TAOS_CHECK_GOTO(terrno, &lino, _exit);
|
||||
}
|
||||
|
||||
// buf[len] = '\0';
|
||||
|
|
|
@ -271,7 +271,7 @@ static int32_t tRowBuildTupleRow(SArray *aColVal, const SRowBuildScanInfo *sinfo
|
|||
|
||||
*ppRow = (SRow *)taosMemoryCalloc(1, sinfo->tupleRowSize);
|
||||
if (*ppRow == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
(*ppRow)->flag = sinfo->tupleFlag;
|
||||
(*ppRow)->numOfPKs = sinfo->numOfPKs;
|
||||
|
@ -354,7 +354,7 @@ static int32_t tRowBuildKVRow(SArray *aColVal, const SRowBuildScanInfo *sinfo, c
|
|||
|
||||
*ppRow = (SRow *)taosMemoryCalloc(1, sinfo->kvRowSize);
|
||||
if (*ppRow == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
(*ppRow)->flag = sinfo->kvFlag;
|
||||
(*ppRow)->numOfPKs = sinfo->numOfPKs;
|
||||
|
@ -663,7 +663,7 @@ static int32_t tRowMergeImpl(SArray *aRowP, STSchema *pTSchema, int32_t iStart,
|
|||
|
||||
aIter = taosMemoryCalloc(nRow, sizeof(SRowIter *));
|
||||
if (aIter == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _exit;
|
||||
}
|
||||
|
||||
|
@ -799,7 +799,7 @@ int32_t tRowIterOpen(SRow *pRow, STSchema *pTSchema, SRowIter **ppIter) {
|
|||
|
||||
SRowIter *pIter = taosMemoryCalloc(1, sizeof(*pIter));
|
||||
if (pIter == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _exit;
|
||||
}
|
||||
|
||||
|
@ -1600,7 +1600,7 @@ int32_t tTagNew(SArray *pArray, int32_t version, int8_t isJson, STag **ppTag) {
|
|||
// build tag
|
||||
(*ppTag) = (STag *)taosMemoryCalloc(szTag, 1);
|
||||
if ((*ppTag) == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _err;
|
||||
}
|
||||
(*ppTag)->flags = 0;
|
||||
|
@ -3231,7 +3231,7 @@ static int32_t tColDataMergeSortMerge(SColData *aColData, int32_t start, int32_t
|
|||
if (end > start) {
|
||||
aDstColData = taosMemoryCalloc(1, sizeof(SColData) * nColData);
|
||||
if (aDstColData == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
for (int c = 0; c < nColData; ++c) {
|
||||
tColDataInit(&aDstColData[c], aColData[c].cid, aColData[c].type, aColData[c].cflag);
|
||||
|
|
|
@ -1829,7 +1829,7 @@ int32_t cloneSUpdateIpWhiteReq(SUpdateIpWhite *pReq, SUpdateIpWhite **pUpdateMsg
|
|||
}
|
||||
SUpdateIpWhite *pClone = taosMemoryCalloc(1, sizeof(SUpdateIpWhite));
|
||||
if (pClone == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
pClone->numOfUser = pReq->numOfUser;
|
||||
|
@ -1837,7 +1837,7 @@ int32_t cloneSUpdateIpWhiteReq(SUpdateIpWhite *pReq, SUpdateIpWhite **pUpdateMsg
|
|||
pClone->pUserIpWhite = taosMemoryCalloc(1, sizeof(SUpdateUserIpWhite) * pReq->numOfUser);
|
||||
if (pClone->pUserIpWhite == NULL) {
|
||||
taosMemoryFree(pClone);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
for (int i = 0; i < pReq->numOfUser; i++) {
|
||||
|
@ -1851,7 +1851,7 @@ int32_t cloneSUpdateIpWhiteReq(SUpdateIpWhite *pReq, SUpdateIpWhite **pUpdateMsg
|
|||
int32_t sz = pOld->numOfRange * sizeof(SIpV4Range);
|
||||
pNew->pIpRanges = taosMemoryCalloc(1, sz);
|
||||
if (pNew->pIpRanges == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
break;
|
||||
}
|
||||
memcpy(pNew->pIpRanges, pOld->pIpRanges, sz);
|
||||
|
@ -10669,7 +10669,7 @@ int32_t tCloneTbTSMAInfo(STableTSMAInfo *pInfo, STableTSMAInfo **pRes) {
|
|||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
STableTSMAInfo *pRet = taosMemoryCalloc(1, sizeof(STableTSMAInfo));
|
||||
if (!pRet) return TSDB_CODE_OUT_OF_MEMORY;
|
||||
if (!pRet) return terrno;
|
||||
|
||||
*pRet = *pInfo;
|
||||
if (pInfo->pFuncs) {
|
||||
|
|
|
@ -473,7 +473,7 @@ int32_t tdSTSRowNew(SArray *pArray, STSchema *pTSchema, STSRow **ppRow, int8_t r
|
|||
}
|
||||
|
||||
if (!(*ppRow)) {
|
||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
||||
TAOS_RETURN(terrno);
|
||||
}
|
||||
|
||||
if (maxVarDataLen > 0) {
|
||||
|
|
|
@ -539,7 +539,7 @@ int32_t convertStringToTimestamp(int16_t type, char* inputData, int64_t timePrec
|
|||
if (type == TSDB_DATA_TYPE_BINARY || type == TSDB_DATA_TYPE_VARBINARY) {
|
||||
newColData = taosMemoryCalloc(1, charLen + 1);
|
||||
if (NULL == newColData) {
|
||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
||||
TAOS_RETURN(terrno);
|
||||
}
|
||||
(void)memcpy(newColData, varDataVal(inputData), charLen);
|
||||
int32_t ret = taosParseTime(newColData, timeVal, charLen, (int32_t)timePrec, tsDaylight);
|
||||
|
@ -551,7 +551,7 @@ int32_t convertStringToTimestamp(int16_t type, char* inputData, int64_t timePrec
|
|||
} else if (type == TSDB_DATA_TYPE_NCHAR) {
|
||||
newColData = taosMemoryCalloc(1, charLen + TSDB_NCHAR_SIZE);
|
||||
if (NULL == newColData) {
|
||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
||||
TAOS_RETURN(terrno);
|
||||
}
|
||||
int len = taosUcs4ToMbs((TdUcs4*)varDataVal(inputData), charLen, newColData);
|
||||
if (len < 0) {
|
||||
|
|
|
@ -365,7 +365,7 @@ int32_t dmBuildVariablesBlock(SSDataBlock **ppBlock) {
|
|||
|
||||
SSDataBlock *pBlock = taosMemoryCalloc(1, sizeof(SSDataBlock));
|
||||
if (pBlock == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
size_t size = 0;
|
||||
|
|
|
@ -97,7 +97,7 @@ static int32_t mmOpen(SMgmtInputOpt *pInput, SMgmtOutputOpt *pOutput) {
|
|||
|
||||
SMnodeMgmt *pMgmt = taosMemoryCalloc(1, sizeof(SMnodeMgmt));
|
||||
if (pMgmt == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
return code;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ static int32_t qmOpen(SMgmtInputOpt *pInput, SMgmtOutputOpt *pOutput) {
|
|||
int32_t code = 0;
|
||||
SQnodeMgmt *pMgmt = taosMemoryCalloc(1, sizeof(SQnodeMgmt));
|
||||
if (pMgmt == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
pMgmt->pData = pInput->pData;
|
||||
|
|
|
@ -44,7 +44,7 @@ int32_t smOpen(SMgmtInputOpt *pInput, SMgmtOutputOpt *pOutput) {
|
|||
int32_t code = 0;
|
||||
SSnodeMgmt *pMgmt = taosMemoryCalloc(1, sizeof(SSnodeMgmt));
|
||||
if (pMgmt == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
return code;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ int32_t vmGetVnodeListFromHash(SVnodeMgmt *pMgmt, int32_t *numOfVnodes, SVnodeOb
|
|||
SVnodeObj **pVnodes = taosMemoryCalloc(size, sizeof(SVnodeObj *));
|
||||
if (pVnodes == NULL) {
|
||||
(void)taosThreadRwlockUnlock(&pMgmt->lock);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
void *pIter = taosHashIterate(pMgmt->hash, NULL);
|
||||
|
@ -62,7 +62,7 @@ static int32_t vmDecodeVnodeList(SJson *pJson, SVnodeMgmt *pMgmt, SWrapperCfg **
|
|||
int32_t vnodesNum = cJSON_GetArraySize(vnodes);
|
||||
if (vnodesNum > 0) {
|
||||
pCfgs = taosMemoryCalloc(vnodesNum, sizeof(SWrapperCfg));
|
||||
if (pCfgs == NULL) return TSDB_CODE_OUT_OF_MEMORY;
|
||||
if (pCfgs == NULL) return terrno;
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < vnodesNum; ++i) {
|
||||
|
|
|
@ -592,7 +592,7 @@ static int32_t vmInit(SMgmtInputOpt *pInput, SMgmtOutputOpt *pOutput) {
|
|||
|
||||
SVnodeMgmt *pMgmt = taosMemoryCalloc(1, sizeof(SVnodeMgmt));
|
||||
if (pMgmt == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _OVER;
|
||||
}
|
||||
|
||||
|
@ -727,7 +727,7 @@ static int32_t vmStartVnodes(SVnodeMgmt *pMgmt) {
|
|||
|
||||
SVnodeThread *threads = taosMemoryCalloc(threadNum, sizeof(SVnodeThread));
|
||||
if (threads == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
for (int32_t t = 0; t < threadNum; ++t) {
|
||||
|
@ -735,7 +735,7 @@ static int32_t vmStartVnodes(SVnodeMgmt *pMgmt) {
|
|||
threads[t].pMgmt = pMgmt;
|
||||
threads[t].ppVnodes = taosMemoryCalloc(vnodesPerThread, sizeof(SVnode *));
|
||||
if (threads[t].ppVnodes == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -297,7 +297,7 @@ static int32_t addEpSetInfo(SMnode *pMnode, SMqConsumerObj *pConsumer, int32_t e
|
|||
taosRUnLockLatch(&pSub->lock);
|
||||
mndReleaseSubscribe(pMnode, pSub);
|
||||
mndReleaseTopic(pMnode, pTopic);
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
(void)memcpy(topicEp.schema.pSchema, pTopic->schema.pSchema, topicEp.schema.nCols * sizeof(SSchema));
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ int32_t tDecodeSStreamObj(SDecoder *pDecoder, SStreamObj *pObj, int32_t sver) {
|
|||
SStreamTask *pTask = taosMemoryCalloc(1, sizeof(SStreamTask));
|
||||
if (pTask == NULL) {
|
||||
taosArrayDestroy(pArray);
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
TAOS_RETURN(code);
|
||||
}
|
||||
if ((code = tDecodeStreamTask(pDecoder, pTask)) < 0) {
|
||||
|
@ -278,7 +278,7 @@ int32_t tNewSMqConsumerObj(int64_t consumerId, char *cgroup, int8_t updateType,
|
|||
int32_t code = 0;
|
||||
SMqConsumerObj *pConsumer = taosMemoryCalloc(1, sizeof(SMqConsumerObj));
|
||||
if (pConsumer == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto END;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ static int32_t mndInitInfosTableSchema(const SSysDbTableSchema *pSrc, int32_t co
|
|||
int32_t code = 0;
|
||||
SSchema *schema = taosMemoryCalloc(colNum, sizeof(SSchema));
|
||||
if (NULL == schema) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
TAOS_RETURN(code);
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,7 @@ int32_t mndBuildInsTableSchema(SMnode *pMnode, const char *dbFName, const char *
|
|||
|
||||
pRsp->pSchemas = taosMemoryCalloc(pMeta->numOfColumns, sizeof(SSchema));
|
||||
if (pRsp->pSchemas == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
pRsp->pSchemas = NULL;
|
||||
TAOS_RETURN(code);
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ int32_t mndBuildInsTableCfg(SMnode *pMnode, const char *dbFName, const char *tbN
|
|||
|
||||
pRsp->pSchemas = taosMemoryCalloc(pMeta->numOfColumns, sizeof(SSchema));
|
||||
if (pRsp->pSchemas == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
pRsp->pSchemas = NULL;
|
||||
TAOS_RETURN(code);
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ int32_t mndInitPerfsTableSchema(const SSysDbTableSchema *pSrc, int32_t colNum, S
|
|||
int32_t code = 0;
|
||||
SSchema *schema = taosMemoryCalloc(colNum, sizeof(SSchema));
|
||||
if (NULL == schema) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
TAOS_RETURN(code);
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ int32_t mndBuildPerfsTableSchema(SMnode *pMnode, const char *dbFName, const char
|
|||
|
||||
pRsp->pSchemas = taosMemoryCalloc(meta->numOfColumns, sizeof(SSchema));
|
||||
if (pRsp->pSchemas == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
pRsp->pSchemas = NULL;
|
||||
TAOS_RETURN(code);
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ int32_t mndBuildPerfsTableCfg(SMnode *pMnode, const char *dbFName, const char *t
|
|||
|
||||
pRsp->pSchemas = taosMemoryCalloc(pMeta->numOfColumns, sizeof(SSchema));
|
||||
if (pRsp->pSchemas == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
pRsp->pSchemas = NULL;
|
||||
TAOS_RETURN(code);
|
||||
}
|
||||
|
|
|
@ -515,7 +515,7 @@ static int32_t mndProcessQueryHeartBeat(SMnode *pMnode, SRpcMsg *pMsg, SClientHb
|
|||
SQueryHbRspBasic *rspBasic = taosMemoryCalloc(1, sizeof(SQueryHbRspBasic));
|
||||
if (rspBasic == NULL) {
|
||||
mndReleaseConn(pMnode, pConn, true);
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
mError("user:%s, conn:%u failed to process hb while since %s", pConn->user, pBasic->connId, terrstr());
|
||||
TAOS_RETURN(code);
|
||||
}
|
||||
|
|
|
@ -1715,7 +1715,7 @@ static int32_t mndCreateTSMATxnPrepare(SCreateTSMACxt* pCxt) {
|
|||
createStreamRedoAction.contLen = tSerializeSCMCreateStreamReq(0, 0, pCxt->pCreateStreamReq);
|
||||
createStreamRedoAction.pCont = taosMemoryCalloc(1, createStreamRedoAction.contLen);
|
||||
if (!createStreamRedoAction.pCont) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _OVER;
|
||||
}
|
||||
if (createStreamRedoAction.contLen != tSerializeSCMCreateStreamReq(createStreamRedoAction.pCont, createStreamRedoAction.contLen, pCxt->pCreateStreamReq)) {
|
||||
|
@ -1730,7 +1730,7 @@ static int32_t mndCreateTSMATxnPrepare(SCreateTSMACxt* pCxt) {
|
|||
createStreamUndoAction.contLen = tSerializeSMDropStreamReq(0, 0, pCxt->pDropStreamReq);
|
||||
createStreamUndoAction.pCont = taosMemoryCalloc(1, createStreamUndoAction.contLen);
|
||||
if (!createStreamUndoAction.pCont) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _OVER;
|
||||
}
|
||||
if (createStreamUndoAction.contLen != tSerializeSMDropStreamReq(createStreamUndoAction.pCont, createStreamUndoAction.contLen, pCxt->pDropStreamReq)) {
|
||||
|
@ -1748,7 +1748,7 @@ static int32_t mndCreateTSMATxnPrepare(SCreateTSMACxt* pCxt) {
|
|||
dropStbUndoAction.contLen = tSerializeSMDropStbReq(0, 0, &dropStbReq);
|
||||
dropStbUndoAction.pCont = taosMemoryCalloc(1, dropStbUndoAction.contLen);
|
||||
if (!dropStbUndoAction.pCont) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _OVER;
|
||||
}
|
||||
if (dropStbUndoAction.contLen != tSerializeSMDropStbReq(dropStbUndoAction.pCont, dropStbUndoAction.contLen, &dropStbReq)) {
|
||||
|
@ -1993,7 +1993,7 @@ static int32_t mndDropTSMA(SCreateTSMACxt* pCxt) {
|
|||
dropStreamRedoAction.contLen = tSerializeSMDropStreamReq(0, 0, pCxt->pDropStreamReq);
|
||||
dropStreamRedoAction.pCont = taosMemoryCalloc(1, dropStreamRedoAction.contLen);
|
||||
if (!dropStreamRedoAction.pCont) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _OVER;
|
||||
}
|
||||
if (dropStreamRedoAction.contLen !=
|
||||
|
@ -2017,7 +2017,7 @@ static int32_t mndDropTSMA(SCreateTSMACxt* pCxt) {
|
|||
dropStbRedoAction.contLen = tSerializeSMDropStbReq(0, 0, &dropStbReq);
|
||||
dropStbRedoAction.pCont = taosMemoryCalloc(1, dropStbRedoAction.contLen);
|
||||
if (!dropStbRedoAction.pCont) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _OVER;
|
||||
}
|
||||
if (dropStbRedoAction.contLen != tSerializeSMDropStbReq(dropStbRedoAction.pCont, dropStbRedoAction.contLen, &dropStbReq)) {
|
||||
|
@ -2420,7 +2420,7 @@ static int32_t mndGetTSMA(SMnode *pMnode, char *tsmaFName, STableTSMAInfoRsp *rs
|
|||
|
||||
STableTSMAInfo *pTsma = taosMemoryCalloc(1, sizeof(STableTSMAInfo));
|
||||
if (!pTsma) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
sdbRelease(pMnode->pSdb, pSma);
|
||||
mndReleaseStb(pMnode, pDstStb);
|
||||
TAOS_RETURN(code);
|
||||
|
@ -2503,7 +2503,7 @@ static int32_t mndGetSomeTsmas(SMnode* pMnode, STableTSMAInfoRsp* pRsp, tsmaFilt
|
|||
|
||||
STableTSMAInfo *pTsma = taosMemoryCalloc(1, sizeof(STableTSMAInfo));
|
||||
if (!pTsma) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
mndReleaseStb(pMnode, pStb);
|
||||
sdbRelease(pSdb, pSma);
|
||||
sdbCancelFetch(pSdb, pIter);
|
||||
|
|
|
@ -877,7 +877,7 @@ int32_t mndBuildStbFromReq(SMnode *pMnode, SStbObj *pDst, SMCreateStbReq *pCreat
|
|||
if (pDst->commentLen > 0) {
|
||||
pDst->comment = taosMemoryCalloc(pDst->commentLen + 1, 1);
|
||||
if (pDst->comment == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
TAOS_RETURN(code);
|
||||
}
|
||||
memcpy(pDst->comment, pCreate->pComment, pDst->commentLen + 1);
|
||||
|
@ -887,7 +887,7 @@ int32_t mndBuildStbFromReq(SMnode *pMnode, SStbObj *pDst, SMCreateStbReq *pCreat
|
|||
if (pDst->ast1Len > 0) {
|
||||
pDst->pAst1 = taosMemoryCalloc(pDst->ast1Len, 1);
|
||||
if (pDst->pAst1 == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
TAOS_RETURN(code);
|
||||
}
|
||||
memcpy(pDst->pAst1, pCreate->pAst1, pDst->ast1Len);
|
||||
|
@ -897,7 +897,7 @@ int32_t mndBuildStbFromReq(SMnode *pMnode, SStbObj *pDst, SMCreateStbReq *pCreat
|
|||
if (pDst->ast2Len > 0) {
|
||||
pDst->pAst2 = taosMemoryCalloc(pDst->ast2Len, 1);
|
||||
if (pDst->pAst2 == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
TAOS_RETURN(code);
|
||||
}
|
||||
memcpy(pDst->pAst2, pCreate->pAst2, pDst->ast2Len);
|
||||
|
@ -906,7 +906,7 @@ int32_t mndBuildStbFromReq(SMnode *pMnode, SStbObj *pDst, SMCreateStbReq *pCreat
|
|||
pDst->pColumns = taosMemoryCalloc(1, pDst->numOfColumns * sizeof(SSchema));
|
||||
pDst->pTags = taosMemoryCalloc(1, pDst->numOfTags * sizeof(SSchema));
|
||||
if (pDst->pColumns == NULL || pDst->pTags == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
TAOS_RETURN(code);
|
||||
}
|
||||
|
||||
|
@ -1179,7 +1179,7 @@ static int32_t mndBuildStbFromAlter(SStbObj *pStb, SStbObj *pDst, SMCreateStbReq
|
|||
pDst->pCmpr = taosMemoryCalloc(1, pDst->numOfColumns * sizeof(SColCmpr));
|
||||
|
||||
if (pDst->pColumns == NULL || pDst->pTags == NULL || pDst->pCmpr == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
TAOS_RETURN(code);
|
||||
}
|
||||
|
||||
|
@ -1392,7 +1392,7 @@ int32_t mndAllocStbSchemas(const SStbObj *pOld, SStbObj *pNew) {
|
|||
pNew->pColumns = taosMemoryCalloc(pNew->numOfColumns, sizeof(SSchema));
|
||||
pNew->pCmpr = taosMemoryCalloc(pNew->numOfColumns, sizeof(SColCmpr));
|
||||
if (pNew->pTags == NULL || pNew->pColumns == NULL || pNew->pCmpr == NULL) {
|
||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
||||
TAOS_RETURN(terrno);
|
||||
}
|
||||
|
||||
memcpy(pNew->pColumns, pOld->pColumns, sizeof(SSchema) * pOld->numOfColumns);
|
||||
|
@ -2096,13 +2096,13 @@ static int32_t mndBuildStbSchemaImp(SDbObj *pDb, SStbObj *pStb, const char *tbNa
|
|||
pRsp->pSchemas = taosMemoryCalloc(totalCols, sizeof(SSchema));
|
||||
if (pRsp->pSchemas == NULL) {
|
||||
taosRUnLockLatch(&pStb->lock);
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
TAOS_RETURN(code);
|
||||
}
|
||||
pRsp->pSchemaExt = taosMemoryCalloc(pStb->numOfColumns, sizeof(SSchemaExt));
|
||||
if (pRsp->pSchemaExt == NULL) {
|
||||
taosRUnLockLatch(&pStb->lock);
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
TAOS_RETURN(code);
|
||||
}
|
||||
|
||||
|
@ -2157,7 +2157,7 @@ static int32_t mndBuildStbCfgImp(SDbObj *pDb, SStbObj *pStb, const char *tbName,
|
|||
pRsp->pSchemas = taosMemoryCalloc(totalCols, sizeof(SSchema));
|
||||
if (pRsp->pSchemas == NULL) {
|
||||
taosRUnLockLatch(&pStb->lock);
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
TAOS_RETURN(code);
|
||||
}
|
||||
|
||||
|
@ -2318,7 +2318,7 @@ static int32_t mndBuildSMAlterStbRsp(SDbObj *pDb, SStbObj *pObj, void **pCont, i
|
|||
|
||||
alterRsp.pMeta = taosMemoryCalloc(1, sizeof(STableMetaRsp));
|
||||
if (NULL == alterRsp.pMeta) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
TAOS_RETURN(code);
|
||||
}
|
||||
|
||||
|
@ -2371,7 +2371,7 @@ int32_t mndBuildSMCreateStbRsp(SMnode *pMnode, char *dbFName, char *stbFName, vo
|
|||
|
||||
stbRsp.pMeta = taosMemoryCalloc(1, sizeof(STableMetaRsp));
|
||||
if (NULL == stbRsp.pMeta) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _OVER;
|
||||
}
|
||||
|
||||
|
@ -4063,7 +4063,7 @@ static void mndDestroyDropTbsWithTsmaCtx(SMndDropTbsWithTsmaCtx *p) {
|
|||
static int32_t mndInitDropTbsWithTsmaCtx(SMndDropTbsWithTsmaCtx **ppCtx) {
|
||||
int32_t code = 0;
|
||||
SMndDropTbsWithTsmaCtx *pCtx = taosMemoryCalloc(1, sizeof(SMndDropTbsWithTsmaCtx));
|
||||
if (!pCtx) return TSDB_CODE_OUT_OF_MEMORY;
|
||||
if (!pCtx) return terrno;
|
||||
pCtx->pTsmaMap = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), true, HASH_NO_LOCK);
|
||||
if (!pCtx->pTsmaMap) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
|
|
|
@ -533,7 +533,7 @@ int32_t mndPersistTaskDeployReq(STrans *pTrans, SStreamTask *pTask) {
|
|||
|
||||
void *buf = taosMemoryCalloc(1, tlen);
|
||||
if (buf == NULL) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
((SMsgHead *)buf)->vgId = htonl(pTask->info.nodeId);
|
||||
|
|
|
@ -305,7 +305,7 @@ static int32_t doSetResumeAction(STrans *pTrans, SMnode *pMnode, SStreamTask *pT
|
|||
if (pReq == NULL) {
|
||||
mError("failed to malloc in resume stream, size:%" PRIzu ", code:%s", sizeof(SVResumeStreamTaskReq),
|
||||
tstrerror(TSDB_CODE_OUT_OF_MEMORY));
|
||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
// terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
|
@ -406,7 +406,7 @@ static int32_t doSetPauseAction(SMnode *pMnode, STrans *pTrans, SStreamTask *pTa
|
|||
if (pReq == NULL) {
|
||||
mError("failed to malloc in pause stream, size:%" PRIzu ", code:%s", sizeof(SVPauseStreamTaskReq),
|
||||
tstrerror(TSDB_CODE_OUT_OF_MEMORY));
|
||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
// terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
|
@ -471,7 +471,7 @@ int32_t mndStreamSetPauseAction(SMnode *pMnode, STrans *pTrans, SStreamObj *pStr
|
|||
static int32_t doSetDropAction(SMnode *pMnode, STrans *pTrans, SStreamTask *pTask) {
|
||||
SVDropStreamTaskReq *pReq = taosMemoryCalloc(1, sizeof(SVDropStreamTaskReq));
|
||||
if (pReq == NULL) {
|
||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
// terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
|
@ -526,7 +526,7 @@ int32_t mndStreamSetDropAction(SMnode *pMnode, STrans *pTrans, SStreamObj *pStre
|
|||
static int32_t doSetDropActionFromId(SMnode *pMnode, STrans *pTrans, SOrphanTask* pTask) {
|
||||
SVDropStreamTaskReq *pReq = taosMemoryCalloc(1, sizeof(SVDropStreamTaskReq));
|
||||
if (pReq == NULL) {
|
||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
// terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
return terrno;
|
||||
}
|
||||
|
||||
|
|
|
@ -355,7 +355,7 @@ int32_t mndUpdateIpWhiteImpl(SHashObj *pIpWhiteTab, char *user, char *fqdn, int8
|
|||
if (pList == NULL) {
|
||||
SIpWhiteList *pNewList = taosMemoryCalloc(1, sizeof(SIpWhiteList) + sizeof(SIpV4Range));
|
||||
if (pNewList == NULL) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _OVER);
|
||||
TAOS_CHECK_GOTO(terrno, &lino, _OVER);
|
||||
}
|
||||
(void)memcpy(pNewList->pIpRange, &range, sizeof(SIpV4Range));
|
||||
pNewList->num = 1;
|
||||
|
@ -370,7 +370,7 @@ int32_t mndUpdateIpWhiteImpl(SHashObj *pIpWhiteTab, char *user, char *fqdn, int8
|
|||
int32_t sz = sizeof(SIpWhiteList) + sizeof(SIpV4Range) * (pList->num + 1);
|
||||
SIpWhiteList *pNewList = taosMemoryCalloc(1, sz);
|
||||
if (pNewList == NULL) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _OVER);
|
||||
TAOS_CHECK_GOTO(terrno, &lino, _OVER);
|
||||
}
|
||||
(void)memcpy(pNewList->pIpRange, pList->pIpRange, sizeof(SIpV4Range) * (pList->num));
|
||||
pNewList->pIpRange[pList->num].ip = range.ip;
|
||||
|
@ -397,7 +397,7 @@ int32_t mndUpdateIpWhiteImpl(SHashObj *pIpWhiteTab, char *user, char *fqdn, int8
|
|||
int32_t sz = sizeof(SIpWhiteList) + sizeof(SIpV4Range) * (pList->num - 1);
|
||||
SIpWhiteList *pNewList = taosMemoryCalloc(1, sz);
|
||||
if (pNewList == NULL) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _OVER);
|
||||
TAOS_CHECK_GOTO(terrno, &lino, _OVER);
|
||||
}
|
||||
for (int i = 0; i < pList->num; i++) {
|
||||
SIpV4Range *e = &pList->pIpRange[i];
|
||||
|
@ -468,7 +468,7 @@ int32_t mndUpdateIpWhiteForAllUser(SMnode *pMnode, char *user, char *fqdn, int8_
|
|||
|
||||
char *keyDup = taosMemoryCalloc(1, klen + 1);
|
||||
if (keyDup == NULL) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _OVER);
|
||||
TAOS_CHECK_GOTO(terrno, &lino, _OVER);
|
||||
}
|
||||
(void)memcpy(keyDup, key, klen);
|
||||
bool upd = false;
|
||||
|
@ -503,7 +503,7 @@ static int64_t ipWhiteMgtFillMsg(SUpdateIpWhite *pUpdate) {
|
|||
pUpdate->pUserIpWhite = taosMemoryCalloc(1, num * sizeof(SUpdateUserIpWhite));
|
||||
if (pUpdate->pUserIpWhite == NULL) {
|
||||
(void)taosThreadRwlockUnlock(&ipWhiteMgt.rw);
|
||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
||||
TAOS_RETURN(terrno);
|
||||
}
|
||||
|
||||
void *pIter = taosHashIterate(ipWhiteMgt.pIpWhiteTab, NULL);
|
||||
|
@ -521,7 +521,7 @@ static int64_t ipWhiteMgtFillMsg(SUpdateIpWhite *pUpdate) {
|
|||
pUser->pIpRanges = taosMemoryCalloc(1, list->num * sizeof(SIpV4Range));
|
||||
if (pUser->pIpRanges == NULL) {
|
||||
(void)taosThreadRwlockUnlock(&ipWhiteMgt.rw);
|
||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
||||
TAOS_RETURN(terrno);
|
||||
}
|
||||
(void)memcpy(pUser->pIpRanges, list->pIpRange, list->num * sizeof(SIpV4Range));
|
||||
i++;
|
||||
|
@ -808,7 +808,7 @@ static int32_t createIpWhiteList(void *buf, int32_t len, SIpWhiteList **ppList)
|
|||
|
||||
p = taosMemoryCalloc(1, sizeof(SIpWhiteList) + num * sizeof(SIpV4Range));
|
||||
if (p == NULL) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _OVER);
|
||||
TAOS_CHECK_GOTO(terrno, &lino, _OVER);
|
||||
}
|
||||
TAOS_CHECK_GOTO(tDerializeIpWhileList(buf, len, p), &lino, _OVER);
|
||||
|
||||
|
@ -826,7 +826,7 @@ _OVER:
|
|||
static int32_t createDefaultIpWhiteList(SIpWhiteList **ppWhiteList) {
|
||||
*ppWhiteList = taosMemoryCalloc(1, sizeof(SIpWhiteList) + sizeof(SIpV4Range) * 1);
|
||||
if (*ppWhiteList == NULL) {
|
||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
||||
TAOS_RETURN(terrno);
|
||||
}
|
||||
(*ppWhiteList)->num = 1;
|
||||
SIpV4Range *range = &((*ppWhiteList)->pIpRange[0]);
|
||||
|
@ -1739,7 +1739,7 @@ static int32_t mndCreateUser(SMnode *pMnode, char *acct, SCreateUserReq *pCreate
|
|||
SIpWhiteList *p = taosMemoryCalloc(1, sizeof(SIpWhiteList) + numOfRanges * sizeof(SIpV4Range));
|
||||
if (p == NULL) {
|
||||
taosHashCleanup(pUniqueTab);
|
||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
||||
TAOS_RETURN(terrno);
|
||||
}
|
||||
void *pIter = taosHashIterate(pUniqueTab, NULL);
|
||||
int32_t i = 0;
|
||||
|
@ -2357,7 +2357,7 @@ static int32_t mndProcessAlterUserReq(SRpcMsg *pReq) {
|
|||
SIpWhiteList *pNew = taosMemoryCalloc(1, sizeof(SIpWhiteList) + sizeof(SIpV4Range) * num);
|
||||
|
||||
if (pNew == NULL) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _OVER);
|
||||
TAOS_CHECK_GOTO(terrno, &lino, _OVER);
|
||||
}
|
||||
|
||||
bool exist = false;
|
||||
|
@ -2394,7 +2394,7 @@ static int32_t mndProcessAlterUserReq(SRpcMsg *pReq) {
|
|||
SIpWhiteList *pNew = taosMemoryCalloc(1, sizeof(SIpWhiteList) + sizeof(SIpV4Range) * num);
|
||||
|
||||
if (pNew == NULL) {
|
||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _OVER);
|
||||
TAOS_CHECK_GOTO(terrno, &lino, _OVER);
|
||||
}
|
||||
|
||||
if (pUser->pIpWhiteList->num > 0) {
|
||||
|
|
|
@ -838,7 +838,7 @@ int32_t mndAllocVgroup(SMnode *pMnode, SDbObj *pDb, SVgObj **ppVgroups) {
|
|||
|
||||
pVgroups = taosMemoryCalloc(pDb->cfg.numOfVgroups, sizeof(SVgObj));
|
||||
if (pVgroups == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
goto _OVER;
|
||||
}
|
||||
|
||||
|
|
|
@ -664,7 +664,7 @@ int32_t sdbDoRead(SSdb *pSdb, SSdbIter *pIter, void **ppBuf, int32_t *len) {
|
|||
int32_t maxlen = 4096;
|
||||
void *pBuf = taosMemoryCalloc(1, maxlen);
|
||||
if (pBuf == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
code = terrno;
|
||||
TAOS_RETURN(code);
|
||||
}
|
||||
|
||||
|
|
|
@ -1734,14 +1734,35 @@ static bool isCleanFileDataBlock(STsdbReader* pReader, SFileDataBlockInfo* pBloc
|
|||
return isCleanFileBlock;
|
||||
}
|
||||
|
||||
static int32_t initRowMergeIfNeeded(STsdbReader* pReader, int64_t uid) {
|
||||
SRowMerger* pMerger = &pReader->status.merger;
|
||||
int32_t code = 0;
|
||||
|
||||
if (pMerger->pArray == NULL) {
|
||||
STSchema* ps = getTableSchemaImpl(pReader, uid);
|
||||
if (ps == NULL) {
|
||||
return terrno;
|
||||
}
|
||||
|
||||
code = tsdbRowMergerInit(pMerger, ps);
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
static int32_t buildDataBlockFromBuf(STsdbReader* pReader, STableBlockScanInfo* pBlockScanInfo, int64_t endKey) {
|
||||
if (!(pBlockScanInfo->iiter.hasVal || pBlockScanInfo->iter.hasVal)) {
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t code = initRowMergeIfNeeded(pReader, pBlockScanInfo->uid);
|
||||
if (code != 0) {
|
||||
return code;
|
||||
}
|
||||
|
||||
int64_t st = taosGetTimestampUs();
|
||||
SSDataBlock* pBlock = pReader->resBlockInfo.pResBlock;
|
||||
int32_t code = buildDataBlockFromBufImpl(pBlockScanInfo, endKey, pReader->resBlockInfo.capacity, pReader);
|
||||
code = buildDataBlockFromBufImpl(pBlockScanInfo, endKey, pReader->resBlockInfo.capacity, pReader);
|
||||
|
||||
double el = (taosGetTimestampUs() - st) / 1000.0;
|
||||
updateComposedBlockInfo(pReader, el, pBlockScanInfo);
|
||||
|
@ -1943,20 +1964,10 @@ static int32_t doMergeBufAndFileRows(STsdbReader* pReader, STableBlockScanInfo*
|
|||
TSDBROW fRow = tsdbRowFromBlockData(pBlockData, pDumpInfo->rowIndex);
|
||||
|
||||
// merge is not initialized yet, due to the fact that the pReader->info.pSchema is not initialized
|
||||
if (pMerger->pArray == NULL) {
|
||||
if (pReader->info.pSchema != NULL) {
|
||||
tsdbError("tsdb failed at %s:%d", __func__, __LINE__);
|
||||
return TSDB_CODE_INTERNAL_ERROR;
|
||||
}
|
||||
STSchema* ps = getTableSchemaImpl(pReader, pBlockScanInfo->uid);
|
||||
if (ps == NULL) {
|
||||
return terrno;
|
||||
}
|
||||
int32_t code = tsdbRowMergerInit(pMerger, ps);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
int32_t code = initRowMergeIfNeeded(pReader, pBlockScanInfo->uid);
|
||||
if (code != 0) {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
||||
SRowKey minKey = k;
|
||||
if (pReader->info.order == TSDB_ORDER_ASC) {
|
||||
|
@ -1983,7 +1994,7 @@ static int32_t doMergeBufAndFileRows(STsdbReader* pReader, STableBlockScanInfo*
|
|||
|
||||
// file block ---> stt block -----> mem
|
||||
if (pkCompEx(&minKey, pfKey) == 0) {
|
||||
int32_t code = tsdbRowMergerAdd(pMerger, &fRow, NULL);
|
||||
code = tsdbRowMergerAdd(pMerger, &fRow, NULL);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
return code;
|
||||
}
|
||||
|
@ -1996,7 +2007,7 @@ static int32_t doMergeBufAndFileRows(STsdbReader* pReader, STableBlockScanInfo*
|
|||
|
||||
if (pkCompEx(&minKey, pSttKey) == 0) {
|
||||
TSDBROW* fRow1 = tMergeTreeGetRow(&pSttBlockReader->mergeTree);
|
||||
int32_t code = tsdbRowMergerAdd(pMerger, fRow1, NULL);
|
||||
code = tsdbRowMergerAdd(pMerger, fRow1, NULL);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
return code;
|
||||
}
|
||||
|
@ -2007,7 +2018,7 @@ static int32_t doMergeBufAndFileRows(STsdbReader* pReader, STableBlockScanInfo*
|
|||
}
|
||||
|
||||
if (pkCompEx(&minKey, &k) == 0) {
|
||||
int32_t code = tsdbRowMergerAdd(pMerger, pRow, pSchema);
|
||||
code = tsdbRowMergerAdd(pMerger, pRow, pSchema);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
return code;
|
||||
}
|
||||
|
@ -2018,7 +2029,7 @@ static int32_t doMergeBufAndFileRows(STsdbReader* pReader, STableBlockScanInfo*
|
|||
}
|
||||
}
|
||||
|
||||
int32_t code = tsdbRowMergerGetRow(pMerger, &pTSRow);
|
||||
code = tsdbRowMergerGetRow(pMerger, &pTSRow);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
return code;
|
||||
}
|
||||
|
@ -2039,20 +2050,10 @@ static int32_t mergeFileBlockAndSttBlock(STsdbReader* pReader, SSttBlockReader*
|
|||
int32_t pkSrcSlot = pReader->suppInfo.pkSrcSlot;
|
||||
|
||||
// merge is not initialized yet, due to the fact that the pReader->info.pSchema is not initialized
|
||||
if (pMerger->pArray == NULL) {
|
||||
if (pReader->info.pSchema) {
|
||||
tsdbError("tsdb failed at %s %d", __func__, __LINE__);
|
||||
return TSDB_CODE_INTERNAL_ERROR;
|
||||
}
|
||||
STSchema* ps = getTableSchemaImpl(pReader, pBlockScanInfo->uid);
|
||||
if (ps == NULL) {
|
||||
return terrno;
|
||||
}
|
||||
code = tsdbRowMergerInit(pMerger, ps);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
code = initRowMergeIfNeeded(pReader, pBlockScanInfo->uid);
|
||||
if (code != 0) {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
||||
bool dataInDataFile = hasDataInFileBlock(pBlockData, pDumpInfo);
|
||||
bool dataInSttFile = hasDataInSttBlock(pBlockScanInfo);
|
||||
|
@ -2175,21 +2176,10 @@ static int32_t doMergeMultiLevelRows(STsdbReader* pReader, STableBlockScanInfo*
|
|||
}
|
||||
|
||||
// merge is not initialized yet, due to the fact that the pReader->info.pSchema is not initialized
|
||||
if (pMerger->pArray == NULL) {
|
||||
if (pReader->info.pSchema != NULL) {
|
||||
tsdbError("tsdb read failed at: %s:%d", __func__, __LINE__);
|
||||
return TSDB_CODE_INTERNAL_ERROR;
|
||||
}
|
||||
STSchema* ps = getTableSchemaImpl(pReader, pBlockScanInfo->uid);
|
||||
if (ps == NULL) {
|
||||
return terrno;
|
||||
}
|
||||
|
||||
code = tsdbRowMergerInit(pMerger, ps);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
code = initRowMergeIfNeeded(pReader, pBlockScanInfo->uid);
|
||||
if (code != 0) {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
||||
SRowKey minKey = k;
|
||||
if (ASCENDING_TRAVERSE(pReader->info.order)) {
|
||||
|
@ -2579,21 +2569,10 @@ int32_t mergeRowsInFileBlocks(SBlockData* pBlockData, STableBlockScanInfo* pBloc
|
|||
}
|
||||
|
||||
// merge is not initialized yet, due to the fact that the pReader->info.pSchema is not initialized
|
||||
if (pMerger->pArray == NULL) {
|
||||
if (pReader->info.pSchema != NULL) {
|
||||
tsdbError("tsdb reader failed at: %s:%d", __func__, __LINE__);
|
||||
return TSDB_CODE_INTERNAL_ERROR;
|
||||
}
|
||||
STSchema* ps = getTableSchemaImpl(pReader, pBlockScanInfo->uid);
|
||||
if (ps == NULL) {
|
||||
return terrno;
|
||||
}
|
||||
|
||||
code = tsdbRowMergerInit(pMerger, ps);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
code = initRowMergeIfNeeded(pReader, pBlockScanInfo->uid);
|
||||
if (code != 0) {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
||||
tRowKeyAssign(&pBlockScanInfo->lastProcKey, pKey);
|
||||
|
||||
|
|
|
@ -551,6 +551,8 @@ int32_t setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t n
|
|||
if (code != TSDB_CODE_SUCCESS && fmIsUserDefinedFunc(pCtx[i].functionId)) {
|
||||
pResInfo->initialized = false;
|
||||
return TSDB_CODE_UDF_FUNC_EXEC_FAILURE;
|
||||
} else if (code != TSDB_CODE_SUCCESS) {
|
||||
return code;
|
||||
}
|
||||
} else {
|
||||
pResInfo->initialized = true;
|
||||
|
|
|
@ -200,7 +200,8 @@ SNode* createDefaultTableOptions(SAstCreateContext* pCxt);
|
|||
SNode* createAlterTableOptions(SAstCreateContext* pCxt);
|
||||
SNode* setTableOption(SAstCreateContext* pCxt, SNode* pOptions, ETableOptionType type, void* pVal);
|
||||
SNode* createColumnDefNode(SAstCreateContext* pCxt, SToken* pColName, SDataType dataType, SNode* pOptions);
|
||||
SNode* setColumnOptions(SAstCreateContext* pCxt, SNode* pOptions, EColumnOptionType type, void* pVal);
|
||||
SNode* setColumnOptions(SAstCreateContext* pCxt, SNode* pOptions, const SToken* pVal1, void* pVal2);
|
||||
SNode* setColumnOptionsPK(SAstCreateContext* pCxt, SNode* pOptions);
|
||||
SNode* createDefaultColumnOptions(SAstCreateContext* pCxt);
|
||||
SNode* createCreateTableStmt(SAstCreateContext* pCxt, bool ignoreExists, SNode* pRealTable, SNodeList* pCols,
|
||||
SNodeList* pTags, SNode* pOptions);
|
||||
|
|
|
@ -750,7 +750,7 @@ column_stream_def_list(A) ::= column_stream_def_list(B)
|
|||
|
||||
column_stream_def(A) ::= column_name(B) stream_col_options(C). { A = createColumnDefNode(pCxt, &B, createDataType(TSDB_DATA_TYPE_NULL), C); }
|
||||
stream_col_options(A) ::= . { A = createDefaultColumnOptions(pCxt); }
|
||||
stream_col_options(A) ::= stream_col_options(B) PRIMARY KEY. { A = setColumnOptions(pCxt, B, COLUMN_OPTION_PRIMARYKEY, NULL); }
|
||||
stream_col_options(A) ::= stream_col_options(B) PRIMARY KEY. { A = setColumnOptionsPK(pCxt, B); }
|
||||
//column_stream_def(A) ::= column_def(B). { A = B; }
|
||||
|
||||
%type tag_def_or_ref_opt { SNodeList* }
|
||||
|
@ -1612,7 +1612,5 @@ null_ordering_opt(A) ::= NULLS LAST.
|
|||
STRICT STRING TIMES VALUES VARIABLE VIEW WAL.
|
||||
|
||||
column_options(A) ::= . { A = createDefaultColumnOptions(pCxt); }
|
||||
column_options(A) ::= column_options(B) PRIMARY KEY. { A = setColumnOptions(pCxt, B, COLUMN_OPTION_PRIMARYKEY, NULL); }
|
||||
column_options(A) ::= column_options(B) ENCODE NK_STRING(C). { A = setColumnOptions(pCxt, B, COLUMN_OPTION_ENCODE, &C); }
|
||||
column_options(A) ::= column_options(B) COMPRESS NK_STRING(C). { A = setColumnOptions(pCxt, B, COLUMN_OPTION_COMPRESS, &C); }
|
||||
column_options(A) ::= column_options(B) LEVEL NK_STRING(C). { A = setColumnOptions(pCxt, B, COLUMN_OPTION_LEVEL, &C); }
|
||||
column_options(A) ::= column_options(B) PRIMARY KEY. { A = setColumnOptionsPK(pCxt, B); }
|
||||
column_options(A) ::= column_options(B) NK_ID(C) NK_STRING(D). { A = setColumnOptions(pCxt, B, &C, &D); }
|
||||
|
|
|
@ -2160,34 +2160,60 @@ _err:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SNode* setColumnOptions(SAstCreateContext* pCxt, SNode* pOptions, EColumnOptionType type, void* pVal) {
|
||||
EColumnOptionType getColumnOptionType(const char* optionType) {
|
||||
if (0 == strcasecmp(optionType, "ENCODE")) {
|
||||
return COLUMN_OPTION_ENCODE;
|
||||
} else if (0 == strcasecmp(optionType, "COMPRESS")) {
|
||||
return COLUMN_OPTION_COMPRESS;
|
||||
} else if (0 == strcasecmp(optionType, "LEVEL")) {
|
||||
return COLUMN_OPTION_LEVEL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
SNode* setColumnOptionsPK(SAstCreateContext* pCxt, SNode* pOptions) {
|
||||
CHECK_PARSER_STATUS(pCxt);
|
||||
((SColumnOptions*)pOptions)->bPrimaryKey = true;
|
||||
return pOptions;
|
||||
_err:
|
||||
nodesDestroyNode(pOptions);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SNode* setColumnOptions(SAstCreateContext* pCxt, SNode* pOptions, const SToken* pVal1, void* pVal2) {
|
||||
CHECK_PARSER_STATUS(pCxt);
|
||||
char optionType[TSDB_CL_OPTION_LEN];
|
||||
|
||||
memset(optionType, 0, TSDB_CL_OPTION_LEN);
|
||||
strncpy(optionType, pVal1->z, TMIN(pVal1->n, TSDB_CL_OPTION_LEN));
|
||||
if (0 == strlen(optionType)) {
|
||||
pCxt->errCode = TSDB_CODE_PAR_SYNTAX_ERROR;
|
||||
return pOptions;
|
||||
}
|
||||
EColumnOptionType type = getColumnOptionType(optionType);
|
||||
switch (type) {
|
||||
case COLUMN_OPTION_ENCODE:
|
||||
memset(((SColumnOptions*)pOptions)->encode, 0, TSDB_CL_COMPRESS_OPTION_LEN);
|
||||
COPY_STRING_FORM_STR_TOKEN(((SColumnOptions*)pOptions)->encode, (SToken*)pVal);
|
||||
COPY_STRING_FORM_STR_TOKEN(((SColumnOptions*)pOptions)->encode, (SToken*)pVal2);
|
||||
if (0 == strlen(((SColumnOptions*)pOptions)->encode)) {
|
||||
pCxt->errCode = TSDB_CODE_TSC_ENCODE_PARAM_ERROR;
|
||||
}
|
||||
break;
|
||||
case COLUMN_OPTION_COMPRESS:
|
||||
memset(((SColumnOptions*)pOptions)->compress, 0, TSDB_CL_COMPRESS_OPTION_LEN);
|
||||
COPY_STRING_FORM_STR_TOKEN(((SColumnOptions*)pOptions)->compress, (SToken*)pVal);
|
||||
COPY_STRING_FORM_STR_TOKEN(((SColumnOptions*)pOptions)->compress, (SToken*)pVal2);
|
||||
if (0 == strlen(((SColumnOptions*)pOptions)->compress)) {
|
||||
pCxt->errCode = TSDB_CODE_TSC_COMPRESS_PARAM_ERROR;
|
||||
}
|
||||
break;
|
||||
case COLUMN_OPTION_LEVEL:
|
||||
memset(((SColumnOptions*)pOptions)->compressLevel, 0, TSDB_CL_COMPRESS_OPTION_LEN);
|
||||
COPY_STRING_FORM_STR_TOKEN(((SColumnOptions*)pOptions)->compressLevel, (SToken*)pVal);
|
||||
COPY_STRING_FORM_STR_TOKEN(((SColumnOptions*)pOptions)->compressLevel, (SToken*)pVal2);
|
||||
if (0 == strlen(((SColumnOptions*)pOptions)->compressLevel)) {
|
||||
pCxt->errCode = TSDB_CODE_TSC_COMPRESS_LEVEL_ERROR;
|
||||
}
|
||||
break;
|
||||
case COLUMN_OPTION_PRIMARYKEY:
|
||||
((SColumnOptions*)pOptions)->bPrimaryKey = true;
|
||||
break;
|
||||
default:
|
||||
pCxt->errCode = TSDB_CODE_PAR_SYNTAX_ERROR;
|
||||
break;
|
||||
}
|
||||
return pOptions;
|
||||
|
|
|
@ -338,9 +338,6 @@ static SKeyword keywordTable[] = {
|
|||
{"S3_COMPACT", TK_S3_COMPACT},
|
||||
{"S3MIGRATE", TK_S3MIGRATE},
|
||||
{"KEEP_TIME_OFFSET", TK_KEEP_TIME_OFFSET},
|
||||
{"ENCODE", TK_ENCODE},
|
||||
{"COMPRESS", TK_COMPRESS},
|
||||
{"LEVEL", TK_LEVEL},
|
||||
{"ARBGROUPS", TK_ARBGROUPS},
|
||||
{"IS_IMPORT", TK_IS_IMPORT},
|
||||
{"FORCE_WINDOW_CLOSE", TK_FORCE_WINDOW_CLOSE},
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3266,6 +3266,7 @@ int32_t syncNodeAppend(SSyncNode* ths, SSyncRaftEntry* pEntry) {
|
|||
sError("vgId:%d, cannot append an invalid client request with no msg head. type:%s, dataLen:%d", ths->vgId,
|
||||
TMSG_INFO(pEntry->originalRpcType), pEntry->dataLen);
|
||||
syncEntryDestroy(pEntry);
|
||||
pEntry = NULL;
|
||||
goto _out;
|
||||
}
|
||||
|
||||
|
@ -3274,6 +3275,7 @@ int32_t syncNodeAppend(SSyncNode* ths, SSyncRaftEntry* pEntry) {
|
|||
sError("vgId:%d, failed to enqueue sync log buffer, index:%" PRId64, ths->vgId, pEntry->index);
|
||||
(void)syncFsmExecute(ths, ths->pFsm, ths->state, raftStoreGetTerm(ths), pEntry, terrno, false);
|
||||
syncEntryDestroy(pEntry);
|
||||
pEntry = NULL;
|
||||
goto _out;
|
||||
}
|
||||
|
||||
|
@ -3282,6 +3284,7 @@ _out:;
|
|||
// proceed match index, with replicating on needed
|
||||
SyncIndex matchIndex = syncLogBufferProceed(ths->pLogBuf, ths, NULL, "Append");
|
||||
|
||||
if(pEntry != NULL)
|
||||
sTrace("vgId:%d, append raft entry. index:%" PRId64 ", term:%" PRId64 " pBuf: [%" PRId64 " %" PRId64 " %" PRId64
|
||||
", %" PRId64 ")",
|
||||
ths->vgId, pEntry->index, pEntry->term, ths->pLogBuf->startIndex, ths->pLogBuf->commitIndex,
|
||||
|
|
|
@ -285,6 +285,7 @@ SHashObj *taosHashInit(size_t capacity, _hash_fn_t fn, bool update, SHashLockTyp
|
|||
}
|
||||
|
||||
if (taosArrayPush(pHashObj->pMemBlock, &p) == NULL) {
|
||||
taosMemoryFree(p);
|
||||
taosArrayDestroy(pHashObj->pMemBlock);
|
||||
taosMemoryFree(pHashObj->hashList);
|
||||
taosMemoryFree(pHashObj);
|
||||
|
|
|
@ -20,7 +20,7 @@ class TDTestCase(TBase):
|
|||
self.max_tag_length = 16382
|
||||
self.max_column_length = 65517
|
||||
self.child_table_num = 1
|
||||
self.insert_round_num = 700
|
||||
self.insert_round_num = 300
|
||||
self.row_num_per_round = 15
|
||||
self.start_ts = 1704082431000
|
||||
|
||||
|
@ -47,8 +47,8 @@ class TDTestCase(TBase):
|
|||
# check the data
|
||||
for i in range(self.child_table_num):
|
||||
tdSql.query(f"select * from ct_binary{i+1};")
|
||||
tdSql.checkRows(10500)
|
||||
row_num = random.randint(0, 9999)
|
||||
tdSql.checkRows(4500)
|
||||
row_num = random.randint(0, 3999)
|
||||
tdSql.checkData(row_num, 1, 'a' * self.max_column_length)
|
||||
tdSql.query(f"show tags from ct_binary{i+1};")
|
||||
tdSql.checkData(0, 5, tag)
|
||||
|
@ -71,8 +71,8 @@ class TDTestCase(TBase):
|
|||
# check the data
|
||||
for i in range(self.child_table_num):
|
||||
tdSql.query(f"select * from ct_varchar{i+1};")
|
||||
tdSql.checkRows(10500)
|
||||
row_num = random.randint(0, 9999)
|
||||
tdSql.checkRows(4500)
|
||||
row_num = random.randint(0, 3999)
|
||||
tdSql.checkData(row_num, 1, 'b' * self.max_column_length)
|
||||
tdSql.query(f"show tags from ct_varchar{i+1};")
|
||||
tdSql.checkData(0, 5, tag)
|
||||
|
@ -106,8 +106,8 @@ class TDTestCase(TBase):
|
|||
# check the data
|
||||
for i in range(self.child_table_num):
|
||||
tdSql.query(f"select * from ct_nchar{i+1};")
|
||||
tdSql.checkRows(10500)
|
||||
row_num = random.randint(0, 9999)
|
||||
tdSql.checkRows(4500)
|
||||
row_num = random.randint(0, 3999)
|
||||
tdSql.checkData(row_num, 1, column)
|
||||
tdSql.query(f"show tags from ct_nchar{i+1};")
|
||||
tdSql.checkData(0, 5, tag)
|
||||
|
@ -132,8 +132,8 @@ class TDTestCase(TBase):
|
|||
# check the data
|
||||
for i in range(self.child_table_num):
|
||||
tdSql.query(f"select * from ct_varbinary{i+1};")
|
||||
tdSql.checkRows(5600)
|
||||
row_num = random.randint(0, 5599)
|
||||
tdSql.checkRows(2400)
|
||||
row_num = random.randint(0, 2399)
|
||||
tdSql.checkData(row_num, 1, bytes.fromhex(column))
|
||||
tdSql.query(f"show tags from ct_varbinary{i+1};")
|
||||
tdSql.checkData(0, 5, '\\x' + tag.upper())
|
||||
|
@ -161,8 +161,8 @@ class TDTestCase(TBase):
|
|||
# check the data
|
||||
for i in range(self.child_table_num):
|
||||
tdSql.query(f"select * from ct_json_tag{i+1} where t1->'{tag_key}' = '{tag_value}';")
|
||||
tdSql.checkRows(5600)
|
||||
row_num = random.randint(0, 5599)
|
||||
tdSql.checkRows(2400)
|
||||
row_num = random.randint(0, 2399)
|
||||
tdSql.checkData(row_num, 1, bytes.fromhex(column))
|
||||
|
||||
def run(self):
|
||||
|
|
|
@ -19,7 +19,6 @@ import taos
|
|||
import frame
|
||||
import frame.etool
|
||||
|
||||
|
||||
from frame.log import *
|
||||
from frame.cases import *
|
||||
from frame.sql import *
|
||||
|
@ -29,14 +28,13 @@ from frame import *
|
|||
|
||||
class TDTestCase(TBase):
|
||||
updatecfgDict = {
|
||||
"keepColumnName" : "1",
|
||||
"ttlChangeOnWrite" : "1",
|
||||
"querySmaOptimize" : "1",
|
||||
"slowLogScope" : "none",
|
||||
"queryBufferSize" : 10240
|
||||
"keepColumnName": "1",
|
||||
"ttlChangeOnWrite": "1",
|
||||
"querySmaOptimize": "1",
|
||||
"slowLogScope": "none",
|
||||
"queryBufferSize": 10240
|
||||
}
|
||||
|
||||
|
||||
def insertData(self):
|
||||
tdLog.info(f"insert data.")
|
||||
# taosBenchmark run
|
||||
|
@ -508,6 +506,11 @@ class TDTestCase(TBase):
|
|||
tdSql.checkRows(1)
|
||||
tdSql.checkData(0, 0, None)
|
||||
|
||||
def test_error(self):
|
||||
tdSql.error(
|
||||
"select * from (select to_iso8601(ts, timezone()), timezone() from meters order by ts desc) limit 1000;",
|
||||
expectErrInfo="Not supported timzone format") # TS-5340
|
||||
|
||||
# run
|
||||
def run(self):
|
||||
tdLog.debug(f"start to excute {__file__}")
|
||||
|
@ -547,8 +550,11 @@ class TDTestCase(TBase):
|
|||
# agg function
|
||||
self.test_stddev()
|
||||
self.test_varpop()
|
||||
tdLog.success(f"{__file__} successfully executed")
|
||||
|
||||
# error function
|
||||
self.test_error()
|
||||
|
||||
tdLog.success(f"{__file__} successfully executed")
|
||||
|
||||
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
|
|
|
@ -225,6 +225,11 @@ class TDTestCase(TBase):
|
|||
sql2 = "select bi from stb where bi is not null order by bi desc limit 10;"
|
||||
self.checkSameResult(sql1, sql2)
|
||||
|
||||
# same as by TD-31726
|
||||
sql1 = "select fc as a, dc as a from stb limit 5;"
|
||||
sql2 = "select * from (select fc as a, dc as a from stb)t limit 5;"
|
||||
self.checkSameResult(sql1, sql2)
|
||||
|
||||
# distributed expect values
|
||||
expects = {
|
||||
"Block_Rows" : 6*100000,
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
###################################################################
|
||||
# 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 -*-
|
||||
from frame.log import *
|
||||
from frame.cases import *
|
||||
from frame.sql import *
|
||||
from frame import etool
|
||||
|
||||
|
||||
class TDTestCase:
|
||||
# init
|
||||
def init(self, conn, logSql, replicaVar=1):
|
||||
self.replicaVar = int(replicaVar)
|
||||
tdLog.debug(f"start to excute {__file__}")
|
||||
tdSql.init(conn.cursor(), True)
|
||||
# taosBenchmark run
|
||||
tdLog.info(f"insert data.")
|
||||
jfile = etool.curFile(__file__, "window.json")
|
||||
etool.benchMark(json=jfile)
|
||||
|
||||
# run
|
||||
def run(self):
|
||||
# TD-31660
|
||||
sql = "select _wstart,_wend,count(voltage),tbname from db.stb partition by tbname event_window start with voltage >2 end with voltage > 15 slimit 5 limit 5"
|
||||
tdSql.query(sql)
|
||||
tdSql.checkRows(25)
|
||||
sql = "select _wstart,_wend,count(voltage),tbname from db.stb partition by tbname count_window(600) slimit 5 limit 5;"
|
||||
tdSql.query(sql)
|
||||
tdSql.checkRows(25)
|
||||
|
||||
# stop
|
||||
def stop(self):
|
||||
tdSql.execute("drop database db;")
|
||||
tdSql.close()
|
||||
tdLog.success(f"{__file__} successfully executed")
|
||||
|
||||
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
|
@ -0,0 +1,123 @@
|
|||
{
|
||||
"filetype": "insert",
|
||||
"cfgdir": "/etc/taos",
|
||||
"host": "127.0.0.1",
|
||||
"port": 6030,
|
||||
"user": "root",
|
||||
"password": "taosdata",
|
||||
"connection_pool_size": 8,
|
||||
"num_of_records_per_req": 4000,
|
||||
"prepared_rand": 10000,
|
||||
"thread_count": 3,
|
||||
"create_table_thread_count": 1,
|
||||
"confirm_parameter_prompt": "no",
|
||||
"databases": [
|
||||
{
|
||||
"dbinfo": {
|
||||
"name": "db",
|
||||
"drop": "yes",
|
||||
"vgroups": 3,
|
||||
"replica": 1,
|
||||
"duration": "3d",
|
||||
"wal_retention_period": 1,
|
||||
"wal_retention_size": 1,
|
||||
"stt_trigger": 1
|
||||
},
|
||||
"super_tables": [
|
||||
{
|
||||
"name": "stb",
|
||||
"child_table_exists": "no",
|
||||
"childtable_count": 6,
|
||||
"insert_rows": 100000,
|
||||
"childtable_prefix": "d",
|
||||
"insert_mode": "taosc",
|
||||
"timestamp_step": 30000,
|
||||
"start_timestamp": 1700000000000,
|
||||
"columns": [
|
||||
{
|
||||
"type": "bool",
|
||||
"name": "bc"
|
||||
},
|
||||
{
|
||||
"type": "float",
|
||||
"name": "fc"
|
||||
},
|
||||
{
|
||||
"type": "double",
|
||||
"name": "voltage",
|
||||
"max": 250,
|
||||
"min": 200
|
||||
},
|
||||
{
|
||||
"type": "tinyint",
|
||||
"name": "ti"
|
||||
},
|
||||
{
|
||||
"type": "smallint",
|
||||
"name": "si"
|
||||
},
|
||||
{
|
||||
"type": "int",
|
||||
"name": "ic"
|
||||
},
|
||||
{
|
||||
"type": "bigint",
|
||||
"name": "bi"
|
||||
},
|
||||
{
|
||||
"type": "utinyint",
|
||||
"name": "uti"
|
||||
},
|
||||
{
|
||||
"type": "usmallint",
|
||||
"name": "usi"
|
||||
},
|
||||
{
|
||||
"type": "uint",
|
||||
"name": "ui"
|
||||
},
|
||||
{
|
||||
"type": "ubigint",
|
||||
"name": "ubi"
|
||||
},
|
||||
{
|
||||
"type": "binary",
|
||||
"name": "bin",
|
||||
"len": 8
|
||||
},
|
||||
{
|
||||
"type": "nchar",
|
||||
"name": "nch",
|
||||
"len": 16
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
{
|
||||
"type": "tinyint",
|
||||
"name": "groupid",
|
||||
"max": 10,
|
||||
"min": 1
|
||||
},
|
||||
{
|
||||
"name": "location",
|
||||
"type": "binary",
|
||||
"len": 16,
|
||||
"values": [
|
||||
"San Francisco",
|
||||
"Los Angles",
|
||||
"San Diego",
|
||||
"San Jose",
|
||||
"Palo Alto",
|
||||
"Campbell",
|
||||
"Mountain View",
|
||||
"Sunnyvale",
|
||||
"Santa Clara",
|
||||
"Cupertino"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -279,6 +279,12 @@ class TDTestCase(TBase):
|
|||
|
||||
# alter error
|
||||
sqls = [
|
||||
f"alter table {tbname} add column a1 int ONLYOPTION",
|
||||
f"alter table {tbname} add column a1 int 'simple8b';",
|
||||
f"alter table {tbname} add column a1 int WRONG 'simple8b';",
|
||||
f"alter table {tbname} add column a1 int 123456789 'simple8b';",
|
||||
f"alter table {tbname} add column a1 int WRONGANDVERYLONG 'simple8b';",
|
||||
f"alter table {tbname} add column a1 int ENCODE 'veryveryveryveryveryverylong';",
|
||||
f"alter table {tbname} add column a1 int ENCODE 'simple8bAA';",
|
||||
f"alter table {tbname} add column a2 int COMPRESS 'AABB';",
|
||||
f"alter table {tbname} add column a3 bigint LEVEL 'high1';",
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
,,y,army,./pytest.sh python3 ./test.py -f tmq/tmqBugs.py -N 3
|
||||
,,y,army,./pytest.sh python3 ./test.py -f query/fill/fill_compare_asc_desc.py
|
||||
,,y,army,./pytest.sh python3 ./test.py -f query/last/test_last.py
|
||||
,,y,army,./pytest.sh python3 ./test.py -f query/window/base.py
|
||||
|
||||
#
|
||||
# system test
|
||||
|
|
Loading…
Reference in New Issue