Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8becbc26
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
8becbc26
编写于
6月 21, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: support show create table
上级
0f148c6f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
54 addition
and
12 deletion
+54
-12
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+2
-2
source/libs/catalog/src/ctgAsync.c
source/libs/catalog/src/ctgAsync.c
+1
-1
source/libs/catalog/src/ctgRemote.c
source/libs/catalog/src/ctgRemote.c
+13
-5
source/libs/catalog/src/ctgUtil.c
source/libs/catalog/src/ctgUtil.c
+16
-0
tests/script/tsim/show/basic.sim
tests/script/tsim/show/basic.sim
+22
-4
未找到文件。
source/client/src/clientImpl.c
浏览文件 @
8becbc26
...
...
@@ -244,10 +244,10 @@ void asyncExecLocalCmd(SRequestObj* pRequest, SQuery* pQuery) {
}
SReqResultInfo
*
pResultInfo
=
&
pRequest
->
body
.
resInfo
;
pRequest
->
code
=
code
;
if
(
pRequest
->
code
!=
TSDB_CODE_SUCCESS
)
{
pResultInfo
->
numOfRows
=
0
;
pRequest
->
code
=
code
;
tscError
(
"0x%"
PRIx64
" fetch results failed, code:%s, reqId:0x%"
PRIx64
,
pRequest
->
self
,
tstrerror
(
code
),
pRequest
->
requestId
);
}
else
{
...
...
@@ -256,7 +256,7 @@ void asyncExecLocalCmd(SRequestObj* pRequest, SQuery* pQuery) {
pRequest
->
requestId
);
}
pRequest
->
body
.
queryFp
(
pRequest
->
body
.
param
,
pRequest
,
0
);
pRequest
->
body
.
queryFp
(
pRequest
->
body
.
param
,
pRequest
,
code
);
// pRequest->body.fetchFp(pRequest->body.param, pRequest, pResultInfo->numOfRows);
}
...
...
source/libs/catalog/src/ctgAsync.c
浏览文件 @
8becbc26
...
...
@@ -744,7 +744,7 @@ int32_t ctgHandleTaskEnd(SCtgTask* pTask, int32_t rspCode) {
_return:
qDebug
(
"QID:0x%"
PRIx64
" user callback with rsp %s"
,
pJob
->
queryId
,
tstrerror
(
code
));
qDebug
(
"QID:0x%"
PRIx64
"
ctg call
user callback with rsp %s"
,
pJob
->
queryId
,
tstrerror
(
code
));
(
*
pJob
->
userFp
)(
&
pJob
->
jobRes
,
pJob
->
userParam
,
code
);
...
...
source/libs/catalog/src/ctgRemote.c
浏览文件 @
8becbc26
...
...
@@ -639,7 +639,9 @@ int32_t ctgGetTbMetaFromVnode(SCatalog* pCtg, SRequestConnInfo *pConn, const SNa
sprintf
(
tbFName
,
"%s.%s"
,
dbFName
,
pTableName
->
tname
);
void
*
(
*
mallocFp
)(
int32_t
)
=
pTask
?
taosMemoryMalloc
:
rpcMallocCont
;
ctgDebug
(
"try to get table meta from vnode, vgId:%d, tbFName:%s"
,
vgroupInfo
->
vgId
,
tbFName
);
SEp
*
pEp
=
&
vgroupInfo
->
epSet
.
eps
[
vgroupInfo
->
epSet
.
inUse
];
ctgDebug
(
"try to get table meta from vnode, vgId:%d, ep num:%d, ep %s:%d, tbFName:%s"
,
vgroupInfo
->
vgId
,
vgroupInfo
->
epSet
.
numOfEps
,
pEp
->
fqdn
,
pEp
->
port
,
tbFName
);
SBuildTableInput
bInput
=
{.
vgId
=
vgroupInfo
->
vgId
,
.
dbFName
=
dbFName
,
.
tbName
=
(
char
*
)
tNameGetTableName
(
pTableName
)};
char
*
msg
=
NULL
;
...
...
@@ -690,7 +692,9 @@ int32_t ctgGetTableCfgFromVnode(SCatalog* pCtg, SRequestConnInfo *pConn, const S
tNameGetFullDbName
(
pTableName
,
dbFName
);
SBuildTableInput
bInput
=
{.
vgId
=
vgroupInfo
->
vgId
,
.
dbFName
=
dbFName
,
.
tbName
=
(
char
*
)
pTableName
->
tname
};
ctgDebug
(
"try to get table cfg from vnode, vgId:%d, tbFName:%s"
,
vgroupInfo
->
vgId
,
tbFName
);
SEp
*
pEp
=
&
vgroupInfo
->
epSet
.
eps
[
vgroupInfo
->
epSet
.
inUse
];
ctgDebug
(
"try to get table cfg from vnode, vgId:%d, ep num:%d, ep %s:%d, tbFName:%s"
,
vgroupInfo
->
vgId
,
vgroupInfo
->
epSet
.
numOfEps
,
pEp
->
fqdn
,
pEp
->
port
,
tbFName
);
int32_t
code
=
queryBuildMsg
[
TMSG_INDEX
(
reqType
)](
&
bInput
,
&
msg
,
0
,
&
msgLen
,
mallocFp
);
if
(
code
)
{
...
...
@@ -700,8 +704,12 @@ int32_t ctgGetTableCfgFromVnode(SCatalog* pCtg, SRequestConnInfo *pConn, const S
if
(
pTask
)
{
CTG_ERR_RET
(
ctgUpdateMsgCtx
(
&
pTask
->
msgCtx
,
reqType
,
NULL
,
(
char
*
)
tbFName
));
CTG_RET
(
ctgAsyncSendMsg
(
pCtg
,
pConn
,
pTask
,
reqType
,
msg
,
msgLen
));
SRequestConnInfo
vConn
=
{.
pTrans
=
pConn
->
pTrans
,
.
requestId
=
pConn
->
requestId
,
.
requestObjRefId
=
pConn
->
requestObjRefId
,
.
mgmtEps
=
vgroupInfo
->
epSet
};
CTG_RET
(
ctgAsyncSendMsg
(
pCtg
,
&
vConn
,
pTask
,
reqType
,
msg
,
msgLen
));
}
SRpcMsg
rpcMsg
=
{
...
...
@@ -711,7 +719,7 @@ int32_t ctgGetTableCfgFromVnode(SCatalog* pCtg, SRequestConnInfo *pConn, const S
};
SRpcMsg
rpcRsp
=
{
0
};
rpcSendRecv
(
pConn
->
pTrans
,
&
pConn
->
mgmtEps
,
&
rpcMsg
,
&
rpcRsp
);
rpcSendRecv
(
pConn
->
pTrans
,
&
vgroupInfo
->
epSet
,
&
rpcMsg
,
&
rpcRsp
);
CTG_ERR_RET
(
ctgProcessRspMsg
(
out
,
reqType
,
rpcRsp
.
pCont
,
rpcRsp
.
contLen
,
rpcRsp
.
code
,
(
char
*
)
tbFName
));
...
...
source/libs/catalog/src/ctgUtil.c
浏览文件 @
8becbc26
...
...
@@ -379,6 +379,14 @@ void ctgFreeTaskRes(CTG_TASK_TYPE type, void **pRes) {
*
pRes
=
NULL
;
break
;
}
case
CTG_TASK_GET_TB_CFG
:
{
if
(
*
pRes
)
{
STableCfg
*
pInfo
=
(
STableCfg
*
)
*
pRes
;
tFreeSTableCfgRsp
(
pInfo
);
taosMemoryFreeClear
(
*
pRes
);
}
break
;
}
case
CTG_TASK_GET_INDEX
:
{
taosMemoryFreeClear
(
*
pRes
);
break
;
...
...
@@ -438,6 +446,14 @@ void ctgFreeSubTaskRes(CTG_TASK_TYPE type, void **pRes) {
*
pRes
=
NULL
;
break
;
}
case
CTG_TASK_GET_TB_CFG
:
{
if
(
*
pRes
)
{
STableCfg
*
pInfo
=
(
STableCfg
*
)
*
pRes
;
tFreeSTableCfgRsp
(
pInfo
);
taosMemoryFreeClear
(
*
pRes
);
}
break
;
}
case
CTG_TASK_GET_INDEX
:
{
taosMemoryFreeClear
(
*
pRes
);
break
;
...
...
tests/script/tsim/show/basic.sim
浏览文件 @
8becbc26
...
...
@@ -36,6 +36,7 @@ sql create database db vgroups 3
sql use db
sql create table stb (ts timestamp, c int) tags (t int)
sql create table t0 using stb tags (0)
sql create table tba (ts timestamp, c1 binary(10), c2 nchar(10));
print =============== run show xxxx
sql show dnodes
...
...
@@ -62,7 +63,7 @@ if $rows != 1 then
endi
#sql show streams,
sql show tables
if $rows !=
1
then
if $rows !=
2
then
return -1
endi
#sql show user_table_distributed
...
...
@@ -98,7 +99,7 @@ if $rows != 1 then
endi
#sql select * from information_schema.`streams`
sql select * from information_schema.user_tables
if $rows !=
29
then
if $rows !=
30
then
return -1
endi
#sql select * from information_schema.user_table_distributed
...
...
@@ -160,7 +161,7 @@ if $rows != 1 then
endi
#sql show streams,
sql show tables
if $rows !=
1
then
if $rows !=
2
then
return -1
endi
#sql show user_table_distributed
...
...
@@ -196,7 +197,7 @@ if $rows != 1 then
endi
#sql select * from performance_schema.`streams`
sql select * from information_schema.user_tables
if $rows !=
29
then
if $rows !=
30
then
return -1
endi
#sql select * from information_schema.user_table_distributed
...
...
@@ -209,5 +210,22 @@ if $rows != 3 then
return -1
endi
sql show create stable stb;
if $rows != 1 then
return -1
endi
sql show create table t0;
if $rows != 1 then
return -1
endi
sql show create table tba;
if $rows != 1 then
return -1
endi
sql_error show create stable t0;
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录