Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
e0438151
Unverified
提交
e0438151
authored
7 年前
作者:
Evgenij Ryazanov
提交者:
GitHub
7 年前
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1065 from katzyn/ddl
Update schema rights on schema rename
上级
515bee4a
e5374fab
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
63 行增加
和
0 行删除
+63
-0
changelog.html
h2/src/docsrc/html/changelog.html
+12
-0
Schema.java
h2/src/main/org/h2/schema/Schema.java
+12
-0
TestRights.java
h2/src/test/org/h2/test/db/TestRights.java
+39
-0
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
e0438151
...
...
@@ -21,6 +21,18 @@ Change Log
<h2>
Next Version (unreleased)
</h2>
<ul>
<li>
Issue #456: H2 table privileges referring to old schema after schema rename
</li>
<li>
Yet another fix to Page memory accounting
</li>
<li>
Replace MVStore.ASSERT variable with assertions
</li>
<li>
Issue #1063: Leftover comments about enhanced for loops
</li>
<li>
PR #1059: Assorted minor changes
</li>
<li>
PR #1058: Txcommit atomic
</li>
<li>
Issue #1038: ora_hash function implementation off by one
</li>
<li>
PR #1054: Introduce overflow bit in tx state
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/schema/Schema.java
浏览文件 @
e0438151
...
...
@@ -127,6 +127,18 @@ public class Schema extends DbObjectBase {
&&
triggers
.
isEmpty
()
&&
constraints
.
isEmpty
()
&&
constants
.
isEmpty
()
&&
functions
.
isEmpty
();
}
@Override
public
ArrayList
<
DbObject
>
getChildren
()
{
ArrayList
<
DbObject
>
children
=
New
.
arrayList
();
ArrayList
<
Right
>
rights
=
database
.
getAllRights
();
for
(
Right
right
:
rights
)
{
if
(
right
.
getGrantedObject
()
==
this
)
{
children
.
add
(
right
);
}
}
return
children
;
}
@Override
public
void
removeChildrenAndResources
(
Session
session
)
{
while
(
triggers
!=
null
&&
triggers
.
size
()
>
0
)
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/db/TestRights.java
浏览文件 @
e0438151
...
...
@@ -48,6 +48,8 @@ public class TestRights extends TestBase {
testSchemaRenameUser
();
testAccessRights
();
testSchemaAdminRole
();
testTableRename
();
testSchemaRename
();
testSchemaDrop
();
deleteDb
(
"rights"
);
}
...
...
@@ -492,6 +494,43 @@ public class TestRights extends TestBase {
conn
.
close
();
}
private
void
testTableRename
()
throws
SQLException
{
if
(
config
.
memory
)
{
return
;
}
deleteDb
(
"rights"
);
Connection
conn
=
getConnection
(
"rights"
);
stat
=
conn
.
createStatement
();
stat
.
execute
(
"create user test password '' admin"
);
stat
.
execute
(
"create schema b"
);
stat
.
execute
(
"create table b.t1(id int)"
);
stat
.
execute
(
"grant select on b.t1 to test"
);
stat
.
execute
(
"alter table b.t1 rename to b.t2"
);
conn
.
close
();
conn
=
getConnection
(
"rights"
);
stat
=
conn
.
createStatement
();
stat
.
execute
(
"drop user test"
);
conn
.
close
();
}
private
void
testSchemaRename
()
throws
SQLException
{
if
(
config
.
memory
)
{
return
;
}
deleteDb
(
"rights"
);
Connection
conn
=
getConnection
(
"rights"
);
stat
=
conn
.
createStatement
();
stat
.
execute
(
"create user test password '' admin"
);
stat
.
execute
(
"create schema b"
);
stat
.
execute
(
"grant select on schema b to test"
);
stat
.
execute
(
"alter schema b rename to c"
);
conn
.
close
();
conn
=
getConnection
(
"rights"
);
stat
=
conn
.
createStatement
();
stat
.
execute
(
"drop user test"
);
conn
.
close
();
}
private
void
testSchemaDrop
()
throws
SQLException
{
if
(
config
.
memory
)
{
return
;
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论