Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ebdb2488
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看板
提交
ebdb2488
编写于
5月 24, 2022
作者:
X
xywang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): reverted previous modifications and added a check
上级
19e7a2a4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
14 deletion
+15
-14
src/client/src/tscParseLineProtocol.c
src/client/src/tscParseLineProtocol.c
+3
-2
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+12
-12
未找到文件。
src/client/src/tscParseLineProtocol.c
浏览文件 @
ebdb2488
...
...
@@ -1178,11 +1178,12 @@ static int doSmlInsertOneDataPoint(TAOS* taos, TAOS_SML_DATA_POINT* point, SSmlL
for
(
int
col
=
1
;
col
<
point
->
fieldNum
;
++
col
)
{
TAOS_SML_KV
*
kv
=
point
->
fields
+
col
;
int32_t
len
=
0
;
retLen
=
converToStr
(
sql
+
sqlLen
,
kv
->
type
,
kv
->
value
,
kv
->
length
,
&
len
);
if
(
retLen
>=
kv
->
length
||
retLen
==
TSDB_CODE_TSC_INVALID_VALUE
)
{
if
(
freeBytes
-
sqlLen
<=
kv
->
length
)
{
tscError
(
"SML:0x%"
PRIx64
" no free space for converToStr"
,
info
->
id
);
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
converToStr
(
sql
+
sqlLen
,
kv
->
type
,
kv
->
value
,
kv
->
length
,
&
len
);
sqlLen
+=
len
;
retLen
=
snprintf
(
sql
+
sqlLen
,
freeBytes
-
sqlLen
,
","
);
if
(
retLen
>=
freeBytes
-
sqlLen
)
{
...
...
src/client/src/tscUtil.c
浏览文件 @
ebdb2488
...
...
@@ -43,51 +43,51 @@ int32_t converToStr(char *str, int type, void *buf, int32_t bufSize, int32_t *le
switch
(
type
)
{
case
TSDB_DATA_TYPE_NULL
:
n
=
s
nprintf
(
str
,
bufSize
,
"null"
);
n
=
s
printf
(
str
,
"null"
);
break
;
case
TSDB_DATA_TYPE_BOOL
:
n
=
s
nprintf
(
str
,
bufSize
,
(
*
(
int8_t
*
)
buf
)
?
"true"
:
"false"
);
n
=
s
printf
(
str
,
(
*
(
int8_t
*
)
buf
)
?
"true"
:
"false"
);
break
;
case
TSDB_DATA_TYPE_TINYINT
:
n
=
s
nprintf
(
str
,
bufSize
,
"%d"
,
*
(
int8_t
*
)
buf
);
n
=
s
printf
(
str
,
"%d"
,
*
(
int8_t
*
)
buf
);
break
;
case
TSDB_DATA_TYPE_SMALLINT
:
n
=
s
nprintf
(
str
,
bufSize
,
"%d"
,
*
(
int16_t
*
)
buf
);
n
=
s
printf
(
str
,
"%d"
,
*
(
int16_t
*
)
buf
);
break
;
case
TSDB_DATA_TYPE_INT
:
n
=
s
nprintf
(
str
,
bufSize
,
"%d"
,
*
(
int32_t
*
)
buf
);
n
=
s
printf
(
str
,
"%d"
,
*
(
int32_t
*
)
buf
);
break
;
case
TSDB_DATA_TYPE_BIGINT
:
case
TSDB_DATA_TYPE_TIMESTAMP
:
n
=
s
nprintf
(
str
,
bufSize
,
"%"
PRId64
,
*
(
int64_t
*
)
buf
);
n
=
s
printf
(
str
,
"%"
PRId64
,
*
(
int64_t
*
)
buf
);
break
;
case
TSDB_DATA_TYPE_UTINYINT
:
n
=
s
nprintf
(
str
,
bufSize
,
"%d"
,
*
(
uint8_t
*
)
buf
);
n
=
s
printf
(
str
,
"%d"
,
*
(
uint8_t
*
)
buf
);
break
;
case
TSDB_DATA_TYPE_USMALLINT
:
n
=
s
nprintf
(
str
,
bufSize
,
"%d"
,
*
(
uint16_t
*
)
buf
);
n
=
s
printf
(
str
,
"%d"
,
*
(
uint16_t
*
)
buf
);
break
;
case
TSDB_DATA_TYPE_UINT
:
n
=
s
nprintf
(
str
,
bufSize
,
"%u"
,
*
(
uint32_t
*
)
buf
);
n
=
s
printf
(
str
,
"%u"
,
*
(
uint32_t
*
)
buf
);
break
;
case
TSDB_DATA_TYPE_UBIGINT
:
n
=
s
nprintf
(
str
,
bufSize
,
"%"
PRIu64
,
*
(
uint64_t
*
)
buf
);
n
=
s
printf
(
str
,
"%"
PRIu64
,
*
(
uint64_t
*
)
buf
);
break
;
case
TSDB_DATA_TYPE_FLOAT
:
n
=
s
nprintf
(
str
,
bufSize
,
"%.*e"
,
DECIMAL_DIG
,
GET_FLOAT_VAL
(
buf
));
n
=
s
printf
(
str
,
"%.*e"
,
DECIMAL_DIG
,
GET_FLOAT_VAL
(
buf
));
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
n
=
s
nprintf
(
str
,
bufSize
,
"%.*e"
,
DECIMAL_DIG
,
GET_DOUBLE_VAL
(
buf
));
n
=
s
printf
(
str
,
"%.*e"
,
DECIMAL_DIG
,
GET_DOUBLE_VAL
(
buf
));
break
;
case
TSDB_DATA_TYPE_BINARY
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录