Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
554a5c0f
提交
554a5c0f
authored
5月 15, 2009
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
22be687e
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
1994 行增加
和
1870 行删除
+1994
-1870
changelog.html
h2/src/docsrc/html/changelog.html
+6
-1
performance.html
h2/src/docsrc/html/performance.html
+15
-1
_docs_en.utf8.txt
h2/src/docsrc/text/_docs_en.utf8.txt
+647
-611
_docs_ja.utf8.txt
h2/src/docsrc/text/_docs_ja.utf8.txt
+648
-612
_docs_en.properties
h2/src/docsrc/textbase/_docs_en.properties
+627
-615
Set.java
h2/src/main/org/h2/command/dml/Set.java
+8
-10
Database.java
h2/src/main/org/h2/engine/Database.java
+3
-3
Function.java
h2/src/main/org/h2/expression/Function.java
+1
-1
LogFile.java
h2/src/main/org/h2/log/LogFile.java
+3
-3
LogSystem.java
h2/src/main/org/h2/log/LogSystem.java
+1
-1
DiskFile.java
h2/src/main/org/h2/store/DiskFile.java
+1
-1
TableData.java
h2/src/main/org/h2/table/TableData.java
+1
-1
CompareMode.java
h2/src/main/org/h2/value/CompareMode.java
+13
-5
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+12
-2
TestFuzzOptimizations.java
h2/src/test/org/h2/test/synth/TestFuzzOptimizations.java
+1
-0
testSimple.in.txt
h2/src/test/org/h2/test/testSimple.in.txt
+3
-0
TestPattern.java
h2/src/test/org/h2/test/unit/TestPattern.java
+1
-1
TestValueHashMap.java
h2/src/test/org/h2/test/unit/TestValueHashMap.java
+1
-1
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+2
-1
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
554a5c0f
...
...
@@ -18,7 +18,12 @@ Change Log
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
Calling execute() or prepareStatement() with null as the SQL statement
<ul><li>
Identifiers with a digit and then a dollar sign didn't work. Example: A1$B.
</li><li>
MS SQL Server compatibility: support for linked tables with
NVARCHAR, NCHAR, NCLOB, and LONGNVARCHAR.
</li><li>
Android: Workaround for a problem when using read-only databases in zip files
(skip seems to be implemented incorrectly on the Android system).
</li><li>
Calling execute() or prepareStatement() with null as the SQL statement
now throws an exception.
</li><li>
Benchmark: the number of executed statements was incorrect. The H2 database
was loaded at the beginning of the test to collect results, now it is loaded at the very end.
...
...
h2/src/docsrc/html/performance.html
浏览文件 @
554a5c0f
...
...
@@ -107,7 +107,7 @@ One query where HSQLDB is slow is a two-table join:
</p>
<pre>
SELECT COUNT(DISTINCT S_I_ID) FROM ORDER_LINE, STOCK
WHERE OL_W_ID=? AND OL_D_ID=? AND OL_O_ID
<
? AND OL_O_ID
>
=?
WHERE OL_W_ID=? AND OL_D_ID=? AND OL_O_ID
<
? AND OL_O_ID
>
=?
AND S_W_ID=? AND S_I_ID=OL_I_ID AND S_QUANTITY
<
?
</pre>
<p>
...
...
@@ -172,6 +172,20 @@ SQLite was not tested because the JDBC driver doesn't support transactions.
<h3>
About this Benchmark
</h3>
<h4>
How to Run
</h4>
<p>
This test was executed as follows:
</p>
<pre>
build benchmark
</pre>
<h4>
Separate Process per Database
</h4>
<p>
For each database, a new process is started, to ensure the previous test does not impact
the current test.
</p>
<h4>
Number of Connections
</h4>
<p>
This is mostly a single-connection benchmark.
...
...
h2/src/docsrc/text/_docs_en.utf8.txt
浏览文件 @
554a5c0f
差异被折叠。
点击展开。
h2/src/docsrc/text/_docs_ja.utf8.txt
浏览文件 @
554a5c0f
差异被折叠。
点击展开。
h2/src/docsrc/textbase/_docs_en.properties
浏览文件 @
554a5c0f
This source diff could not be displayed because it is too large. You can
view the blob
instead.
h2/src/main/org/h2/command/dml/Set.java
浏览文件 @
554a5c0f
...
...
@@ -12,7 +12,6 @@ import java.text.Collator;
import
org.h2.command.Prepared
;
import
org.h2.compress.Compressor
;
import
org.h2.constant.ErrorCode
;
import
org.h2.constant.SysProperties
;
import
org.h2.engine.Database
;
import
org.h2.engine.Mode
;
import
org.h2.engine.Session
;
...
...
@@ -99,21 +98,20 @@ public class Set extends Prepared {
StringBuffer
buff
=
new
StringBuffer
();
buff
.
append
(
stringValue
);
if
(
stringValue
.
equals
(
CompareMode
.
OFF
))
{
compareMode
=
new
CompareMode
(
null
,
null
,
0
);
compareMode
=
new
CompareMode
(
null
,
0
);
}
else
{
Collator
coll
=
CompareMode
.
getCollator
(
stringValue
);
compareMode
=
new
CompareMode
(
coll
,
stringValue
,
SysProperties
.
getCollatorCacheSize
());
int
strength
=
getIntValue
();
buff
.
append
(
" STRENGTH "
);
if
(
getIntValue
()
==
Collator
.
IDENTICAL
)
{
if
(
strength
==
Collator
.
IDENTICAL
)
{
buff
.
append
(
"IDENTICAL"
);
}
else
if
(
getIntValue
()
==
Collator
.
PRIMARY
)
{
}
else
if
(
strength
==
Collator
.
PRIMARY
)
{
buff
.
append
(
"PRIMARY"
);
}
else
if
(
getIntValue
()
==
Collator
.
SECONDARY
)
{
}
else
if
(
strength
==
Collator
.
SECONDARY
)
{
buff
.
append
(
"SECONDARY"
);
}
else
if
(
getIntValue
()
==
Collator
.
TERTIARY
)
{
}
else
if
(
strength
==
Collator
.
TERTIARY
)
{
buff
.
append
(
"TERTIARY"
);
}
co
ll
.
setStrength
(
getIntValue
()
);
co
mpareMode
=
new
CompareMode
(
stringValue
,
strength
);
}
addOrUpdateSetting
(
name
,
buff
.
toString
(),
0
);
database
.
setCompareMode
(
compareMode
);
...
...
@@ -341,7 +339,7 @@ public class Set extends Prepared {
private
void
addOrUpdateSetting
(
String
name
,
String
s
,
int
v
)
throws
SQLException
{
Database
database
=
session
.
getDatabase
();
if
(
database
.
get
ReadOnly
())
{
if
(
database
.
is
ReadOnly
())
{
return
;
}
Setting
setting
=
database
.
findSetting
(
name
);
...
...
h2/src/main/org/h2/engine/Database.java
浏览文件 @
554a5c0f
...
...
@@ -170,7 +170,7 @@ public class Database implements DataHandler {
private
boolean
reconnectChangePending
;
public
Database
(
String
name
,
ConnectionInfo
ci
,
String
cipher
)
throws
SQLException
{
this
.
compareMode
=
new
CompareMode
(
null
,
null
,
0
);
this
.
compareMode
=
new
CompareMode
(
null
,
0
);
this
.
persistent
=
ci
.
isPersistent
();
this
.
filePasswordHash
=
ci
.
getFilePasswordHash
();
this
.
databaseName
=
name
;
...
...
@@ -1768,7 +1768,7 @@ public class Database implements DataHandler {
}
}
public
boolean
get
ReadOnly
()
{
public
boolean
is
ReadOnly
()
{
return
readOnly
;
}
...
...
@@ -2046,7 +2046,7 @@ public class Database implements DataHandler {
}
}
public
boolean
get
IndexSummaryValid
()
{
public
boolean
is
IndexSummaryValid
()
{
return
indexSummaryValid
;
}
...
...
h2/src/main/org/h2/expression/Function.java
浏览文件 @
554a5c0f
...
...
@@ -691,7 +691,7 @@ public class Function extends Expression implements FunctionCall {
result
=
ValueBoolean
.
get
(
session
.
getAutoCommit
());
break
;
case
READONLY:
result
=
ValueBoolean
.
get
(
database
.
get
ReadOnly
());
result
=
ValueBoolean
.
get
(
database
.
is
ReadOnly
());
break
;
case
DATABASE_PATH:
{
String
path
=
database
.
getDatabasePath
();
...
...
h2/src/main/org/h2/log/LogFile.java
浏览文件 @
554a5c0f
...
...
@@ -85,7 +85,7 @@ public class LogFile {
unwritten
=
new
ObjectArray
();
try
{
readHeader
();
if
(!
log
.
getDatabase
().
get
ReadOnly
())
{
if
(!
log
.
getDatabase
().
is
ReadOnly
())
{
writeHeader
();
}
pos
=
getBlock
();
...
...
@@ -243,7 +243,7 @@ public class LogFile {
int
blocks
=
in
.
readInt
();
if
(
blocks
<
0
)
{
return
true
;
}
else
if
(
blocks
==
0
&&
!
database
.
get
ReadOnly
())
{
}
else
if
(
blocks
==
0
&&
!
database
.
is
ReadOnly
())
{
truncate
(
pos
);
return
false
;
}
...
...
@@ -359,7 +359,7 @@ public class LogFile {
* the file.
*/
void
redoAllGoEnd
()
throws
SQLException
{
boolean
readOnly
=
logSystem
.
getDatabase
().
get
ReadOnly
();
boolean
readOnly
=
logSystem
.
getDatabase
().
is
ReadOnly
();
long
length
=
file
.
length
();
if
(
length
<=
FileStore
.
HEADER_LENGTH
)
{
return
;
...
...
h2/src/main/org/h2/log/LogSystem.java
浏览文件 @
554a5c0f
...
...
@@ -602,7 +602,7 @@ public class LogSystem {
if
(
summary
!=
null
)
{
currentLog
.
addSummary
(
true
,
summary
);
}
if
(
database
.
getLogIndexChanges
()
||
database
.
get
IndexSummaryValid
())
{
if
(
database
.
getLogIndexChanges
()
||
database
.
is
IndexSummaryValid
())
{
file
=
database
.
getIndexFile
();
summary
=
file
.
getSummary
();
if
(
summary
!=
null
)
{
...
...
h2/src/main/org/h2/store/DiskFile.java
浏览文件 @
554a5c0f
...
...
@@ -480,7 +480,7 @@ public class DiskFile implements CacheWriter {
public
void
close
()
throws
SQLException
{
synchronized
(
database
)
{
SQLException
closeException
=
null
;
if
(!
database
.
get
ReadOnly
())
{
if
(!
database
.
is
ReadOnly
())
{
try
{
flush
();
}
catch
(
SQLException
e
)
{
...
...
h2/src/main/org/h2/table/TableData.java
浏览文件 @
554a5c0f
...
...
@@ -246,7 +246,7 @@ public class TableData extends Table implements RecordReader {
// need to update, because maybe the index is rebuilt at startup,
// and so the head pos may have changed, which needs to be stored now.
// addSchemaObject doesn't update the sys table at startup
if
(
index
.
getIndexType
().
getPersistent
()
&&
!
database
.
get
ReadOnly
()
if
(
index
.
getIndexType
().
getPersistent
()
&&
!
database
.
is
ReadOnly
()
&&
!
database
.
getLog
().
containsInDoubtTransactions
())
{
// can not save anything in the log file if it contains in-doubt transactions
database
.
update
(
session
,
index
);
...
...
h2/src/main/org/h2/value/CompareMode.java
浏览文件 @
554a5c0f
...
...
@@ -10,6 +10,7 @@ import java.text.CollationKey;
import
java.text.Collator
;
import
java.util.Locale
;
import
org.h2.constant.SysProperties
;
import
org.h2.util.SmallLRUCache
;
import
org.h2.util.StringUtils
;
...
...
@@ -35,13 +36,17 @@ public class CompareMode {
* The cache is used to speed up comparison when using a collator;
* CollationKey objects are cached.
*
* @param collator the collator or null
* @param name the collation name or null
* @param
cacheSize the number of entries in the CollationKey cache
* @param
strength the collation strength
*/
public
CompareMode
(
Collator
collator
,
String
name
,
int
cacheSize
)
{
this
.
collator
=
collator
;
if
(
collator
!=
null
&&
cacheSize
!=
0
)
{
public
CompareMode
(
String
name
,
int
strength
)
{
this
.
collator
=
CompareMode
.
getCollator
(
name
);
int
cacheSize
=
0
;
if
(
collator
!=
null
)
{
this
.
collator
.
setStrength
(
strength
);
cacheSize
=
SysProperties
.
getCollatorCacheSize
();
}
if
(
cacheSize
!=
0
)
{
collationKeys
=
new
SmallLRUCache
(
cacheSize
);
}
else
{
collationKeys
=
null
;
...
...
@@ -140,6 +145,9 @@ public class CompareMode {
* @return the collator
*/
public
static
Collator
getCollator
(
String
name
)
{
if
(
name
==
null
)
{
return
null
;
}
Collator
result
=
null
;
if
(
name
.
length
()
==
2
)
{
Locale
locale
=
new
Locale
(
name
.
toLowerCase
(),
""
);
...
...
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
554a5c0f
...
...
@@ -286,12 +286,22 @@ java org.h2.test.TestAll timer
System
.
setProperty
(
"h2.maxMemoryRowsDistinct"
,
"128"
);
System
.
setProperty
(
"h2.check2"
,
"true"
);
// 2009-05-15: 25 test fail with page store (first loop)
// System.setProperty("h2.pageStore", "true");
/*
what do other databases do when calling prepareStatement(null)
and execute(null)?
index grows:
runscript from '~/Desktop/merge.sql';
create table test(id int, name varchar, primary key(id, name));
@LOOP 10000 merge into test(id, name) values(?, 'test' || ?);
BaseIndex or TableData should have its own compareMode
(default is: Database.compareMode when created).
standard: COLLATE for each column (MySQL, SQL Server)
stored in the pageStore as well.
check syntax in other databases.
this mean changing the collation is allowed if there are tables.
test case for running out of disk space (using a special file system)
...
...
h2/src/test/org/h2/test/synth/TestFuzzOptimizations.java
浏览文件 @
554a5c0f
...
...
@@ -121,6 +121,7 @@ public class TestFuzzOptimizations extends TestBase {
group
+=
" ORDER BY 1, 2, 3"
;
List
a
=
db
.
query
(
x
+
"TEST"
+
group
);
List
b
=
db
.
query
(
x
+
"TEST_INDEXED"
+
group
);
assertEquals
(
a
.
toString
(),
b
.
toString
());
assertTrue
(
a
.
equals
(
b
));
}
db
.
execute
(
"DROP TABLE TEST_INDEXED"
);
...
...
h2/src/test/org/h2/test/testSimple.in.txt
浏览文件 @
554a5c0f
create table t1$2(id int);
drop table t1$2;
create table test(id int primary key) as select x from system_range(1, 200);
delete from test;
insert into test(id) values(1);
...
...
h2/src/test/org/h2/test/unit/TestPattern.java
浏览文件 @
554a5c0f
...
...
@@ -27,7 +27,7 @@ public class TestPattern extends TestBase {
}
public
void
test
()
throws
SQLException
{
CompareMode
mode
=
new
CompareMode
(
null
,
null
,
10
0
);
CompareMode
mode
=
new
CompareMode
(
null
,
0
);
CompareLike
comp
=
new
CompareLike
(
mode
,
null
,
null
,
null
,
false
);
test
(
comp
,
"B"
,
"%_"
);
test
(
comp
,
"A"
,
"A%"
);
...
...
h2/src/test/org/h2/test/unit/TestValueHashMap.java
浏览文件 @
554a5c0f
...
...
@@ -29,7 +29,7 @@ import org.h2.value.ValueInt;
*/
public
class
TestValueHashMap
extends
TestBase
implements
DataHandler
{
CompareMode
compareMode
=
new
CompareMode
(
null
,
null
,
0
);
CompareMode
compareMode
=
new
CompareMode
(
null
,
0
);
/**
* Run just this test.
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
554a5c0f
...
...
@@ -588,4 +588,5 @@ animate scaladoc models disadvantages vladykin sergi trims requesting
handing bonita placed euros embeds reliability singular unregister quotas
overall httpdocs tigris eclemma separates underscore yajsw she her truncating
relocating smtps smtp osde joist catching guesses delimiters shortlist sheet
rowspan cheat partitioning datepart
\ No newline at end of file
rowspan cheat partitioning datepart dreamsource toussi locates fred
longnvarchar collate localdb
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论