Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
439ed872
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看板
提交
439ed872
编写于
10月 25, 2021
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-10700]<enhance>: The escape char backstick can be used for both tag name and column name
上级
ba163cf1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
6 addition
and
6 deletion
+6
-6
src/client/inc/tscParseLine.h
src/client/inc/tscParseLine.h
+0
-1
src/client/src/tscParseLineProtocol.c
src/client/src/tscParseLineProtocol.c
+3
-3
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+2
-2
src/inc/taosdef.h
src/inc/taosdef.h
+1
-0
未找到文件。
src/client/inc/tscParseLine.h
浏览文件 @
439ed872
...
@@ -24,7 +24,6 @@ extern "C" {
...
@@ -24,7 +24,6 @@ extern "C" {
#define SML_TIMESTAMP_MILLI_SECOND_DIGITS 13
#define SML_TIMESTAMP_MILLI_SECOND_DIGITS 13
typedef
TSDB_SML_PROTOCOL_TYPE
SMLProtocolType
;
typedef
TSDB_SML_PROTOCOL_TYPE
SMLProtocolType
;
#define SML_ESCAPE_CHAR_SIZE 2
typedef
struct
{
typedef
struct
{
char
*
key
;
char
*
key
;
...
...
src/client/src/tscParseLineProtocol.c
浏览文件 @
439ed872
...
@@ -1925,7 +1925,7 @@ static int32_t parseSmlKey(TAOS_SML_KV *pKV, const char **index, SHashObj *pHash
...
@@ -1925,7 +1925,7 @@ static int32_t parseSmlKey(TAOS_SML_KV *pKV, const char **index, SHashObj *pHash
return
TSDB_CODE_TSC_LINE_SYNTAX_ERROR
;
return
TSDB_CODE_TSC_LINE_SYNTAX_ERROR
;
}
}
pKV
->
key
=
calloc
(
len
+
SML
_ESCAPE_CHAR_SIZE
+
1
,
1
);
pKV
->
key
=
calloc
(
len
+
TS
_ESCAPE_CHAR_SIZE
+
1
,
1
);
memcpy
(
pKV
->
key
,
key
,
len
+
1
);
memcpy
(
pKV
->
key
,
key
,
len
+
1
);
addEscapeCharToString
(
pKV
->
key
,
len
);
addEscapeCharToString
(
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
);
...
@@ -2022,7 +2022,7 @@ static int32_t parseSmlMeasurement(TAOS_SML_DATA_POINT *pSml, const char **index
...
@@ -2022,7 +2022,7 @@ static int32_t parseSmlMeasurement(TAOS_SML_DATA_POINT *pSml, const char **index
const
char
*
cur
=
*
index
;
const
char
*
cur
=
*
index
;
int16_t
len
=
0
;
int16_t
len
=
0
;
pSml
->
stableName
=
calloc
(
TSDB_TABLE_NAME_LEN
+
SML
_ESCAPE_CHAR_SIZE
,
1
);
pSml
->
stableName
=
calloc
(
TSDB_TABLE_NAME_LEN
+
TS
_ESCAPE_CHAR_SIZE
,
1
);
if
(
pSml
->
stableName
==
NULL
){
if
(
pSml
->
stableName
==
NULL
){
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
}
...
@@ -2119,7 +2119,7 @@ static int32_t parseSmlKvPairs(TAOS_SML_KV **pKVs, int *num_kvs,
...
@@ -2119,7 +2119,7 @@ static int32_t parseSmlKvPairs(TAOS_SML_KV **pKVs, int *num_kvs,
goto
error
;
goto
error
;
}
}
if
(
!
isField
&&
(
strcasecmp
(
pkv
->
key
,
"`ID`"
)
==
0
))
{
if
(
!
isField
&&
(
strcasecmp
(
pkv
->
key
,
"`ID`"
)
==
0
))
{
smlData
->
childTableName
=
malloc
(
pkv
->
length
+
SML
_ESCAPE_CHAR_SIZE
+
1
);
smlData
->
childTableName
=
malloc
(
pkv
->
length
+
TS
_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
);
addEscapeCharToString
(
smlData
->
childTableName
,
(
int32_t
)
pkv
->
length
);
addEscapeCharToString
(
smlData
->
childTableName
,
(
int32_t
)
pkv
->
length
);
...
...
src/client/src/tscSQLParser.c
浏览文件 @
439ed872
...
@@ -6324,8 +6324,8 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
...
@@ -6324,8 +6324,8 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
//handle Escape character backstick
//handle Escape character backstick
if
(
name
.
z
[
0
]
==
TS_ESCAPE_CHAR
&&
name
.
z
[
name
.
n
-
1
]
==
TS_ESCAPE_CHAR
)
{
if
(
name
.
z
[
0
]
==
TS_ESCAPE_CHAR
&&
name
.
z
[
name
.
n
-
1
]
==
TS_ESCAPE_CHAR
)
{
memmove
(
name
.
z
,
name
.
z
+
1
,
name
.
n
);
memmove
(
name
.
z
,
name
.
z
+
1
,
name
.
n
);
name
.
z
[
name
.
n
-
2
]
=
'\0'
;
name
.
z
[
name
.
n
-
TS_ESCAPE_CHAR_SIZE
]
=
'\0'
;
name
.
n
-=
2
;
name
.
n
-=
TS_ESCAPE_CHAR_SIZE
;
}
}
if
(
getColumnIndexByName
(
&
name
,
pQueryInfo
,
&
columnIndex
,
tscGetErrorMsgPayload
(
pCmd
))
!=
TSDB_CODE_SUCCESS
)
{
if
(
getColumnIndexByName
(
&
name
,
pQueryInfo
,
&
columnIndex
,
tscGetErrorMsgPayload
(
pCmd
))
!=
TSDB_CODE_SUCCESS
)
{
...
...
src/inc/taosdef.h
浏览文件 @
439ed872
...
@@ -99,6 +99,7 @@ extern const int32_t TYPE_BYTES[15];
...
@@ -99,6 +99,7 @@ extern const int32_t TYPE_BYTES[15];
#define TS_PATH_DELIMITER "."
#define TS_PATH_DELIMITER "."
#define TS_ESCAPE_CHAR '`'
#define TS_ESCAPE_CHAR '`'
#define TS_ESCAPE_CHAR_SIZE 2
#define TSDB_TIME_PRECISION_MILLI 0
#define TSDB_TIME_PRECISION_MILLI 0
#define TSDB_TIME_PRECISION_MICRO 1
#define TSDB_TIME_PRECISION_MICRO 1
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录