Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8d38ce5a
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看板
提交
8d38ce5a
编写于
6月 11, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: enable show grants in community version
上级
9d070b3d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
108 addition
and
8 deletion
+108
-8
source/common/src/systable.c
source/common/src/systable.c
+1
-1
source/dnode/mnode/impl/inc/mndGrant.h
source/dnode/mnode/impl/inc/mndGrant.h
+2
-0
source/dnode/mnode/impl/src/mndGrant.c
source/dnode/mnode/impl/src/mndGrant.c
+102
-6
tools/shell/src/shellEngine.c
tools/shell/src/shellEngine.c
+3
-1
未找到文件。
source/common/src/systable.c
浏览文件 @
8d38ce5a
...
...
@@ -175,7 +175,7 @@ static const SSysDbTableSchema userUsersSchema[] = {
};
static
const
SSysDbTableSchema
grantsSchema
[]
=
{
{.
name
=
"version"
,
.
bytes
=
8
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"version"
,
.
bytes
=
9
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"expire time"
,
.
bytes
=
19
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"expired"
,
.
bytes
=
5
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"storage(GB)"
,
.
bytes
=
21
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
...
...
source/dnode/mnode/impl/inc/mndGrant.h
浏览文件 @
8d38ce5a
...
...
@@ -20,6 +20,8 @@
"C"
{
#endif
#include "mndInt.h"
typedef
enum
{
TSDB_GRANT_ALL
,
TSDB_GRANT_TIME
,
...
...
source/dnode/mnode/impl/src/mndGrant.c
浏览文件 @
8d38ce5a
...
...
@@ -14,19 +14,115 @@
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "taoserror.h"
#include "mndGrant.h"
#include "mndInt.h"
#include "mndShow.h"
#ifndef _GRANT
static
int32_t
mndRetrieveGrant
(
SRpcMsg
*
pReq
,
SShowObj
*
pShow
,
SSDataBlock
*
pBlock
,
int32_t
rows
)
{
return
0
;
}
static
int32_t
mndRetrieveGrant
(
SRpcMsg
*
pReq
,
SShowObj
*
pShow
,
SSDataBlock
*
pBlock
,
int32_t
rows
)
{
int32_t
numOfRows
=
0
;
char
*
pWrite
;
int32_t
cols
=
0
;
char
tmp
[
32
];
char
tmp1
[
32
];
if
(
pShow
->
numOfRows
<
1
)
{
cols
=
0
;
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
const
char
*
src
=
"community"
;
STR_WITH_SIZE_TO_VARSTR
(
tmp
,
src
,
strlen
(
src
));
colDataAppend
(
pColInfo
,
numOfRows
,
tmp
,
false
);
cols
++
;
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
src
=
"unlimited"
;
STR_WITH_SIZE_TO_VARSTR
(
tmp
,
src
,
strlen
(
src
));
colDataAppend
(
pColInfo
,
numOfRows
,
tmp
,
false
);
cols
++
;
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
src
=
"false"
;
STR_WITH_SIZE_TO_VARSTR
(
tmp
,
src
,
strlen
(
src
));
colDataAppend
(
pColInfo
,
numOfRows
,
tmp
,
false
);
cols
++
;
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
src
=
"unlimited"
;
STR_WITH_SIZE_TO_VARSTR
(
tmp
,
src
,
strlen
(
src
));
colDataAppend
(
pColInfo
,
numOfRows
,
tmp
,
false
);
cols
++
;
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
src
=
"unlimited"
;
STR_WITH_SIZE_TO_VARSTR
(
tmp
,
src
,
strlen
(
src
));
colDataAppend
(
pColInfo
,
numOfRows
,
tmp
,
false
);
cols
++
;
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
src
=
"unlimited"
;
STR_WITH_SIZE_TO_VARSTR
(
tmp
,
src
,
strlen
(
src
));
colDataAppend
(
pColInfo
,
numOfRows
,
tmp
,
false
);
cols
++
;
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
src
=
"unlimited"
;
STR_WITH_SIZE_TO_VARSTR
(
tmp
,
src
,
strlen
(
src
));
colDataAppend
(
pColInfo
,
numOfRows
,
tmp
,
false
);
cols
++
;
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
src
=
"unlimited"
;
STR_WITH_SIZE_TO_VARSTR
(
tmp
,
src
,
strlen
(
src
));
colDataAppend
(
pColInfo
,
numOfRows
,
tmp
,
false
);
cols
++
;
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
src
=
"unlimited"
;
STR_WITH_SIZE_TO_VARSTR
(
tmp
,
src
,
strlen
(
src
));
colDataAppend
(
pColInfo
,
numOfRows
,
tmp
,
false
);
cols
++
;
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
src
=
"unlimited"
;
STR_WITH_SIZE_TO_VARSTR
(
tmp
,
src
,
strlen
(
src
));
colDataAppend
(
pColInfo
,
numOfRows
,
tmp
,
false
);
cols
++
;
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
src
=
"unlimited"
;
STR_WITH_SIZE_TO_VARSTR
(
tmp
,
src
,
strlen
(
src
));
colDataAppend
(
pColInfo
,
numOfRows
,
tmp
,
false
);
cols
++
;
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
src
=
"unlimited"
;
STR_WITH_SIZE_TO_VARSTR
(
tmp
,
src
,
strlen
(
src
));
colDataAppend
(
pColInfo
,
numOfRows
,
tmp
,
false
);
cols
++
;
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
src
=
"unlimited"
;
STR_WITH_SIZE_TO_VARSTR
(
tmp
,
src
,
strlen
(
src
));
colDataAppend
(
pColInfo
,
numOfRows
,
tmp
,
false
);
cols
++
;
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
src
=
"unlimited"
;
STR_WITH_SIZE_TO_VARSTR
(
tmp
,
src
,
strlen
(
src
));
colDataAppend
(
pColInfo
,
numOfRows
,
tmp
,
false
);
numOfRows
++
;
}
pShow
->
numOfRows
+=
numOfRows
;
return
numOfRows
;
}
int32_t
mndInitGrant
(
SMnode
*
pMnode
)
{
mndAddShowRetrieveHandle
(
pMnode
,
TSDB_MGMT_TABLE_GRANTS
,
mndRetrieveGrant
);
return
TSDB_CODE_SUCCESS
;
mndAddShowRetrieveHandle
(
pMnode
,
TSDB_MGMT_TABLE_GRANTS
,
mndRetrieveGrant
);
return
0
;
}
void
mndCleanupGrant
()
{}
void
grantParseParameter
()
{
mError
(
"can't parsed parameter k"
);
}
int32_t
grantCheck
(
EGrantType
grant
)
{
return
TSDB_CODE_SUCCESS
;
}
...
...
tools/shell/src/shellEngine.c
浏览文件 @
8d38ce5a
...
...
@@ -886,7 +886,9 @@ void shellGetGrantInfo() {
memcpy
(
expiretime
,
row
[
1
],
fields
[
1
].
bytes
);
memcpy
(
expired
,
row
[
2
],
fields
[
2
].
bytes
);
if
(
strcmp
(
expiretime
,
"unlimited"
)
==
0
)
{
if
(
strcmp
(
serverVersion
,
"community"
)
==
0
)
{
fprintf
(
stdout
,
"Server is Community Edition.
\n
"
);
}
else
if
(
strcmp
(
expiretime
,
"unlimited"
)
==
0
)
{
fprintf
(
stdout
,
"Server is Enterprise %s Edition, %s and will never expire.
\n
"
,
serverVersion
,
sinfo
);
}
else
{
fprintf
(
stdout
,
"Server is Enterprise %s Edition, %s and will expire at %s.
\n
"
,
serverVersion
,
sinfo
,
expiretime
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录