Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
332b5504
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
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看板
提交
332b5504
编写于
4月 14, 2022
作者:
wafwerar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(grant): change the way taosd calls grant.
上级
7323c88d
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
35 addition
and
10 deletion
+35
-10
include/util/tdef.h
include/util/tdef.h
+1
-0
source/dnode/mgmt/CMakeLists.txt
source/dnode/mgmt/CMakeLists.txt
+0
-7
source/dnode/mgmt/exe/dndMain.c
source/dnode/mgmt/exe/dndMain.c
+1
-1
source/dnode/mnode/impl/inc/mndGrant.h
source/dnode/mnode/impl/inc/mndGrant.h
+1
-0
source/dnode/mnode/impl/src/mndGrant.c
source/dnode/mnode/impl/src/mndGrant.c
+3
-1
source/dnode/mnode/impl/src/mndInfoSchema.c
source/dnode/mnode/impl/src/mndInfoSchema.c
+17
-0
source/dnode/mnode/impl/src/mndUser.c
source/dnode/mnode/impl/src/mndUser.c
+7
-0
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+2
-0
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+3
-1
未找到文件。
include/util/tdef.h
浏览文件 @
332b5504
...
...
@@ -117,6 +117,7 @@ extern const int32_t TYPE_BYTES[15];
#define TSDB_INS_TABLE_VGROUPS "vgroups"
#define TSDB_INS_TABLE_BNODES "bnodes"
#define TSDB_INS_TABLE_SNODES "snodes"
#define TSDB_INS_TABLE_LICENCES "grants"
#define TSDB_INDEX_TYPE_SMA "SMA"
#define TSDB_INDEX_TYPE_FULLTEXT "FULLTEXT"
...
...
source/dnode/mgmt/CMakeLists.txt
浏览文件 @
332b5504
...
...
@@ -24,13 +24,6 @@ target_include_directories(
)
target_link_libraries
(
taosd dnode
)
IF
(
TD_GRANT
)
TARGET_LINK_LIBRARIES
(
taosd grant
)
ENDIF
()
IF
(
TD_USB_DONGLE
)
TARGET_LINK_LIBRARIES
(
taosd usb_dongle
)
ENDIF
()
if
(
${
BUILD_TEST
}
)
add_subdirectory
(
test
)
endif
(
${
BUILD_TEST
}
)
source/dnode/mgmt/exe/dndMain.c
浏览文件 @
332b5504
...
...
@@ -91,7 +91,7 @@ static int32_t dndParseArgs(int32_t argc, char const *argv[]) {
}
static
void
dndGenerateGrant
()
{
grantParse
Parameter
();
parseGrant
Parameter
();
}
static
void
dndPrintVersion
()
{
...
...
source/dnode/mnode/impl/inc/mndGrant.h
浏览文件 @
332b5504
...
...
@@ -44,6 +44,7 @@ void grantReset(EGrantType grant, uint64_t value);
void
grantAdd
(
EGrantType
grant
,
uint64_t
value
);
void
grantRestore
(
EGrantType
grant
,
uint64_t
value
);
void
parseGrantParameter
();
#ifdef __cplusplus
}
#endif
...
...
source/dnode/mnode/impl/src/mndGrant.c
浏览文件 @
332b5504
...
...
@@ -28,4 +28,6 @@ void grantReset(EGrantType grant, uint64_t value) {}
void
grantAdd
(
EGrantType
grant
,
uint64_t
value
)
{}
void
grantRestore
(
EGrantType
grant
,
uint64_t
value
)
{}
#endif
\ No newline at end of file
#endif
void
parseGrantParameter
()
{
parseGrantParameter
();
}
\ No newline at end of file
source/dnode/mnode/impl/src/mndInfoSchema.c
浏览文件 @
332b5504
...
...
@@ -151,6 +151,22 @@ static const SInfosTableSchema userUsersSchema[] = {
{.
name
=
"create_time"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_TIMESTAMP
},
{.
name
=
"account"
,
.
bytes
=
TSDB_USER_LEN
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_BINARY
},
};
static
const
SInfosTableSchema
grantsSchema
[]
=
{
{.
name
=
"version"
,
.
bytes
=
8
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_BINARY
},
{.
name
=
"expire time"
,
.
bytes
=
19
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_BINARY
},
{.
name
=
"expired"
,
.
bytes
=
5
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_BINARY
},
{.
name
=
"storage(GB)"
,
.
bytes
=
21
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_BINARY
},
{.
name
=
"timeseries"
,
.
bytes
=
21
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_BINARY
},
{.
name
=
"databases"
,
.
bytes
=
10
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_BINARY
},
{.
name
=
"users"
,
.
bytes
=
10
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_BINARY
},
{.
name
=
"accounts"
,
.
bytes
=
10
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_BINARY
},
{.
name
=
"dnodes"
,
.
bytes
=
10
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_BINARY
},
{.
name
=
"connections"
,
.
bytes
=
11
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_BINARY
},
{.
name
=
"streams"
,
.
bytes
=
9
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_BINARY
},
{.
name
=
"cpu cores"
,
.
bytes
=
9
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_BINARY
},
{.
name
=
"speed(PPS)"
,
.
bytes
=
9
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_BINARY
},
{.
name
=
"querytime"
,
.
bytes
=
9
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_BINARY
},
};
static
const
SInfosTableSchema
vgroupsSchema
[]
=
{
{.
name
=
"vgroup_id"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
{.
name
=
"db_name"
,
.
bytes
=
SYSTABLE_SCH_DB_NAME_LEN
,
.
type
=
TSDB_DATA_TYPE_BINARY
},
...
...
@@ -211,6 +227,7 @@ static const SInfosTableMeta infosMeta[] = {
{
TSDB_INS_TABLE_USER_TABLE_DISTRIBUTED
,
userTblDistSchema
,
tListLen
(
userTblDistSchema
)},
{
TSDB_INS_TABLE_USER_USERS
,
userUsersSchema
,
tListLen
(
userUsersSchema
)},
{
TSDB_INS_TABLE_VGROUPS
,
vgroupsSchema
,
tListLen
(
vgroupsSchema
)},
{
TSDB_INS_TABLE_LICENCES
,
grantsSchema
,
tListLen
(
grantsSchema
)},
};
// connection/application/
...
...
source/dnode/mnode/impl/src/mndUser.c
浏览文件 @
332b5504
...
...
@@ -687,6 +687,8 @@ static int32_t mndGetUserMeta(SNodeMsg *pReq, SShowObj *pShow, STableMetaRsp *pM
}
static
int32_t
mndRetrieveUsers
(
SNodeMsg
*
pReq
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
printf
(
"%s(%d) %s rows=%d
\n
"
,
__FILE__
,
__LINE__
,
__func__
,
rows
);
printf
(
"%s(%d) %s pShow->numOfReads=%d
\n
"
,
__FILE__
,
__LINE__
,
__func__
,
pShow
->
numOfReads
);
SMnode
*
pMnode
=
pReq
->
pNode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
numOfRows
=
0
;
...
...
@@ -701,10 +703,12 @@ static int32_t mndRetrieveUsers(SNodeMsg *pReq, SShowObj *pShow, char *data, int
cols
=
0
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
printf
(
"%s(%d) %s pWrite=%p
\n
"
,
__FILE__
,
__LINE__
,
__func__
,
pWrite
);
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
pUser
->
user
,
pShow
->
bytes
[
cols
]);
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
printf
(
"%s(%d) %s pWrite=%p
\n
"
,
__FILE__
,
__LINE__
,
__func__
,
pWrite
);
if
(
pUser
->
superUser
)
{
const
char
*
src
=
"super"
;
STR_WITH_SIZE_TO_VARSTR
(
pWrite
,
src
,
strlen
(
src
));
...
...
@@ -715,10 +719,12 @@ static int32_t mndRetrieveUsers(SNodeMsg *pReq, SShowObj *pShow, char *data, int
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
printf
(
"%s(%d) %s pWrite=%p
\n
"
,
__FILE__
,
__LINE__
,
__func__
,
pWrite
);
*
(
int64_t
*
)
pWrite
=
pUser
->
createdTime
;
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
printf
(
"%s(%d) %s pWrite=%p
\n
"
,
__FILE__
,
__LINE__
,
__func__
,
pWrite
);
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
pUser
->
acct
,
pShow
->
bytes
[
cols
]);
cols
++
;
...
...
@@ -728,6 +734,7 @@ static int32_t mndRetrieveUsers(SNodeMsg *pReq, SShowObj *pShow, char *data, int
mndVacuumResult
(
data
,
pShow
->
numOfColumns
,
numOfRows
,
rows
,
pShow
);
pShow
->
numOfReads
+=
numOfRows
;
printf
(
"%s(%d) %s numOfRows=%d
\n
"
,
__FILE__
,
__LINE__
,
__func__
,
numOfRows
);
return
numOfRows
;
}
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
332b5504
...
...
@@ -772,6 +772,8 @@ SOperatorInfo* createSysTableScanOperatorInfo(void* pSysTableReadHandle, SSDataB
tableType
=
TSDB_MGMT_TABLE_USER
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_DNODES
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_DNODE
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_LICENCES
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_GRANTS
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_MNODES
,
tListLen
(
pName
->
tname
))
==
0
)
{
tableType
=
TSDB_MGMT_TABLE_MNODE
;
}
else
if
(
strncasecmp
(
name
,
TSDB_INS_TABLE_MODULES
,
tListLen
(
pName
->
tname
))
==
0
)
{
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
332b5504
...
...
@@ -2363,7 +2363,6 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) {
break
;
case
QUERY_NODE_SHOW_APPS_STMT
:
case
QUERY_NODE_SHOW_CONNECTIONS_STMT
:
case
QUERY_NODE_SHOW_LICENCE_STMT
:
case
QUERY_NODE_SHOW_QUERIES_STMT
:
case
QUERY_NODE_SHOW_SCORES_STMT
:
case
QUERY_NODE_SHOW_TOPICS_STMT
:
...
...
@@ -2551,6 +2550,8 @@ static const char* getSysTableName(ENodeType type) {
return
TSDB_INS_TABLE_BNODES
;
case
QUERY_NODE_SHOW_SNODES_STMT
:
return
TSDB_INS_TABLE_SNODES
;
case
QUERY_NODE_SHOW_LICENCE_STMT
:
return
TSDB_INS_TABLE_LICENCES
;
default:
break
;
}
...
...
@@ -3058,6 +3059,7 @@ static int32_t rewriteAlterTable(STranslateContext* pCxt, SQuery* pQuery) {
static
int32_t
rewriteQuery
(
STranslateContext
*
pCxt
,
SQuery
*
pQuery
)
{
int32_t
code
=
TSDB_CODE_SUCCESS
;
switch
(
nodeType
(
pQuery
->
pRoot
))
{
case
QUERY_NODE_SHOW_LICENCE_STMT
:
case
QUERY_NODE_SHOW_DATABASES_STMT
:
case
QUERY_NODE_SHOW_TABLES_STMT
:
case
QUERY_NODE_SHOW_STABLES_STMT
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录