Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ad4c949f
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
ad4c949f
编写于
12月 12, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
12月 12, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #18907 from taosdata/main
merge from main to 3.0
上级
ce94c88f
88bf65ff
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
2062 addition
and
1912 deletion
+2062
-1912
source/dnode/mgmt/node_mgmt/src/dmNodes.c
source/dnode/mgmt/node_mgmt/src/dmNodes.c
+7
-4
source/dnode/mnode/impl/src/mndConsumer.c
source/dnode/mnode/impl/src/mndConsumer.c
+0
-8
source/libs/executor/src/timesliceoperator.c
source/libs/executor/src/timesliceoperator.c
+5
-1
source/libs/parser/inc/sql.y
source/libs/parser/inc/sql.y
+1
-1
source/libs/parser/src/sql.c
source/libs/parser/src/sql.c
+1892
-1898
tests/parallel_test/cases.task
tests/parallel_test/cases.task
+1
-0
tests/script/tsim/user/privilege_topic.sim
tests/script/tsim/user/privilege_topic.sim
+156
-0
未找到文件。
source/dnode/mgmt/node_mgmt/src/dmNodes.c
浏览文件 @
ad4c949f
...
@@ -149,10 +149,13 @@ int32_t dmRunDnode(SDnode *pDnode) {
...
@@ -149,10 +149,13 @@ int32_t dmRunDnode(SDnode *pDnode) {
return
0
;
return
0
;
}
}
if
(
count
==
0
)
osUpdate
();
if
(
count
==
10
)
{
osUpdate
();
count
%=
10
;
count
=
0
;
}
else
{
count
++
;
count
++
;
}
taosMsleep
(
100
);
taosMsleep
(
100
);
}
}
}
}
source/dnode/mnode/impl/src/mndConsumer.c
浏览文件 @
ad4c949f
...
@@ -554,14 +554,6 @@ static int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
...
@@ -554,14 +554,6 @@ static int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
goto
SUBSCRIBE_OVER
;
goto
SUBSCRIBE_OVER
;
}
}
// check topic only
#if 0
if (mndCheckDbPrivilegeByName(pMnode, pMsg->info.conn.user, MND_OPER_READ_DB, pTopic->db) != 0) {
mndReleaseTopic(pMnode, pTopic);
goto SUBSCRIBE_OVER;
}
#endif
if
(
mndCheckTopicPrivilege
(
pMnode
,
pMsg
->
info
.
conn
.
user
,
MND_OPER_SUBSCRIBE
,
pTopic
)
!=
0
)
{
if
(
mndCheckTopicPrivilege
(
pMnode
,
pMsg
->
info
.
conn
.
user
,
MND_OPER_SUBSCRIBE
,
pTopic
)
!=
0
)
{
mndReleaseTopic
(
pMnode
,
pTopic
);
mndReleaseTopic
(
pMnode
,
pTopic
);
goto
SUBSCRIBE_OVER
;
goto
SUBSCRIBE_OVER
;
...
...
source/libs/executor/src/timesliceoperator.c
浏览文件 @
ad4c949f
...
@@ -91,11 +91,15 @@ static void doKeepLinearInfo(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlo
...
@@ -91,11 +91,15 @@ static void doKeepLinearInfo(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlo
SColumnInfoData
*
pTsCol
=
taosArrayGet
(
pBlock
->
pDataBlock
,
pSliceInfo
->
tsCol
.
slotId
);
SColumnInfoData
*
pTsCol
=
taosArrayGet
(
pBlock
->
pDataBlock
,
pSliceInfo
->
tsCol
.
slotId
);
SFillLinearInfo
*
pLinearInfo
=
taosArrayGet
(
pSliceInfo
->
pLinearInfo
,
i
);
SFillLinearInfo
*
pLinearInfo
=
taosArrayGet
(
pSliceInfo
->
pLinearInfo
,
i
);
if
(
!
IS_MATHABLE_TYPE
(
pColInfoData
->
info
.
type
))
{
continue
;
}
// null value is represented by using key = INT64_MIN for now.
// null value is represented by using key = INT64_MIN for now.
// TODO: optimize to ignore null values for linear interpolation.
// TODO: optimize to ignore null values for linear interpolation.
if
(
!
pLinearInfo
->
isStartSet
)
{
if
(
!
pLinearInfo
->
isStartSet
)
{
if
(
!
colDataIsNull_s
(
pColInfoData
,
rowIndex
))
{
if
(
!
colDataIsNull_s
(
pColInfoData
,
rowIndex
))
{
ASSERT
(
IS_MATHABLE_TYPE
(
pColInfoData
->
info
.
type
));
pLinearInfo
->
start
.
key
=
*
(
int64_t
*
)
colDataGetData
(
pTsCol
,
rowIndex
);
pLinearInfo
->
start
.
key
=
*
(
int64_t
*
)
colDataGetData
(
pTsCol
,
rowIndex
);
char
*
p
=
colDataGetData
(
pColInfoData
,
rowIndex
);
char
*
p
=
colDataGetData
(
pColInfoData
,
rowIndex
);
...
...
source/libs/parser/inc/sql.y
浏览文件 @
ad4c949f
...
@@ -232,7 +232,7 @@ alter_db_option(A) ::= KEEP integer_list(B).
...
@@ -232,7 +232,7 @@ alter_db_option(A) ::= KEEP integer_list(B).
alter_db_option(A) ::= KEEP variable_list(B). { A.type = DB_OPTION_KEEP; A.pList = B; }
alter_db_option(A) ::= KEEP variable_list(B). { A.type = DB_OPTION_KEEP; A.pList = B; }
alter_db_option(A) ::= PAGES NK_INTEGER(B). { A.type = DB_OPTION_PAGES; A.val = B; }
alter_db_option(A) ::= PAGES NK_INTEGER(B). { A.type = DB_OPTION_PAGES; A.val = B; }
alter_db_option(A) ::= REPLICA NK_INTEGER(B). { A.type = DB_OPTION_REPLICA; A.val = B; }
alter_db_option(A) ::= REPLICA NK_INTEGER(B). { A.type = DB_OPTION_REPLICA; A.val = B; }
alter_db_option(A) ::= STRICT NK_STRING(B). { A.type = DB_OPTION_STRICT; A.val = B; }
//
alter_db_option(A) ::= STRICT NK_STRING(B). { A.type = DB_OPTION_STRICT; A.val = B; }
alter_db_option(A) ::= WAL_LEVEL NK_INTEGER(B). { A.type = DB_OPTION_WAL; A.val = B; }
alter_db_option(A) ::= WAL_LEVEL NK_INTEGER(B). { A.type = DB_OPTION_WAL; A.val = B; }
alter_db_option(A) ::= STT_TRIGGER NK_INTEGER(B). { A.type = DB_OPTION_STT_TRIGGER; A.val = B; }
alter_db_option(A) ::= STT_TRIGGER NK_INTEGER(B). { A.type = DB_OPTION_STT_TRIGGER; A.val = B; }
...
...
source/libs/parser/src/sql.c
浏览文件 @
ad4c949f
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
tests/parallel_test/cases.task
浏览文件 @
ad4c949f
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
,,y,script,./test.sh -f tsim/user/password.sim
,,y,script,./test.sh -f tsim/user/password.sim
,,y,script,./test.sh -f tsim/user/privilege_db.sim
,,y,script,./test.sh -f tsim/user/privilege_db.sim
,,y,script,./test.sh -f tsim/user/privilege_sysinfo.sim
,,y,script,./test.sh -f tsim/user/privilege_sysinfo.sim
,,y,script,./test.sh -f tsim/user/privilege_topic.sim
,,y,script,./test.sh -f tsim/db/alter_option.sim
,,y,script,./test.sh -f tsim/db/alter_option.sim
,,y,script,./test.sh -f tsim/db/alter_replica_13.sim
,,y,script,./test.sh -f tsim/db/alter_replica_13.sim
,,y,script,./test.sh -f tsim/db/alter_replica_31.sim
,,y,script,./test.sh -f tsim/db/alter_replica_31.sim
...
...
tests/script/tsim/user/privilege_topic.sim
0 → 100644
浏览文件 @
ad4c949f
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
print =============== create db
sql create database root_d1 vgroups 1;
sql create database root_d2 vgroups 1;
sql create database root_d3 vgroups 1;
sql show user privileges
if $rows != 1 then
return -1
endi
if $data(root)[1] != all then
return -1
endi
if $data(root)[2] != all then
return -1
endi
print =============== create users
sql create user user1 PASS 'taosdata'
sql create user user2 PASS 'taosdata'
sql create user user3 PASS 'taosdata'
sql create user user4 PASS 'taosdata'
sql create user user5 PASS 'taosdata'
sql create user user6 PASS 'taosdata'
sql alter user user1 sysinfo 0
sql select * from information_schema.ins_users
if $rows != 7 then
return -1
endi
sql GRANT read ON root_d1.* to user1;
sql GRANT write ON root_d2.* to user2;
sql GRANT read ON root_d3.* to user3;
sql GRANT write ON root_d3.* to user3;
sql show user privileges
if $rows != 5 then
return -1
endi
if $data(user1)[1] != read then
return -1
endi
if $data(user1)[2] != root_d1 then
return -1
endi
if $data(user2)[1] != write then
return -1
endi
if $data(user2)[2] != root_d2 then
return -1
endi
print =============== create topis
sql use root_d1
sql create table root_d1_stb (ts timestamp, i int) tags (j int)
sql create topic root_d1_topic1 as select ts, i from root_d1_stb
sql create topic root_d1_topic2 as select ts, i from root_d1_stb
sql create topic root_d1_topic3 as select ts, i from root_d1_stb
sql create topic root_d1_topic4 as select ts, i from root_d1_stb
sql show user privileges
if $rows != 5 then
return -1
endi
sql GRANT subscribe ON root_d1_topic1 TO user4
sql GRANT subscribe ON root_d1_topic2 TO user5
sql GRANT subscribe ON root_d1_topic3 TO user6
sql show user privileges
if $rows != 8 then
return -1
endi
if $data(user4)[1] != subscribe then
return -1
endi
if $data(user4)[2] != root_d1_topic1 then
return -1
endi
if $data(user5)[1] != subscribe then
return -1
endi
if $data(user5)[2] != root_d1_topic2 then
return -1
endi
if $data(user6)[1] != subscribe then
return -1
endi
if $data(user6)[2] != root_d1_topic3 then
return -1
endi
sql REVOKE subscribe ON root_d1_topic3 from user6
sql show user privileges
if $rows != 7 then
return -1
endi
if $data(user4)[1] != subscribe then
return -1
endi
if $data(user4)[2] != root_d1_topic1 then
return -1
endi
if $data(user5)[1] != subscribe then
return -1
endi
if $data(user5)[2] != root_d1_topic2 then
return -1
endi
print =============== repeat revoke/grant or invalid revoke/grant
sql GRANT subscribe ON root_d1_topic1 to user4
sql GRANT subscribe ON root_d1_topic2 to user4
sql GRANT subscribe ON root_d1_topic3 to user4
sql GRANT subscribe ON root_d1_topic1 to user5
sql GRANT subscribe ON root_d1_topic2 to user5
sql GRANT subscribe ON root_d1_topic3 to user5
sql GRANT subscribe ON root_d1_topic1 to user6
sql GRANT subscribe ON root_d1_topic2 to user6
sql GRANT subscribe ON root_d1_topic3 to user6
sql REVOKE subscribe ON root_d1_topic1 from user4
sql REVOKE subscribe ON root_d1_topic2 from user4
sql REVOKE subscribe ON root_d1_topic3 from user4
sql REVOKE subscribe ON root_d1_topic1 from user5
sql REVOKE subscribe ON root_d1_topic2 from user5
sql REVOKE subscribe ON root_d1_topic3 from user5
sql REVOKE subscribe ON root_d1_topic1 from user6
sql REVOKE subscribe ON root_d1_topic2 from user6
sql REVOKE subscribe ON root_d1_topic3 from user6
print =============== invalid revoke/grant
sql_error GRANT subscribe ON root_d1_topicx from user5
sql_error REVOKE subscribe ON root_d1_topicx from user5
print =============== check
sql GRANT subscribe ON root_d1_topic1 TO user4
sql GRANT subscribe ON root_d1_topic2 TO user5
sql GRANT subscribe ON root_d1_topic3 TO user6
sql show user privileges
if $rows != 8 then
return -1
endi
print =============== re connect
print user u1 login
sql close
sql connect user1
sql_error show user privileges
system sh/exec.sh -n dnode1 -s stop -x SIGINT
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录