Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5b266515
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看板
提交
5b266515
编写于
9月 15, 2021
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-6645/enhance]: make schemaless non-doube-quoted content case-insensitive
上级
7be209aa
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
27 deletion
+22
-27
src/client/src/tscParseLineProtocol.c
src/client/src/tscParseLineProtocol.c
+18
-26
src/client/src/tscParseOpenTSDB.c
src/client/src/tscParseOpenTSDB.c
+4
-1
未找到文件。
src/client/src/tscParseLineProtocol.c
浏览文件 @
5b266515
...
...
@@ -1212,7 +1212,7 @@ static bool isTinyInt(char *pVal, uint16_t len) {
if
(
len
<=
2
)
{
return
false
;
}
if
(
!
strcmp
(
&
pVal
[
len
-
2
],
"i8"
))
{
if
(
!
strc
asec
mp
(
&
pVal
[
len
-
2
],
"i8"
))
{
//printf("Type is int8(%s)\n", pVal);
return
true
;
}
...
...
@@ -1226,7 +1226,7 @@ static bool isTinyUint(char *pVal, uint16_t len) {
if
(
pVal
[
0
]
==
'-'
)
{
return
false
;
}
if
(
!
strcmp
(
&
pVal
[
len
-
2
],
"u8"
))
{
if
(
!
strc
asec
mp
(
&
pVal
[
len
-
2
],
"u8"
))
{
//printf("Type is uint8(%s)\n", pVal);
return
true
;
}
...
...
@@ -1237,7 +1237,7 @@ static bool isSmallInt(char *pVal, uint16_t len) {
if
(
len
<=
3
)
{
return
false
;
}
if
(
!
strcmp
(
&
pVal
[
len
-
3
],
"i16"
))
{
if
(
!
strc
asec
mp
(
&
pVal
[
len
-
3
],
"i16"
))
{
//printf("Type is int16(%s)\n", pVal);
return
true
;
}
...
...
@@ -1251,7 +1251,7 @@ static bool isSmallUint(char *pVal, uint16_t len) {
if
(
pVal
[
0
]
==
'-'
)
{
return
false
;
}
if
(
strcmp
(
&
pVal
[
len
-
3
],
"u16"
)
==
0
)
{
if
(
strc
asec
mp
(
&
pVal
[
len
-
3
],
"u16"
)
==
0
)
{
//printf("Type is uint16(%s)\n", pVal);
return
true
;
}
...
...
@@ -1262,7 +1262,7 @@ static bool isInt(char *pVal, uint16_t len) {
if
(
len
<=
3
)
{
return
false
;
}
if
(
strcmp
(
&
pVal
[
len
-
3
],
"i32"
)
==
0
)
{
if
(
strc
asec
mp
(
&
pVal
[
len
-
3
],
"i32"
)
==
0
)
{
//printf("Type is int32(%s)\n", pVal);
return
true
;
}
...
...
@@ -1276,7 +1276,7 @@ static bool isUint(char *pVal, uint16_t len) {
if
(
pVal
[
0
]
==
'-'
)
{
return
false
;
}
if
(
strcmp
(
&
pVal
[
len
-
3
],
"u32"
)
==
0
)
{
if
(
strc
asec
mp
(
&
pVal
[
len
-
3
],
"u32"
)
==
0
)
{
//printf("Type is uint32(%s)\n", pVal);
return
true
;
}
...
...
@@ -1287,7 +1287,7 @@ static bool isBigInt(char *pVal, uint16_t len) {
if
(
len
<=
3
)
{
return
false
;
}
if
(
strcmp
(
&
pVal
[
len
-
3
],
"i64"
)
==
0
)
{
if
(
strc
asec
mp
(
&
pVal
[
len
-
3
],
"i64"
)
==
0
)
{
//printf("Type is int64(%s)\n", pVal);
return
true
;
}
...
...
@@ -1301,7 +1301,7 @@ static bool isBigUint(char *pVal, uint16_t len) {
if
(
pVal
[
0
]
==
'-'
)
{
return
false
;
}
if
(
strcmp
(
&
pVal
[
len
-
3
],
"u64"
)
==
0
)
{
if
(
strc
asec
mp
(
&
pVal
[
len
-
3
],
"u64"
)
==
0
)
{
//printf("Type is uint64(%s)\n", pVal);
return
true
;
}
...
...
@@ -1312,7 +1312,7 @@ static bool isFloat(char *pVal, uint16_t len) {
if
(
len
<=
3
)
{
return
false
;
}
if
(
strcmp
(
&
pVal
[
len
-
3
],
"f32"
)
==
0
)
{
if
(
strc
asec
mp
(
&
pVal
[
len
-
3
],
"f32"
)
==
0
)
{
//printf("Type is float(%s)\n", pVal);
return
true
;
}
...
...
@@ -1323,7 +1323,7 @@ static bool isDouble(char *pVal, uint16_t len) {
if
(
len
<=
3
)
{
return
false
;
}
if
(
strcmp
(
&
pVal
[
len
-
3
],
"f64"
)
==
0
)
{
if
(
strc
asec
mp
(
&
pVal
[
len
-
3
],
"f64"
)
==
0
)
{
//printf("Type is double(%s)\n", pVal);
return
true
;
}
...
...
@@ -1331,34 +1331,24 @@ static bool isDouble(char *pVal, uint16_t len) {
}
static
bool
isBool
(
char
*
pVal
,
uint16_t
len
,
bool
*
bVal
)
{
if
((
len
==
1
)
&&
(
pVal
[
len
-
1
]
==
't'
||
pVal
[
len
-
1
]
==
'T'
))
{
if
((
len
==
1
)
&&
!
strcasecmp
(
&
pVal
[
len
-
1
],
"t"
))
{
//printf("Type is bool(%c)\n", pVal[len - 1]);
*
bVal
=
true
;
return
true
;
}
if
((
len
==
1
)
&&
(
pVal
[
len
-
1
]
==
'f'
||
pVal
[
len
-
1
]
==
'F'
))
{
if
((
len
==
1
)
&&
!
strcasecmp
(
&
pVal
[
len
-
1
],
"f"
))
{
//printf("Type is bool(%c)\n", pVal[len - 1]);
*
bVal
=
false
;
return
true
;
}
if
((
len
==
4
)
&&
(
!
strcmp
(
&
pVal
[
len
-
4
],
"true"
)
||
!
strcmp
(
&
pVal
[
len
-
4
],
"True"
)
||
!
strcmp
(
&
pVal
[
len
-
4
],
"TRUE"
)))
{
if
((
len
==
4
)
&&
!
strcasecmp
(
&
pVal
[
len
-
4
],
"true"
))
{
//printf("Type is bool(%s)\n", &pVal[len - 4]);
*
bVal
=
true
;
return
true
;
}
if
((
len
==
5
)
&&
(
!
strcmp
(
&
pVal
[
len
-
5
],
"false"
)
||
!
strcmp
(
&
pVal
[
len
-
5
],
"False"
)
||
!
strcmp
(
&
pVal
[
len
-
5
],
"FALSE"
)))
{
if
((
len
==
5
)
&&
!
strcasecmp
(
&
pVal
[
len
-
5
],
"false"
))
{
//printf("Type is bool(%s)\n", &pVal[len - 5]);
*
bVal
=
false
;
return
true
;
...
...
@@ -1384,7 +1374,7 @@ static bool isNchar(char *pVal, uint16_t len) {
if
(
len
<
3
)
{
return
false
;
}
if
(
pVal
[
0
]
==
'L'
&&
pVal
[
1
]
==
'"'
&&
pVal
[
len
-
1
]
==
'"'
)
{
if
(
(
pVal
[
0
]
==
'l'
||
pVal
[
0
]
==
'L'
)
&&
pVal
[
1
]
==
'"'
&&
pVal
[
len
-
1
]
==
'"'
)
{
//printf("Type is nchar(%s)\n", pVal);
return
true
;
}
...
...
@@ -1434,7 +1424,7 @@ static bool isTimeStamp(char *pVal, uint16_t len, SMLTimeStampType *tsType) {
return
false
;
}
static
bool
convertStrToNumber
(
TAOS_SML_KV
*
pVal
,
char
*
str
,
SSmlLinesInfo
*
info
)
{
static
bool
convertStrToNumber
(
TAOS_SML_KV
*
pVal
,
char
*
str
,
SSmlLinesInfo
*
info
)
{
errno
=
0
;
uint8_t
type
=
pVal
->
type
;
int16_t
length
=
pVal
->
length
;
...
...
@@ -1442,6 +1432,7 @@ static bool convertStrToNumber(TAOS_SML_KV *pVal, char*str, SSmlLinesInfo* info)
uint64_t
val_u
;
double
val_d
;
strntolower_s
(
str
,
str
,
strlen
(
str
));
if
(
IS_FLOAT_TYPE
(
type
))
{
val_d
=
strtod
(
str
,
NULL
);
}
else
{
...
...
@@ -1724,6 +1715,7 @@ int32_t convertSmlTimeStamp(TAOS_SML_KV *pVal, char *value,
SMLTimeStampType
type
;
int64_t
tsVal
;
strntolower_s
(
value
,
value
,
len
);
if
(
!
isTimeStamp
(
value
,
len
,
&
type
))
{
return
TSDB_CODE_TSC_INVALID_TIME_STAMP
;
}
...
...
src/client/src/tscParseOpenTSDB.c
浏览文件 @
5b266515
...
...
@@ -38,7 +38,7 @@ static int32_t parseTelnetMetric(TAOS_SML_DATA_POINT *pSml, const char **index,
uint16_t
len
=
0
;
pSml
->
stableName
=
tcalloc
(
TSDB_TABLE_NAME_LEN
+
1
,
1
);
// +1 to avoid 1772 line over write
if
(
pSml
->
stableName
==
NULL
){
if
(
pSml
->
stableName
==
NULL
)
{
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
if
(
isdigit
(
*
cur
))
{
...
...
@@ -485,6 +485,7 @@ int32_t parseTimestampFromJSONObj(cJSON *root, int64_t *tsVal, SSmlLinesInfo* in
}
size_t
typeLen
=
strlen
(
type
->
valuestring
);
strntolower_s
(
type
->
valuestring
,
type
->
valuestring
,
typeLen
);
if
(
typeLen
==
1
&&
type
->
valuestring
[
0
]
==
's'
)
{
//seconds
*
tsVal
=
(
int64_t
)(
*
tsVal
*
1e9
);
...
...
@@ -505,6 +506,8 @@ int32_t parseTimestampFromJSONObj(cJSON *root, int64_t *tsVal, SSmlLinesInfo* in
default:
return
TSDB_CODE_TSC_INVALID_JSON
;
}
}
else
{
return
TSDB_CODE_TSC_INVALID_JSON
;
}
return
TSDB_CODE_SUCCESS
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录