Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
aa1cfa97
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
“f12c270e69955146460f57a226b2588041faecbf”上不存在“src/connector/python/windows/python3/taos/subscription.py”
提交
aa1cfa97
编写于
10月 25, 2021
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-10700]<enhance>: The escape char backstick can be used for both tag name and column name
上级
cd39c61b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
6 deletion
+7
-6
src/client/inc/tscParseLine.h
src/client/inc/tscParseLine.h
+1
-0
src/client/src/tscParseLineProtocol.c
src/client/src/tscParseLineProtocol.c
+6
-6
未找到文件。
src/client/inc/tscParseLine.h
浏览文件 @
aa1cfa97
...
@@ -68,6 +68,7 @@ typedef struct {
...
@@ -68,6 +68,7 @@ typedef struct {
int64_t
affectedRows
;
int64_t
affectedRows
;
}
SSmlLinesInfo
;
}
SSmlLinesInfo
;
void
addEscapeCharToString
(
char
*
str
,
int32_t
len
);
int
tscSmlInsert
(
TAOS
*
taos
,
TAOS_SML_DATA_POINT
*
points
,
int
numPoint
,
SSmlLinesInfo
*
info
);
int
tscSmlInsert
(
TAOS
*
taos
,
TAOS_SML_DATA_POINT
*
points
,
int
numPoint
,
SSmlLinesInfo
*
info
);
bool
checkDuplicateKey
(
char
*
key
,
SHashObj
*
pHash
,
SSmlLinesInfo
*
info
);
bool
checkDuplicateKey
(
char
*
key
,
SHashObj
*
pHash
,
SSmlLinesInfo
*
info
);
bool
isValidInteger
(
char
*
str
);
bool
isValidInteger
(
char
*
str
);
...
...
src/client/src/tscParseLineProtocol.c
浏览文件 @
aa1cfa97
...
@@ -499,6 +499,7 @@ static int32_t fillDbSchema(STableMeta* tableMeta, char* tableName, SSmlSTableSc
...
@@ -499,6 +499,7 @@ static int32_t fillDbSchema(STableMeta* tableMeta, char* tableName, SSmlSTableSc
for
(
int
i
=
0
;
i
<
tableMeta
->
tableInfo
.
numOfColumns
;
++
i
)
{
for
(
int
i
=
0
;
i
<
tableMeta
->
tableInfo
.
numOfColumns
;
++
i
)
{
SSchema
field
;
SSchema
field
;
tstrncpy
(
field
.
name
,
tableMeta
->
schema
[
i
].
name
,
strlen
(
tableMeta
->
schema
[
i
].
name
)
+
1
);
tstrncpy
(
field
.
name
,
tableMeta
->
schema
[
i
].
name
,
strlen
(
tableMeta
->
schema
[
i
].
name
)
+
1
);
addEscapeCharToString
(
field
.
name
,
(
int16_t
)
strlen
(
field
.
name
));
field
.
type
=
tableMeta
->
schema
[
i
].
type
;
field
.
type
=
tableMeta
->
schema
[
i
].
type
;
field
.
bytes
=
tableMeta
->
schema
[
i
].
bytes
;
field
.
bytes
=
tableMeta
->
schema
[
i
].
bytes
;
taosArrayPush
(
schema
->
fields
,
&
field
);
taosArrayPush
(
schema
->
fields
,
&
field
);
...
@@ -510,6 +511,7 @@ static int32_t fillDbSchema(STableMeta* tableMeta, char* tableName, SSmlSTableSc
...
@@ -510,6 +511,7 @@ static int32_t fillDbSchema(STableMeta* tableMeta, char* tableName, SSmlSTableSc
int
j
=
i
+
tableMeta
->
tableInfo
.
numOfColumns
;
int
j
=
i
+
tableMeta
->
tableInfo
.
numOfColumns
;
SSchema
field
;
SSchema
field
;
tstrncpy
(
field
.
name
,
tableMeta
->
schema
[
j
].
name
,
strlen
(
tableMeta
->
schema
[
j
].
name
)
+
1
);
tstrncpy
(
field
.
name
,
tableMeta
->
schema
[
j
].
name
,
strlen
(
tableMeta
->
schema
[
j
].
name
)
+
1
);
addEscapeCharToString
(
field
.
name
,
(
int16_t
)
strlen
(
field
.
name
));
field
.
type
=
tableMeta
->
schema
[
j
].
type
;
field
.
type
=
tableMeta
->
schema
[
j
].
type
;
field
.
bytes
=
tableMeta
->
schema
[
j
].
bytes
;
field
.
bytes
=
tableMeta
->
schema
[
j
].
bytes
;
taosArrayPush
(
schema
->
tags
,
&
field
);
taosArrayPush
(
schema
->
tags
,
&
field
);
...
@@ -1175,15 +1177,13 @@ static void escapeSpecialCharacter(uint8_t field, const char **pos) {
...
@@ -1175,15 +1177,13 @@ static void escapeSpecialCharacter(uint8_t field, const char **pos) {
*
pos
=
cur
;
*
pos
=
cur
;
}
}
void
addEscapeChar
toString
(
char
*
str
,
int16_t
*
bufL
en
)
{
void
addEscapeChar
ToString
(
char
*
str
,
int32_t
l
en
)
{
if
(
str
==
NULL
)
{
if
(
str
==
NULL
)
{
return
;
return
;
}
}
int16_t
len
=
*
bufLen
;
memmove
(
str
+
1
,
str
,
len
);
memmove
(
str
+
1
,
str
,
len
);
str
[
0
]
=
str
[
len
+
1
]
=
TS_ESCAPE_CHAR
;
str
[
0
]
=
str
[
len
+
1
]
=
TS_ESCAPE_CHAR
;
str
[
len
+
2
]
=
'\0'
;
str
[
len
+
2
]
=
'\0'
;
*
bufLen
+=
SML_ESCAPE_CHAR_SIZE
;
}
}
bool
isValidInteger
(
char
*
str
)
{
bool
isValidInteger
(
char
*
str
)
{
...
@@ -1927,7 +1927,7 @@ static int32_t parseSmlKey(TAOS_SML_KV *pKV, const char **index, SHashObj *pHash
...
@@ -1927,7 +1927,7 @@ static int32_t parseSmlKey(TAOS_SML_KV *pKV, const char **index, SHashObj *pHash
pKV
->
key
=
calloc
(
len
+
SML_ESCAPE_CHAR_SIZE
+
1
,
1
);
pKV
->
key
=
calloc
(
len
+
SML_ESCAPE_CHAR_SIZE
+
1
,
1
);
memcpy
(
pKV
->
key
,
key
,
len
+
1
);
memcpy
(
pKV
->
key
,
key
,
len
+
1
);
addEscapeChar
toString
(
pKV
->
key
,
&
len
);
addEscapeChar
ToString
(
pKV
->
key
,
len
);
tscDebug
(
"SML:0x%"
PRIx64
" Key:%s|len:%d"
,
info
->
id
,
pKV
->
key
,
len
);
tscDebug
(
"SML:0x%"
PRIx64
" Key:%s|len:%d"
,
info
->
id
,
pKV
->
key
,
len
);
*
index
=
cur
+
1
;
*
index
=
cur
+
1
;
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
...
@@ -2062,7 +2062,7 @@ static int32_t parseSmlMeasurement(TAOS_SML_DATA_POINT *pSml, const char **index
...
@@ -2062,7 +2062,7 @@ static int32_t parseSmlMeasurement(TAOS_SML_DATA_POINT *pSml, const char **index
pSml
->
stableName
=
NULL
;
pSml
->
stableName
=
NULL
;
return
TSDB_CODE_TSC_LINE_SYNTAX_ERROR
;
return
TSDB_CODE_TSC_LINE_SYNTAX_ERROR
;
}
}
addEscapeChar
toString
(
pSml
->
stableName
,
&
len
);
addEscapeChar
ToString
(
pSml
->
stableName
,
len
);
*
index
=
cur
+
1
;
*
index
=
cur
+
1
;
tscDebug
(
"SML:0x%"
PRIx64
" Stable name in measurement:%s|len:%d"
,
info
->
id
,
pSml
->
stableName
,
len
);
tscDebug
(
"SML:0x%"
PRIx64
" Stable name in measurement:%s|len:%d"
,
info
->
id
,
pSml
->
stableName
,
len
);
...
@@ -2122,7 +2122,7 @@ static int32_t parseSmlKvPairs(TAOS_SML_KV **pKVs, int *num_kvs,
...
@@ -2122,7 +2122,7 @@ static int32_t parseSmlKvPairs(TAOS_SML_KV **pKVs, int *num_kvs,
smlData
->
childTableName
=
malloc
(
pkv
->
length
+
SML_ESCAPE_CHAR_SIZE
+
1
);
smlData
->
childTableName
=
malloc
(
pkv
->
length
+
SML_ESCAPE_CHAR_SIZE
+
1
);
memcpy
(
smlData
->
childTableName
,
pkv
->
value
,
pkv
->
length
);
memcpy
(
smlData
->
childTableName
,
pkv
->
value
,
pkv
->
length
);
strntolower_s
(
smlData
->
childTableName
,
smlData
->
childTableName
,
(
int32_t
)
pkv
->
length
);
strntolower_s
(
smlData
->
childTableName
,
smlData
->
childTableName
,
(
int32_t
)
pkv
->
length
);
//addEscapeChar
t
oString(smlData->childTableName, (int32_t)pkv->length);
//addEscapeChar
T
oString(smlData->childTableName, (int32_t)pkv->length);
free
(
pkv
->
key
);
free
(
pkv
->
key
);
free
(
pkv
->
value
);
free
(
pkv
->
value
);
}
else
{
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录