Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
491bc343
Unverified
提交
491bc343
authored
6 年前
作者:
Evgenij Ryazanov
提交者:
GitHub
6 年前
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1345 from katzyn/misc
Replace some init methods with constructors
上级
498e99ba
2e2dfda1
隐藏空白字符变更
内嵌
并排
正在显示
36 个修改的文件
包含
64 行增加
和
49 行删除
+64
-49
Constraint.java
h2/src/main/org/h2/constraint/Constraint.java
+1
-1
Comment.java
h2/src/main/org/h2/engine/Comment.java
+1
-1
DbObjectBase.java
h2/src/main/org/h2/engine/DbObjectBase.java
+1
-1
FunctionAlias.java
h2/src/main/org/h2/engine/FunctionAlias.java
+1
-1
Right.java
h2/src/main/org/h2/engine/Right.java
+2
-2
RightOwner.java
h2/src/main/org/h2/engine/RightOwner.java
+1
-1
Setting.java
h2/src/main/org/h2/engine/Setting.java
+1
-1
UserAggregate.java
h2/src/main/org/h2/engine/UserAggregate.java
+1
-1
UserDataType.java
h2/src/main/org/h2/engine/UserDataType.java
+1
-1
BaseIndex.java
h2/src/main/org/h2/index/BaseIndex.java
+4
-4
FunctionIndex.java
h2/src/main/org/h2/index/FunctionIndex.java
+1
-1
HashIndex.java
h2/src/main/org/h2/index/HashIndex.java
+1
-1
LinkedIndex.java
h2/src/main/org/h2/index/LinkedIndex.java
+1
-1
MetaIndex.java
h2/src/main/org/h2/index/MetaIndex.java
+1
-1
NonUniqueHashIndex.java
h2/src/main/org/h2/index/NonUniqueHashIndex.java
+1
-1
PageBtreeIndex.java
h2/src/main/org/h2/index/PageBtreeIndex.java
+1
-1
PageDataIndex.java
h2/src/main/org/h2/index/PageDataIndex.java
+1
-1
PageDelegateIndex.java
h2/src/main/org/h2/index/PageDelegateIndex.java
+3
-3
PageIndex.java
h2/src/main/org/h2/index/PageIndex.java
+16
-0
RangeIndex.java
h2/src/main/org/h2/index/RangeIndex.java
+1
-1
ScanIndex.java
h2/src/main/org/h2/index/ScanIndex.java
+1
-1
SpatialTreeIndex.java
h2/src/main/org/h2/index/SpatialTreeIndex.java
+1
-2
TreeIndex.java
h2/src/main/org/h2/index/TreeIndex.java
+1
-1
ViewIndex.java
h2/src/main/org/h2/index/ViewIndex.java
+2
-2
MVDelegateIndex.java
h2/src/main/org/h2/mvstore/db/MVDelegateIndex.java
+3
-3
MVPrimaryIndex.java
h2/src/main/org/h2/mvstore/db/MVPrimaryIndex.java
+1
-1
MVSecondaryIndex.java
h2/src/main/org/h2/mvstore/db/MVSecondaryIndex.java
+1
-1
MVSpatialIndex.java
h2/src/main/org/h2/mvstore/db/MVSpatialIndex.java
+1
-1
Constant.java
h2/src/main/org/h2/schema/Constant.java
+1
-1
Schema.java
h2/src/main/org/h2/schema/Schema.java
+1
-1
SchemaObjectBase.java
h2/src/main/org/h2/schema/SchemaObjectBase.java
+3
-3
Sequence.java
h2/src/main/org/h2/schema/Sequence.java
+1
-1
TriggerObject.java
h2/src/main/org/h2/schema/TriggerObject.java
+1
-1
Table.java
h2/src/main/org/h2/table/Table.java
+1
-1
TableSynonym.java
h2/src/main/org/h2/table/TableSynonym.java
+1
-1
TestTableEngines.java
h2/src/test/org/h2/test/db/TestTableEngines.java
+3
-3
没有找到文件。
h2/src/main/org/h2/constraint/Constraint.java
浏览文件 @
491bc343
...
@@ -64,7 +64,7 @@ public abstract class Constraint extends SchemaObjectBase implements
...
@@ -64,7 +64,7 @@ public abstract class Constraint extends SchemaObjectBase implements
protected
Table
table
;
protected
Table
table
;
Constraint
(
Schema
schema
,
int
id
,
String
name
,
Table
table
)
{
Constraint
(
Schema
schema
,
int
id
,
String
name
,
Table
table
)
{
initSchemaObjectBase
(
schema
,
id
,
name
,
Trace
.
CONSTRAINT
);
super
(
schema
,
id
,
name
,
Trace
.
CONSTRAINT
);
this
.
table
=
table
;
this
.
table
=
table
;
this
.
setTemporary
(
table
.
isTemporary
());
this
.
setTemporary
(
table
.
isTemporary
());
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/Comment.java
浏览文件 @
491bc343
...
@@ -20,7 +20,7 @@ public class Comment extends DbObjectBase {
...
@@ -20,7 +20,7 @@ public class Comment extends DbObjectBase {
private
String
commentText
;
private
String
commentText
;
public
Comment
(
Database
database
,
int
id
,
DbObject
obj
)
{
public
Comment
(
Database
database
,
int
id
,
DbObject
obj
)
{
initDbObjectBase
(
database
,
id
,
getKey
(
obj
),
Trace
.
DATABASE
);
super
(
database
,
id
,
getKey
(
obj
),
Trace
.
DATABASE
);
this
.
objectType
=
obj
.
getType
();
this
.
objectType
=
obj
.
getType
();
this
.
objectName
=
obj
.
getSQL
();
this
.
objectName
=
obj
.
getSQL
();
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/DbObjectBase.java
浏览文件 @
491bc343
...
@@ -43,7 +43,7 @@ public abstract class DbObjectBase implements DbObject {
...
@@ -43,7 +43,7 @@ public abstract class DbObjectBase implements DbObject {
* @param name the name
* @param name the name
* @param traceModuleId the trace module id
* @param traceModuleId the trace module id
*/
*/
protected
void
init
DbObjectBase
(
Database
db
,
int
objectId
,
String
name
,
protected
DbObjectBase
(
Database
db
,
int
objectId
,
String
name
,
int
traceModuleId
)
{
int
traceModuleId
)
{
this
.
database
=
db
;
this
.
database
=
db
;
this
.
trace
=
db
.
getTrace
(
traceModuleId
);
this
.
trace
=
db
.
getTrace
(
traceModuleId
);
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/FunctionAlias.java
浏览文件 @
491bc343
...
@@ -47,7 +47,7 @@ public class FunctionAlias extends SchemaObjectBase {
...
@@ -47,7 +47,7 @@ public class FunctionAlias extends SchemaObjectBase {
private
boolean
bufferResultSetToLocalTemp
=
true
;
private
boolean
bufferResultSetToLocalTemp
=
true
;
private
FunctionAlias
(
Schema
schema
,
int
id
,
String
name
)
{
private
FunctionAlias
(
Schema
schema
,
int
id
,
String
name
)
{
initSchemaObjectBase
(
schema
,
id
,
name
,
Trace
.
FUNCTION
);
super
(
schema
,
id
,
name
,
Trace
.
FUNCTION
);
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/Right.java
浏览文件 @
491bc343
...
@@ -68,14 +68,14 @@ public class Right extends DbObjectBase {
...
@@ -68,14 +68,14 @@ public class Right extends DbObjectBase {
private
DbObject
grantedObject
;
private
DbObject
grantedObject
;
public
Right
(
Database
db
,
int
id
,
RightOwner
grantee
,
Role
grantedRole
)
{
public
Right
(
Database
db
,
int
id
,
RightOwner
grantee
,
Role
grantedRole
)
{
initDbObjectBase
(
db
,
id
,
"RIGHT_"
+
id
,
Trace
.
USER
);
super
(
db
,
id
,
"RIGHT_"
+
id
,
Trace
.
USER
);
this
.
grantee
=
grantee
;
this
.
grantee
=
grantee
;
this
.
grantedRole
=
grantedRole
;
this
.
grantedRole
=
grantedRole
;
}
}
public
Right
(
Database
db
,
int
id
,
RightOwner
grantee
,
int
grantedRight
,
public
Right
(
Database
db
,
int
id
,
RightOwner
grantee
,
int
grantedRight
,
DbObject
grantedObject
)
{
DbObject
grantedObject
)
{
initDbObjectBase
(
db
,
id
,
Integer
.
toString
(
id
),
Trace
.
USER
);
super
(
db
,
id
,
Integer
.
toString
(
id
),
Trace
.
USER
);
this
.
grantee
=
grantee
;
this
.
grantee
=
grantee
;
this
.
grantedRight
=
grantedRight
;
this
.
grantedRight
=
grantedRight
;
this
.
grantedObject
=
grantedObject
;
this
.
grantedObject
=
grantedObject
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/RightOwner.java
浏览文件 @
491bc343
...
@@ -29,7 +29,7 @@ public abstract class RightOwner extends DbObjectBase {
...
@@ -29,7 +29,7 @@ public abstract class RightOwner extends DbObjectBase {
protected
RightOwner
(
Database
database
,
int
id
,
String
name
,
protected
RightOwner
(
Database
database
,
int
id
,
String
name
,
int
traceModuleId
)
{
int
traceModuleId
)
{
initDbObjectBase
(
database
,
id
,
name
,
traceModuleId
);
super
(
database
,
id
,
name
,
traceModuleId
);
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/Setting.java
浏览文件 @
491bc343
...
@@ -18,7 +18,7 @@ public class Setting extends DbObjectBase {
...
@@ -18,7 +18,7 @@ public class Setting extends DbObjectBase {
private
String
stringValue
;
private
String
stringValue
;
public
Setting
(
Database
database
,
int
id
,
String
settingName
)
{
public
Setting
(
Database
database
,
int
id
,
String
settingName
)
{
initDbObjectBase
(
database
,
id
,
settingName
,
Trace
.
SETTING
);
super
(
database
,
id
,
settingName
,
Trace
.
SETTING
);
}
}
public
void
setIntValue
(
int
value
)
{
public
void
setIntValue
(
int
value
)
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/UserAggregate.java
浏览文件 @
491bc343
...
@@ -26,7 +26,7 @@ public class UserAggregate extends DbObjectBase {
...
@@ -26,7 +26,7 @@ public class UserAggregate extends DbObjectBase {
public
UserAggregate
(
Database
db
,
int
id
,
String
name
,
String
className
,
public
UserAggregate
(
Database
db
,
int
id
,
String
name
,
String
className
,
boolean
force
)
{
boolean
force
)
{
initDbObjectBase
(
db
,
id
,
name
,
Trace
.
FUNCTION
);
super
(
db
,
id
,
name
,
Trace
.
FUNCTION
);
this
.
className
=
className
;
this
.
className
=
className
;
if
(!
force
)
{
if
(!
force
)
{
getInstance
();
getInstance
();
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/UserDataType.java
浏览文件 @
491bc343
...
@@ -18,7 +18,7 @@ public class UserDataType extends DbObjectBase {
...
@@ -18,7 +18,7 @@ public class UserDataType extends DbObjectBase {
private
Column
column
;
private
Column
column
;
public
UserDataType
(
Database
database
,
int
id
,
String
name
)
{
public
UserDataType
(
Database
database
,
int
id
,
String
name
)
{
initDbObjectBase
(
database
,
id
,
name
,
Trace
.
DATABASE
);
super
(
database
,
id
,
name
,
Trace
.
DATABASE
);
}
}
@Override
@Override
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/BaseIndex.java
浏览文件 @
491bc343
...
@@ -35,8 +35,8 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index {
...
@@ -35,8 +35,8 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index {
protected
IndexColumn
[]
indexColumns
;
protected
IndexColumn
[]
indexColumns
;
protected
Column
[]
columns
;
protected
Column
[]
columns
;
protected
int
[]
columnIds
;
protected
int
[]
columnIds
;
protected
Table
table
;
protected
final
Table
table
;
protected
IndexType
indexType
;
protected
final
IndexType
indexType
;
/**
/**
* Initialize the base index.
* Initialize the base index.
...
@@ -48,9 +48,9 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index {
...
@@ -48,9 +48,9 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index {
* not yet known
* not yet known
* @param newIndexType the index type
* @param newIndexType the index type
*/
*/
protected
void
init
BaseIndex
(
Table
newTable
,
int
id
,
String
name
,
protected
BaseIndex
(
Table
newTable
,
int
id
,
String
name
,
IndexColumn
[]
newIndexColumns
,
IndexType
newIndexType
)
{
IndexColumn
[]
newIndexColumns
,
IndexType
newIndexType
)
{
initSchemaObjectBase
(
newTable
.
getSchema
(),
id
,
name
,
Trace
.
INDEX
);
super
(
newTable
.
getSchema
(),
id
,
name
,
Trace
.
INDEX
);
this
.
indexType
=
newIndexType
;
this
.
indexType
=
newIndexType
;
this
.
table
=
newTable
;
this
.
table
=
newTable
;
if
(
newIndexColumns
!=
null
)
{
if
(
newIndexColumns
!=
null
)
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/FunctionIndex.java
浏览文件 @
491bc343
...
@@ -24,7 +24,7 @@ public class FunctionIndex extends BaseIndex {
...
@@ -24,7 +24,7 @@ public class FunctionIndex extends BaseIndex {
private
final
FunctionTable
functionTable
;
private
final
FunctionTable
functionTable
;
public
FunctionIndex
(
FunctionTable
functionTable
,
IndexColumn
[]
columns
)
{
public
FunctionIndex
(
FunctionTable
functionTable
,
IndexColumn
[]
columns
)
{
initBaseIndex
(
functionTable
,
0
,
null
,
columns
,
IndexType
.
createNonUnique
(
true
));
super
(
functionTable
,
0
,
null
,
columns
,
IndexType
.
createNonUnique
(
true
));
this
.
functionTable
=
functionTable
;
this
.
functionTable
=
functionTable
;
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/HashIndex.java
浏览文件 @
491bc343
...
@@ -33,7 +33,7 @@ public class HashIndex extends BaseIndex {
...
@@ -33,7 +33,7 @@ public class HashIndex extends BaseIndex {
public
HashIndex
(
RegularTable
table
,
int
id
,
String
indexName
,
public
HashIndex
(
RegularTable
table
,
int
id
,
String
indexName
,
IndexColumn
[]
columns
,
IndexType
indexType
)
{
IndexColumn
[]
columns
,
IndexType
indexType
)
{
initBaseIndex
(
table
,
id
,
indexName
,
columns
,
indexType
);
super
(
table
,
id
,
indexName
,
columns
,
indexType
);
this
.
indexColumn
=
columns
[
0
].
column
.
getColumnId
();
this
.
indexColumn
=
columns
[
0
].
column
.
getColumnId
();
this
.
tableData
=
table
;
this
.
tableData
=
table
;
reset
();
reset
();
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/LinkedIndex.java
浏览文件 @
491bc343
...
@@ -37,7 +37,7 @@ public class LinkedIndex extends BaseIndex {
...
@@ -37,7 +37,7 @@ public class LinkedIndex extends BaseIndex {
public
LinkedIndex
(
TableLink
table
,
int
id
,
IndexColumn
[]
columns
,
public
LinkedIndex
(
TableLink
table
,
int
id
,
IndexColumn
[]
columns
,
IndexType
indexType
)
{
IndexType
indexType
)
{
initBaseIndex
(
table
,
id
,
null
,
columns
,
indexType
);
super
(
table
,
id
,
null
,
columns
,
indexType
);
link
=
table
;
link
=
table
;
targetTableName
=
link
.
getQualifiedTable
();
targetTableName
=
link
.
getQualifiedTable
();
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/MetaIndex.java
浏览文件 @
491bc343
...
@@ -26,7 +26,7 @@ public class MetaIndex extends BaseIndex {
...
@@ -26,7 +26,7 @@ public class MetaIndex extends BaseIndex {
private
final
boolean
scan
;
private
final
boolean
scan
;
public
MetaIndex
(
MetaTable
meta
,
IndexColumn
[]
columns
,
boolean
scan
)
{
public
MetaIndex
(
MetaTable
meta
,
IndexColumn
[]
columns
,
boolean
scan
)
{
initBaseIndex
(
meta
,
0
,
null
,
columns
,
IndexType
.
createNonUnique
(
true
));
super
(
meta
,
0
,
null
,
columns
,
IndexType
.
createNonUnique
(
true
));
this
.
meta
=
meta
;
this
.
meta
=
meta
;
this
.
scan
=
scan
;
this
.
scan
=
scan
;
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/NonUniqueHashIndex.java
浏览文件 @
491bc343
...
@@ -38,7 +38,7 @@ public class NonUniqueHashIndex extends BaseIndex {
...
@@ -38,7 +38,7 @@ public class NonUniqueHashIndex extends BaseIndex {
public
NonUniqueHashIndex
(
RegularTable
table
,
int
id
,
String
indexName
,
public
NonUniqueHashIndex
(
RegularTable
table
,
int
id
,
String
indexName
,
IndexColumn
[]
columns
,
IndexType
indexType
)
{
IndexColumn
[]
columns
,
IndexType
indexType
)
{
initBaseIndex
(
table
,
id
,
indexName
,
columns
,
indexType
);
super
(
table
,
id
,
indexName
,
columns
,
indexType
);
this
.
indexColumn
=
columns
[
0
].
column
.
getColumnId
();
this
.
indexColumn
=
columns
[
0
].
column
.
getColumnId
();
this
.
tableData
=
table
;
this
.
tableData
=
table
;
reset
();
reset
();
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/PageBtreeIndex.java
浏览文件 @
491bc343
...
@@ -43,7 +43,7 @@ public class PageBtreeIndex extends PageIndex {
...
@@ -43,7 +43,7 @@ public class PageBtreeIndex extends PageIndex {
public
PageBtreeIndex
(
RegularTable
table
,
int
id
,
String
indexName
,
public
PageBtreeIndex
(
RegularTable
table
,
int
id
,
String
indexName
,
IndexColumn
[]
columns
,
IndexColumn
[]
columns
,
IndexType
indexType
,
boolean
create
,
Session
session
)
{
IndexType
indexType
,
boolean
create
,
Session
session
)
{
initBaseIndex
(
table
,
id
,
indexName
,
columns
,
indexType
);
super
(
table
,
id
,
indexName
,
columns
,
indexType
);
if
(!
database
.
isStarting
()
&&
create
)
{
if
(!
database
.
isStarting
()
&&
create
)
{
checkIndexColumnTypes
(
columns
);
checkIndexColumnTypes
(
columns
);
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/PageDataIndex.java
浏览文件 @
491bc343
...
@@ -47,7 +47,7 @@ public class PageDataIndex extends PageIndex {
...
@@ -47,7 +47,7 @@ public class PageDataIndex extends PageIndex {
public
PageDataIndex
(
RegularTable
table
,
int
id
,
IndexColumn
[]
columns
,
public
PageDataIndex
(
RegularTable
table
,
int
id
,
IndexColumn
[]
columns
,
IndexType
indexType
,
boolean
create
,
Session
session
)
{
IndexType
indexType
,
boolean
create
,
Session
session
)
{
initBaseIndex
(
table
,
id
,
table
.
getName
()
+
"_DATA"
,
columns
,
indexType
);
super
(
table
,
id
,
table
.
getName
()
+
"_DATA"
,
columns
,
indexType
);
// trace = database.getTrace(Trace.PAGE_STORE + "_di");
// trace = database.getTrace(Trace.PAGE_STORE + "_di");
// trace.setLevel(TraceSystem.DEBUG);
// trace.setLevel(TraceSystem.DEBUG);
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/PageDelegateIndex.java
浏览文件 @
491bc343
...
@@ -27,9 +27,9 @@ public class PageDelegateIndex extends PageIndex {
...
@@ -27,9 +27,9 @@ public class PageDelegateIndex extends PageIndex {
public
PageDelegateIndex
(
RegularTable
table
,
int
id
,
String
name
,
public
PageDelegateIndex
(
RegularTable
table
,
int
id
,
String
name
,
IndexType
indexType
,
PageDataIndex
mainIndex
,
boolean
create
,
IndexType
indexType
,
PageDataIndex
mainIndex
,
boolean
create
,
Session
session
)
{
Session
session
)
{
IndexColumn
[]
cols
=
IndexColumn
.
wrap
(
super
(
table
,
id
,
name
,
new
Column
[]
{
table
.
getColumn
(
mainIndex
.
getMainIndexColumn
())});
IndexColumn
.
wrap
(
new
Column
[]
{
table
.
getColumn
(
mainIndex
.
getMainIndexColumn
())
}),
this
.
initBaseIndex
(
table
,
id
,
name
,
cols
,
indexType
);
indexType
);
this
.
mainIndex
=
mainIndex
;
this
.
mainIndex
=
mainIndex
;
if
(!
database
.
isPersistent
()
||
id
<
0
)
{
if
(!
database
.
isPersistent
()
||
id
<
0
)
{
throw
DbException
.
throwInternalError
(
name
);
throw
DbException
.
throwInternalError
(
name
);
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/PageIndex.java
浏览文件 @
491bc343
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
*/
*/
package
org
.
h2
.
index
;
package
org
.
h2
.
index
;
import
org.h2.table.IndexColumn
;
import
org.h2.table.Table
;
/**
/**
* A page store index.
* A page store index.
...
@@ -18,6 +20,20 @@ public abstract class PageIndex extends BaseIndex {
...
@@ -18,6 +20,20 @@ public abstract class PageIndex extends BaseIndex {
private
boolean
sortedInsertMode
;
private
boolean
sortedInsertMode
;
/**
* Initialize the page store index.
*
* @param newTable the table
* @param id the object id
* @param name the index name
* @param newIndexColumns the columns that are indexed or null if this is
* not yet known
* @param newIndexType the index type
*/
protected
PageIndex
(
Table
newTable
,
int
id
,
String
name
,
IndexColumn
[]
newIndexColumns
,
IndexType
newIndexType
)
{
super
(
newTable
,
id
,
name
,
newIndexColumns
,
newIndexType
);
}
/**
/**
* Get the root page of this index.
* Get the root page of this index.
*
*
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/RangeIndex.java
浏览文件 @
491bc343
...
@@ -24,7 +24,7 @@ public class RangeIndex extends BaseIndex {
...
@@ -24,7 +24,7 @@ public class RangeIndex extends BaseIndex {
private
final
RangeTable
rangeTable
;
private
final
RangeTable
rangeTable
;
public
RangeIndex
(
RangeTable
table
,
IndexColumn
[]
columns
)
{
public
RangeIndex
(
RangeTable
table
,
IndexColumn
[]
columns
)
{
initBaseIndex
(
table
,
0
,
"RANGE_INDEX"
,
columns
,
super
(
table
,
0
,
"RANGE_INDEX"
,
columns
,
IndexType
.
createNonUnique
(
true
));
IndexType
.
createNonUnique
(
true
));
this
.
rangeTable
=
table
;
this
.
rangeTable
=
table
;
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/ScanIndex.java
浏览文件 @
491bc343
...
@@ -35,7 +35,7 @@ public class ScanIndex extends BaseIndex {
...
@@ -35,7 +35,7 @@ public class ScanIndex extends BaseIndex {
public
ScanIndex
(
RegularTable
table
,
int
id
,
IndexColumn
[]
columns
,
public
ScanIndex
(
RegularTable
table
,
int
id
,
IndexColumn
[]
columns
,
IndexType
indexType
)
{
IndexType
indexType
)
{
initBaseIndex
(
table
,
id
,
table
.
getName
()
+
"_DATA"
,
columns
,
indexType
);
super
(
table
,
id
,
table
.
getName
()
+
"_DATA"
,
columns
,
indexType
);
tableData
=
table
;
tableData
=
table
;
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/SpatialTreeIndex.java
浏览文件 @
491bc343
...
@@ -58,6 +58,7 @@ public class SpatialTreeIndex extends BaseIndex implements SpatialIndex {
...
@@ -58,6 +58,7 @@ public class SpatialTreeIndex extends BaseIndex implements SpatialIndex {
public
SpatialTreeIndex
(
Table
table
,
int
id
,
String
indexName
,
public
SpatialTreeIndex
(
Table
table
,
int
id
,
String
indexName
,
IndexColumn
[]
columns
,
IndexType
indexType
,
boolean
persistent
,
IndexColumn
[]
columns
,
IndexType
indexType
,
boolean
persistent
,
boolean
create
,
Session
session
)
{
boolean
create
,
Session
session
)
{
super
(
table
,
id
,
indexName
,
columns
,
indexType
);
if
(
indexType
.
isUnique
())
{
if
(
indexType
.
isUnique
())
{
throw
DbException
.
getUnsupportedException
(
"not unique"
);
throw
DbException
.
getUnsupportedException
(
"not unique"
);
}
}
...
@@ -81,9 +82,7 @@ public class SpatialTreeIndex extends BaseIndex implements SpatialIndex {
...
@@ -81,9 +82,7 @@ public class SpatialTreeIndex extends BaseIndex implements SpatialIndex {
throw
DbException
.
getUnsupportedException
(
throw
DbException
.
getUnsupportedException
(
"cannot do nulls last"
);
"cannot do nulls last"
);
}
}
initBaseIndex
(
table
,
id
,
indexName
,
columns
,
indexType
);
this
.
needRebuild
=
create
;
this
.
needRebuild
=
create
;
this
.
table
=
table
;
if
(!
database
.
isStarting
())
{
if
(!
database
.
isStarting
())
{
if
(
columns
[
0
].
column
.
getType
()
!=
Value
.
GEOMETRY
)
{
if
(
columns
[
0
].
column
.
getType
()
!=
Value
.
GEOMETRY
)
{
throw
DbException
.
getUnsupportedException
(
throw
DbException
.
getUnsupportedException
(
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/TreeIndex.java
浏览文件 @
491bc343
...
@@ -30,7 +30,7 @@ public class TreeIndex extends BaseIndex {
...
@@ -30,7 +30,7 @@ public class TreeIndex extends BaseIndex {
public
TreeIndex
(
RegularTable
table
,
int
id
,
String
indexName
,
public
TreeIndex
(
RegularTable
table
,
int
id
,
String
indexName
,
IndexColumn
[]
columns
,
IndexType
indexType
)
{
IndexColumn
[]
columns
,
IndexType
indexType
)
{
initBaseIndex
(
table
,
id
,
indexName
,
columns
,
indexType
);
super
(
table
,
id
,
indexName
,
columns
,
indexType
);
tableData
=
table
;
tableData
=
table
;
if
(!
database
.
isStarting
())
{
if
(!
database
.
isStarting
())
{
checkIndexColumnTypes
(
columns
);
checkIndexColumnTypes
(
columns
);
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/ViewIndex.java
浏览文件 @
491bc343
...
@@ -64,7 +64,7 @@ public class ViewIndex extends BaseIndex implements SpatialIndex {
...
@@ -64,7 +64,7 @@ public class ViewIndex extends BaseIndex implements SpatialIndex {
*/
*/
public
ViewIndex
(
TableView
view
,
String
querySQL
,
public
ViewIndex
(
TableView
view
,
String
querySQL
,
ArrayList
<
Parameter
>
originalParameters
,
boolean
recursive
)
{
ArrayList
<
Parameter
>
originalParameters
,
boolean
recursive
)
{
initBaseIndex
(
view
,
0
,
null
,
null
,
IndexType
.
createNonUnique
(
false
));
super
(
view
,
0
,
null
,
null
,
IndexType
.
createNonUnique
(
false
));
this
.
view
=
view
;
this
.
view
=
view
;
this
.
querySQL
=
querySQL
;
this
.
querySQL
=
querySQL
;
this
.
originalParameters
=
originalParameters
;
this
.
originalParameters
=
originalParameters
;
...
@@ -91,7 +91,7 @@ public class ViewIndex extends BaseIndex implements SpatialIndex {
...
@@ -91,7 +91,7 @@ public class ViewIndex extends BaseIndex implements SpatialIndex {
*/
*/
public
ViewIndex
(
TableView
view
,
ViewIndex
index
,
Session
session
,
public
ViewIndex
(
TableView
view
,
ViewIndex
index
,
Session
session
,
int
[]
masks
,
TableFilter
[]
filters
,
int
filter
,
SortOrder
sortOrder
)
{
int
[]
masks
,
TableFilter
[]
filters
,
int
filter
,
SortOrder
sortOrder
)
{
initBaseIndex
(
view
,
0
,
null
,
null
,
IndexType
.
createNonUnique
(
false
));
super
(
view
,
0
,
null
,
null
,
IndexType
.
createNonUnique
(
false
));
this
.
view
=
view
;
this
.
view
=
view
;
this
.
querySQL
=
index
.
querySQL
;
this
.
querySQL
=
index
.
querySQL
;
this
.
originalParameters
=
index
.
originalParameters
;
this
.
originalParameters
=
index
.
originalParameters
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/mvstore/db/MVDelegateIndex.java
浏览文件 @
491bc343
...
@@ -30,9 +30,9 @@ public class MVDelegateIndex extends BaseIndex implements MVIndex {
...
@@ -30,9 +30,9 @@ public class MVDelegateIndex extends BaseIndex implements MVIndex {
public
MVDelegateIndex
(
MVTable
table
,
int
id
,
String
name
,
public
MVDelegateIndex
(
MVTable
table
,
int
id
,
String
name
,
MVPrimaryIndex
mainIndex
,
MVPrimaryIndex
mainIndex
,
IndexType
indexType
)
{
IndexType
indexType
)
{
IndexColumn
[]
cols
=
IndexColumn
.
wrap
(
new
Column
[]
{
table
super
(
table
,
id
,
name
,
.
getColumn
(
mainIndex
.
getMainIndexColumn
())
});
IndexColumn
.
wrap
(
new
Column
[]
{
table
.
getColumn
(
mainIndex
.
getMainIndexColumn
())
}),
this
.
initBaseIndex
(
table
,
id
,
name
,
cols
,
indexType
);
indexType
);
this
.
mainIndex
=
mainIndex
;
this
.
mainIndex
=
mainIndex
;
if
(
id
<
0
)
{
if
(
id
<
0
)
{
throw
DbException
.
throwInternalError
(
name
);
throw
DbException
.
throwInternalError
(
name
);
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/mvstore/db/MVPrimaryIndex.java
浏览文件 @
491bc343
...
@@ -45,8 +45,8 @@ public class MVPrimaryIndex extends BaseIndex {
...
@@ -45,8 +45,8 @@ public class MVPrimaryIndex extends BaseIndex {
public
MVPrimaryIndex
(
Database
db
,
MVTable
table
,
int
id
,
public
MVPrimaryIndex
(
Database
db
,
MVTable
table
,
int
id
,
IndexColumn
[]
columns
,
IndexType
indexType
)
{
IndexColumn
[]
columns
,
IndexType
indexType
)
{
super
(
table
,
id
,
table
.
getName
()
+
"_DATA"
,
columns
,
indexType
);
this
.
mvTable
=
table
;
this
.
mvTable
=
table
;
initBaseIndex
(
table
,
id
,
table
.
getName
()
+
"_DATA"
,
columns
,
indexType
);
int
[]
sortTypes
=
new
int
[
columns
.
length
];
int
[]
sortTypes
=
new
int
[
columns
.
length
];
for
(
int
i
=
0
;
i
<
columns
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
columns
.
length
;
i
++)
{
sortTypes
[
i
]
=
SortOrder
.
ASCENDING
;
sortTypes
[
i
]
=
SortOrder
.
ASCENDING
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/mvstore/db/MVSecondaryIndex.java
浏览文件 @
491bc343
...
@@ -48,8 +48,8 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex {
...
@@ -48,8 +48,8 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex {
public
MVSecondaryIndex
(
Database
db
,
MVTable
table
,
int
id
,
String
indexName
,
public
MVSecondaryIndex
(
Database
db
,
MVTable
table
,
int
id
,
String
indexName
,
IndexColumn
[]
columns
,
IndexType
indexType
)
{
IndexColumn
[]
columns
,
IndexType
indexType
)
{
super
(
table
,
id
,
indexName
,
columns
,
indexType
);
this
.
mvTable
=
table
;
this
.
mvTable
=
table
;
initBaseIndex
(
table
,
id
,
indexName
,
columns
,
indexType
);
if
(!
database
.
isStarting
())
{
if
(!
database
.
isStarting
())
{
checkIndexColumnTypes
(
columns
);
checkIndexColumnTypes
(
columns
);
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/mvstore/db/MVSpatialIndex.java
浏览文件 @
491bc343
...
@@ -65,6 +65,7 @@ public class MVSpatialIndex extends BaseIndex implements SpatialIndex, MVIndex {
...
@@ -65,6 +65,7 @@ public class MVSpatialIndex extends BaseIndex implements SpatialIndex, MVIndex {
public
MVSpatialIndex
(
public
MVSpatialIndex
(
Database
db
,
MVTable
table
,
int
id
,
String
indexName
,
Database
db
,
MVTable
table
,
int
id
,
String
indexName
,
IndexColumn
[]
columns
,
IndexType
indexType
)
{
IndexColumn
[]
columns
,
IndexType
indexType
)
{
super
(
table
,
id
,
indexName
,
columns
,
indexType
);
if
(
columns
.
length
!=
1
)
{
if
(
columns
.
length
!=
1
)
{
throw
DbException
.
getUnsupportedException
(
throw
DbException
.
getUnsupportedException
(
"Can only index one column"
);
"Can only index one column"
);
...
@@ -88,7 +89,6 @@ public class MVSpatialIndex extends BaseIndex implements SpatialIndex, MVIndex {
...
@@ -88,7 +89,6 @@ public class MVSpatialIndex extends BaseIndex implements SpatialIndex, MVIndex {
+
col
.
column
.
getCreateSQL
());
+
col
.
column
.
getCreateSQL
());
}
}
this
.
mvTable
=
table
;
this
.
mvTable
=
table
;
initBaseIndex
(
table
,
id
,
indexName
,
columns
,
indexType
);
if
(!
database
.
isStarting
())
{
if
(!
database
.
isStarting
())
{
checkIndexColumnTypes
(
columns
);
checkIndexColumnTypes
(
columns
);
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/schema/Constant.java
浏览文件 @
491bc343
...
@@ -23,7 +23,7 @@ public class Constant extends SchemaObjectBase {
...
@@ -23,7 +23,7 @@ public class Constant extends SchemaObjectBase {
private
ValueExpression
expression
;
private
ValueExpression
expression
;
public
Constant
(
Schema
schema
,
int
id
,
String
name
)
{
public
Constant
(
Schema
schema
,
int
id
,
String
name
)
{
initSchemaObjectBase
(
schema
,
id
,
name
,
Trace
.
SCHEMA
);
super
(
schema
,
id
,
name
,
Trace
.
SCHEMA
);
}
}
@Override
@Override
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/schema/Schema.java
浏览文件 @
491bc343
...
@@ -73,6 +73,7 @@ public class Schema extends DbObjectBase {
...
@@ -73,6 +73,7 @@ public class Schema extends DbObjectBase {
*/
*/
public
Schema
(
Database
database
,
int
id
,
String
schemaName
,
User
owner
,
public
Schema
(
Database
database
,
int
id
,
String
schemaName
,
User
owner
,
boolean
system
)
{
boolean
system
)
{
super
(
database
,
id
,
schemaName
,
Trace
.
SCHEMA
);
tablesAndViews
=
database
.
newConcurrentStringMap
();
tablesAndViews
=
database
.
newConcurrentStringMap
();
synonyms
=
database
.
newConcurrentStringMap
();
synonyms
=
database
.
newConcurrentStringMap
();
indexes
=
database
.
newConcurrentStringMap
();
indexes
=
database
.
newConcurrentStringMap
();
...
@@ -81,7 +82,6 @@ public class Schema extends DbObjectBase {
...
@@ -81,7 +82,6 @@ public class Schema extends DbObjectBase {
constraints
=
database
.
newConcurrentStringMap
();
constraints
=
database
.
newConcurrentStringMap
();
constants
=
database
.
newConcurrentStringMap
();
constants
=
database
.
newConcurrentStringMap
();
functions
=
database
.
newConcurrentStringMap
();
functions
=
database
.
newConcurrentStringMap
();
initDbObjectBase
(
database
,
id
,
schemaName
,
Trace
.
SCHEMA
);
this
.
owner
=
owner
;
this
.
owner
=
owner
;
this
.
system
=
system
;
this
.
system
=
system
;
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/schema/SchemaObjectBase.java
浏览文件 @
491bc343
...
@@ -13,7 +13,7 @@ import org.h2.engine.DbObjectBase;
...
@@ -13,7 +13,7 @@ import org.h2.engine.DbObjectBase;
public
abstract
class
SchemaObjectBase
extends
DbObjectBase
implements
public
abstract
class
SchemaObjectBase
extends
DbObjectBase
implements
SchemaObject
{
SchemaObject
{
private
Schema
schema
;
private
final
Schema
schema
;
/**
/**
* Initialize some attributes of this object.
* Initialize some attributes of this object.
...
@@ -23,9 +23,9 @@ public abstract class SchemaObjectBase extends DbObjectBase implements
...
@@ -23,9 +23,9 @@ public abstract class SchemaObjectBase extends DbObjectBase implements
* @param name the name
* @param name the name
* @param traceModuleId the trace module id
* @param traceModuleId the trace module id
*/
*/
protected
void
init
SchemaObjectBase
(
Schema
newSchema
,
int
id
,
String
name
,
protected
SchemaObjectBase
(
Schema
newSchema
,
int
id
,
String
name
,
int
traceModuleId
)
{
int
traceModuleId
)
{
initDbObjectBase
(
newSchema
.
getDatabase
(),
id
,
name
,
traceModuleId
);
super
(
newSchema
.
getDatabase
(),
id
,
name
,
traceModuleId
);
this
.
schema
=
newSchema
;
this
.
schema
=
newSchema
;
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/schema/Sequence.java
浏览文件 @
491bc343
...
@@ -67,7 +67,7 @@ public class Sequence extends SchemaObjectBase {
...
@@ -67,7 +67,7 @@ public class Sequence extends SchemaObjectBase {
public
Sequence
(
Schema
schema
,
int
id
,
String
name
,
Long
startValue
,
public
Sequence
(
Schema
schema
,
int
id
,
String
name
,
Long
startValue
,
Long
increment
,
Long
cacheSize
,
Long
minValue
,
Long
maxValue
,
Long
increment
,
Long
cacheSize
,
Long
minValue
,
Long
maxValue
,
boolean
cycle
,
boolean
belongsToTable
)
{
boolean
cycle
,
boolean
belongsToTable
)
{
initSchemaObjectBase
(
schema
,
id
,
name
,
Trace
.
SEQUENCE
);
super
(
schema
,
id
,
name
,
Trace
.
SEQUENCE
);
this
.
increment
=
increment
!=
null
?
this
.
increment
=
increment
!=
null
?
increment
:
1
;
increment
:
1
;
this
.
minValue
=
minValue
!=
null
?
this
.
minValue
=
minValue
!=
null
?
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/schema/TriggerObject.java
浏览文件 @
491bc343
...
@@ -52,7 +52,7 @@ public class TriggerObject extends SchemaObjectBase {
...
@@ -52,7 +52,7 @@ public class TriggerObject extends SchemaObjectBase {
private
Trigger
triggerCallback
;
private
Trigger
triggerCallback
;
public
TriggerObject
(
Schema
schema
,
int
id
,
String
name
,
Table
table
)
{
public
TriggerObject
(
Schema
schema
,
int
id
,
String
name
,
Table
table
)
{
initSchemaObjectBase
(
schema
,
id
,
name
,
Trace
.
TRIGGER
);
super
(
schema
,
id
,
name
,
Trace
.
TRIGGER
);
this
.
table
=
table
;
this
.
table
=
table
;
setTemporary
(
table
.
isTemporary
());
setTemporary
(
table
.
isTemporary
());
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/table/Table.java
浏览文件 @
491bc343
...
@@ -95,8 +95,8 @@ public abstract class Table extends SchemaObjectBase {
...
@@ -95,8 +95,8 @@ public abstract class Table extends SchemaObjectBase {
public
Table
(
Schema
schema
,
int
id
,
String
name
,
boolean
persistIndexes
,
public
Table
(
Schema
schema
,
int
id
,
String
name
,
boolean
persistIndexes
,
boolean
persistData
)
{
boolean
persistData
)
{
super
(
schema
,
id
,
name
,
Trace
.
TABLE
);
columnMap
=
schema
.
getDatabase
().
newStringMap
();
columnMap
=
schema
.
getDatabase
().
newStringMap
();
initSchemaObjectBase
(
schema
,
id
,
name
,
Trace
.
TABLE
);
this
.
persistIndexes
=
persistIndexes
;
this
.
persistIndexes
=
persistIndexes
;
this
.
persistData
=
persistData
;
this
.
persistData
=
persistData
;
compareMode
=
schema
.
getDatabase
().
getCompareMode
();
compareMode
=
schema
.
getDatabase
().
getCompareMode
();
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/table/TableSynonym.java
浏览文件 @
491bc343
...
@@ -26,7 +26,7 @@ public class TableSynonym extends SchemaObjectBase {
...
@@ -26,7 +26,7 @@ public class TableSynonym extends SchemaObjectBase {
private
Table
synonymFor
;
private
Table
synonymFor
;
public
TableSynonym
(
CreateSynonymData
data
)
{
public
TableSynonym
(
CreateSynonymData
data
)
{
initSchemaObjectBase
(
data
.
schema
,
data
.
id
,
data
.
synonymName
,
Trace
.
TABLE
);
super
(
data
.
schema
,
data
.
id
,
data
.
synonymName
,
Trace
.
TABLE
);
this
.
data
=
data
;
this
.
data
=
data
;
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/db/TestTableEngines.java
浏览文件 @
491bc343
...
@@ -920,7 +920,7 @@ public class TestTableEngines extends TestDb {
...
@@ -920,7 +920,7 @@ public class TestTableEngines extends TestDb {
public
class
Scan
extends
BaseIndex
{
public
class
Scan
extends
BaseIndex
{
Scan
(
Table
table
)
{
Scan
(
Table
table
)
{
initBaseIndex
(
table
,
table
.
getId
(),
table
.
getName
()
+
"_SCAN"
,
super
(
table
,
table
.
getId
(),
table
.
getName
()
+
"_SCAN"
,
IndexColumn
.
wrap
(
table
.
getColumns
()),
IndexType
.
createScan
(
false
));
IndexColumn
.
wrap
(
table
.
getColumns
()),
IndexType
.
createScan
(
false
));
}
}
...
@@ -1145,7 +1145,7 @@ public class TestTableEngines extends TestDb {
...
@@ -1145,7 +1145,7 @@ public class TestTableEngines extends TestDb {
*/
*/
public
class
AffinityIndex
extends
BaseIndex
{
public
class
AffinityIndex
extends
BaseIndex
{
AffinityIndex
(
Table
table
,
int
id
,
String
name
,
IndexColumn
[]
newIndexColumns
)
{
AffinityIndex
(
Table
table
,
int
id
,
String
name
,
IndexColumn
[]
newIndexColumns
)
{
initBaseIndex
(
table
,
id
,
name
,
newIndexColumns
,
IndexType
.
createAffinity
());
super
(
table
,
id
,
name
,
newIndexColumns
,
IndexType
.
createAffinity
());
}
}
@Override
@Override
...
@@ -1534,7 +1534,7 @@ public class TestTableEngines extends TestDb {
...
@@ -1534,7 +1534,7 @@ public class TestTableEngines extends TestDb {
final
TreeSet
<
SearchRow
>
set
=
new
TreeSet
<>(
this
);
final
TreeSet
<
SearchRow
>
set
=
new
TreeSet
<>(
this
);
TreeSetIndex
(
Table
t
,
String
name
,
IndexColumn
[]
cols
,
IndexType
type
)
{
TreeSetIndex
(
Table
t
,
String
name
,
IndexColumn
[]
cols
,
IndexType
type
)
{
initBaseIndex
(
t
,
0
,
name
,
cols
,
type
);
super
(
t
,
0
,
name
,
cols
,
type
);
}
}
@Override
@Override
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论