Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
8825c9ce
提交
8825c9ce
authored
3月 17, 2013
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Documentation.
上级
9e771b50
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
1724 行增加
和
1710 行删除
+1724
-1710
installation.html
h2/src/docsrc/html/installation.html
+2
-2
_docs_en.utf8.txt
h2/src/docsrc/text/_docs_en.utf8.txt
+551
-545
_docs_ja.utf8.txt
h2/src/docsrc/text/_docs_ja.utf8.txt
+551
-545
_docs_en.properties
h2/src/docsrc/textbase/_docs_en.properties
+547
-545
SysProperties.java
h2/src/main/org/h2/constant/SysProperties.java
+1
-1
Session.java
h2/src/main/org/h2/engine/Session.java
+1
-1
JdbcDatabaseMetaData.java
h2/src/main/org/h2/jdbc/JdbcDatabaseMetaData.java
+4
-4
MVMap.java
h2/src/main/org/h2/mvstore/MVMap.java
+1
-1
TransactionStore.java
h2/src/main/org/h2/mvstore/TransactionStore.java
+35
-35
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
MVTable.java
h2/src/main/org/h2/mvstore/db/MVTable.java
+3
-3
MVTableEngine.java
h2/src/main/org/h2/mvstore/db/MVTableEngine.java
+1
-1
TestCompatibility.java
h2/src/test/org/h2/test/db/TestCompatibility.java
+1
-1
TestTransactionStore.java
h2/src/test/org/h2/test/store/TestTransactionStore.java
+20
-20
TestCompress.java
h2/src/test/org/h2/test/unit/TestCompress.java
+2
-2
TestTools.java
h2/src/test/org/h2/test/unit/TestTools.java
+2
-2
没有找到文件。
h2/src/docsrc/html/installation.html
浏览文件 @
8825c9ce
...
...
@@ -46,8 +46,8 @@ Other software most likely also works, but is not tested as much.
<p>
As this database is written in Java, it can run on many different platforms.
It is tested with Java 6 and 7.
Currently, the database is developed and tested on Windows 8
and Mac OS X using Java 6, but it also works in many other operating systems
Currently, the database is developed and tested on Windows 8
and Mac OS X using Java 6, but it also works in many other operating systems
and using other Java runtime environments.
All major operating systems (Windows XP, Windows Vista, Windows 7, Mac OS, Ubuntu,...) are supported.
</p>
...
...
h2/src/docsrc/text/_docs_en.utf8.txt
浏览文件 @
8825c9ce
差异被折叠。
点击展开。
h2/src/docsrc/text/_docs_ja.utf8.txt
浏览文件 @
8825c9ce
差异被折叠。
点击展开。
h2/src/docsrc/textbase/_docs_en.properties
浏览文件 @
8825c9ce
差异被折叠。
点击展开。
h2/src/main/org/h2/constant/SysProperties.java
浏览文件 @
8825c9ce
...
...
@@ -149,7 +149,7 @@ public class SysProperties {
* H2 Console: session timeout in milliseconds. The default is 30 minutes.
*/
public
static
final
int
CONSOLE_TIMEOUT
=
Utils
.
getProperty
(
"h2.consoleTimeout"
,
30
*
60
*
1000
);
/**
* System property <code>h2.dataSourceTraceLevel</code> (default: 1).<br />
* The trace level of the data source implementation. Default is 1 for
...
...
h2/src/main/org/h2/engine/Session.java
浏览文件 @
8825c9ce
...
...
@@ -1236,7 +1236,7 @@ public class Session extends SessionWithState {
/**
* Get the transaction to use for this session.
*
*
* @param store the store
* @return the transaction
*/
...
...
h2/src/main/org/h2/jdbc/JdbcDatabaseMetaData.java
浏览文件 @
8825c9ce
...
...
@@ -2345,7 +2345,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
String
m
=
getMode
();
if
(
m
.
equals
(
"MySQL"
))
{
return
true
;
}
}
return
false
;
}
...
...
@@ -2386,7 +2386,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
String
m
=
getMode
();
if
(
m
.
equals
(
"MySQL"
))
{
return
true
;
}
}
return
false
;
}
...
...
@@ -2401,7 +2401,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
String
m
=
getMode
();
if
(
m
.
equals
(
"MySQL"
))
{
return
false
;
}
}
return
true
;
}
...
...
@@ -2972,7 +2972,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
public
String
toString
()
{
return
getTraceObjectName
()
+
": "
+
conn
;
}
private
String
getMode
()
throws
SQLException
{
if
(
mode
==
null
)
{
PreparedStatement
prep
=
conn
.
prepareStatement
(
...
...
h2/src/main/org/h2/mvstore/MVMap.java
浏览文件 @
8825c9ce
...
...
@@ -592,7 +592,7 @@ public class MVMap<K, V> extends AbstractMap<K, V>
/**
* Check whether the two values are equal.
*
*
* @param a the first value
* @param b the second value
* @return true if they are equal
...
...
h2/src/main/org/h2/mvstore/TransactionStore.java
浏览文件 @
8825c9ce
...
...
@@ -18,7 +18,7 @@ import org.h2.util.New;
* A store that supports concurrent transactions.
*/
public
class
TransactionStore
{
private
static
final
String
LAST_TRANSACTION_ID
=
"lastTransactionId"
;
/**
...
...
@@ -101,10 +101,10 @@ public class TransactionStore {
}
}
}
/**
* Get the list of currently open transactions.
*
*
* @return the list of transactions
*/
public
synchronized
List
<
Transaction
>
getOpenTransactions
()
{
...
...
@@ -141,10 +141,10 @@ public class TransactionStore {
openTransactionMap
.
put
(
transactionId
,
t
);
return
t
;
}
/**
* Prepare a transaction.
*
*
* @param transactionId the transaction id
*/
void
prepare
(
long
transactionId
)
{
...
...
@@ -152,11 +152,11 @@ public class TransactionStore {
Object
[]
v
=
{
Transaction
.
STATUS_PREPARED
,
old
[
1
]
};
openTransactions
.
put
(
transactionId
,
v
);
store
.
commit
();
}
}
/**
* Set the name of a transaction.
*
*
* @param transactionId the transaction id
* @param name the new name
*/
...
...
@@ -165,7 +165,7 @@ public class TransactionStore {
Object
[]
v
=
{
old
[
0
],
name
};
openTransactions
.
put
(
transactionId
,
v
);
store
.
commit
();
}
}
/**
* Commit a transaction.
...
...
@@ -261,7 +261,7 @@ public class TransactionStore {
* A transaction.
*/
public
static
class
Transaction
{
/**
* The status of an open transaction.
*/
...
...
@@ -291,9 +291,9 @@ public class TransactionStore {
* The transaction id.
*/
final
long
transactionId
;
private
int
status
;
private
String
name
;
private
long
logId
;
...
...
@@ -305,39 +305,39 @@ public class TransactionStore {
this
.
name
=
name
;
this
.
logId
=
logId
;
}
/**
* Get the transaction id.
*
*
* @return the transaction id
*/
public
long
getId
()
{
return
transactionId
;
}
/**
* Get the transaction status.
*
*
* @return the status
*/
public
int
getStatus
()
{
return
status
;
}
/**
* Set the name of the transaction.
*
*
* @param name the new name
*/
public
void
setName
(
String
name
)
{
checkOpen
();
checkOpen
();
store
.
setTransactionName
(
transactionId
,
name
);
this
.
name
=
name
;
}
/**
* Get the name of the transaction.
*
*
* @return name the name
*/
public
String
getName
()
{
...
...
@@ -398,7 +398,7 @@ public class TransactionStore {
/**
* Roll back to the given savepoint. This is only allowed if the
* transaction is open.
*
*
* @param savepointId the savepoint id
*/
public
void
rollbackToSavepoint
(
long
savepointId
)
{
...
...
@@ -426,7 +426,7 @@ public class TransactionStore {
status
=
STATUS_CLOSED
;
}
}
/**
* Roll the transaction back. Afterwards, this transaction is closed.
*/
...
...
@@ -459,7 +459,7 @@ public class TransactionStore {
private
Transaction
transaction
;
private
final
int
mapId
;
/**
* The map used for writing (the latest version).
* <p>
...
...
@@ -467,14 +467,14 @@ public class TransactionStore {
* Value: { transactionId, oldVersion, value }
*/
private
final
MVMap
<
K
,
Object
[]>
mapWrite
;
/**
* The map used for reading (possibly an older version). Reading is done
* on an older version so that changes are not immediately visible, to
* support statement processing (for example
* "update test set id = id + 1").
* <p>
* Key: key the key of the data.
* Key: key the key of the data.
* Value: { transactionId, oldVersion, value }
*/
private
final
MVMap
<
K
,
Object
[]>
mapRead
;
...
...
@@ -489,7 +489,7 @@ public class TransactionStore {
mapRead
=
mapWrite
;
}
}
/**
* Get the size of the map as seen by this transaction.
*
...
...
@@ -530,7 +530,7 @@ public class TransactionStore {
* <p>
* If the row is locked, this method will retry until the row could be
* updated or until a lock timeout.
*
*
* @param key the key
* @param value the new value (not null)
* @throws IllegalStateException if a lock timeout occurs
...
...
@@ -539,7 +539,7 @@ public class TransactionStore {
DataUtils
.
checkArgument
(
value
!=
null
,
"The value may not be null"
);
return
set
(
key
,
value
);
}
private
V
set
(
K
key
,
V
value
)
{
checkOpen
();
long
start
=
0
;
...
...
@@ -571,13 +571,13 @@ public class TransactionStore {
}
}
}
/**
* Try to remove the value for the given key.
* <p>
* This will fail if the row is locked by another transaction (that
* means, if another open transaction changed the row).
*
*
* @param key the key
* @return whether the entry could be removed
*/
...
...
@@ -599,12 +599,12 @@ public class TransactionStore {
DataUtils
.
checkArgument
(
value
!=
null
,
"The value may not be null"
);
return
trySet
(
key
,
value
,
false
);
}
/**
* Try to set or remove the value. When updating only unchanged entries,
* then the value is only changed if it was not changed after opening
* the map.
*
*
* @param key the key
* @param value the new value (null to remove the value)
* @param onlyIfUnchanged only set the value if it was not changed (by
...
...
@@ -620,7 +620,7 @@ public class TransactionStore {
long
tx
=
(
Long
)
current
[
0
];
if
(
tx
==
transaction
.
transactionId
)
{
if
(
value
==
null
)
{
// ignore removing an entry
// ignore removing an entry
// if it was added or changed
// in the same statement
return
true
;
...
...
@@ -698,7 +698,7 @@ public class TransactionStore {
/**
* Get the value for the given key at the time when this map was opened.
*
*
* @param key the key
* @return the value or null
*/
...
...
@@ -715,7 +715,7 @@ public class TransactionStore {
public
V
getLatest
(
K
key
)
{
return
get
(
key
,
mapWrite
);
}
/**
* Get the value for the given key.
*
...
...
@@ -758,7 +758,7 @@ public class TransactionStore {
/**
* Open the map to store the data.
*
*
* @param <A> the key type
* @param <B> the value type
* @param name the map name
...
...
h2/src/main/org/h2/mvstore/db/MVPrimaryIndex.java
浏览文件 @
8825c9ce
...
...
@@ -322,7 +322,7 @@ public class MVPrimaryIndex extends BaseIndex {
public
boolean
isRowIdIndex
()
{
return
true
;
}
/**
* Get the map to store the data.
*
...
...
h2/src/main/org/h2/mvstore/db/MVSecondaryIndex.java
浏览文件 @
8825c9ce
...
...
@@ -295,7 +295,7 @@ public class MVSecondaryIndex extends BaseIndex {
}
}
/**
* Get the map to store the data.
*
...
...
h2/src/main/org/h2/mvstore/db/MVTable.java
浏览文件 @
8825c9ce
...
...
@@ -672,17 +672,17 @@ public class MVTable extends TableBase {
public
void
checkRename
()
{
// ok
}
/**
* Get the transaction to use for this session.
*
*
* @param session the session
* @return the transaction
*/
Transaction
getTransaction
(
Session
session
)
{
return
session
.
getTransaction
(
store
);
}
public
TransactionStore
getStore
()
{
return
store
;
}
...
...
h2/src/main/org/h2/mvstore/db/MVTableEngine.java
浏览文件 @
8825c9ce
...
...
@@ -139,7 +139,7 @@ public class MVTableEngine implements TableEngine {
* The store.
*/
private
final
MVStore
store
;
/**
* The transaction store.
*/
...
...
h2/src/test/org/h2/test/db/TestCompatibility.java
浏览文件 @
8825c9ce
...
...
@@ -236,7 +236,7 @@ public class TestCompatibility extends TestBase {
conn
=
getConnection
(
"compatibility;MODE=MYSQL"
);
stat
=
conn
.
createStatement
();
testLog
(
Math
.
log
(
10
),
stat
);
DatabaseMetaData
meta
=
conn
.
getMetaData
();
assertTrue
(
meta
.
storesLowerCaseIdentifiers
());
assertTrue
(
meta
.
storesLowerCaseQuotedIdentifiers
());
...
...
h2/src/test/org/h2/test/store/TestTransactionStore.java
浏览文件 @
8825c9ce
...
...
@@ -45,7 +45,7 @@ public class TestTransactionStore extends TestBase {
testSingleConnection
();
testCompareWithPostgreSQL
();
}
/**
* Tests behavior when used for a sequence of SQL statements. Each statement
* uses a savepoint. Within a statement, changes by the statement itself are
...
...
@@ -63,14 +63,14 @@ public class TestTransactionStore extends TestBase {
TransactionMap
<
String
,
String
>
m
;
long
startUpdate
;
long
version
;
tx
=
ts
.
begin
();
// start of statement
// create table test
startUpdate
=
tx
.
setSavepoint
();
tx
.
openMap
(
"test"
);
// start of statement
// insert into test(id, name) values(1, 'Hello'), (2, 'World')
startUpdate
=
tx
.
setSavepoint
();
...
...
@@ -81,10 +81,10 @@ public class TestTransactionStore extends TestBase {
// not seen yet (within the same statement)
assertNull
(
m
.
get
(
"1"
));
assertNull
(
m
.
get
(
"2"
));
// start of statement
startUpdate
=
tx
.
setSavepoint
();
version
=
s
.
getCurrentVersion
();
version
=
s
.
getCurrentVersion
();
// now we see the newest version
m
=
tx
.
openMap
(
"test"
,
version
);
assertEquals
(
"Hello"
,
m
.
get
(
"1"
));
...
...
@@ -98,25 +98,25 @@ public class TestTransactionStore extends TestBase {
// already updated by this statement, so it has no effect
// but still returns true because it was changed by this transaction
assertTrue
(
m
.
trySet
(
"2"
,
null
,
true
));
assertTrue
(
m
.
trySet
(
"3"
,
"World"
,
true
));
// not seen within this statement
assertEquals
(
"Hello"
,
m
.
get
(
"1"
));
assertEquals
(
"World"
,
m
.
get
(
"2"
));
assertNull
(
m
.
get
(
"3"
));
// start of statement
startUpdate
=
tx
.
setSavepoint
();
version
=
s
.
getCurrentVersion
();
version
=
s
.
getCurrentVersion
();
m
=
tx
.
openMap
(
"test"
,
version
);
// select * from test
assertNull
(
m
.
get
(
"1"
));
assertEquals
(
"Hello"
,
m
.
get
(
"2"
));
assertEquals
(
"World"
,
m
.
get
(
"3"
));
// start of statement
startUpdate
=
tx
.
setSavepoint
();
version
=
s
.
getCurrentVersion
();
version
=
s
.
getCurrentVersion
();
m
=
tx
.
openMap
(
"test"
,
version
);
// update test set id = 1
// should fail: duplicate key
...
...
@@ -125,30 +125,30 @@ public class TestTransactionStore extends TestBase {
assertTrue
(
m
.
trySet
(
"3"
,
null
,
true
));
assertFalse
(
m
.
trySet
(
"1"
,
"World"
,
true
));
tx
.
rollbackToSavepoint
(
startUpdate
);
version
=
s
.
getCurrentVersion
();
version
=
s
.
getCurrentVersion
();
m
=
tx
.
openMap
(
"test"
,
version
);
assertNull
(
m
.
get
(
"1"
));
assertEquals
(
"Hello"
,
m
.
get
(
"2"
));
assertEquals
(
"World"
,
m
.
get
(
"3"
));
tx
.
commit
();
ts
.
close
();
s
.
close
();
}
}
private
void
testTwoPhaseCommit
()
throws
Exception
{
String
fileName
=
getBaseDir
()
+
"/testTwoPhaseCommit.h3"
;
FileUtils
.
delete
(
fileName
);
MVStore
s
;
TransactionStore
ts
;
Transaction
tx
;
Transaction
txOld
;
TransactionMap
<
String
,
String
>
m
;
List
<
Transaction
>
list
;
s
=
MVStore
.
open
(
fileName
);
ts
=
new
TransactionStore
(
s
);
tx
=
ts
.
begin
();
...
...
@@ -166,7 +166,7 @@ public class TestTransactionStore extends TestBase {
s
.
commit
();
ts
.
close
();
s
.
close
();
s
=
MVStore
.
open
(
fileName
);
ts
=
new
TransactionStore
(
s
);
tx
=
ts
.
begin
();
...
...
@@ -188,7 +188,7 @@ public class TestTransactionStore extends TestBase {
txOld
.
rollback
();
s
.
commit
();
s
.
close
();
s
=
MVStore
.
open
(
fileName
);
ts
=
new
TransactionStore
(
s
);
tx
=
ts
.
begin
();
...
...
h2/src/test/org/h2/test/unit/TestCompress.java
浏览文件 @
8825c9ce
差异被折叠。
点击展开。
h2/src/test/org/h2/test/unit/TestTools.java
浏览文件 @
8825c9ce
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论