Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
108cd6a1
提交
108cd6a1
authored
10月 30, 2010
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prepare for version 1.3.x beta
上级
db3c045e
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
78 行增加
和
66 行删除
+78
-66
roadmap.html
h2/src/docsrc/html/roadmap.html
+15
-14
ScriptCommand.java
h2/src/main/org/h2/command/dml/ScriptCommand.java
+1
-1
DbSettings.java
h2/src/main/org/h2/constant/DbSettings.java
+20
-12
SysProperties.java
h2/src/main/org/h2/constant/SysProperties.java
+1
-1
Constants.java
h2/src/main/org/h2/engine/Constants.java
+1
-0
Database.java
h2/src/main/org/h2/engine/Database.java
+1
-1
FullTextLucene.java
h2/src/main/org/h2/fulltext/FullTextLucene.java
+32
-32
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+1
-1
Build.java
h2/src/tools/org/h2/build/Build.java
+6
-4
没有找到文件。
h2/src/docsrc/html/roadmap.html
浏览文件 @
108cd6a1
...
...
@@ -24,27 +24,28 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
<h2>
Version 1.3.x: Planned Changes
</h2>
<ul><li>
Enable h2.lobInDatabase (store CLOB and BLOB in the database file).
</li><li>
Set A
UTO_ANALYZE
to 2000 (automatic ANALYZE).
</li><li>
Enable
h2.functionsInSchema
(allow to store functions in a schema).
</li><li>
Enable
h2.selectForUpdateMvcc
(MVCC and SELECT FOR UPDATE).
</li><li>
Enable
h2.largeTransactions
(support for very large transactions).
</li><li>
Set A
NALYZE_AUTO
to 2000 (automatic ANALYZE).
</li><li>
Enable
FUNCTIONS_IN_SCHEMA
(allow to store functions in a schema).
</li><li>
Enable
SELECT_FOR_UPDATE_MVCC
(MVCC and SELECT FOR UPDATE).
</li><li>
Enable
LARGE_TRANSACTIONS
(support for very large transactions).
Change documentation for MAX_MEMORY_UNDO in help.csv, because
now changes to tables without a primary key can be buffered to disk.
Later, change MAX_MEMORY_UNDO to reflect number of bytes instead of record
(also remove Constants.UNDO_BLOCK_SIZE).
Later, change undo log file format (fillAligned no longer required; var int).
</li><li>
Enable
h2.nestedJoins
(nested joins and right outer joins).
</li><li>
Enable
h2.optimizeOr
(convert OR conditions to IN(..) if possible).
</li><li>
Disable
h2.databaseToUpper
(database short names are converted to uppercase).
</li><li>
Enable
h2.dropRestrict
(default action for DROP is RESTRICT).
</li><li>
Enable
NESTED_JOINS
(nested joins and right outer joins).
</li><li>
Enable
OPTIMIZE_OR
(convert OR conditions to IN(..) if possible).
</li><li>
Disable
DATABASE_TO_UPPER
(database short names are converted to uppercase).
</li><li>
Enable
DROP_RESTRICT
(default action for DROP is RESTRICT).
Change documentation.
</li><li>
Set MAX_MEMORY_ROWS_DISTINCT to a lower value.
</li><li>
Enable OPTIMIZE_INSERT_FROM_SELECT (speed up CREATE TABLE ... AS SELECT).
</li><li>
Possibly enable QUERY_CACHE_SIZE.
</li><li>
Disable DB_CLOSE_ON_EXIT (the shutdown hook) by default.
</li><li>
For RUNSCRIPT and SCRIPT (commands and tools), use UTF-8 by default
(ScriptCommand.charset).
</li><li>
Use Lucene 3 by default.
</li><li>
For RUNSCRIPT and SCRIPT (commands and tools), use UTF-8 by default.
</li><li>
Set h2.maxMemoryRowsDistinct to a lower value.
</li><li>
Enable h2.optimizeInsertFromSelect (speed up CREATE TABLE ... AS SELECT).
</li><li>
Possibly enable h2.queryCacheSize.
</li><li>
Possibly enable h2.databaseToUpper.
</li><li>
Disable the shutdown hook by default.
</li></ul>
<h2>
Priority 1
</h2>
...
...
h2/src/main/org/h2/command/dml/ScriptCommand.java
浏览文件 @
108cd6a1
...
...
@@ -62,7 +62,7 @@ import org.h2.value.ValueString;
*/
public
class
ScriptCommand
extends
ScriptBase
{
private
String
charset
=
SysProperties
.
FILE_ENCODING
;
private
String
charset
=
Constants
.
VERSION_MINOR
<
3
?
SysProperties
.
FILE_ENCODING
:
Constants
.
UTF8
;
private
boolean
passwords
;
private
boolean
data
;
private
boolean
settings
;
...
...
h2/src/main/org/h2/constant/DbSettings.java
浏览文件 @
108cd6a1
...
...
@@ -7,6 +7,7 @@
package
org
.
h2
.
constant
;
import
java.util.HashMap
;
import
org.h2.engine.Constants
;
import
org.h2.engine.SettingsBase
;
/**
...
...
@@ -47,7 +48,7 @@ public class DbSettings extends SettingsBase {
* starting the database. It is not run on local temporary tables, and
* tables that have a trigger on SELECT.
*/
public
final
int
analyzeAuto
=
get
(
"ANALYZE_AUTO"
,
0
);
public
final
int
analyzeAuto
=
get
(
"ANALYZE_AUTO"
,
Constants
.
VERSION_MINOR
>=
3
?
2000
:
0
);
/**
* Database setting <code>ANALYZE_SAMPLE</code> (default: 10000).<br />
...
...
@@ -56,13 +57,20 @@ public class DbSettings extends SettingsBase {
public
final
int
analyzeSample
=
get
(
"ANALYZE_SAMPLE"
,
10000
);
/**
* Database setting <code>
databaseToUpper
</code> (default: true).<br />
* Database setting <code>
DATABASE_TO_UPPER
</code> (default: true).<br />
* Database short names are converted to uppercase for the DATABASE()
* function, and in the CATALOG column of all database meta data methods.
* Setting this to "false" is experimental.
*/
// public final boolean databaseToUpper = get("DATABASE_TO_UPPER", Constants.VERSION_MINOR < 3);
public
final
boolean
databaseToUpper
=
get
(
"DATABASE_TO_UPPER"
,
true
);
/**
* Database setting <code>DB_CLOSE_ON_EXIT</code> (default: true).<br />
* Close the database when the virtual machine exits normally, using a shutdown hook.
*/
public
final
boolean
dbCloseOnExit
=
get
(
"DB_CLOSE_ON_EXIT"
,
Constants
.
VERSION_MINOR
<
3
);
/**
* Database setting <code>DEFAULT_ESCAPE</code> (default: \).<br />
* The default escape character for LIKE comparisons. To select no escape
...
...
@@ -83,7 +91,7 @@ public class DbSettings extends SettingsBase {
* with older versions of H2 the default action is currently CASCADE. This will
* change in a future version of H2.
*/
public
final
boolean
dropRestrict
=
get
(
"DROP_RESTRICT"
,
false
);
public
final
boolean
dropRestrict
=
get
(
"DROP_RESTRICT"
,
Constants
.
VERSION_MINOR
>=
3
);
/**
* Database setting <code>ESTIMATED_FUNCTION_TABLE_ROWS</code> (default:
...
...
@@ -100,7 +108,7 @@ public class DbSettings extends SettingsBase {
* will always include the schema name in the CREATE ALIAS statement.
* This is not backward compatible with H2 versions 1.2.134 and older.
*/
public
final
boolean
functionsInSchema
=
get
(
"FUNCTIONS_IN_SCHEMA"
,
false
);
public
final
boolean
functionsInSchema
=
get
(
"FUNCTIONS_IN_SCHEMA"
,
Constants
.
VERSION_MINOR
>=
3
);
/**
* Database setting <code>LARGE_RESULT_BUFFER_SIZE</code> (default: 4096).<br />
...
...
@@ -113,7 +121,7 @@ public class DbSettings extends SettingsBase {
* Database setting <code>LARGE_TRANSACTIONS</code> (default: false).<br />
* Support very large transactions
*/
public
final
boolean
largeTransactions
=
get
(
"LARGE_TRANSACTIONS"
,
false
);
public
final
boolean
largeTransactions
=
get
(
"LARGE_TRANSACTIONS"
,
Constants
.
VERSION_MINOR
>=
3
);
/**
* Database setting <code>MAX_COMPACT_COUNT</code>
...
...
@@ -135,7 +143,7 @@ public class DbSettings extends SettingsBase {
* more than this number of rows are in a result set, a temporary table is
* used.
*/
public
final
int
maxMemoryRowsDistinct
=
get
(
"MAX_MEMORY_ROWS_DISTINCT"
,
Integer
.
MAX_VALUE
);
public
final
int
maxMemoryRowsDistinct
=
get
(
"MAX_MEMORY_ROWS_DISTINCT"
,
Constants
.
VERSION_MINOR
>=
3
?
10000
:
Integer
.
MAX_VALUE
);
/**
* Database setting <code>MAX_QUERY_TIMEOUT</code> (default: 0).<br />
...
...
@@ -146,10 +154,10 @@ public class DbSettings extends SettingsBase {
public
int
maxQueryTimeout
=
get
(
"MAX_QUERY_TIMEOUT"
,
0
);
/**
* Database setting <code>
h2.nestedJoins
</code> (default: false).<br />
* Database setting <code>
NESTED_JOINS
</code> (default: false).<br />
* Whether nested joins should be supported.
*/
public
final
boolean
nestedJoins
=
get
(
"NESTED_JOINS"
,
false
);
public
final
boolean
nestedJoins
=
get
(
"NESTED_JOINS"
,
Constants
.
VERSION_MINOR
>=
3
);
/**
* Database setting <code>OPTIMIZE_DISTINCT</code> (default: true).<br />
...
...
@@ -178,7 +186,7 @@ public class DbSettings extends SettingsBase {
* Insert into table from query directly bypassing temporary disk storage.
* This also applies to create table as select.
*/
public
final
boolean
optimizeInsertFromSelect
=
get
(
"OPTIMIZE_INSERT_FROM_SELECT"
,
false
);
public
final
boolean
optimizeInsertFromSelect
=
get
(
"OPTIMIZE_INSERT_FROM_SELECT"
,
Constants
.
VERSION_MINOR
>=
3
);
/**
* Database setting <code>OPTIMIZE_IN_LIST</code> (default: true).<br />
...
...
@@ -197,7 +205,7 @@ public class DbSettings extends SettingsBase {
* Database setting <code>OPTIMIZE_OR</code> (default: false).<br />
* Convert (C=? OR C=?) to (C IN(?, ?)).
*/
public
final
boolean
optimizeOr
=
get
(
"OPTIMIZE_OR"
,
false
);
public
final
boolean
optimizeOr
=
get
(
"OPTIMIZE_OR"
,
Constants
.
VERSION_MINOR
>=
3
);
/**
* Database setting <code>OPTIMIZE_SUBQUERY_CACHE</code> (default: true).<br />
...
...
@@ -239,7 +247,7 @@ public class DbSettings extends SettingsBase {
* SELECT statements are cached (excluding UNION and FOR UPDATE statements).
* This works for both statements and prepared statement.
*/
public
final
int
queryCacheSize
=
get
(
"QUERY_CACHE_SIZE"
,
0
);
public
final
int
queryCacheSize
=
get
(
"QUERY_CACHE_SIZE"
,
Constants
.
VERSION_MINOR
>=
3
?
8
:
0
);
/**
* Database setting <code>RECOMPILE_ALWAYS</code> (default: false).<br />
...
...
@@ -260,7 +268,7 @@ public class DbSettings extends SettingsBase {
* Database setting <code>SELECT_FOR_UPDATE_MVCC</code> (default: false).<br />
* If set, SELECT .. FOR UPDATE queries lock only the selected rows when using MVCC.
*/
public
final
boolean
selectForUpdateMvcc
=
get
(
"SELECT_FOR_UPDATE_MVCC"
,
false
);
public
final
boolean
selectForUpdateMvcc
=
get
(
"SELECT_FOR_UPDATE_MVCC"
,
Constants
.
VERSION_MINOR
>=
3
);
/**
* Database setting <code>SHARE_LINKED_CONNECTIONS</code>
...
...
h2/src/main/org/h2/constant/SysProperties.java
浏览文件 @
108cd6a1
...
...
@@ -199,7 +199,7 @@ public class SysProperties {
* System property <code>h2.lobInDatabase</code> (default: false).<br />
* Store LOB files in the database.
*/
public
static
final
boolean
LOB_IN_DATABASE
=
getBooleanSetting
(
"h2.lobInDatabase"
,
Constants
.
VERSION_MINOR
<
3
?
false
:
true
);
public
static
final
boolean
LOB_IN_DATABASE
=
getBooleanSetting
(
"h2.lobInDatabase"
,
Constants
.
VERSION_MINOR
>=
3
);
/**
* System property <code>h2.lobClientMaxSizeMemory</code> (default: 65536).<br />
...
...
h2/src/main/org/h2/engine/Constants.java
浏览文件 @
108cd6a1
...
...
@@ -65,6 +65,7 @@ public class Constants {
* The minor version of this database.
*/
public
static
final
int
VERSION_MINOR
=
2
;
// Build.getLuceneVersion() uses an ugly hack to read this value
/**
* The lock mode that means no locking is used at all.
...
...
h2/src/main/org/h2/engine/Database.java
浏览文件 @
108cd6a1
...
...
@@ -200,7 +200,7 @@ public class Database implements DataHandler {
setEventListenerClass
(
listener
);
}
this
.
multiVersion
=
ci
.
getProperty
(
"MVCC"
,
false
);
boolean
closeAtVmShutdown
=
ci
.
getProperty
(
"DB_CLOSE_ON_EXIT"
,
true
)
;
boolean
closeAtVmShutdown
=
dbSettings
.
dbCloseOnExit
;
int
traceLevelFile
=
ci
.
getIntProperty
(
SetTypes
.
TRACE_LEVEL_FILE
,
TraceSystem
.
DEFAULT_TRACE_LEVEL_FILE
);
int
traceLevelSystemOut
=
ci
.
getIntProperty
(
SetTypes
.
TRACE_LEVEL_SYSTEM_OUT
,
TraceSystem
.
DEFAULT_TRACE_LEVEL_SYSTEM_OUT
);
...
...
h2/src/main/org/h2/fulltext/FullTextLucene.java
浏览文件 @
108cd6a1
...
...
@@ -39,11 +39,11 @@ import org.h2.util.New;
import
org.h2.util.StatementBuilder
;
import
org.h2.util.StringUtils
;
//## Java 1.4 end ##
/
/
## LUCENE2 begin ##
/
*
## LUCENE2 begin ##
import org.apache.lucene.index.IndexModifier;
import org.apache.lucene.search.Hits;
//## LUCENE2 end ##
/
*
## LUCENE3 begin ##
## LUCENE2 end ##*/
/
/
## LUCENE3 begin ##
import
java.io.File
;
import
org.apache.lucene.search.ScoreDoc
;
import
org.apache.lucene.search.TopDocs
;
...
...
@@ -51,7 +51,7 @@ import org.apache.lucene.store.FSDirectory;
import
org.apache.lucene.store.Directory
;
import
org.apache.lucene.util.Version
;
import
org.apache.lucene.index.IndexWriter
;
//
## LUCENE3 end ##*/
//
//## LUCENE3 end ##
/**
* This class implements the full text search based on Apache Lucene.
...
...
@@ -268,13 +268,13 @@ public class FullTextLucene extends FullText {
IndexAccess
access
=
INDEX_ACCESS
.
get
(
path
);
if
(
access
==
null
)
{
try
{
/
/
## LUCENE2 begin ##
/
*
## LUCENE2 begin ##
boolean recreate = !IndexReader.indexExists(path);
Analyzer analyzer = new StandardAnalyzer();
access = new IndexAccess();
access.modifier = new IndexModifier(path, analyzer, recreate);
//## LUCENE2 end ##
/
*
## LUCENE3 begin ##
## LUCENE2 end ##*/
/
/
## LUCENE3 begin ##
File
f
=
new
File
(
path
);
Directory
indexDir
=
FSDirectory
.
open
(
f
);
boolean
recreate
=
!
IndexReader
.
indexExists
(
indexDir
);
...
...
@@ -286,7 +286,7 @@ public class FullTextLucene extends FullText {
access
=
new
IndexAccess
();
access
.
writer
=
writer
;
access
.
searcher
=
new
IndexSearcher
(
reader
);
//
## LUCENE3 end ##*/
//
//## LUCENE3 end ##
}
catch
(
IOException
e
)
{
throw
convertException
(
e
);
}
...
...
@@ -360,14 +360,14 @@ public class FullTextLucene extends FullText {
synchronized
(
INDEX_ACCESS
)
{
try
{
INDEX_ACCESS
.
remove
(
indexPath
);
/
/
## LUCENE2 begin ##
/
*
## LUCENE2 begin ##
access.modifier.flush();
access.modifier.close();
//## LUCENE2 end ##
/
*
## LUCENE3 begin ##
## LUCENE2 end ##*/
/
/
## LUCENE3 begin ##
access
.
searcher
.
close
();
access
.
writer
.
close
();
//
## LUCENE3 end ##*/
//
//## LUCENE3 end ##
}
catch
(
Exception
e
)
{
throw
convertException
(
e
);
}
...
...
@@ -395,7 +395,7 @@ public class FullTextLucene extends FullText {
}
try
{
IndexAccess
access
=
getIndexAccess
(
conn
);
/
/
## LUCENE2 begin ##
/
*
## LUCENE2 begin ##
access.modifier.flush();
String path = getIndexPath(conn);
IndexReader reader = IndexReader.open(path);
...
...
@@ -411,8 +411,8 @@ public class FullTextLucene extends FullText {
for (int i = 0; i < limit && i + offset < max; i++) {
Document doc = hits.doc(i + offset);
float score = hits.score(i + offset);
//## LUCENE2 end ##
/
*
## LUCENE3 begin ##
## LUCENE2 end ##*/
/
/
## LUCENE3 begin ##
// take a reference as the searcher may change
Searcher
searcher
=
access
.
searcher
;
// reuse the same analyzer; it's thread-safe;
...
...
@@ -436,7 +436,7 @@ public class FullTextLucene extends FullText {
ScoreDoc
sd
=
docs
.
scoreDocs
[
i
+
offset
];
Document
doc
=
searcher
.
doc
(
sd
.
doc
);
float
score
=
sd
.
score
;
//
## LUCENE3 end ##*/
//
//## LUCENE3 end ##
String
q
=
doc
.
get
(
LUCENE_FIELD_QUERY
);
if
(
data
)
{
int
idx
=
q
.
indexOf
(
" WHERE "
);
...
...
@@ -459,10 +459,10 @@ public class FullTextLucene extends FullText {
result
.
addRow
(
q
,
score
);
}
}
/
/
## LUCENE2 begin ##
/
*
## LUCENE2 begin ##
// TODO keep it open if possible
reader.close();
//## LUCENE2 end ##
## LUCENE2 end ##*/
}
catch
(
Exception
e
)
{
throw
convertException
(
e
);
}
...
...
@@ -605,7 +605,7 @@ public class FullTextLucene extends FullText {
* @param row the row
*/
protected
void
insert
(
Object
[]
row
)
throws
SQLException
{
/
/
## LUCENE2 begin ##
/
*
## LUCENE2 begin ##
String query = getQuery(row);
Document doc = new Document();
doc.add(new Field(LUCENE_FIELD_QUERY, query,
...
...
@@ -637,8 +637,8 @@ public class FullTextLucene extends FullText {
} catch (IOException e) {
throw convertException(e);
}
//## LUCENE2 end ##
/
*
## LUCENE3 begin ##
## LUCENE2 end ##*/
/
/
## LUCENE3 begin ##
String
query
=
getQuery
(
row
);
Document
doc
=
new
Document
();
doc
.
add
(
new
Field
(
LUCENE_FIELD_QUERY
,
query
,
...
...
@@ -675,7 +675,7 @@ public class FullTextLucene extends FullText {
}
catch
(
IOException
e
)
{
throw
convertException
(
e
);
}
//
## LUCENE3 end ##*/
//
//## LUCENE3 end ##
}
/**
...
...
@@ -687,12 +687,12 @@ public class FullTextLucene extends FullText {
String
query
=
getQuery
(
row
);
try
{
Term
term
=
new
Term
(
LUCENE_FIELD_QUERY
,
query
);
/
/
## LUCENE2 begin ##
/
*
## LUCENE2 begin ##
indexAccess.modifier.deleteDocuments(term);
//## LUCENE2 end ##
/
*
## LUCENE3 begin ##
## LUCENE2 end ##*/
/
/
## LUCENE3 begin ##
indexAccess
.
writer
.
deleteDocuments
(
term
);
//
## LUCENE3 end ##*/
//
//## LUCENE3 end ##
}
catch
(
IOException
e
)
{
throw
convertException
(
e
);
}
...
...
@@ -726,23 +726,23 @@ public class FullTextLucene extends FullText {
/**
* The index modified.
*/
/
/
## LUCENE2 begin ##
/
*
## LUCENE2 begin ##
IndexModifier modifier;
//## LUCENE2 end ##
## LUCENE2 end ##*/
/**
* The index writer.
*/
/
*
## LUCENE3 begin ##
/
/
## LUCENE3 begin ##
IndexWriter
writer
;
//
## LUCENE3 end ##*/
//
//## LUCENE3 end ##
/**
* The index searcher.
*/
/
*
## LUCENE3 begin ##
/
/
## LUCENE3 begin ##
Searcher
searcher
;
//
## LUCENE3 end ##*/
//
//## LUCENE3 end ##
}
}
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
108cd6a1
...
...
@@ -325,7 +325,7 @@ java org.h2.test.TestAll timer
int
initialTest
;
// System.setProperty("h2.lobInDatabase", "true");
test
.
nestedJoins
=
true
;
//
test.nestedJoins = true;
// System.setProperty("h2.largeTransactions", "true");
// System.setProperty("h2.analyzeAuto", "100");
// System.setProperty("h2.optimizeOr", "true");
...
...
h2/src/tools/org/h2/build/Build.java
浏览文件 @
108cd6a1
...
...
@@ -133,9 +133,7 @@ public class Build extends BuildBase {
}
else
{
SwitchSource
.
main
(
"-dir"
,
"src"
,
"-version"
,
version
,
check
,
noCheck
);
}
if
(
System
.
getProperty
(
"lucene"
)
!=
null
)
{
SwitchSource
.
main
(
"-dir"
,
"src"
,
"-LUCENE2"
,
"-LUCENE3"
,
"+LUCENE"
+
getLuceneVersion
());
}
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
...
...
@@ -260,7 +258,11 @@ public class Build extends BuildBase {
}
private
int
getLuceneVersion
()
{
return
Integer
.
parseInt
(
System
.
getProperty
(
"lucene"
,
"2"
));
// use Lucene 2 for H2 1.2.x, and Lucene 3 for H2 1.3.x.
String
s
=
new
String
(
readFile
(
new
File
(
"src/main/org/h2/engine/Constants.java"
)));
int
idx
=
s
.
indexOf
(
"VERSION_MINOR"
)
+
"VERSION_MINOR"
.
length
()
+
3
;
int
version
=
Integer
.
parseInt
(
s
.
substring
(
idx
,
idx
+
1
));
return
Integer
.
parseInt
(
System
.
getProperty
(
"lucene"
,
""
+
version
));
}
private
String
getJarSuffix
()
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论