Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
357e86b9
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看板
提交
357e86b9
编写于
5月 24, 2023
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:add tag filter for stable subscribe
上级
8537e4e8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
26 deletion
+12
-26
include/common/tmsg.h
include/common/tmsg.h
+2
-5
source/common/src/tmsg.c
source/common/src/tmsg.c
+7
-20
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+3
-1
未找到文件。
include/common/tmsg.h
浏览文件 @
357e86b9
...
...
@@ -1945,11 +1945,8 @@ typedef struct {
int8_t
withMeta
;
char
*
sql
;
char
subDbName
[
TSDB_DB_FNAME_LEN
];
union
{
char
*
ast
;
char
subStbName
[
TSDB_TABLE_FNAME_LEN
];
};
char
*
subStbFilterAst
;
char
*
ast
;
char
subStbName
[
TSDB_TABLE_FNAME_LEN
];
}
SCMCreateTopicReq
;
int32_t
tSerializeSCMCreateTopicReq
(
void
*
buf
,
int32_t
bufLen
,
const
SCMCreateTopicReq
*
pReq
);
...
...
source/common/src/tmsg.c
浏览文件 @
357e86b9
...
...
@@ -3832,19 +3832,16 @@ int32_t tSerializeSCMCreateTopicReq(void *buf, int32_t bufLen, const SCMCreateTo
if
(
tEncodeI8
(
&
encoder
,
pReq
->
withMeta
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
&
encoder
,
pReq
->
subDbName
)
<
0
)
return
-
1
;
if
(
TOPIC_SUB_TYPE__DB
==
pReq
->
subType
)
{
}
else
if
(
TOPIC_SUB_TYPE__TABLE
==
pReq
->
subType
)
{
if
(
tEncodeCStr
(
&
encoder
,
pReq
->
subStbName
)
<
0
)
return
-
1
;
}
else
{
if
(
TOPIC_SUB_TYPE__TABLE
==
pReq
->
subType
)
{
if
(
tEncodeCStr
(
&
encoder
,
pReq
->
subStbName
)
<
0
)
return
-
1
;
}
if
(
tEncodeI32
(
&
encoder
,
strlen
(
pReq
->
ast
))
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
&
encoder
,
pReq
->
ast
)
<
0
)
return
-
1
;
}
if
(
tEncodeI32
(
&
encoder
,
strlen
(
pReq
->
sql
))
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
&
encoder
,
pReq
->
sql
)
<
0
)
return
-
1
;
if
(
TOPIC_SUB_TYPE__TABLE
==
pReq
->
subType
)
{
if
(
tEncodeI32
(
&
encoder
,
strlen
(
pReq
->
subStbFilterAst
))
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
&
encoder
,
pReq
->
subStbFilterAst
)
<
0
)
return
-
1
;
}
tEndEncode
(
&
encoder
);
int32_t
tlen
=
encoder
.
pos
;
...
...
@@ -3866,9 +3863,10 @@ int32_t tDeserializeSCMCreateTopicReq(void *buf, int32_t bufLen, SCMCreateTopicR
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
withMeta
)
<
0
)
return
-
1
;
if
(
tDecodeCStrTo
(
&
decoder
,
pReq
->
subDbName
)
<
0
)
return
-
1
;
if
(
TOPIC_SUB_TYPE__DB
==
pReq
->
subType
)
{
}
else
if
(
TOPIC_SUB_TYPE__TABLE
==
pReq
->
subType
)
{
if
(
tDecodeCStrTo
(
&
decoder
,
pReq
->
subStbName
)
<
0
)
return
-
1
;
}
else
{
if
(
TOPIC_SUB_TYPE__TABLE
==
pReq
->
subType
)
{
if
(
tDecodeCStrTo
(
&
decoder
,
pReq
->
subStbName
)
<
0
)
return
-
1
;
}
if
(
tDecodeI32
(
&
decoder
,
&
astLen
)
<
0
)
return
-
1
;
if
(
astLen
>
0
)
{
pReq
->
ast
=
taosMemoryCalloc
(
1
,
astLen
+
1
);
...
...
@@ -3883,15 +3881,6 @@ int32_t tDeserializeSCMCreateTopicReq(void *buf, int32_t bufLen, SCMCreateTopicR
if
(
tDecodeCStrTo
(
&
decoder
,
pReq
->
sql
)
<
0
)
return
-
1
;
}
if
(
TOPIC_SUB_TYPE__TABLE
==
pReq
->
subType
)
{
if
(
tDecodeI32
(
&
decoder
,
&
astLen
)
<
0
)
return
-
1
;
if
(
astLen
>
0
)
{
pReq
->
subStbFilterAst
=
taosMemoryCalloc
(
1
,
astLen
+
1
);
if
(
pReq
->
subStbFilterAst
==
NULL
)
return
-
1
;
if
(
tDecodeCStrTo
(
&
decoder
,
pReq
->
subStbFilterAst
)
<
0
)
return
-
1
;
}
}
tEndDecode
(
&
decoder
);
tDecoderClear
(
&
decoder
);
...
...
@@ -3900,10 +3889,8 @@ int32_t tDeserializeSCMCreateTopicReq(void *buf, int32_t bufLen, SCMCreateTopicR
void
tFreeSCMCreateTopicReq
(
SCMCreateTopicReq
*
pReq
)
{
taosMemoryFreeClear
(
pReq
->
sql
);
if
(
TOPIC_SUB_TYPE__
COLUMN
=
=
pReq
->
subType
)
{
if
(
TOPIC_SUB_TYPE__
DB
!
=
pReq
->
subType
)
{
taosMemoryFreeClear
(
pReq
->
ast
);
}
else
if
(
TOPIC_SUB_TYPE__TABLE
==
pReq
->
subType
)
{
taosMemoryFreeClear
(
pReq
->
subStbFilterAst
);
}
}
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
357e86b9
...
...
@@ -5764,7 +5764,9 @@ static int32_t buildCreateTopicReq(STranslateContext* pCxt, SCreateTopicStmt* pS
toName
(
pCxt
->
pParseCxt
->
acctId
,
pStmt
->
subDbName
,
pStmt
->
subSTbName
,
&
name
);
tNameGetFullDbName
(
&
name
,
pReq
->
subDbName
);
tNameExtractFullName
(
&
name
,
pReq
->
subStbName
);
code
=
nodesNodeToString
(
pStmt
->
pQuery
,
false
,
&
pReq
->
subStbFilterAst
,
NULL
);
if
(
pStmt
->
pQuery
!=
NULL
)
{
code
=
nodesNodeToString
(
pStmt
->
pQuery
,
false
,
&
pReq
->
ast
,
NULL
);
}
}
else
if
(
'\0'
!=
pStmt
->
subDbName
[
0
])
{
pReq
->
subType
=
TOPIC_SUB_TYPE__DB
;
tNameSetDbName
(
&
name
,
pCxt
->
pParseCxt
->
acctId
,
pStmt
->
subDbName
,
strlen
(
pStmt
->
subDbName
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录