Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4ff8072d
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4ff8072d
编写于
12月 31, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-11818] fix bug in show tables;
上级
cbadce0e
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
29 addition
and
29 deletion
+29
-29
source/client/test/clientTests.cpp
source/client/test/clientTests.cpp
+27
-27
source/dnode/vnode/impl/src/vnodeQuery.c
source/dnode/vnode/impl/src/vnodeQuery.c
+2
-2
未找到文件。
source/client/test/clientTests.cpp
浏览文件 @
4ff8072d
...
@@ -463,30 +463,30 @@ TEST(testCase, show_table_Test) {
...
@@ -463,30 +463,30 @@ TEST(testCase, show_table_Test) {
taos_close
(
pConn
);
taos_close
(
pConn
);
}
}
TEST
(
testCase
,
create_multiple_tables
)
{
//
TEST(testCase, create_multiple_tables) {
TAOS
*
pConn
=
taos_connect
(
"localhost"
,
"root"
,
"taosdata"
,
NULL
,
0
);
//
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
assert
(
pConn
!=
NULL
);
//
assert(pConn != NULL);
//
TAOS_RES
*
pRes
=
taos_query
(
pConn
,
"use abc1"
);
//
TAOS_RES* pRes = taos_query(pConn, "use abc1");
taos_free_result
(
pRes
);
//
taos_free_result(pRes);
//
pRes
=
taos_query
(
pConn
,
"create table t_2 using st1 tags(1) t_3 using st2 tags(2)"
);
//
pRes = taos_query(pConn, "create table t_2 using st1 tags(1) t_3 using st2 tags(2)");
if
(
taos_errno
(
pRes
)
!=
0
)
{
//
if (taos_errno(pRes) != 0) {
printf
(
"failed to show vgroups, reason:%s
\n
"
,
taos_errstr
(
pRes
));
//
printf("failed to show vgroups, reason:%s\n", taos_errstr(pRes));
taos_free_result
(
pRes
);
//
taos_free_result(pRes);
ASSERT_TRUE
(
false
);
//
ASSERT_TRUE(false);
}
//
}
//
TAOS_ROW
pRow
=
NULL
;
//
TAOS_ROW pRow = NULL;
TAOS_FIELD
*
pFields
=
taos_fetch_fields
(
pRes
);
//
TAOS_FIELD* pFields = taos_fetch_fields(pRes);
int32_t
numOfFields
=
taos_num_fields
(
pRes
);
//
int32_t numOfFields = taos_num_fields(pRes);
//
char
str
[
512
]
=
{
0
};
//
char str[512] = {0};
while
((
pRow
=
taos_fetch_row
(
pRes
))
!=
NULL
)
{
//
while((pRow = taos_fetch_row(pRes)) != NULL) {
int32_t
code
=
taos_print_row
(
str
,
pRow
,
pFields
,
numOfFields
);
//
int32_t code = taos_print_row(str, pRow, pFields, numOfFields);
printf
(
"%s
\n
"
,
str
);
//
printf("%s\n", str);
}
//
}
//
taos_free_result
(
pRes
);
//
taos_free_result(pRes);
taos_close
(
pConn
);
//
taos_close(pConn);
}
//
}
source/dnode/vnode/impl/src/vnodeQuery.c
浏览文件 @
4ff8072d
...
@@ -136,7 +136,7 @@ static int32_t vnodeGetTableList(SVnode *pVnode, SRpcMsg *pMsg) {
...
@@ -136,7 +136,7 @@ static int32_t vnodeGetTableList(SVnode *pVnode, SRpcMsg *pMsg) {
metaCloseTbCursor
(
pCur
);
metaCloseTbCursor
(
pCur
);
int32_t
rowLen
=
(
TSDB_TABLE_NAME_LEN
+
VARSTR_HEADER_SIZE
)
+
8
+
4
+
(
TSDB_TABLE_NAME_LEN
+
VARSTR_HEADER_SIZE
)
+
8
+
4
;
int32_t
rowLen
=
(
TSDB_TABLE_NAME_LEN
+
VARSTR_HEADER_SIZE
)
+
8
+
2
+
(
TSDB_TABLE_NAME_LEN
+
VARSTR_HEADER_SIZE
)
+
8
+
4
;
int32_t
numOfTables
=
(
int32_t
)
taosArrayGetSize
(
pArray
);
int32_t
numOfTables
=
(
int32_t
)
taosArrayGetSize
(
pArray
);
int32_t
payloadLen
=
rowLen
*
numOfTables
;
int32_t
payloadLen
=
rowLen
*
numOfTables
;
...
@@ -150,7 +150,7 @@ static int32_t vnodeGetTableList(SVnode *pVnode, SRpcMsg *pMsg) {
...
@@ -150,7 +150,7 @@ static int32_t vnodeGetTableList(SVnode *pVnode, SRpcMsg *pMsg) {
char
*
n
=
taosArrayGetP
(
pArray
,
i
);
char
*
n
=
taosArrayGetP
(
pArray
,
i
);
STR_TO_VARSTR
(
p
,
n
);
STR_TO_VARSTR
(
p
,
n
);
p
+=
rowLen
;
p
+=
(
TSDB_TABLE_NAME_LEN
+
VARSTR_HEADER_SIZE
)
;
}
}
pFetchRsp
->
numOfRows
=
htonl
(
numOfTables
);
pFetchRsp
->
numOfRows
=
htonl
(
numOfTables
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录