Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
6e46c77f
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6e46c77f
编写于
9月 14, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1326
上级
a0d8e5c8
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
18 addition
and
18 deletion
+18
-18
src/plugins/http/inc/httpInt.h
src/plugins/http/inc/httpInt.h
+1
-1
src/plugins/http/inc/httpSql.h
src/plugins/http/inc/httpSql.h
+3
-3
src/plugins/http/src/httpGcHandle.c
src/plugins/http/src/httpGcHandle.c
+1
-1
src/plugins/http/src/httpGcJson.c
src/plugins/http/src/httpGcJson.c
+13
-13
未找到文件。
src/plugins/http/inc/httpInt.h
浏览文件 @
6e46c77f
...
...
@@ -36,7 +36,7 @@
#define HTTP_BUFFER_SIZE 8388608
#define HTTP_STEP_SIZE 4096 //http message get process step by step
#define HTTP_METHOD_SCANNER_SIZE 7 //http method fp size
#define
TSDB_CODE_
HTTP_GC_TARGET_SIZE 512
#define HTTP_GC_TARGET_SIZE 512
#define HTTP_WRITE_RETRY_TIMES 500
#define HTTP_WRITE_WAIT_TIME_MS 5
#define HTTP_SESSION_ID_LEN (TSDB_USER_LEN + TSDB_PASSWORD_LEN)
...
...
src/plugins/http/inc/httpSql.h
浏览文件 @
6e46c77f
...
...
@@ -29,10 +29,10 @@ void httpFreeMultiCmds(HttpContext *pContext);
HttpSqlCmd
*
httpNewSqlCmd
(
HttpContext
*
pContext
);
HttpSqlCmd
*
httpCurrSqlCmd
(
HttpContext
*
pContext
);
int32_t
httpCurSqlCmdPos
(
HttpContext
*
pContext
);
int32_t
httpCurSqlCmdPos
(
HttpContext
*
pContext
);
void
httpTrimTableName
(
char
*
name
);
void
httpTrimTableName
(
char
*
name
);
int32_t
httpShrinkTableName
(
HttpContext
*
pContext
,
int32_t
pos
,
char
*
name
);
char
*
httpGetCmdsString
(
HttpContext
*
pContext
,
int32_t
pos
);
char
*
httpGetCmdsString
(
HttpContext
*
pContext
,
int32_t
pos
);
#endif
src/plugins/http/src/httpGcHandle.c
浏览文件 @
6e46c77f
...
...
@@ -228,7 +228,7 @@ bool gcProcessQueryRequest(HttpContext* pContext) {
cmd
->
values
=
refIdBuffer
;
cmd
->
table
=
aliasBuffer
;
cmd
->
numOfRows
=
0
;
// hack way as target flags
cmd
->
timestamp
=
httpAddToSqlCmdBufferWithSize
(
pContext
,
TSDB_CODE_
HTTP_GC_TARGET_SIZE
+
1
);
// hack way
cmd
->
timestamp
=
httpAddToSqlCmdBufferWithSize
(
pContext
,
HTTP_GC_TARGET_SIZE
+
1
);
// hack way
if
(
cmd
->
timestamp
==
-
1
)
{
httpWarn
(
"context:%p, fd:%d, user:%s, cant't malloc target size, sql buffer is full"
,
pContext
,
pContext
->
fd
,
...
...
src/plugins/http/src/httpGcJson.c
浏览文件 @
6e46c77f
...
...
@@ -129,48 +129,48 @@ bool gcBuildQueryJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result,
// for group by
if
(
groupFields
!=
-
1
)
{
char
target
[
TSDB_CODE_
HTTP_GC_TARGET_SIZE
]
=
{
0
};
char
target
[
HTTP_GC_TARGET_SIZE
]
=
{
0
};
int32_t
len
;
len
=
snprintf
(
target
,
TSDB_CODE_
HTTP_GC_TARGET_SIZE
,
"%s{"
,
aliasBuffer
);
len
=
snprintf
(
target
,
HTTP_GC_TARGET_SIZE
,
"%s{"
,
aliasBuffer
);
for
(
int32_t
i
=
dataFields
+
1
;
i
<
num_fields
;
i
++
){
switch
(
fields
[
i
].
type
)
{
case
TSDB_DATA_TYPE_BOOL
:
case
TSDB_DATA_TYPE_TINYINT
:
len
+=
snprintf
(
target
+
len
,
TSDB_CODE_
HTTP_GC_TARGET_SIZE
-
len
,
"%s:%d"
,
fields
[
i
].
name
,
*
((
int8_t
*
)
row
[
i
]));
len
+=
snprintf
(
target
+
len
,
HTTP_GC_TARGET_SIZE
-
len
,
"%s:%d"
,
fields
[
i
].
name
,
*
((
int8_t
*
)
row
[
i
]));
break
;
case
TSDB_DATA_TYPE_SMALLINT
:
len
+=
snprintf
(
target
+
len
,
TSDB_CODE_
HTTP_GC_TARGET_SIZE
-
len
,
"%s:%d"
,
fields
[
i
].
name
,
*
((
int16_t
*
)
row
[
i
]));
len
+=
snprintf
(
target
+
len
,
HTTP_GC_TARGET_SIZE
-
len
,
"%s:%d"
,
fields
[
i
].
name
,
*
((
int16_t
*
)
row
[
i
]));
break
;
case
TSDB_DATA_TYPE_INT
:
len
+=
snprintf
(
target
+
len
,
TSDB_CODE_
HTTP_GC_TARGET_SIZE
-
len
,
"%s:%d,"
,
fields
[
i
].
name
,
*
((
int32_t
*
)
row
[
i
]));
len
+=
snprintf
(
target
+
len
,
HTTP_GC_TARGET_SIZE
-
len
,
"%s:%d,"
,
fields
[
i
].
name
,
*
((
int32_t
*
)
row
[
i
]));
break
;
case
TSDB_DATA_TYPE_BIGINT
:
len
+=
snprintf
(
target
+
len
,
TSDB_CODE_
HTTP_GC_TARGET_SIZE
-
len
,
"%s:%ld"
,
fields
[
i
].
name
,
*
((
int64_t
*
)
row
[
i
]));
len
+=
snprintf
(
target
+
len
,
HTTP_GC_TARGET_SIZE
-
len
,
"%s:%ld"
,
fields
[
i
].
name
,
*
((
int64_t
*
)
row
[
i
]));
break
;
case
TSDB_DATA_TYPE_FLOAT
:
len
+=
snprintf
(
target
+
len
,
TSDB_CODE_
HTTP_GC_TARGET_SIZE
-
len
,
"%s:%.5f"
,
fields
[
i
].
name
,
*
((
float
*
)
row
[
i
]));
len
+=
snprintf
(
target
+
len
,
HTTP_GC_TARGET_SIZE
-
len
,
"%s:%.5f"
,
fields
[
i
].
name
,
*
((
float
*
)
row
[
i
]));
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
len
+=
snprintf
(
target
+
len
,
TSDB_CODE_
HTTP_GC_TARGET_SIZE
-
len
,
"%s:%.9f"
,
fields
[
i
].
name
,
*
((
double
*
)
row
[
i
]));
len
+=
snprintf
(
target
+
len
,
HTTP_GC_TARGET_SIZE
-
len
,
"%s:%.9f"
,
fields
[
i
].
name
,
*
((
double
*
)
row
[
i
]));
break
;
case
TSDB_DATA_TYPE_BINARY
:
case
TSDB_DATA_TYPE_NCHAR
:
if
(
row
[
i
]
!=
NULL
){
len
+=
snprintf
(
target
+
len
,
TSDB_CODE_
HTTP_GC_TARGET_SIZE
-
len
,
"%s:"
,
fields
[
i
].
name
);
len
+=
snprintf
(
target
+
len
,
HTTP_GC_TARGET_SIZE
-
len
,
"%s:"
,
fields
[
i
].
name
);
memcpy
(
target
+
len
,
(
char
*
)
row
[
i
],
length
[
i
]);
len
=
strlen
(
target
);
}
break
;
default:
len
+=
snprintf
(
target
+
len
,
TSDB_CODE_
HTTP_GC_TARGET_SIZE
-
len
,
"%s:%s"
,
fields
[
i
].
name
,
"-"
);
len
+=
snprintf
(
target
+
len
,
HTTP_GC_TARGET_SIZE
-
len
,
"%s:%s"
,
fields
[
i
].
name
,
"-"
);
break
;
}
if
(
i
<
num_fields
-
1
){
len
+=
snprintf
(
target
+
len
,
TSDB_CODE_
HTTP_GC_TARGET_SIZE
-
len
,
", "
);
len
+=
snprintf
(
target
+
len
,
HTTP_GC_TARGET_SIZE
-
len
,
", "
);
}
}
len
+=
snprintf
(
target
+
len
,
TSDB_CODE_
HTTP_GC_TARGET_SIZE
-
len
,
"}"
);
len
+=
snprintf
(
target
+
len
,
HTTP_GC_TARGET_SIZE
-
len
,
"}"
);
if
(
strcmp
(
target
,
targetBuffer
)
!=
0
)
{
// first target not write this section
...
...
@@ -180,7 +180,7 @@ bool gcBuildQueryJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result,
// start new target
gcWriteTargetStartJson
(
jsonBuf
,
refIdBuffer
,
target
);
strncpy
(
targetBuffer
,
target
,
TSDB_CODE_
HTTP_GC_TARGET_SIZE
);
strncpy
(
targetBuffer
,
target
,
HTTP_GC_TARGET_SIZE
);
}
}
// end of group by
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录