Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
faa9789d
提交
faa9789d
authored
6月 17, 2018
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix typos and update dictionary.txt
上级
5d27f38d
显示空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
34 行增加
和
29 行删除
+34
-29
changelog.html
h2/src/docsrc/html/changelog.html
+1
-1
Command.java
h2/src/main/org/h2/command/Command.java
+1
-1
MVStore.java
h2/src/main/org/h2/mvstore/MVStore.java
+1
-1
MVTable.java
h2/src/main/org/h2/mvstore/db/MVTable.java
+7
-7
CommitDecisionMaker.java
h2/src/main/org/h2/mvstore/tx/CommitDecisionMaker.java
+1
-1
RollbackDecisionMaker.java
h2/src/main/org/h2/mvstore/tx/RollbackDecisionMaker.java
+2
-2
TransactionMap.java
h2/src/main/org/h2/mvstore/tx/TransactionMap.java
+1
-1
TransactionStore.java
h2/src/main/org/h2/mvstore/tx/TransactionStore.java
+6
-6
TxDecisionMaker.java
h2/src/main/org/h2/mvstore/tx/TxDecisionMaker.java
+1
-1
DefaultAuthenticator.java
h2/src/main/org/h2/security/auth/DefaultAuthenticator.java
+1
-1
LdapCredentialsValidator.java
...n/org/h2/security/auth/impl/LdapCredentialsValidator.java
+1
-1
TestAuthentication.java
h2/src/test/org/h2/test/auth/TestAuthentication.java
+4
-4
TestTransactionStore.java
h2/src/test/org/h2/test/store/TestTransactionStore.java
+1
-1
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+6
-1
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
faa9789d
...
@@ -33,7 +33,7 @@ Change Log
...
@@ -33,7 +33,7 @@ Change Log
</li>
</li>
<li>
PR #1176: Magic value replacement with constant
<li>
PR #1176: Magic value replacement with constant
</li>
</li>
<li>
PR #1171: Introduce last commited value into a VersionedValue
<li>
PR #1171: Introduce last commit
t
ed value into a VersionedValue
</li>
</li>
<li>
PR #1175: tighten test conditions - do not ignore any exceptions
<li>
PR #1175: tighten test conditions - do not ignore any exceptions
</li>
</li>
...
...
h2/src/main/org/h2/command/Command.java
浏览文件 @
faa9789d
...
@@ -321,7 +321,7 @@ public abstract class Command implements CommandInterface {
...
@@ -321,7 +321,7 @@ public abstract class Command implements CommandInterface {
if
(
start
!=
0
&&
TimeUnit
.
NANOSECONDS
.
toMillis
(
now
-
start
)
>
session
.
getLockTimeout
())
{
if
(
start
!=
0
&&
TimeUnit
.
NANOSECONDS
.
toMillis
(
now
-
start
)
>
session
.
getLockTimeout
())
{
throw
DbException
.
get
(
ErrorCode
.
LOCK_TIMEOUT_1
,
e
);
throw
DbException
.
get
(
ErrorCode
.
LOCK_TIMEOUT_1
,
e
);
}
}
// Only in PageStore mode we need to sleep here to avoid bu
z
y wait loop
// Only in PageStore mode we need to sleep here to avoid bu
s
y wait loop
Database
database
=
session
.
getDatabase
();
Database
database
=
session
.
getDatabase
();
if
(
database
.
getMvStore
()
==
null
)
{
if
(
database
.
getMvStore
()
==
null
)
{
int
sleep
=
1
+
MathUtils
.
randomInt
(
10
);
int
sleep
=
1
+
MathUtils
.
randomInt
(
10
);
...
...
h2/src/main/org/h2/mvstore/MVStore.java
浏览文件 @
faa9789d
...
@@ -2568,7 +2568,7 @@ public class MVStore {
...
@@ -2568,7 +2568,7 @@ public class MVStore {
String
oldName
=
getMapName
(
id
);
String
oldName
=
getMapName
(
id
);
if
(
oldName
!=
null
&&
!
oldName
.
equals
(
newName
))
{
if
(
oldName
!=
null
&&
!
oldName
.
equals
(
newName
))
{
String
idHexStr
=
Integer
.
toHexString
(
id
);
String
idHexStr
=
Integer
.
toHexString
(
id
);
// we need to cope w
h
ith the case of previously unfinished rename
// we need to cope with the case of previously unfinished rename
String
existingIdHexStr
=
meta
.
get
(
"name."
+
newName
);
String
existingIdHexStr
=
meta
.
get
(
"name."
+
newName
);
DataUtils
.
checkArgument
(
DataUtils
.
checkArgument
(
existingIdHexStr
==
null
||
existingIdHexStr
.
equals
(
idHexStr
),
existingIdHexStr
==
null
||
existingIdHexStr
.
equals
(
idHexStr
),
...
...
h2/src/main/org/h2/mvstore/db/MVTable.java
浏览文件 @
faa9789d
...
@@ -119,7 +119,7 @@ public class MVTable extends TableBase {
...
@@ -119,7 +119,7 @@ public class MVTable extends TableBase {
*/
*/
private
final
ArrayDeque
<
Session
>
waitingSessions
=
new
ArrayDeque
<>();
private
final
ArrayDeque
<
Session
>
waitingSessions
=
new
ArrayDeque
<>();
private
final
Trace
traceLock
;
private
final
Trace
traceLock
;
private
final
AtomicInteger
changesUn
it
lAnalyze
;
private
final
AtomicInteger
changesUn
ti
lAnalyze
;
private
int
nextAnalyze
;
private
int
nextAnalyze
;
private
final
boolean
containsLargeObject
;
private
final
boolean
containsLargeObject
;
private
Column
rowIdColumn
;
private
Column
rowIdColumn
;
...
@@ -130,7 +130,7 @@ public class MVTable extends TableBase {
...
@@ -130,7 +130,7 @@ public class MVTable extends TableBase {
public
MVTable
(
CreateTableData
data
,
MVTableEngine
.
Store
store
)
{
public
MVTable
(
CreateTableData
data
,
MVTableEngine
.
Store
store
)
{
super
(
data
);
super
(
data
);
nextAnalyze
=
database
.
getSettings
().
analyzeAuto
;
nextAnalyze
=
database
.
getSettings
().
analyzeAuto
;
changesUn
it
lAnalyze
=
nextAnalyze
<=
0
?
null
:
new
AtomicInteger
(
nextAnalyze
);
changesUn
ti
lAnalyze
=
nextAnalyze
<=
0
?
null
:
new
AtomicInteger
(
nextAnalyze
);
this
.
store
=
store
;
this
.
store
=
store
;
this
.
transactionStore
=
store
.
getTransactionStore
();
this
.
transactionStore
=
store
.
getTransactionStore
();
this
.
isHidden
=
data
.
isHidden
;
this
.
isHidden
=
data
.
isHidden
;
...
@@ -714,8 +714,8 @@ public class MVTable extends TableBase {
...
@@ -714,8 +714,8 @@ public class MVTable extends TableBase {
Index
index
=
indexes
.
get
(
i
);
Index
index
=
indexes
.
get
(
i
);
index
.
truncate
(
session
);
index
.
truncate
(
session
);
}
}
if
(
changesUn
it
lAnalyze
!=
null
)
{
if
(
changesUn
ti
lAnalyze
!=
null
)
{
changesUn
it
lAnalyze
.
set
(
nextAnalyze
);
changesUn
ti
lAnalyze
.
set
(
nextAnalyze
);
}
}
}
}
...
@@ -745,12 +745,12 @@ public class MVTable extends TableBase {
...
@@ -745,12 +745,12 @@ public class MVTable extends TableBase {
}
}
private
void
analyzeIfRequired
(
Session
session
)
{
private
void
analyzeIfRequired
(
Session
session
)
{
if
(
changesUn
it
lAnalyze
!=
null
)
{
if
(
changesUn
ti
lAnalyze
!=
null
)
{
if
(
changesUn
it
lAnalyze
.
decrementAndGet
()
==
0
)
{
if
(
changesUn
ti
lAnalyze
.
decrementAndGet
()
==
0
)
{
if
(
nextAnalyze
<=
Integer
.
MAX_VALUE
/
2
)
{
if
(
nextAnalyze
<=
Integer
.
MAX_VALUE
/
2
)
{
nextAnalyze
*=
2
;
nextAnalyze
*=
2
;
}
}
changesUn
it
lAnalyze
.
set
(
nextAnalyze
);
changesUn
ti
lAnalyze
.
set
(
nextAnalyze
);
session
.
markTableForAnalyze
(
this
);
session
.
markTableForAnalyze
(
this
);
}
}
}
}
...
...
h2/src/main/org/h2/mvstore/tx/CommitDecisionMaker.java
浏览文件 @
faa9789d
...
@@ -28,7 +28,7 @@ final class CommitDecisionMaker extends MVMap.DecisionMaker<VersionedValue> {
...
@@ -28,7 +28,7 @@ final class CommitDecisionMaker extends MVMap.DecisionMaker<VersionedValue> {
assert
decision
==
null
;
assert
decision
==
null
;
if
(
existingValue
==
null
||
if
(
existingValue
==
null
||
// map entry was treated as already committed, and then
// map entry was treated as already committed, and then
// it has been removed by another transaction (commit
ed and closed by now
)
// it has been removed by another transaction (commit
ted and closed by now
)
existingValue
.
getOperationId
()
!=
undoKey
)
{
existingValue
.
getOperationId
()
!=
undoKey
)
{
// this is not a final undo log entry for this key,
// this is not a final undo log entry for this key,
// or map entry was treated as already committed and then
// or map entry was treated as already committed and then
...
...
h2/src/main/org/h2/mvstore/tx/RollbackDecisionMaker.java
浏览文件 @
faa9789d
...
@@ -30,8 +30,8 @@ final class RollbackDecisionMaker extends MVMap.DecisionMaker<Object[]> {
...
@@ -30,8 +30,8 @@ final class RollbackDecisionMaker extends MVMap.DecisionMaker<Object[]> {
@Override
@Override
public
MVMap
.
Decision
decide
(
Object
[]
existingValue
,
Object
[]
providedValue
)
{
public
MVMap
.
Decision
decide
(
Object
[]
existingValue
,
Object
[]
providedValue
)
{
assert
decision
==
null
;
assert
decision
==
null
;
// normaly existingValue will always be there except of db initialization
// normal
l
y existingValue will always be there except of db initialization
// where some undo log enty was captured on disk but actual map entry was not
// where some undo log ent
r
y was captured on disk but actual map entry was not
if
(
existingValue
!=
null
)
{
if
(
existingValue
!=
null
)
{
VersionedValue
valueToRestore
=
(
VersionedValue
)
existingValue
[
2
];
VersionedValue
valueToRestore
=
(
VersionedValue
)
existingValue
[
2
];
long
operationId
;
long
operationId
;
...
...
h2/src/main/org/h2/mvstore/tx/TransactionMap.java
浏览文件 @
faa9789d
...
@@ -109,7 +109,7 @@ public class TransactionMap<K, V> {
...
@@ -109,7 +109,7 @@ public class TransactionMap<K, V> {
// Entries describing removals from the map by this transaction and all transactions,
// Entries describing removals from the map by this transaction and all transactions,
// which are committed but not closed yet,
// which are committed but not closed yet,
// and
a
ntries about additions to the map by other uncommitted transactions were counted,
// and
e
ntries about additions to the map by other uncommitted transactions were counted,
// but they should not contribute into total count.
// but they should not contribute into total count.
if
(
2
*
undoLogSize
>
size
)
{
if
(
2
*
undoLogSize
>
size
)
{
// the undo log is larger than half of the map - scan the entries of the map directly
// the undo log is larger than half of the map - scan the entries of the map directly
...
...
h2/src/main/org/h2/mvstore/tx/TransactionStore.java
浏览文件 @
faa9789d
...
@@ -89,7 +89,7 @@ public class TransactionStore {
...
@@ -89,7 +89,7 @@ public class TransactionStore {
private
final
AtomicReferenceArray
<
Transaction
>
transactions
=
private
final
AtomicReferenceArray
<
Transaction
>
transactions
=
new
AtomicReferenceArray
<>(
MAX_OPEN_TRANSACTIONS
+
1
);
new
AtomicReferenceArray
<>(
MAX_OPEN_TRANSACTIONS
+
1
);
private
static
final
String
UNDO_LOG_NAME_PEFIX
=
"undoLog"
;
private
static
final
String
UNDO_LOG_NAME_P
R
EFIX
=
"undoLog"
;
private
static
final
char
UNDO_LOG_COMMITTED
=
'-'
;
// must come before open in lexicographical order
private
static
final
char
UNDO_LOG_COMMITTED
=
'-'
;
// must come before open in lexicographical order
private
static
final
char
UNDO_LOG_OPEN
=
'.'
;
private
static
final
char
UNDO_LOG_OPEN
=
'.'
;
...
@@ -101,7 +101,7 @@ public class TransactionStore {
...
@@ -101,7 +101,7 @@ public class TransactionStore {
public
static
String
getUndoLogName
(
boolean
committed
,
int
transactionId
)
{
public
static
String
getUndoLogName
(
boolean
committed
,
int
transactionId
)
{
return
UNDO_LOG_NAME_PEFIX
+
return
UNDO_LOG_NAME_P
R
EFIX
+
(
committed
?
UNDO_LOG_COMMITTED
:
UNDO_LOG_OPEN
)
+
(
committed
?
UNDO_LOG_COMMITTED
:
UNDO_LOG_OPEN
)
+
(
transactionId
>
0
?
String
.
valueOf
(
transactionId
)
:
""
);
(
transactionId
>
0
?
String
.
valueOf
(
transactionId
)
:
""
);
}
}
...
@@ -120,7 +120,7 @@ public class TransactionStore {
...
@@ -120,7 +120,7 @@ public class TransactionStore {
*
*
* @param store the store
* @param store the store
* @param dataType the data type for map keys and values
* @param dataType the data type for map keys and values
* @param timeoutMillis lock aquisition timeout in milliseconds, 0 means no wait
* @param timeoutMillis lock a
c
quisition timeout in milliseconds, 0 means no wait
*/
*/
public
TransactionStore
(
MVStore
store
,
DataType
dataType
,
int
timeoutMillis
)
{
public
TransactionStore
(
MVStore
store
,
DataType
dataType
,
int
timeoutMillis
)
{
this
.
store
=
store
;
this
.
store
=
store
;
...
@@ -143,10 +143,10 @@ public class TransactionStore {
...
@@ -143,10 +143,10 @@ public class TransactionStore {
public
void
init
()
{
public
void
init
()
{
if
(!
init
)
{
if
(!
init
)
{
for
(
String
mapName
:
store
.
getMapNames
())
{
for
(
String
mapName
:
store
.
getMapNames
())
{
if
(
mapName
.
startsWith
(
UNDO_LOG_NAME_PEFIX
))
{
if
(
mapName
.
startsWith
(
UNDO_LOG_NAME_P
R
EFIX
))
{
boolean
committed
=
mapName
.
charAt
(
UNDO_LOG_NAME_PEFIX
.
length
())
==
UNDO_LOG_COMMITTED
;
boolean
committed
=
mapName
.
charAt
(
UNDO_LOG_NAME_P
R
EFIX
.
length
())
==
UNDO_LOG_COMMITTED
;
if
(
store
.
hasData
(
mapName
)
||
committed
)
{
if
(
store
.
hasData
(
mapName
)
||
committed
)
{
int
transactionId
=
Integer
.
parseInt
(
mapName
.
substring
(
UNDO_LOG_NAME_PEFIX
.
length
()
+
1
));
int
transactionId
=
Integer
.
parseInt
(
mapName
.
substring
(
UNDO_LOG_NAME_P
R
EFIX
.
length
()
+
1
));
VersionedBitSet
openTxBitSet
=
openTransactions
.
get
();
VersionedBitSet
openTxBitSet
=
openTransactions
.
get
();
if
(!
openTxBitSet
.
get
(
transactionId
))
{
if
(!
openTxBitSet
.
get
(
transactionId
))
{
Object
[]
data
=
preparedTransactions
.
get
(
transactionId
);
Object
[]
data
=
preparedTransactions
.
get
(
transactionId
);
...
...
h2/src/main/org/h2/mvstore/tx/TxDecisionMaker.java
浏览文件 @
faa9789d
...
@@ -49,7 +49,7 @@ public abstract class TxDecisionMaker extends MVMap.DecisionMaker<VersionedValue
...
@@ -49,7 +49,7 @@ public abstract class TxDecisionMaker extends MVMap.DecisionMaker<VersionedValue
logIt
(
existingValue
.
value
==
null
?
null
:
VersionedValue
.
getInstance
(
existingValue
.
value
));
logIt
(
existingValue
.
value
==
null
?
null
:
VersionedValue
.
getInstance
(
existingValue
.
value
));
decision
=
MVMap
.
Decision
.
PUT
;
decision
=
MVMap
.
Decision
.
PUT
;
}
else
if
(
fetchTransaction
(
blockingId
)
==
null
)
{
}
else
if
(
fetchTransaction
(
blockingId
)
==
null
)
{
// condition above means transaction has been committed/r
p
lled back and closed by now
// condition above means transaction has been committed/r
o
lled back and closed by now
decision
=
MVMap
.
Decision
.
REPEAT
;
decision
=
MVMap
.
Decision
.
REPEAT
;
}
else
{
}
else
{
// this entry comes from a different transaction, and this
// this entry comes from a different transaction, and this
...
...
h2/src/main/org/h2/security/auth/DefaultAuthenticator.java
浏览文件 @
faa9789d
...
@@ -163,7 +163,7 @@ public class DefaultAuthenticator implements Authenticator {
...
@@ -163,7 +163,7 @@ public class DefaultAuthenticator implements Authenticator {
}
}
/**
/**
* Initializes the authenticator
(it is called by AuthententicationManager)
* Initializes the authenticator
.
*
*
* this method is skipped if skipDefaultInitialization is set Order of
* this method is skipped if skipDefaultInitialization is set Order of
* initialization is
* initialization is
...
...
h2/src/main/org/h2/security/auth/impl/LdapCredentialsValidator.java
浏览文件 @
faa9789d
...
@@ -24,7 +24,7 @@ import org.h2.security.auth.ConfigProperties;
...
@@ -24,7 +24,7 @@ import org.h2.security.auth.ConfigProperties;
* <li>bindDnPattern bind dn pattern with %u instead of username
* <li>bindDnPattern bind dn pattern with %u instead of username
* (example: uid=%u,ou=users,dc=example,dc=com)</li>
* (example: uid=%u,ou=users,dc=example,dc=com)</li>
* <li>host ldap server</li>
* <li>host ldap server</li>
* <li>port of ldap service; optional, by default 389 for
u
nsecure, 636 for secure</li>
* <li>port of ldap service; optional, by default 389 for
i
nsecure, 636 for secure</li>
* <li>secure, optional by default is true (use SSL)</li>
* <li>secure, optional by default is true (use SSL)</li>
* </ul>
* </ul>
*/
*/
...
...
h2/src/test/org/h2/test/auth/TestAuthentication.java
浏览文件 @
faa9789d
...
@@ -126,7 +126,7 @@ public class TestAuthentication extends TestBase {
...
@@ -126,7 +126,7 @@ public class TestAuthentication extends TestBase {
protected
void
allTests
()
throws
Exception
{
protected
void
allTests
()
throws
Exception
{
testInvalidPassword
();
testInvalidPassword
();
testExternalUserWihoutRealm
();
testExternalUserWi
t
houtRealm
();
testExternalUser
();
testExternalUser
();
testAssignRealNameRole
();
testAssignRealNameRole
();
testStaticRole
();
testStaticRole
();
...
@@ -146,7 +146,7 @@ public class TestAuthentication extends TestBase {
...
@@ -146,7 +146,7 @@ public class TestAuthentication extends TestBase {
}
}
}
}
protected
void
testExternalUserWihoutRealm
()
throws
Exception
{
protected
void
testExternalUserWi
t
houtRealm
()
throws
Exception
{
try
{
try
{
Connection
wrongLoginConnection
=
DriverManager
.
getConnection
(
getDatabaseURL
(),
getExternalUser
(),
Connection
wrongLoginConnection
=
DriverManager
.
getConnection
(
getDatabaseURL
(),
getExternalUser
(),
getExternalUserPassword
());
getExternalUserPassword
());
...
@@ -265,8 +265,8 @@ public class TestAuthentication extends TestBase {
...
@@ -265,8 +265,8 @@ public class TestAuthentication extends TestBase {
try
{
try
{
try
{
try
{
testExternalUser
();
testExternalUser
();
throw
new
Exception
(
"External user shouldnt be allowed"
);
throw
new
Exception
(
"External user shouldn
'
t be allowed"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
}
}
}
finally
{
}
finally
{
configureAuthentication
(
database
);
configureAuthentication
(
database
);
...
...
h2/src/test/org/h2/test/store/TestTransactionStore.java
浏览文件 @
faa9789d
...
@@ -404,7 +404,7 @@ public class TestTransactionStore extends TestBase {
...
@@ -404,7 +404,7 @@ public class TestTransactionStore extends TestBase {
}
}
}
}
// re-open TransactionStore, because we rolled back
// re-open TransactionStore, because we rolled back
// underlying MVStore without rolling back TranactionStore
// underlying MVStore without rolling back Tran
s
actionStore
s
.
close
();
s
.
close
();
s
=
MVStore
.
open
(
fileName
);
s
=
MVStore
.
open
(
fileName
);
ts
=
new
TransactionStore
(
s
);
ts
=
new
TransactionStore
(
s
);
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
faa9789d
...
@@ -777,4 +777,9 @@ geometries sourceschema destschema generatedcolumn alphanumerically usages
...
@@ -777,4 +777,9 @@ geometries sourceschema destschema generatedcolumn alphanumerically usages
sizable instantiates renders sdt txcommit unhelpful optimiser treats rejects referring untrusted computes vacate inverted
sizable instantiates renders sdt txcommit unhelpful optimiser treats rejects referring untrusted computes vacate inverted
reordered colliding evgenij archaic invocations apostrophe hypothetically testref ryazanov useless completes highlighting tends degrade
reordered colliding evgenij archaic invocations apostrophe hypothetically testref ryazanov useless completes highlighting tends degrade
summands minuend subtrahend
summands minuend subtrahend localtime localtimestamp governs unfinished pressure closure discovered victim seemingly
flaw capture coherent removals silence opentransactions picture tokar mailto andrei dur discarded blocker captures txdm
intentionally authenticator authrealm ventura credentials alessandro validator acquisition vital mariadb preventing
ewkt ewkb informations authzpwd realms mappers jaxb realmname configurationfile unmarshal jaas externals customize
authenticators appname interrogate metatable barrier preliminary staticuser staticpassword unregistered inquiry
ldapexample remoteuser assignments djava validators mock relate mapid tighten
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论