Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
ad71fc46
提交
ad71fc46
authored
2月 17, 2010
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
21b02e28
全部展开
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
1146 行增加
和
1122 行删除
+1146
-1122
_docs_en.utf8.txt
h2/src/docsrc/text/_docs_en.utf8.txt
+377
-365
_docs_ja.utf8.txt
h2/src/docsrc/text/_docs_ja.utf8.txt
+377
-365
_docs_en.properties
h2/src/docsrc/textbase/_docs_en.properties
+370
-366
Database.java
h2/src/main/org/h2/engine/Database.java
+8
-6
HashIndex.java
h2/src/main/org/h2/index/HashIndex.java
+4
-9
Data.java
h2/src/main/org/h2/store/Data.java
+5
-5
ValueHashMap.java
h2/src/main/org/h2/util/ValueHashMap.java
+1
-3
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+1
-0
TestRecovery.java
h2/src/test/org/h2/test/unit/TestRecovery.java
+2
-2
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+1
-1
没有找到文件。
h2/src/docsrc/text/_docs_en.utf8.txt
浏览文件 @
ad71fc46
差异被折叠。
点击展开。
h2/src/docsrc/text/_docs_ja.utf8.txt
浏览文件 @
ad71fc46
差异被折叠。
点击展开。
h2/src/docsrc/textbase/_docs_en.properties
浏览文件 @
ad71fc46
差异被折叠。
点击展开。
h2/src/main/org/h2/engine/Database.java
浏览文件 @
ad71fc46
...
@@ -1103,14 +1103,16 @@ public class Database implements DataHandler {
...
@@ -1103,14 +1103,16 @@ public class Database implements DataHandler {
pageStore
.
compact
(
compactFully
);
pageStore
.
compact
(
compactFully
);
}
}
}
catch
(
DbException
e
)
{
}
catch
(
DbException
e
)
{
if
(
e
.
getErrorCode
()
!=
ErrorCode
.
DATABASE_IS_CLOSED
){
if
(
e
.
getErrorCode
()
!=
ErrorCode
.
DATABASE_IS_CLOSED
)
{
// e.printStackTrace();
if
(
SysProperties
.
CHECK2
)
{
// TODO don't ignore exceptions
e
.
printStackTrace
();
}
}
}
traceSystem
.
getTrace
(
Trace
.
DATABASE
).
error
(
"close"
,
e
);
traceSystem
.
getTrace
(
Trace
.
DATABASE
).
error
(
"close"
,
e
);
}
catch
(
Throwable
t
){
}
catch
(
Throwable
t
)
{
// e.printStackTrace();
if
(
SysProperties
.
CHECK2
)
{
// TODO don't ignore exceptions
t
.
printStackTrace
();
}
traceSystem
.
getTrace
(
Trace
.
DATABASE
).
error
(
"close"
,
t
);
traceSystem
.
getTrace
(
Trace
.
DATABASE
).
error
(
"close"
,
t
);
}
}
}
}
...
...
h2/src/main/org/h2/index/HashIndex.java
浏览文件 @
ad71fc46
...
@@ -21,7 +21,11 @@ import org.h2.value.Value;
...
@@ -21,7 +21,11 @@ import org.h2.value.Value;
*/
*/
public
class
HashIndex
extends
BaseIndex
{
public
class
HashIndex
extends
BaseIndex
{
/**
* The index of the indexed column.
*/
protected
final
int
indexColumn
;
protected
final
int
indexColumn
;
private
final
TableData
tableData
;
private
final
TableData
tableData
;
private
ValueHashMap
<
Long
>
rows
;
private
ValueHashMap
<
Long
>
rows
;
...
@@ -85,15 +89,6 @@ public class HashIndex extends BaseIndex {
...
@@ -85,15 +89,6 @@ public class HashIndex extends BaseIndex {
// nothing to do
// nothing to do
}
}
/**
* Generate the search key from a row. Only single column indexes are
* supported (multi-column indexes could be mapped to an value array, but
* that is much slower than using a tree based index).
*
* @param row the row
* @return the value
*/
public
double
getCost
(
Session
session
,
int
[]
masks
)
{
public
double
getCost
(
Session
session
,
int
[]
masks
)
{
for
(
Column
column
:
columns
)
{
for
(
Column
column
:
columns
)
{
int
index
=
column
.
getColumnId
();
int
index
=
column
.
getColumnId
();
...
...
h2/src/main/org/h2/store/Data.java
浏览文件 @
ad71fc46
...
@@ -11,16 +11,15 @@ package org.h2.store;
...
@@ -11,16 +11,15 @@ package org.h2.store;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.math.BigInteger
;
import
java.sql.Date
;
import
java.sql.Date
;
import
java.sql.SQLException
;
import
java.sql.Time
;
import
java.sql.Time
;
import
java.sql.Timestamp
;
import
java.sql.Timestamp
;
import
org.h2.constant.ErrorCode
;
import
org.h2.constant.ErrorCode
;
import
org.h2.constant.SysProperties
;
import
org.h2.constant.SysProperties
;
import
org.h2.engine.Constants
;
import
org.h2.engine.Constants
;
import
org.h2.message.DbException
;
import
org.h2.message.DbException
;
import
org.h2.util.Utils
;
import
org.h2.util.DateTimeUtils
;
import
org.h2.util.DateTimeUtils
;
import
org.h2.util.MathUtils
;
import
org.h2.util.MathUtils
;
import
org.h2.util.Utils
;
import
org.h2.value.Value
;
import
org.h2.value.Value
;
import
org.h2.value.ValueArray
;
import
org.h2.value.ValueArray
;
import
org.h2.value.ValueBoolean
;
import
org.h2.value.ValueBoolean
;
...
@@ -53,6 +52,7 @@ public class Data {
...
@@ -53,6 +52,7 @@ public class Data {
*/
*/
public
static
final
int
LENGTH_INT
=
4
;
public
static
final
int
LENGTH_INT
=
4
;
private
static
final
boolean
TEST
=
false
;
private
static
final
int
TEST_OFFSET
=
0
;
private
static
final
int
TEST_OFFSET
=
0
;
/**
/**
...
@@ -355,7 +355,7 @@ public class Data {
...
@@ -355,7 +355,7 @@ public class Data {
*/
*/
public
void
writeValue
(
Value
v
)
{
public
void
writeValue
(
Value
v
)
{
int
start
=
pos
;
int
start
=
pos
;
if
(
TEST
_OFFSET
>
0
)
{
if
(
TEST
)
{
pos
+=
TEST_OFFSET
;
pos
+=
TEST_OFFSET
;
}
}
if
(
v
==
ValueNull
.
INSTANCE
)
{
if
(
v
==
ValueNull
.
INSTANCE
)
{
...
@@ -562,8 +562,8 @@ public class Data {
...
@@ -562,8 +562,8 @@ public class Data {
* @return the value
* @return the value
*/
*/
public
Value
readValue
()
{
public
Value
readValue
()
{
if
(
TEST
_OFFSET
>
0
)
{
if
(
TEST
)
{
pos
+=
TEST_OFFSET
;
pos
+=
TEST_OFFSET
;
}
}
int
type
=
data
[
pos
++]
&
255
;
int
type
=
data
[
pos
++]
&
255
;
switch
(
type
)
{
switch
(
type
)
{
...
...
h2/src/main/org/h2/util/ValueHashMap.java
浏览文件 @
ad71fc46
...
@@ -22,10 +22,8 @@ public class ValueHashMap<V> extends HashBase {
...
@@ -22,10 +22,8 @@ public class ValueHashMap<V> extends HashBase {
private
V
[]
values
;
private
V
[]
values
;
/**
/**
* Create a new value hash map using the given data handler.
* Create a new value hash map.
* The data handler is used to compare values.
*
*
* @param handler the data handler
* @return the object
* @return the object
*/
*/
public
static
<
T
>
ValueHashMap
<
T
>
newInstance
()
{
public
static
<
T
>
ValueHashMap
<
T
>
newInstance
()
{
...
...
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
ad71fc46
...
@@ -291,6 +291,7 @@ java org.h2.test.TestAll timer
...
@@ -291,6 +291,7 @@ java org.h2.test.TestAll timer
System
.
setProperty
(
"h2.check2"
,
"true"
);
System
.
setProperty
(
"h2.check2"
,
"true"
);
/*
/*
maybe remove ValueHashMap
test recovery of large pages and transaction log
test recovery of large pages and transaction log
test recovery with 'trace' mode (btree data)
test recovery with 'trace' mode (btree data)
test runscript with setCheckResults, execute, process, setShowResults
test runscript with setCheckResults, execute, process, setShowResults
...
...
h2/src/test/org/h2/test/unit/TestRecovery.java
浏览文件 @
ad71fc46
...
@@ -42,8 +42,8 @@ public class TestRecovery extends TestBase {
...
@@ -42,8 +42,8 @@ public class TestRecovery extends TestBase {
stat
.
execute
(
"create table test as select * from system_range(1, 100)"
);
stat
.
execute
(
"create table test as select * from system_range(1, 100)"
);
stat
.
execute
(
"create table a(id int primary key) as select * from system_range(1, 100)"
);
stat
.
execute
(
"create table a(id int primary key) as select * from system_range(1, 100)"
);
stat
.
execute
(
"create table b(id int references a(id)) as select * from system_range(1, 100)"
);
stat
.
execute
(
"create table b(id int references a(id)) as select * from system_range(1, 100)"
);
stat
.
execute
(
"create table c(d clob) as select space(10000) ||
'end'"
);
stat
.
execute
(
"create table c(d clob) as select space(10000) ||
'end'"
);
stat
.
execute
(
"create table d(d varchar) as select space(10000) ||
'end'"
);
stat
.
execute
(
"create table d(d varchar) as select space(10000) ||
'end'"
);
stat
.
execute
(
"alter table a add foreign key(id) references b(id)"
);
stat
.
execute
(
"alter table a add foreign key(id) references b(id)"
);
// all rows have the same value - so that SCRIPT can't re-order the rows
// all rows have the same value - so that SCRIPT can't re-order the rows
stat
.
execute
(
"create table e(id varchar) as select space(10) from system_range(1, 1000)"
);
stat
.
execute
(
"create table e(id varchar) as select space(10) from system_range(1, 1000)"
);
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
ad71fc46
...
@@ -634,4 +634,4 @@ profiles superinterfaces conventions brace indentations increments
...
@@ -634,4 +634,4 @@ profiles superinterfaces conventions brace indentations increments
explicitconstructorcall switchstatements members parens alignment declarations
explicitconstructorcall switchstatements members parens alignment declarations
jdt continuation codegen parenthesized tabulation ellipsis imple inits guardian
jdt continuation codegen parenthesized tabulation ellipsis imple inits guardian
postfix iconified deiconified deactivated activated worker frequent utilities
postfix iconified deiconified deactivated activated worker frequent utilities
workers appender recovers
workers appender recovers
balanced
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论