Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6386c323
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
6386c323
编写于
4月 24, 2023
作者:
D
dapan1121
提交者:
GitHub
4月 24, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #21034 from taosdata/szhou/td-23586
enhance: error code refactor
上级
f5a97448
8ce07b0c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
11 addition
and
18 deletion
+11
-18
include/util/taoserror.h
include/util/taoserror.h
+6
-8
source/libs/function/src/tudf.c
source/libs/function/src/tudf.c
+4
-7
source/util/src/terror.c
source/util/src/terror.c
+1
-3
未找到文件。
include/util/taoserror.h
浏览文件 @
6386c323
...
@@ -716,15 +716,13 @@ int32_t* taosGetErrno();
...
@@ -716,15 +716,13 @@ int32_t* taosGetErrno();
#define TSDB_CODE_UDF_STOPPING TAOS_DEF_ERROR_CODE(0, 0x2901)
#define TSDB_CODE_UDF_STOPPING TAOS_DEF_ERROR_CODE(0, 0x2901)
#define TSDB_CODE_UDF_PIPE_READ_ERR TAOS_DEF_ERROR_CODE(0, 0x2902)
#define TSDB_CODE_UDF_PIPE_READ_ERR TAOS_DEF_ERROR_CODE(0, 0x2902)
#define TSDB_CODE_UDF_PIPE_CONNECT_ERR TAOS_DEF_ERROR_CODE(0, 0x2903)
#define TSDB_CODE_UDF_PIPE_CONNECT_ERR TAOS_DEF_ERROR_CODE(0, 0x2903)
#define TSDB_CODE_UDF_PIPE_NO
_PIPE
TAOS_DEF_ERROR_CODE(0, 0x2904)
#define TSDB_CODE_UDF_PIPE_NO
T_EXIST
TAOS_DEF_ERROR_CODE(0, 0x2904)
#define TSDB_CODE_UDF_LOAD_UDF_FAILURE TAOS_DEF_ERROR_CODE(0, 0x2905)
#define TSDB_CODE_UDF_LOAD_UDF_FAILURE TAOS_DEF_ERROR_CODE(0, 0x2905)
#define TSDB_CODE_UDF_INVALID_STATE TAOS_DEF_ERROR_CODE(0, 0x2906)
#define TSDB_CODE_UDF_INVALID_INPUT TAOS_DEF_ERROR_CODE(0, 0x2906)
#define TSDB_CODE_UDF_INVALID_INPUT TAOS_DEF_ERROR_CODE(0, 0x2907)
#define TSDB_CODE_UDF_INVALID_BUFSIZE TAOS_DEF_ERROR_CODE(0, 0x2907)
#define TSDB_CODE_UDF_NO_FUNC_HANDLE TAOS_DEF_ERROR_CODE(0, 0x2908)
#define TSDB_CODE_UDF_INVALID_OUTPUT_TYPE TAOS_DEF_ERROR_CODE(0, 0x2908)
#define TSDB_CODE_UDF_INVALID_BUFSIZE TAOS_DEF_ERROR_CODE(0, 0x2909)
#define TSDB_CODE_UDF_SCRIPT_NOT_SUPPORTED TAOS_DEF_ERROR_CODE(0, 0x2909)
#define TSDB_CODE_UDF_INVALID_OUTPUT_TYPE TAOS_DEF_ERROR_CODE(0, 0x290A)
#define TSDB_CODE_UDF_FUNC_EXEC_FAILURE TAOS_DEF_ERROR_CODE(0, 0x290A)
#define TSDB_CODE_UDF_SCRIPT_NOT_SUPPORTED TAOS_DEF_ERROR_CODE(0, 0x290B)
#define TSDB_CODE_UDF_FUNC_EXEC_FAILURE TAOS_DEF_ERROR_CODE(0, 0x290C)
// sml
// sml
#define TSDB_CODE_SML_INVALID_PROTOCOL_TYPE TAOS_DEF_ERROR_CODE(0, 0x3000)
#define TSDB_CODE_SML_INVALID_PROTOCOL_TYPE TAOS_DEF_ERROR_CODE(0, 0x3000)
...
...
source/libs/function/src/tudf.c
浏览文件 @
6386c323
...
@@ -1580,7 +1580,7 @@ int32_t udfcStartUvTask(SClientUvTaskNode *uvTask) {
...
@@ -1580,7 +1580,7 @@ int32_t udfcStartUvTask(SClientUvTaskNode *uvTask) {
case
UV_TASK_REQ_RSP
:
{
case
UV_TASK_REQ_RSP
:
{
uv_pipe_t
*
pipe
=
uvTask
->
pipe
;
uv_pipe_t
*
pipe
=
uvTask
->
pipe
;
if
(
pipe
==
NULL
)
{
if
(
pipe
==
NULL
)
{
code
=
TSDB_CODE_UDF_PIPE_NO
_PIPE
;
code
=
TSDB_CODE_UDF_PIPE_NO
T_EXIST
;
}
else
{
}
else
{
uv_write_t
*
write
=
taosMemoryMalloc
(
sizeof
(
uv_write_t
));
uv_write_t
*
write
=
taosMemoryMalloc
(
sizeof
(
uv_write_t
));
write
->
data
=
pipe
->
data
;
write
->
data
=
pipe
->
data
;
...
@@ -1598,7 +1598,7 @@ int32_t udfcStartUvTask(SClientUvTaskNode *uvTask) {
...
@@ -1598,7 +1598,7 @@ int32_t udfcStartUvTask(SClientUvTaskNode *uvTask) {
case
UV_TASK_DISCONNECT
:
{
case
UV_TASK_DISCONNECT
:
{
uv_pipe_t
*
pipe
=
uvTask
->
pipe
;
uv_pipe_t
*
pipe
=
uvTask
->
pipe
;
if
(
pipe
==
NULL
)
{
if
(
pipe
==
NULL
)
{
code
=
TSDB_CODE_UDF_PIPE_NO
_PIPE
;
code
=
TSDB_CODE_UDF_PIPE_NO
T_EXIST
;
}
else
{
}
else
{
SClientUvConn
*
conn
=
pipe
->
data
;
SClientUvConn
*
conn
=
pipe
->
data
;
QUEUE_INSERT_TAIL
(
&
conn
->
taskQueue
,
&
uvTask
->
connTaskQueue
);
QUEUE_INSERT_TAIL
(
&
conn
->
taskQueue
,
&
uvTask
->
connTaskQueue
);
...
@@ -1759,9 +1759,6 @@ int32_t udfcRunUdfUvTask(SClientUdfTask *task, int8_t uvTaskType) {
...
@@ -1759,9 +1759,6 @@ int32_t udfcRunUdfUvTask(SClientUdfTask *task, int8_t uvTaskType) {
}
}
int32_t
doSetupUdf
(
char
udfName
[],
UdfcFuncHandle
*
funcHandle
)
{
int32_t
doSetupUdf
(
char
udfName
[],
UdfcFuncHandle
*
funcHandle
)
{
if
(
gUdfcProxy
.
udfcState
!=
UDFC_STATE_READY
)
{
return
TSDB_CODE_UDF_INVALID_STATE
;
}
SClientUdfTask
*
task
=
taosMemoryCalloc
(
1
,
sizeof
(
SClientUdfTask
));
SClientUdfTask
*
task
=
taosMemoryCalloc
(
1
,
sizeof
(
SClientUdfTask
));
task
->
errCode
=
0
;
task
->
errCode
=
0
;
task
->
session
=
taosMemoryCalloc
(
1
,
sizeof
(
SUdfcUvSession
));
task
->
session
=
taosMemoryCalloc
(
1
,
sizeof
(
SUdfcUvSession
));
...
@@ -1804,7 +1801,7 @@ int32_t callUdf(UdfcFuncHandle handle, int8_t callType, SSDataBlock *input, SUdf
...
@@ -1804,7 +1801,7 @@ int32_t callUdf(UdfcFuncHandle handle, int8_t callType, SSDataBlock *input, SUdf
SUdfcUvSession
*
session
=
(
SUdfcUvSession
*
)
handle
;
SUdfcUvSession
*
session
=
(
SUdfcUvSession
*
)
handle
;
if
(
session
->
udfUvPipe
==
NULL
)
{
if
(
session
->
udfUvPipe
==
NULL
)
{
fnError
(
"No pipe to udfd"
);
fnError
(
"No pipe to udfd"
);
return
TSDB_CODE_UDF_PIPE_NO
_PIPE
;
return
TSDB_CODE_UDF_PIPE_NO
T_EXIST
;
}
}
SClientUdfTask
*
task
=
taosMemoryCalloc
(
1
,
sizeof
(
SClientUdfTask
));
SClientUdfTask
*
task
=
taosMemoryCalloc
(
1
,
sizeof
(
SClientUdfTask
));
task
->
errCode
=
0
;
task
->
errCode
=
0
;
...
@@ -1928,7 +1925,7 @@ int32_t doTeardownUdf(UdfcFuncHandle handle) {
...
@@ -1928,7 +1925,7 @@ int32_t doTeardownUdf(UdfcFuncHandle handle) {
if
(
session
->
udfUvPipe
==
NULL
)
{
if
(
session
->
udfUvPipe
==
NULL
)
{
fnError
(
"tear down udf. pipe to udfd does not exist. udf name: %s"
,
session
->
udfName
);
fnError
(
"tear down udf. pipe to udfd does not exist. udf name: %s"
,
session
->
udfName
);
taosMemoryFree
(
session
);
taosMemoryFree
(
session
);
return
TSDB_CODE_UDF_PIPE_NO
_PIPE
;
return
TSDB_CODE_UDF_PIPE_NO
T_EXIST
;
}
}
SClientUdfTask
*
task
=
taosMemoryCalloc
(
1
,
sizeof
(
SClientUdfTask
));
SClientUdfTask
*
task
=
taosMemoryCalloc
(
1
,
sizeof
(
SClientUdfTask
));
...
...
source/util/src/terror.c
浏览文件 @
6386c323
...
@@ -581,11 +581,9 @@ TAOS_DEFINE_ERROR(TSDB_CODE_FUNC_DUP_TIMESTAMP, "Duplicate timestamps
...
@@ -581,11 +581,9 @@ TAOS_DEFINE_ERROR(TSDB_CODE_FUNC_DUP_TIMESTAMP, "Duplicate timestamps
TAOS_DEFINE_ERROR
(
TSDB_CODE_UDF_STOPPING
,
"udf is stopping"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_UDF_STOPPING
,
"udf is stopping"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_UDF_PIPE_READ_ERR
,
"udf pipe read error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_UDF_PIPE_READ_ERR
,
"udf pipe read error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_UDF_PIPE_CONNECT_ERR
,
"udf pipe connect error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_UDF_PIPE_CONNECT_ERR
,
"udf pipe connect error"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_UDF_PIPE_NO
_PIPE
,
"udf no pipe
"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_UDF_PIPE_NO
T_EXIST
,
"udf pipe not exist
"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_UDF_LOAD_UDF_FAILURE
,
"udf load failure"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_UDF_LOAD_UDF_FAILURE
,
"udf load failure"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_UDF_INVALID_STATE
,
"udf invalid state"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_UDF_INVALID_INPUT
,
"udf invalid function input"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_UDF_INVALID_INPUT
,
"udf invalid function input"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_UDF_NO_FUNC_HANDLE
,
"udf no function handle"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_UDF_INVALID_BUFSIZE
,
"udf invalid bufsize"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_UDF_INVALID_BUFSIZE
,
"udf invalid bufsize"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_UDF_INVALID_OUTPUT_TYPE
,
"udf invalid output type"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_UDF_INVALID_OUTPUT_TYPE
,
"udf invalid output type"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_UDF_SCRIPT_NOT_SUPPORTED
,
"udf program language not supported"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_UDF_SCRIPT_NOT_SUPPORTED
,
"udf program language not supported"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录