Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
1487876f
提交
1487876f
authored
7月 10, 2014
作者:
noelgrandin@gmail.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename Database#update to Database#updateMeta for symmetry with the other meta related methods
上级
6cb91c1b
显示空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
24 行增加
和
24 行删除
+24
-24
AlterSchemaRename.java
h2/src/main/org/h2/command/ddl/AlterSchemaRename.java
+1
-1
AlterTableAlterColumn.java
h2/src/main/org/h2/command/ddl/AlterTableAlterColumn.java
+5
-5
AlterTableRename.java
h2/src/main/org/h2/command/ddl/AlterTableRename.java
+1
-1
AlterTableRenameColumn.java
h2/src/main/org/h2/command/ddl/AlterTableRenameColumn.java
+2
-2
AlterUser.java
h2/src/main/org/h2/command/ddl/AlterUser.java
+1
-1
Analyze.java
h2/src/main/org/h2/command/ddl/Analyze.java
+2
-2
CreateView.java
h2/src/main/org/h2/command/ddl/CreateView.java
+1
-1
GrantRevoke.java
h2/src/main/org/h2/command/ddl/GrantRevoke.java
+2
-2
SetComment.java
h2/src/main/org/h2/command/ddl/SetComment.java
+2
-2
AlterSequence.java
h2/src/main/org/h2/command/dml/AlterSequence.java
+1
-1
Set.java
h2/src/main/org/h2/command/dml/Set.java
+1
-1
Database.java
h2/src/main/org/h2/engine/Database.java
+3
-3
Sequence.java
h2/src/main/org/h2/schema/Sequence.java
+1
-1
Table.java
h2/src/main/org/h2/table/Table.java
+1
-1
没有找到文件。
h2/src/main/org/h2/command/ddl/AlterSchemaRename.java
浏览文件 @
1487876f
...
@@ -53,7 +53,7 @@ public class AlterSchemaRename extends DefineCommand {
...
@@ -53,7 +53,7 @@ public class AlterSchemaRename extends DefineCommand {
db
.
renameDatabaseObject
(
session
,
oldSchema
,
newSchemaName
);
db
.
renameDatabaseObject
(
session
,
oldSchema
,
newSchemaName
);
ArrayList
<
SchemaObject
>
all
=
db
.
getAllSchemaObjects
();
ArrayList
<
SchemaObject
>
all
=
db
.
getAllSchemaObjects
();
for
(
SchemaObject
schemaObject
:
all
)
{
for
(
SchemaObject
schemaObject
:
all
)
{
db
.
update
(
session
,
schemaObject
);
db
.
update
Meta
(
session
,
schemaObject
);
}
}
return
0
;
return
0
;
}
}
...
...
h2/src/main/org/h2/command/ddl/AlterTableAlterColumn.java
浏览文件 @
1487876f
...
@@ -102,7 +102,7 @@ public class AlterTableAlterColumn extends SchemaCommand {
...
@@ -102,7 +102,7 @@ public class AlterTableAlterColumn extends SchemaCommand {
}
}
checkNoNullValues
();
checkNoNullValues
();
oldColumn
.
setNullable
(
false
);
oldColumn
.
setNullable
(
false
);
db
.
update
(
session
,
table
);
db
.
update
Meta
(
session
,
table
);
break
;
break
;
}
}
case
CommandInterface
.
ALTER_TABLE_ALTER_COLUMN_NULL
:
{
case
CommandInterface
.
ALTER_TABLE_ALTER_COLUMN_NULL
:
{
...
@@ -112,7 +112,7 @@ public class AlterTableAlterColumn extends SchemaCommand {
...
@@ -112,7 +112,7 @@ public class AlterTableAlterColumn extends SchemaCommand {
}
}
checkNullable
();
checkNullable
();
oldColumn
.
setNullable
(
true
);
oldColumn
.
setNullable
(
true
);
db
.
update
(
session
,
table
);
db
.
update
Meta
(
session
,
table
);
break
;
break
;
}
}
case
CommandInterface
.
ALTER_TABLE_ALTER_COLUMN_DEFAULT
:
{
case
CommandInterface
.
ALTER_TABLE_ALTER_COLUMN_DEFAULT
:
{
...
@@ -120,7 +120,7 @@ public class AlterTableAlterColumn extends SchemaCommand {
...
@@ -120,7 +120,7 @@ public class AlterTableAlterColumn extends SchemaCommand {
oldColumn
.
setSequence
(
null
);
oldColumn
.
setSequence
(
null
);
oldColumn
.
setDefaultExpression
(
session
,
defaultExpression
);
oldColumn
.
setDefaultExpression
(
session
,
defaultExpression
);
removeSequence
(
sequence
);
removeSequence
(
sequence
);
db
.
update
(
session
,
table
);
db
.
update
Meta
(
session
,
table
);
break
;
break
;
}
}
case
CommandInterface
.
ALTER_TABLE_ALTER_COLUMN_CHANGE_TYPE
:
{
case
CommandInterface
.
ALTER_TABLE_ALTER_COLUMN_CHANGE_TYPE
:
{
...
@@ -130,7 +130,7 @@ public class AlterTableAlterColumn extends SchemaCommand {
...
@@ -130,7 +130,7 @@ public class AlterTableAlterColumn extends SchemaCommand {
if
(
oldColumn
.
isWideningConversion
(
newColumn
))
{
if
(
oldColumn
.
isWideningConversion
(
newColumn
))
{
convertAutoIncrementColumn
(
newColumn
);
convertAutoIncrementColumn
(
newColumn
);
oldColumn
.
copy
(
newColumn
);
oldColumn
.
copy
(
newColumn
);
db
.
update
(
session
,
table
);
db
.
update
Meta
(
session
,
table
);
}
else
{
}
else
{
oldColumn
.
setSequence
(
null
);
oldColumn
.
setSequence
(
null
);
oldColumn
.
setDefaultExpression
(
session
,
null
);
oldColumn
.
setDefaultExpression
(
session
,
null
);
...
@@ -173,7 +173,7 @@ public class AlterTableAlterColumn extends SchemaCommand {
...
@@ -173,7 +173,7 @@ public class AlterTableAlterColumn extends SchemaCommand {
case
CommandInterface
.
ALTER_TABLE_ALTER_COLUMN_SELECTIVITY
:
{
case
CommandInterface
.
ALTER_TABLE_ALTER_COLUMN_SELECTIVITY
:
{
int
value
=
newSelectivity
.
optimize
(
session
).
getValue
(
session
).
getInt
();
int
value
=
newSelectivity
.
optimize
(
session
).
getValue
(
session
).
getInt
();
oldColumn
.
setSelectivity
(
value
);
oldColumn
.
setSelectivity
(
value
);
db
.
update
(
session
,
table
);
db
.
update
Meta
(
session
,
table
);
break
;
break
;
}
}
default
:
default
:
...
...
h2/src/main/org/h2/command/ddl/AlterTableRename.java
浏览文件 @
1487876f
...
@@ -46,7 +46,7 @@ public class AlterTableRename extends SchemaCommand {
...
@@ -46,7 +46,7 @@ public class AlterTableRename extends SchemaCommand {
if
(!
t
.
isHidden
())
{
if
(!
t
.
isHidden
())
{
t
.
setHidden
(
hidden
);
t
.
setHidden
(
hidden
);
oldTable
.
setHidden
(
true
);
oldTable
.
setHidden
(
true
);
db
.
update
(
session
,
oldTable
);
db
.
update
Meta
(
session
,
oldTable
);
}
}
return
0
;
return
0
;
}
}
...
...
h2/src/main/org/h2/command/ddl/AlterTableRenameColumn.java
浏览文件 @
1487876f
...
@@ -53,10 +53,10 @@ public class AlterTableRenameColumn extends DefineCommand {
...
@@ -53,10 +53,10 @@ public class AlterTableRenameColumn extends DefineCommand {
column
.
removeCheckConstraint
();
column
.
removeCheckConstraint
();
column
.
addCheckConstraint
(
session
,
newCheckExpr
);
column
.
addCheckConstraint
(
session
,
newCheckExpr
);
table
.
setModified
();
table
.
setModified
();
db
.
update
(
session
,
table
);
db
.
update
Meta
(
session
,
table
);
for
(
DbObject
child
:
table
.
getChildren
())
{
for
(
DbObject
child
:
table
.
getChildren
())
{
if
(
child
.
getCreateSQL
()
!=
null
)
{
if
(
child
.
getCreateSQL
()
!=
null
)
{
db
.
update
(
session
,
child
);
db
.
update
Meta
(
session
,
child
);
}
}
}
}
return
0
;
return
0
;
...
...
h2/src/main/org/h2/command/ddl/AlterUser.java
浏览文件 @
1487876f
...
@@ -107,7 +107,7 @@ public class AlterUser extends DefineCommand {
...
@@ -107,7 +107,7 @@ public class AlterUser extends DefineCommand {
default
:
default
:
DbException
.
throwInternalError
(
"type="
+
type
);
DbException
.
throwInternalError
(
"type="
+
type
);
}
}
db
.
update
(
session
,
user
);
db
.
update
Meta
(
session
,
user
);
return
0
;
return
0
;
}
}
...
...
h2/src/main/org/h2/command/ddl/Analyze.java
浏览文件 @
1487876f
...
@@ -114,7 +114,7 @@ public class Analyze extends DefineCommand {
...
@@ -114,7 +114,7 @@ public class Analyze extends DefineCommand {
columns
[
j
].
setSelectivity
(
selectivity
);
columns
[
j
].
setSelectivity
(
selectivity
);
}
}
if
(
manual
)
{
if
(
manual
)
{
db
.
update
(
session
,
table
);
db
.
update
Meta
(
session
,
table
);
}
else
{
}
else
{
Session
sysSession
=
db
.
getSystemSession
();
Session
sysSession
=
db
.
getSystemSession
();
if
(
sysSession
!=
session
)
{
if
(
sysSession
!=
session
)
{
...
@@ -122,7 +122,7 @@ public class Analyze extends DefineCommand {
...
@@ -122,7 +122,7 @@ public class Analyze extends DefineCommand {
// (which is the case if we are within a trigger)
// (which is the case if we are within a trigger)
// then we can't update the statistics because
// then we can't update the statistics because
// that would unlock all locked objects
// that would unlock all locked objects
db
.
update
(
sysSession
,
table
);
db
.
update
Meta
(
sysSession
,
table
);
sysSession
.
commit
(
true
);
sysSession
.
commit
(
true
);
}
}
}
}
...
...
h2/src/main/org/h2/command/ddl/CreateView.java
浏览文件 @
1487876f
...
@@ -119,7 +119,7 @@ public class CreateView extends SchemaCommand {
...
@@ -119,7 +119,7 @@ public class CreateView extends SchemaCommand {
if
(
old
==
null
)
{
if
(
old
==
null
)
{
db
.
addSchemaObject
(
session
,
view
);
db
.
addSchemaObject
(
session
,
view
);
}
else
{
}
else
{
db
.
update
(
session
,
view
);
db
.
update
Meta
(
session
,
view
);
}
}
return
0
;
return
0
;
}
}
...
...
h2/src/main/org/h2/command/ddl/GrantRevoke.java
浏览文件 @
1487876f
...
@@ -115,7 +115,7 @@ public class GrantRevoke extends DefineCommand {
...
@@ -115,7 +115,7 @@ public class GrantRevoke extends DefineCommand {
db
.
addDatabaseObject
(
session
,
right
);
db
.
addDatabaseObject
(
session
,
right
);
}
else
{
}
else
{
right
.
setRightMask
(
right
.
getRightMask
()
|
rightMask
);
right
.
setRightMask
(
right
.
getRightMask
()
|
rightMask
);
db
.
update
(
session
,
right
);
db
.
update
Meta
(
session
,
right
);
}
}
}
}
}
}
...
@@ -151,7 +151,7 @@ public class GrantRevoke extends DefineCommand {
...
@@ -151,7 +151,7 @@ public class GrantRevoke extends DefineCommand {
db
.
removeDatabaseObject
(
session
,
right
);
db
.
removeDatabaseObject
(
session
,
right
);
}
else
{
}
else
{
right
.
setRightMask
(
newRight
);
right
.
setRightMask
(
newRight
);
db
.
update
(
session
,
right
);
db
.
update
Meta
(
session
,
right
);
}
}
}
}
}
}
...
...
h2/src/main/org/h2/command/ddl/SetComment.java
浏览文件 @
1487876f
...
@@ -101,7 +101,7 @@ public class SetComment extends DefineCommand {
...
@@ -101,7 +101,7 @@ public class SetComment extends DefineCommand {
objectType
==
DbObject
.
USER
||
objectType
==
DbObject
.
USER
||
objectType
==
DbObject
.
INDEX
||
objectType
==
DbObject
.
INDEX
||
objectType
==
DbObject
.
CONSTRAINT
)
{
objectType
==
DbObject
.
CONSTRAINT
)
{
db
.
update
(
session
,
object
);
db
.
update
Meta
(
session
,
object
);
}
else
{
}
else
{
Comment
comment
=
db
.
findComment
(
object
);
Comment
comment
=
db
.
findComment
(
object
);
if
(
comment
==
null
)
{
if
(
comment
==
null
)
{
...
@@ -118,7 +118,7 @@ public class SetComment extends DefineCommand {
...
@@ -118,7 +118,7 @@ public class SetComment extends DefineCommand {
db
.
removeDatabaseObject
(
session
,
comment
);
db
.
removeDatabaseObject
(
session
,
comment
);
}
else
{
}
else
{
comment
.
setCommentText
(
text
);
comment
.
setCommentText
(
text
);
db
.
update
(
session
,
comment
);
db
.
update
Meta
(
session
,
comment
);
}
}
}
}
}
}
...
...
h2/src/main/org/h2/command/dml/AlterSequence.java
浏览文件 @
1487876f
...
@@ -104,7 +104,7 @@ public class AlterSequence extends SchemaCommand {
...
@@ -104,7 +104,7 @@ public class AlterSequence extends SchemaCommand {
// would keep other transactions from using the sequence
// would keep other transactions from using the sequence
Session
sysSession
=
db
.
getSystemSession
();
Session
sysSession
=
db
.
getSystemSession
();
synchronized
(
sysSession
)
{
synchronized
(
sysSession
)
{
db
.
update
(
sysSession
,
sequence
);
db
.
update
Meta
(
sysSession
,
sequence
);
sysSession
.
commit
(
true
);
sysSession
.
commit
(
true
);
}
}
return
0
;
return
0
;
...
...
h2/src/main/org/h2/command/dml/Set.java
浏览文件 @
1487876f
...
@@ -522,7 +522,7 @@ public class Set extends Prepared {
...
@@ -522,7 +522,7 @@ public class Set extends Prepared {
if
(
addNew
)
{
if
(
addNew
)
{
database
.
addDatabaseObject
(
session
,
setting
);
database
.
addDatabaseObject
(
session
,
setting
);
}
else
{
}
else
{
database
.
update
(
session
,
setting
);
database
.
update
Meta
(
session
,
setting
);
}
}
}
}
...
...
h2/src/main/org/h2/engine/Database.java
浏览文件 @
1487876f
...
@@ -1564,7 +1564,7 @@ public class Database implements DataHandler {
...
@@ -1564,7 +1564,7 @@ public class Database implements DataHandler {
* @param session the session
* @param session the session
* @param obj the database object
* @param obj the database object
*/
*/
public
synchronized
void
update
(
Session
session
,
DbObject
obj
)
{
public
synchronized
void
update
Meta
(
Session
session
,
DbObject
obj
)
{
lockMeta
(
session
);
lockMeta
(
session
);
int
id
=
obj
.
getId
();
int
id
=
obj
.
getId
();
removeMeta
(
session
,
id
);
removeMeta
(
session
,
id
);
...
@@ -1591,12 +1591,12 @@ public class Database implements DataHandler {
...
@@ -1591,12 +1591,12 @@ public class Database implements DataHandler {
if
(
comment
!=
null
)
{
if
(
comment
!=
null
)
{
DbException
.
throwInternalError
();
DbException
.
throwInternalError
();
}
}
update
(
session
,
obj
);
update
Meta
(
session
,
obj
);
// remember that this scans only one level deep!
// remember that this scans only one level deep!
if
(
list
!=
null
)
{
if
(
list
!=
null
)
{
for
(
DbObject
o
:
list
)
{
for
(
DbObject
o
:
list
)
{
if
(
o
.
getCreateSQL
()
!=
null
)
{
if
(
o
.
getCreateSQL
()
!=
null
)
{
update
(
session
,
o
);
update
Meta
(
session
,
o
);
}
}
}
}
}
}
...
...
h2/src/main/org/h2/schema/Sequence.java
浏览文件 @
1487876f
...
@@ -303,7 +303,7 @@ public class Sequence extends SchemaObjectBase {
...
@@ -303,7 +303,7 @@ public class Sequence extends SchemaObjectBase {
try
{
try
{
value
=
valueWithMargin
;
value
=
valueWithMargin
;
if
(!
isTemporary
())
{
if
(!
isTemporary
())
{
database
.
update
(
session
,
this
);
database
.
update
Meta
(
session
,
this
);
}
}
}
finally
{
}
finally
{
value
=
realValue
;
value
=
realValue
;
...
...
h2/src/main/org/h2/table/Table.java
浏览文件 @
1487876f
...
@@ -1029,7 +1029,7 @@ public abstract class Table extends SchemaObjectBase {
...
@@ -1029,7 +1029,7 @@ public abstract class Table extends SchemaObjectBase {
for
(
Constraint
cons
:
constraints
)
{
for
(
Constraint
cons
:
constraints
)
{
if
(
cons
.
usesIndex
(
index
))
{
if
(
cons
.
usesIndex
(
index
))
{
cons
.
setIndexOwner
(
index
);
cons
.
setIndexOwner
(
index
);
database
.
update
(
session
,
cons
);
database
.
update
Meta
(
session
,
cons
);
stillNeeded
=
true
;
stillNeeded
=
true
;
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论