Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
a0e2fc46
提交
a0e2fc46
authored
10月 17, 2014
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Formatting, documentation
上级
68a0ed13
隐藏空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
90 行增加
和
36 行删除
+90
-36
changelog.html
h2/src/docsrc/html/changelog.html
+3
-1
DbSchema.java
h2/src/main/org/h2/bnf/context/DbSchema.java
+4
-17
Database.java
h2/src/main/org/h2/engine/Database.java
+5
-1
DbSettings.java
h2/src/main/org/h2/engine/DbSettings.java
+4
-3
Session.java
h2/src/main/org/h2/engine/Session.java
+5
-7
SysProperties.java
h2/src/main/org/h2/engine/SysProperties.java
+24
-0
help.csv
h2/src/main/org/h2/res/help.csv
+1
-1
WebApp.java
h2/src/main/org/h2/server/web/WebApp.java
+1
-1
Transfer.java
h2/src/main/org/h2/value/Transfer.java
+1
-1
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+1
-1
TestConcurrent.java
h2/src/test/org/h2/test/store/TestConcurrent.java
+1
-1
testScript.sql
h2/src/test/org/h2/test/testScript.sql
+37
-0
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+1
-1
ArchiveTool.java
h2/src/tools/org/h2/dev/fs/ArchiveTool.java
+2
-1
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
a0e2fc46
...
@@ -17,7 +17,9 @@ Change Log
...
@@ -17,7 +17,9 @@ Change Log
<h1>
Change Log
</h1>
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
OSGi: the MVStore packages are now exported.
<ul><li>
MVStore: improved error messages and logging;
improved behavior if there is an error when serializing objects.
</li><li>
OSGi: the MVStore packages are now exported.
</li><li>
With the MVStore option, when using multiple threads
</li><li>
With the MVStore option, when using multiple threads
that concurrently create indexes or tables,
that concurrently create indexes or tables,
it was relatively easy to get a lock timeout on the "SYS" table.
it was relatively easy to get a lock timeout on the "SYS" table.
...
...
h2/src/main/org/h2/bnf/context/DbSchema.java
浏览文件 @
a0e2fc46
...
@@ -9,6 +9,8 @@ import java.sql.DatabaseMetaData;
...
@@ -9,6 +9,8 @@ import java.sql.DatabaseMetaData;
import
java.sql.ResultSet
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
org.h2.engine.SysProperties
;
import
org.h2.util.New
;
import
org.h2.util.New
;
import
org.h2.util.StringUtils
;
import
org.h2.util.StringUtils
;
...
@@ -18,21 +20,6 @@ import org.h2.util.StringUtils;
...
@@ -18,21 +20,6 @@ import org.h2.util.StringUtils;
*/
*/
public
class
DbSchema
{
public
class
DbSchema
{
/**
* Up to this many tables, the column type and indexes are listed.
*/
public
static
final
int
MAX_TABLES_LIST_INDEXES
=
100
;
/**
* Up to this many tables, the column names are listed.
*/
public
static
final
int
MAX_TABLES_LIST_COLUMNS
=
500
;
/**
* Up to this many tables, the column names are listed.
*/
public
static
final
int
MAX_PROCEDURES_LIST_COLUMNS
=
500
;
/**
/**
* The schema name.
* The schema name.
*/
*/
...
@@ -132,7 +119,7 @@ public class DbSchema {
...
@@ -132,7 +119,7 @@ public class DbSchema {
rs
.
close
();
rs
.
close
();
tables
=
new
DbTableOrView
[
list
.
size
()];
tables
=
new
DbTableOrView
[
list
.
size
()];
list
.
toArray
(
tables
);
list
.
toArray
(
tables
);
if
(
tables
.
length
<
MAX_TABLES_LIST_COLUMNS
)
{
if
(
tables
.
length
<
SysProperties
.
CONSOLE_
MAX_TABLES_LIST_COLUMNS
)
{
for
(
DbTableOrView
tab
:
tables
)
{
for
(
DbTableOrView
tab
:
tables
)
{
try
{
try
{
tab
.
readColumns
(
meta
);
tab
.
readColumns
(
meta
);
...
@@ -161,7 +148,7 @@ public class DbSchema {
...
@@ -161,7 +148,7 @@ public class DbSchema {
rs
.
close
();
rs
.
close
();
procedures
=
new
DbProcedure
[
list
.
size
()];
procedures
=
new
DbProcedure
[
list
.
size
()];
list
.
toArray
(
procedures
);
list
.
toArray
(
procedures
);
if
(
procedures
.
length
<
MAX_PROCEDURES_LIST_COLUMNS
)
{
if
(
procedures
.
length
<
SysProperties
.
CONSOLE_
MAX_PROCEDURES_LIST_COLUMNS
)
{
for
(
DbProcedure
procedure
:
procedures
)
{
for
(
DbProcedure
procedure
:
procedures
)
{
procedure
.
readParameters
(
meta
);
procedure
.
readParameters
(
meta
);
}
}
...
...
h2/src/main/org/h2/engine/Database.java
浏览文件 @
a0e2fc46
...
@@ -876,7 +876,11 @@ public class Database implements DataHandler {
...
@@ -876,7 +876,11 @@ public class Database implements DataHandler {
* @param session the session
* @param session the session
* @return whether it was already locked before by this session
* @return whether it was already locked before by this session
*/
*/
public
synchronized
boolean
lockMeta
(
Session
session
)
{
public
boolean
lockMeta
(
Session
session
)
{
// this method can not be synchronized on the database object,
// as unlocking is also synchronized on the database object -
// so if locking starts just before unlocking, locking could
// never be successful
if
(
meta
==
null
)
{
if
(
meta
==
null
)
{
return
true
;
return
true
;
}
}
...
...
h2/src/main/org/h2/engine/DbSettings.java
浏览文件 @
a0e2fc46
...
@@ -89,8 +89,9 @@ public class DbSettings extends SettingsBase {
...
@@ -89,8 +89,9 @@ public class DbSettings extends SettingsBase {
/**
/**
* Database setting <code>DEFRAG_ALWAYS</code> (default: false).<br />
* Database setting <code>DEFRAG_ALWAYS</code> (default: false).<br />
* Each time the database is closed, it is fully defragmented (SHUTDOWN
* Each time the database is closed normally, it is fully defragmented (the
* DEFRAG).
* same as SHUTDOWN DEFRAG). If you execute SHUTDOWN COMPACT, then this
* setting is ignored.
*/
*/
public
final
boolean
defragAlways
=
get
(
"DEFRAG_ALWAYS"
,
false
);
public
final
boolean
defragAlways
=
get
(
"DEFRAG_ALWAYS"
,
false
);
...
@@ -314,7 +315,7 @@ public class DbSettings extends SettingsBase {
...
@@ -314,7 +315,7 @@ public class DbSettings extends SettingsBase {
/**
/**
* Database setting <code>MV_STORE</code>
* Database setting <code>MV_STORE</code>
* (default: false).<br />
* (default: false
for version 1.3, true for version 1.4
).<br />
* Use the MVStore storage engine.
* Use the MVStore storage engine.
*/
*/
public
boolean
mvStore
=
get
(
"MV_STORE"
,
Constants
.
VERSION_MINOR
>=
4
);
public
boolean
mvStore
=
get
(
"MV_STORE"
,
Constants
.
VERSION_MINOR
>=
4
);
...
...
h2/src/main/org/h2/engine/Session.java
浏览文件 @
a0e2fc46
...
@@ -774,14 +774,12 @@ public class Session extends SessionWithState {
...
@@ -774,14 +774,12 @@ public class Session extends SessionWithState {
}
}
}
}
if
(
locks
.
size
()
>
0
)
{
if
(
locks
.
size
()
>
0
)
{
synchronized
(
database
)
{
// don't use the enhanced for loop to save memory
// don't use the enhanced for loop to save memory
for
(
int
i
=
0
,
size
=
locks
.
size
();
i
<
size
;
i
++)
{
for
(
int
i
=
0
,
size
=
locks
.
size
();
i
<
size
;
i
++)
{
Table
t
=
locks
.
get
(
i
);
Table
t
=
locks
.
get
(
i
);
t
.
unlock
(
this
);
t
.
unlock
(
this
);
}
locks
.
clear
();
}
}
locks
.
clear
();
}
}
savepoints
=
null
;
savepoints
=
null
;
sessionStateChanged
=
true
;
sessionStateChanged
=
true
;
...
...
h2/src/main/org/h2/engine/SysProperties.java
浏览文件 @
a0e2fc46
...
@@ -150,6 +150,30 @@ public class SysProperties {
...
@@ -150,6 +150,30 @@ public class SysProperties {
public
static
final
int
COLLATOR_CACHE_SIZE
=
public
static
final
int
COLLATOR_CACHE_SIZE
=
Utils
.
getProperty
(
"h2.collatorCacheSize"
,
32000
);
Utils
.
getProperty
(
"h2.collatorCacheSize"
,
32000
);
/**
* System property <code>h2.consoleTableIndexes</code>
* (default: 100).<br />
* Up to this many tables, the column type and indexes are listed.
*/
public
static
final
int
CONSOLE_MAX_TABLES_LIST_INDEXES
=
Utils
.
getProperty
(
"h2.consoleTableIndexes"
,
100
);
/**
* System property <code>h2.consoleTableColumns</code>
* (default: 500).<br />
* Up to this many tables, the column names are listed.
*/
public
static
final
int
CONSOLE_MAX_TABLES_LIST_COLUMNS
=
Utils
.
getProperty
(
"h2.consoleTableColumns"
,
300
);
/**
* System property <code>h2.consoleProcedureColumns</code>
* (default: 500).<br />
* Up to this many procedures, the column names are listed.
*/
public
static
final
int
CONSOLE_MAX_PROCEDURES_LIST_COLUMNS
=
Utils
.
getProperty
(
"h2.consoleProcedureColumns"
,
300
);
/**
/**
* System property <code>h2.consoleStream</code> (default: true).<br />
* System property <code>h2.consoleStream</code> (default: true).<br />
* H2 Console: stream query results.
* H2 Console: stream query results.
...
...
h2/src/main/org/h2/res/help.csv
浏览文件 @
a0e2fc46
...
@@ -374,7 +374,7 @@ Sets the collation used for comparing strings."
...
@@ -374,7 +374,7 @@ Sets the collation used for comparing strings."
"Commands (Other)","SET COMPRESS_LOB","
"Commands (Other)","SET COMPRESS_LOB","
SET COMPRESS_LOB { NO | LZF | DEFLATE }
SET COMPRESS_LOB { NO | LZF | DEFLATE }
","
","
Sets the compression algorithm for BLOB and CLOB data
."
This feature is only available for the PageStore storage engine
."
"Commands (Other)","SET DATABASE_EVENT_LISTENER","
"Commands (Other)","SET DATABASE_EVENT_LISTENER","
SET DATABASE_EVENT_LISTENER classNameString
SET DATABASE_EVENT_LISTENER classNameString
","
","
...
...
h2/src/main/org/h2/server/web/WebApp.java
浏览文件 @
a0e2fc46
...
@@ -613,7 +613,7 @@ public class WebApp {
...
@@ -613,7 +613,7 @@ public class WebApp {
return
treeIndex
;
return
treeIndex
;
}
}
boolean
isOracle
=
schema
.
getContents
().
isOracle
();
boolean
isOracle
=
schema
.
getContents
().
isOracle
();
boolean
notManyTables
=
tables
.
length
<
DbSchema
.
MAX_TABLES_LIST_INDEXES
;
boolean
notManyTables
=
tables
.
length
<
SysProperties
.
CONSOLE_
MAX_TABLES_LIST_INDEXES
;
for
(
DbTableOrView
table
:
tables
)
{
for
(
DbTableOrView
table
:
tables
)
{
if
(
table
.
isView
())
{
if
(
table
.
isView
())
{
continue
;
continue
;
...
...
h2/src/main/org/h2/value/Transfer.java
浏览文件 @
a0e2fc46
...
@@ -761,7 +761,7 @@ public class Transfer {
...
@@ -761,7 +761,7 @@ public class Transfer {
public
void
verifyLobMac
(
byte
[]
hmac
,
long
lobId
)
{
public
void
verifyLobMac
(
byte
[]
hmac
,
long
lobId
)
{
byte
[]
result
=
calculateLobMac
(
lobId
);
byte
[]
result
=
calculateLobMac
(
lobId
);
if
(!
Utils
.
compareSecure
(
hmac
,
result
))
{
if
(!
Utils
.
compareSecure
(
hmac
,
result
))
{
throw
DbException
.
get
(
ErrorCode
.
CONNECTION_BROKEN_1
,
throw
DbException
.
get
(
ErrorCode
.
CONNECTION_BROKEN_1
,
"Invalid lob hmac; possibly the connection was re-opened internally"
);
"Invalid lob hmac; possibly the connection was re-opened internally"
);
}
}
}
}
...
...
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
a0e2fc46
...
@@ -793,7 +793,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
...
@@ -793,7 +793,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
new
TestPgServer
().
runTest
(
this
);
new
TestPgServer
().
runTest
(
this
);
new
TestReader
().
runTest
(
this
);
new
TestReader
().
runTest
(
this
);
new
TestRecovery
().
runTest
(
this
);
new
TestRecovery
().
runTest
(
this
);
new
Test
SampleApps
().
runTest
(
this
);
new
Test
Web
().
runTest
(
this
);
new
TestScriptReader
().
runTest
(
this
);
new
TestScriptReader
().
runTest
(
this
);
runTest
(
"org.h2.test.unit.TestServlet"
);
runTest
(
"org.h2.test.unit.TestServlet"
);
new
TestSecurity
().
runTest
(
this
);
new
TestSecurity
().
runTest
(
this
);
...
...
h2/src/test/org/h2/test/store/TestConcurrent.java
浏览文件 @
a0e2fc46
...
@@ -60,7 +60,7 @@ public class TestConcurrent extends TestMVStore {
...
@@ -60,7 +60,7 @@ public class TestConcurrent extends TestMVStore {
testConcurrentWrite
();
testConcurrentWrite
();
testConcurrentRead
();
testConcurrentRead
();
}
}
private
void
testConcurrentAutoCommitAndChange
()
throws
InterruptedException
{
private
void
testConcurrentAutoCommitAndChange
()
throws
InterruptedException
{
String
fileName
=
"memFS:testConcurrentChangeAndBackgroundCompact"
;
String
fileName
=
"memFS:testConcurrentChangeAndBackgroundCompact"
;
FileUtils
.
delete
(
fileName
);
FileUtils
.
delete
(
fileName
);
...
...
h2/src/test/org/h2/test/testScript.sql
浏览文件 @
a0e2fc46
...
@@ -3,6 +3,43 @@
...
@@ -3,6 +3,43 @@
-- Initial Developer: H2 Group
-- Initial Developer: H2 Group
--
--
--- special grammar and test cases ---------------------------------------------------------------------------------------------
--- special grammar and test cases ---------------------------------------------------------------------------------------------
create
table
results
(
eventId
int
,
points
int
,
studentId
int
);
>
ok
insert
into
results
values
(
1
,
10
,
1
),
(
2
,
20
,
1
),
(
3
,
5
,
1
);
>
update
count
:
3
insert
into
results
values
(
1
,
10
,
2
),
(
2
,
20
,
2
),
(
3
,
5
,
2
);
>
update
count
:
3
insert
into
results
values
(
1
,
10
,
3
),
(
2
,
20
,
3
),
(
3
,
5
,
3
);
>
update
count
:
3
SELECT
SUM
(
points
)
FROM
RESULTS
WHERE
eventID
IN
(
SELECT
eventID
FROM
RESULTS
WHERE
studentID
=
2
ORDER
BY
points
DESC
LIMIT
2
)
AND
studentID
=
2
;
SELECT
eventID
FROM
RESULTS
WHERE
studentID
=
2
ORDER
BY
points
DESC
LIMIT
2
;
SELECT
SUM
(
r
.
points
)
FROM
RESULTS
r
,
(
SELECT
eventID
FROM
RESULTS
WHERE
studentID
=
2
ORDER
BY
points
DESC
LIMIT
2
)
r2
WHERE
r2
.
eventID
=
r
.
eventId
AND
studentID
=
2
;
drop
table
results
;
>
ok
create
table
test
(
a
int
,
b
int
);
create
table
test
(
a
int
,
b
int
);
>
ok
>
ok
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
a0e2fc46
...
@@ -764,4 +764,4 @@ operate resized jni yjp ownable starvation reaper biased introduce epoll hangs
...
@@ -764,4 +764,4 @@ operate resized jni yjp ownable starvation reaper biased introduce epoll hangs
compaction aggressive powerful traversing pietrzak michi karl rewriting consequences
compaction aggressive powerful traversing pietrzak michi karl rewriting consequences
linearly patching perfect hole sip enwiki flooding uniformly recursions happening
linearly patching perfect hole sip enwiki flooding uniformly recursions happening
permanently thrusted nucleus forbidden
h2/src/tools/org/h2/dev/fs/ArchiveTool.java
浏览文件 @
a0e2fc46
...
@@ -374,7 +374,8 @@ public class ArchiveTool {
...
@@ -374,7 +374,8 @@ public class ArchiveTool {
new
File
(
name
).
createNewFile
();
new
File
(
name
).
createNewFile
();
remaining
=
4
;
remaining
=
4
;
}
else
{
}
else
{
fileOut
=
new
BufferedOutputStream
(
new
FileOutputStream
(
name
),
1024
*
1024
);
fileOut
=
new
BufferedOutputStream
(
new
FileOutputStream
(
name
),
1024
*
1024
);
}
}
}
else
{
}
else
{
file
.
mkdirs
();
file
.
mkdirs
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论