Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c95e3148
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
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看板
提交
c95e3148
编写于
5月 12, 2023
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:[TD-23117] fix overflow in stack & add test case
上级
e17a105e
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
18 addition
and
8 deletion
+18
-8
source/dnode/mnode/impl/src/mndTopic.c
source/dnode/mnode/impl/src/mndTopic.c
+3
-1
tests/system-test/7-tmq/ins_topics_test.py
tests/system-test/7-tmq/ins_topics_test.py
+15
-7
未找到文件。
source/dnode/mnode/impl/src/mndTopic.c
浏览文件 @
c95e3148
...
...
@@ -908,13 +908,14 @@ static int32_t mndRetrieveTopic(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBl
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
numOfRows
,
(
const
char
*
)
sql
,
false
);
char
schemaJson
[
TSDB_SHOW_SCHEMA_JSON_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
}
;
char
*
schemaJson
=
taosMemoryMalloc
(
TSDB_SHOW_SCHEMA_JSON_LEN
+
VARSTR_HEADER_SIZE
)
;
if
(
pTopic
->
subType
==
TOPIC_SUB_TYPE__COLUMN
){
schemaToJson
(
pTopic
->
schema
.
pSchema
,
pTopic
->
schema
.
nCols
,
schemaJson
);
}
else
if
(
pTopic
->
subType
==
TOPIC_SUB_TYPE__TABLE
){
SStbObj
*
pStb
=
mndAcquireStb
(
pMnode
,
pTopic
->
stbName
);
if
(
pStb
==
NULL
)
{
terrno
=
TSDB_CODE_MND_STB_NOT_EXIST
;
taosMemoryFree
(
schemaJson
);
return
-
1
;
}
schemaToJson
(
pStb
->
pColumns
,
pStb
->
numOfColumns
,
schemaJson
);
...
...
@@ -926,6 +927,7 @@ static int32_t mndRetrieveTopic(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBl
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
numOfRows
,
(
const
char
*
)
schemaJson
,
false
);
taosMemoryFree
(
schemaJson
);
char
mete
[
4
+
VARSTR_HEADER_SIZE
]
=
{
0
};
if
(
pTopic
->
withMeta
){
...
...
tests/system-test/7-tmq/ins_topics_test.py
浏览文件 @
c95e3148
...
...
@@ -35,16 +35,24 @@ class TDTestCase:
tdLog
.
info
(
"create topic"
)
tdSql
.
execute
(
"create topic topic_1 as database db1"
)
tdSql
.
execute
(
"create topic topic_2 as stable db1.st"
)
tdSql
.
execute
(
"create topic topic_2
with meta
as stable db1.st"
)
tdSql
.
execute
(
"create topic topic_3 as select * from db1.nt"
)
tdSql
.
execute
(
"create topic topic_4 as select ts,c3,c5 from db1.st"
)
tdSql
.
execute
(
"create topic topic_4 as select ts,c3,c5
,t2
from db1.st"
)
tdSql
.
query
(
"select * from information_schema.ins_topics"
)
tdSql
.
query
(
"select * from information_schema.ins_topics
order by topic_name
"
)
tdSql
.
checkRows
(
4
)
# tdSql.checkData(0, 1, 51)
# tdSql.checkData(0, 4, 940)
# tdSql.checkData(1, 1, 23)
# tdSql.checkData(1, 4, None)
tdSql
.
checkData
(
0
,
4
,
"NULL"
)
tdSql
.
checkData
(
0
,
5
,
"no"
)
tdSql
.
checkData
(
0
,
6
,
"db"
)
tdSql
.
checkData
(
1
,
4
,
"[{
\"
name
\"
:
\"
ts
\"
,
\"
type
\"
:
\"
TIMESTAMP
\"
,
\"
length
\"
:8},{
\"
name
\"
:
\"
c1
\"
,
\"
type
\"
:
\"
INT
\"
,
\"
length
\"
:4},{
\"
name
\"
:
\"
c2
\"
,
\"
type
\"
:
\"
BOOL
\"
,
\"
length
\"
:1},{
\"
name
\"
:
\"
c3
\"
,
\"
type
\"
:
\"
TINYINT
\"
,
\"
length
\"
:1},{
\"
name
\"
:
\"
c4
\"
,
\"
type
\"
:
\"
DOUBLE
\"
,
\"
length
\"
:8},{
\"
name
\"
:
\"
c5
\"
,
\"
type
\"
:
\"
NCHAR
\"
,
\"
length
\"
:8}]"
)
tdSql
.
checkData
(
1
,
5
,
"yes"
)
tdSql
.
checkData
(
1
,
6
,
"stable"
)
tdSql
.
checkData
(
2
,
4
,
"[{
\"
name
\"
:
\"
ts
\"
,
\"
type
\"
:
\"
TIMESTAMP
\"
,
\"
length
\"
:8},{
\"
name
\"
:
\"
c1
\"
,
\"
type
\"
:
\"
SMALLINT
\"
,
\"
length
\"
:2},{
\"
name
\"
:
\"
c2
\"
,
\"
type
\"
:
\"
FLOAT
\"
,
\"
length
\"
:4},{
\"
name
\"
:
\"
c3
\"
,
\"
type
\"
:
\"
VARCHAR
\"
,
\"
length
\"
:64},{
\"
name
\"
:
\"
c4
\"
,
\"
type
\"
:
\"
BIGINT
\"
,
\"
length
\"
:8}]"
)
tdSql
.
checkData
(
2
,
5
,
"no"
)
tdSql
.
checkData
(
2
,
6
,
"column"
)
tdSql
.
checkData
(
3
,
4
,
"[{
\"
name
\"
:
\"
ts
\"
,
\"
type
\"
:
\"
TIMESTAMP
\"
,
\"
length
\"
:8},{
\"
name
\"
:
\"
c3
\"
,
\"
type
\"
:
\"
TINYINT
\"
,
\"
length
\"
:1},{
\"
name
\"
:
\"
c5
\"
,
\"
type
\"
:
\"
NCHAR
\"
,
\"
length
\"
:8},{
\"
name
\"
:
\"
t2
\"
,
\"
type
\"
:
\"
FLOAT
\"
,
\"
length
\"
:4}]"
)
tdSql
.
checkData
(
3
,
5
,
"no"
)
tdSql
.
checkData
(
3
,
6
,
"column"
)
tdLog
.
printNoPrefix
(
"======== test case end ...... "
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录