Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d2941c06
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
d2941c06
编写于
7月 15, 2021
作者:
X
xywang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-5169]<enhance>: simplified function implementation
上级
cf76ed44
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
13 addition
and
17 deletion
+13
-17
src/inc/taoserror.h
src/inc/taoserror.h
+2
-0
src/plugins/http/src/httpGcHandle.c
src/plugins/http/src/httpGcHandle.c
+2
-6
src/plugins/http/src/httpSql.c
src/plugins/http/src/httpSql.c
+5
-5
src/plugins/http/src/httpTgHandle.c
src/plugins/http/src/httpTgHandle.c
+2
-6
src/util/src/terror.c
src/util/src/terror.c
+2
-0
未找到文件。
src/inc/taoserror.h
浏览文件 @
d2941c06
...
@@ -395,6 +395,8 @@ int32_t* taosGetErrno();
...
@@ -395,6 +395,8 @@ int32_t* taosGetErrno();
#define TSDB_CODE_HTTP_OP_VALUE_NULL TAOS_DEF_ERROR_CODE(0, 0x11A5) //"value not find")
#define TSDB_CODE_HTTP_OP_VALUE_NULL TAOS_DEF_ERROR_CODE(0, 0x11A5) //"value not find")
#define TSDB_CODE_HTTP_OP_VALUE_TYPE TAOS_DEF_ERROR_CODE(0, 0x11A6) //"value type should be boolean number or string")
#define TSDB_CODE_HTTP_OP_VALUE_TYPE TAOS_DEF_ERROR_CODE(0, 0x11A6) //"value type should be boolean number or string")
#define TSDB_CODE_HTTP_REQUEST_JSON_ERROR TAOS_DEF_ERROR_CODE(0, 0x1F00) //"http request json error")
// odbc
// odbc
#define TSDB_CODE_ODBC_OOM TAOS_DEF_ERROR_CODE(0, 0x2100) //"out of memory")
#define TSDB_CODE_ODBC_OOM TAOS_DEF_ERROR_CODE(0, 0x2100) //"out of memory")
#define TSDB_CODE_ODBC_CONV_CHAR_NOT_NUM TAOS_DEF_ERROR_CODE(0, 0x2101) //"convertion not a valid literal input")
#define TSDB_CODE_ODBC_CONV_CHAR_NOT_NUM TAOS_DEF_ERROR_CODE(0, 0x2101) //"convertion not a valid literal input")
...
...
src/plugins/http/src/httpGcHandle.c
浏览文件 @
d2941c06
...
@@ -178,12 +178,8 @@ bool gcProcessQueryRequest(HttpContext* pContext) {
...
@@ -178,12 +178,8 @@ bool gcProcessQueryRequest(HttpContext* pContext) {
#define ESCAPE_ERROR_PROC(code, context, root) \
#define ESCAPE_ERROR_PROC(code, context, root) \
do { \
do { \
if (code != 0) { \
if (code != TSDB_CODE_SUCCESS) { \
if (code == 1) { \
httpSendErrorResp(context, code); \
httpSendErrorResp(context, TSDB_CODE_HTTP_GC_REQ_PARSE_ERROR); \
} else { \
httpSendErrorResp(context, TSDB_CODE_HTTP_NO_ENOUGH_MEMORY); \
} \
\
\
cJSON_Delete(root); \
cJSON_Delete(root); \
return false; \
return false; \
...
...
src/plugins/http/src/httpSql.c
浏览文件 @
d2941c06
...
@@ -429,27 +429,27 @@ int32_t httpCheckAllocEscapeSql(char *oldSql, char **newSql)
...
@@ -429,27 +429,27 @@ int32_t httpCheckAllocEscapeSql(char *oldSql, char **newSql)
char
*
pos
;
char
*
pos
;
if
(
oldSql
==
NULL
||
newSql
==
NULL
)
{
if
(
oldSql
==
NULL
||
newSql
==
NULL
)
{
return
0
;
return
TSDB_CODE_SUCCESS
;
}
}
/* bad sql clause */
/* bad sql clause */
pos
=
strstr
(
oldSql
,
"%%"
);
pos
=
strstr
(
oldSql
,
"%%"
);
if
(
pos
)
{
if
(
pos
)
{
httpError
(
"bad sql:%s"
,
oldSql
);
httpError
(
"bad sql:%s"
,
oldSql
);
return
1
;
return
TSDB_CODE_HTTP_REQUEST_JSON_ERROR
;
}
}
pos
=
strchr
(
oldSql
,
'%'
);
pos
=
strchr
(
oldSql
,
'%'
);
if
(
pos
==
NULL
)
{
if
(
pos
==
NULL
)
{
httpDebug
(
"sql:%s"
,
oldSql
);
httpDebug
(
"sql:%s"
,
oldSql
);
*
newSql
=
oldSql
;
*
newSql
=
oldSql
;
return
0
;
return
TSDB_CODE_SUCCESS
;
}
}
*
newSql
=
(
char
*
)
calloc
(
1
,
(
strlen
(
oldSql
)
<<
1
)
+
1
);
*
newSql
=
(
char
*
)
calloc
(
1
,
(
strlen
(
oldSql
)
<<
1
)
+
1
);
if
(
newSql
==
NULL
)
{
if
(
newSql
==
NULL
)
{
httpError
(
"failed to allocate for new sql, old sql:%s"
,
oldSql
);
httpError
(
"failed to allocate for new sql, old sql:%s"
,
oldSql
);
return
-
1
;
return
TSDB_CODE_HTTP_NO_ENOUGH_MEMORY
;
}
}
char
*
src
=
oldSql
;
char
*
src
=
oldSql
;
...
@@ -473,7 +473,7 @@ int32_t httpCheckAllocEscapeSql(char *oldSql, char **newSql)
...
@@ -473,7 +473,7 @@ int32_t httpCheckAllocEscapeSql(char *oldSql, char **newSql)
}
}
}
}
return
0
;
return
TSDB_CODE_SUCCESS
;
}
}
void
httpCheckFreeEscapedSql
(
char
*
oldSql
,
char
*
newSql
)
void
httpCheckFreeEscapedSql
(
char
*
oldSql
,
char
*
newSql
)
...
...
src/plugins/http/src/httpTgHandle.c
浏览文件 @
d2941c06
...
@@ -613,12 +613,8 @@ bool tgProcessSingleMetric(HttpContext *pContext, cJSON *metric, char *db) {
...
@@ -613,12 +613,8 @@ bool tgProcessSingleMetric(HttpContext *pContext, cJSON *metric, char *db) {
char
*
tagStr
=
NULL
;
char
*
tagStr
=
NULL
;
int32_t
retCode
=
httpCheckAllocEscapeSql
(
tag
->
string
,
&
tagStr
);
int32_t
retCode
=
httpCheckAllocEscapeSql
(
tag
->
string
,
&
tagStr
);
if
(
retCode
!=
0
)
{
if
(
retCode
!=
TSDB_CODE_SUCCESS
)
{
if
(
retCode
==
1
)
{
httpSendErrorResp
(
pContext
,
retCode
);
httpSendErrorResp
(
pContext
,
TSDB_CODE_HTTP_TG_INVALID_JSON
);
}
else
{
httpSendErrorResp
(
pContext
,
TSDB_CODE_HTTP_NO_ENOUGH_MEMORY
);
}
return
false
;
return
false
;
}
}
...
...
src/util/src/terror.c
浏览文件 @
d2941c06
...
@@ -403,6 +403,8 @@ TAOS_DEFINE_ERROR(TSDB_CODE_HTTP_OP_TAG_VALUE_TOO_LONG, "tag value can not mor
...
@@ -403,6 +403,8 @@ TAOS_DEFINE_ERROR(TSDB_CODE_HTTP_OP_TAG_VALUE_TOO_LONG, "tag value can not mor
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_OP_VALUE_NULL
,
"value not find"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_OP_VALUE_NULL
,
"value not find"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_OP_VALUE_TYPE
,
"value type should be boolean, number or string"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_OP_VALUE_TYPE
,
"value type should be boolean, number or string"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_HTTP_REQUEST_JSON_ERROR
,
"http request json error"
)
// odbc
// odbc
TAOS_DEFINE_ERROR
(
TSDB_CODE_ODBC_OOM
,
"out of memory"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_ODBC_OOM
,
"out of memory"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_ODBC_CONV_CHAR_NOT_NUM
,
"convertion not a valid literal input"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_ODBC_CONV_CHAR_NOT_NUM
,
"convertion not a valid literal input"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录