Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
eb73ac3e
提交
eb73ac3e
authored
11月 23, 2011
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Documentation.
上级
961b5963
全部展开
显示空白字符变更
内嵌
并排
正在显示
21 个修改的文件
包含
5111 行增加
和
4864 行删除
+5111
-4864
help.csv
h2/src/docsrc/help/help.csv
+1
-1
advanced.html
h2/src/docsrc/html/advanced.html
+1
-1
changelog.html
h2/src/docsrc/html/changelog.html
+6
-7
features.html
h2/src/docsrc/html/features.html
+10
-3
history.html
h2/src/docsrc/html/history.html
+1
-1
links.html
h2/src/docsrc/html/links.html
+3
-4
roadmap.html
h2/src/docsrc/html/roadmap.html
+4
-2
_docs_en.utf8.txt
h2/src/docsrc/text/_docs_en.utf8.txt
+1700
-1610
_docs_ja.utf8.txt
h2/src/docsrc/text/_docs_ja.utf8.txt
+1700
-1610
_docs_en.properties
h2/src/docsrc/textbase/_docs_en.properties
+1631
-1601
SysProperties.java
h2/src/main/org/h2/constant/SysProperties.java
+10
-8
Database.java
h2/src/main/org/h2/engine/Database.java
+15
-0
FullTextLucene.java
h2/src/main/org/h2/fulltext/FullTextLucene.java
+5
-1
help.csv
h2/src/main/org/h2/res/help.csv
+4
-0
Schema.java
h2/src/main/org/h2/schema/Schema.java
+0
-4
Table.java
h2/src/main/org/h2/table/Table.java
+1
-1
NetUtils.java
h2/src/main/org/h2/util/NetUtils.java
+6
-1
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+1
-1
TestAutoServer.java
h2/src/test/org/h2/test/server/TestAutoServer.java
+1
-3
TestObjectDeserialization.java
h2/src/test/org/h2/test/unit/TestObjectDeserialization.java
+8
-3
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+3
-2
没有找到文件。
h2/src/docsrc/help/help.csv
浏览文件 @
eb73ac3e
...
...
@@ -3511,7 +3511,7 @@ CALL DATABASE_PATH();
"
"Functions (System)","DECODE","
DECODE(value, whenValue, thenValue
,...
)
DECODE(value, whenValue, thenValue
[,...]
)
","
Returns the first matching value. NULL is considered to match NULL.
If no match was found, then NULL or the last parameter (if the parameter count is even) is returned.
...
...
h2/src/docsrc/html/advanced.html
浏览文件 @
eb73ac3e
...
...
@@ -848,7 +848,7 @@ against a database that was created with a user name that is not in the script.
The
<code>
Recover
</code>
tool creates a SQL script from database file. It also processes the transaction log.
</p>
<p>
To verify the database
is always recoverabl
e, append
<code>
;RECOVER_TEST=64
</code>
To verify the database
can recover at any tim
e, append
<code>
;RECOVER_TEST=64
</code>
to the database URL in your test environment. This will simulate an application crash after each 64 writes to the database file.
A log file named
<code>
databaseName.h2.db.log
</code>
is created that lists the operations.
The recovery is tested using an in-memory file system, that means it may require a larger heap setting.
...
...
h2/src/docsrc/html/changelog.html
浏览文件 @
eb73ac3e
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Copyright 2004-2011 H2 Group. Multiple-Licensed under the H2 License, Version 1.0,
...
...
@@ -28,7 +27,7 @@ Change Log
</li><li>
Issue 334: SimpleResultSet.getString now also works for Clob columns.
</li><li>
Subqueries with an aggregate did not always work. Example:
select (select count(*) from test where a = t.a and b = 0) from test t group by a
</li><li>
Server: in some (theoretical) cases, exceptions while closing the connection were
swallow
ed.
</li><li>
Server: in some (theoretical) cases, exceptions while closing the connection were
ignor
ed.
</li><li>
Server.createTcpServer, createPgServer, createWebServer: invalid arguments are now detected.
</li><li>
The selectivity of LOB columns is no longer calculated
because indexes on LOB columns are not supported
...
...
@@ -41,7 +40,7 @@ Change Log
</li><li>
Issue 180: when deserializing objects, the context class loader is used
instead of the default class loader if the system property "h2.useThreadContextClassLoader" is set.
Thanks a lot to Noah Fontes for the patch!
</li><li>
When using the exclusive mode, LOB operations could cause the thread to
freeze
.
</li><li>
When using the exclusive mode, LOB operations could cause the thread to
block
.
This also affected the CreateCluster tool (when using BLOB or CLOB data).
</li><li>
The optimization for "group by" was not working correctly if the group by column
was aliased in the select list.
...
...
h2/src/docsrc/html/features.html
浏览文件 @
eb73ac3e
...
...
@@ -523,7 +523,7 @@ This is achieved using different database URLs. Settings in the URLs are not cas
<td><a
href=
"#execute_sql_on_connection"
>
Execute SQL on connection
</a></td>
<td
class=
"notranslate"
>
jdbc:h2:
<
url
>
;INIT=RUNSCRIPT FROM '~/create.sql'
<br
/>
jdbc:h2:file:~/sample;INIT=RUNSCRIPT FROM '~/create.sql'\
\
;RUNSCRIPT FROM '~/populate.sql'
<br
/>
jdbc:h2:file:~/sample;INIT=RUNSCRIPT FROM '~/create.sql'\;RUNSCRIPT FROM '~/populate.sql'
<br
/>
</td>
</tr>
<tr>
...
...
@@ -772,6 +772,13 @@ must be escaped, as in the example below.
<pre>
String url = "jdbc:h2:mem;INIT=RUNSCRIPT FROM '~/create.sql'\\;RUNSCRIPT FROM '~/populate.sql'";
</pre>
<p>
Please note the double backslash is only required in a Java or properties file.
In a GUI, or in an XML file, only one backslash is required:
</p>
<pre>
<
property name="url" value="jdbc:h2:mem:test;INIT=CREATE SCHEMA IF NOT EXISTS TEST\;RUNSCRIPT FROM '~/sql/populate.sql';DB_CLOSE_DELAY=-1" /
>
</pre>
<h2
id=
"ignore_unknown_settings"
>
Ignore Unknown Settings
</h2>
<p>
...
...
@@ -1190,8 +1197,8 @@ DriverManager.getConnection("jdbc:h2:/data/test;AUTO_SERVER=TRUE");
DriverManager.getConnection("jdbc:h2:/data/test;AUTO_SERVER=TRUE");
</pre>
<p>
When using this feature, by default the server
allocates a random TCP socke
t.
It is possible to control the port that the server uses by passing in an
<code>
AUTO_SERVER_PORT=9090
</code>
parameter
.
When using this feature, by default the server
uses any free TCP por
t.
The port can be set manually using
<code>
AUTO_SERVER_PORT=9090
</code>
.
</p>
<h2
id=
"page_size"
>
Page Size
</h2>
...
...
h2/src/docsrc/html/history.html
浏览文件 @
eb73ac3e
...
...
@@ -97,7 +97,7 @@ spread the word, and translated this project. Also many thanks to the donors:
</li><li><a
href=
"http://skycash.com"
>
SkyCash, Poland
</a>
</li><li><a
href=
"http://lumber-mill.co.jp"
>
Lumber-mill, Inc., Japan
</a>
</li><li><a
href=
"http://www.stockmarketeye.com"
>
StockMarketEye, USA
</a>
</li><li>
Alessio Jacopo D'Adamo, Italy
</a>
</li><li>
Alessio Jacopo D'Adamo, Italy
</li><li>
Martin Wildam, Austria
</li><li>
Ashwin Jayaprakash, USA
</li><li>
Donald Bleyl, USA
...
...
h2/src/docsrc/html/links.html
浏览文件 @
eb73ac3e
...
...
@@ -55,7 +55,6 @@ Quote</a>:
Originally the web application that I am working on is using SQL server.
But, in less than 15 minutes I had H2 up and working with little recoding of the SQL.
Thanks..... "
</a>
</p>
http://groups.google.com/group/h2-database/browse_thread/thread/f4b19dfe31efcbe7/32c07dce1bd5a7a5
...
...
h2/src/docsrc/html/roadmap.html
浏览文件 @
eb73ac3e
...
...
@@ -562,8 +562,10 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>
MySQL compatibility: index names only need to be unique for the given table.
</li><li>
Issue 352: constraints: distinguish between 'no action' and 'restrict'. Currently, only restrict is supported,
and 'no action' is internally mapped to 'restrict'. The database meta data returns 'restrict' in all cases.
</li><li>
Oracle compatilibity: support MEDIAN aggregate function.
</li><li>
Issue 348: Oracle compatilibity: division should return a decimal result.
</li><li>
Oracle compatibility: support MEDIAN aggregate function.
</li><li>
Issue 348: Oracle compatibility: division should return a decimal result.
</li><li>
Read rows on demand: instead of reading the whole row, only read up to that column that is requested.
Keep an pointer to the data area and the column id that is already read.
</li></ul>
<h2>
Not Planned
</h2>
...
...
h2/src/docsrc/text/_docs_en.utf8.txt
浏览文件 @
eb73ac3e
差异被折叠。
点击展开。
h2/src/docsrc/text/_docs_ja.utf8.txt
浏览文件 @
eb73ac3e
差异被折叠。
点击展开。
h2/src/docsrc/textbase/_docs_en.properties
浏览文件 @
eb73ac3e
This source diff could not be displayed because it is too large. You can
view the blob
instead.
h2/src/main/org/h2/constant/SysProperties.java
浏览文件 @
eb73ac3e
...
...
@@ -234,10 +234,10 @@ public class SysProperties {
/**
* System property <code>h2.modifyOnWrite</code> (default: false).<br />
* Only modify the database file when
writing to the database. If disabled,
*
opening the database modifies the file (to prepare it for writing).
*
This only occurs when no recovery is necessary.
*
When enabled, the serialized
file lock is faster.
* Only modify the database file when
recovery is necessary, or when writing
*
to the database. If disabled, opening the database always writes to the
*
file (except if the database is read-only). When enabled, the serialized
* file lock is faster.
*/
public
static
final
boolean
MODIFY_ON_WRITE
=
Utils
.
getProperty
(
"h2.modifyOnWrite"
,
false
);
...
...
@@ -387,11 +387,13 @@ public class SysProperties {
public
static
final
String
URL_MAP
=
Utils
.
getProperty
(
"h2.urlMap"
,
null
);
/**
* System property <code>h2.useThreadContextClassLoader</code> (default: false).<br />
* Instead of using the default class loader when deserializing objects,
* the current thread-context class loader will be used.
* System property <code>h2.useThreadContextClassLoader</code>
* (default: false).<br />
* Instead of using the default class loader when deserializing objects, the
* current thread-context class loader will be used.
*/
public
static
final
boolean
USE_THREAD_CONTEXT_CLASS_LOADER
=
Utils
.
getProperty
(
"h2.useThreadContextClassLoader"
,
false
);
public
static
final
boolean
USE_THREAD_CONTEXT_CLASS_LOADER
=
Utils
.
getProperty
(
"h2.useThreadContextClassLoader"
,
false
);
/**
* System property <code>h2.webMaxValueLength</code> (default: 100000).<br />
...
...
h2/src/main/org/h2/engine/Database.java
浏览文件 @
eb73ac3e
...
...
@@ -2374,12 +2374,27 @@ public class Database implements DataHandler {
return
dbSettings
;
}
/**
* Create a new hash map. Depending on the configuration, the key is case
* sensitive or case insensitive.
*
* @param <V> the value type
* @return the hash map
*/
public
<
V
>
HashMap
<
String
,
V
>
newStringMap
()
{
return
dbSettings
.
databaseToUpper
?
new
HashMap
<
String
,
V
>()
:
new
CaseInsensitiveMap
<
V
>();
}
/**
* Compare two identifiers (table names, column names,...) and verify they
* are equal. Case sensitivity depends on the configuration.
*
* @param a the first identifier
* @param b the second identifier
* @return true if they match
*/
public
boolean
equalsIdentifiers
(
String
a
,
String
b
)
{
if
(
a
==
b
||
a
.
equals
(
b
))
{
return
true
;
...
...
h2/src/main/org/h2/fulltext/FullTextLucene.java
浏览文件 @
eb73ac3e
...
...
@@ -577,7 +577,10 @@ public class FullTextLucene extends FullText {
// ignore
}
public
void
commitIndex
()
throws
SQLException
{
/**
* Commit all changes to the Lucene index.
*/
void
commitIndex
()
throws
SQLException
{
try
{
indexAccess
.
writer
.
commit
();
// recreate Searcher with the IndexWriter's reader.
...
...
@@ -595,6 +598,7 @@ public class FullTextLucene extends FullText {
* Add a row to the index.
*
* @param row the row
* @param commitIndex whether to commit the changes to the Lucene index
*/
protected
void
insert
(
Object
[]
row
,
boolean
commitIndex
)
throws
SQLException
{
/*## LUCENE2 ##
...
...
h2/src/main/org/h2/res/help.csv
浏览文件 @
eb73ac3e
...
...
@@ -1275,6 +1275,10 @@ Returns the name of the database."
DATABASE_PATH()
","
Returns the directory of the database files and the database name, if it is file based."
"Functions (System)","DECODE","
DECODE(value, whenValue, thenValue [,...])
","
Returns the first matching value."
"Functions (System)","FILE_READ","
FILE_READ(fileNameString [,encodingString])
","
...
...
h2/src/main/org/h2/schema/Schema.java
浏览文件 @
eb73ac3e
...
...
@@ -578,8 +578,4 @@ public class Schema extends DbObjectBase {
}
}
public
<
V
>
HashMap
<
String
,
V
>
newStringMap
()
{
return
database
.
newStringMap
();
}
}
h2/src/main/org/h2/table/Table.java
浏览文件 @
eb73ac3e
...
...
@@ -107,7 +107,7 @@ public abstract class Table extends SchemaObjectBase {
private
Row
nullRow
;
public
Table
(
Schema
schema
,
int
id
,
String
name
,
boolean
persistIndexes
,
boolean
persistData
)
{
columnMap
=
schema
.
newStringMap
();
columnMap
=
schema
.
getDatabase
().
newStringMap
();
initSchemaObjectBase
(
schema
,
id
,
name
,
Trace
.
TABLE
);
this
.
persistIndexes
=
persistIndexes
;
this
.
persistData
=
persistData
;
...
...
h2/src/main/org/h2/util/NetUtils.java
浏览文件 @
eb73ac3e
...
...
@@ -46,7 +46,12 @@ public class NetUtils {
if
(
address
==
null
)
{
address
=
InetAddress
.
getLocalHost
();
}
return
createSocket
(
getHostAddress
(
address
),
port
,
ssl
);
int
test
;
// try {
// return createSocket(getHostAddress(address), port, ssl);
// } catch (IOException e) {
return
createSocket
(
"localhost"
,
port
,
ssl
);
// }
}
/**
...
...
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
eb73ac3e
...
...
@@ -343,7 +343,7 @@ java org.h2.test.TestAll timer
System
.
setProperty
(
"h2.useThreadContextClassLoader"
,
"true"
);
int
testing
;
System
.
setProperty
(
"h2.modifyOnWrite"
,
"true"
);
//
System.setProperty("h2.modifyOnWrite", "true");
// System.setProperty("h2.storeLocalTime", "true");
...
...
h2/src/test/org/h2/test/server/TestAutoServer.java
浏览文件 @
eb73ac3e
...
...
@@ -35,10 +35,8 @@ public class TestAutoServer extends TestBase {
public
void
test
()
throws
Exception
{
testUnsupportedCombinations
();
testAutoServer
(
false
);
testAutoServer
(
true
);
if
(!
config
.
big
)
{
int
todo
;
// testAutoServer(true);
testAutoServer
(
true
);
}
testLinkedLocalTablesWithAutoServerReconnect
();
}
...
...
h2/src/test/org/h2/test/unit/TestObjectDeserialization.java
浏览文件 @
eb73ac3e
...
...
@@ -12,14 +12,18 @@ import org.h2.util.StringUtils;
import
org.h2.util.Utils
;
/**
* Tests the ability to deserialize objects that are not part of the system
class-
* loading scope.
* Tests the ability to deserialize objects that are not part of the system
*
class-
loading scope.
*/
public
class
TestObjectDeserialization
extends
TestBase
{
private
static
final
String
CLAZZ
=
"org.h2.test.unit.SampleObject"
;
private
static
final
String
OBJECT
=
"aced00057372001d6f72672e68322e746573742e756e69742e53616d706c654f626a65637400000000000000010200007870"
;
private
static
final
String
OBJECT
=
"aced00057372001d6f72672e68322e746573742e756e69742e53616d706c654f626a65637400000000000000010200007870"
;
/**
* The thread context class loader was used.
*/
protected
boolean
usesThreadContextClassLoader
;
/**
...
...
@@ -37,6 +41,7 @@ public class TestObjectDeserialization extends TestBase {
}
private
void
testThreadContextClassLoader
()
throws
Exception
{
usesThreadContextClassLoader
=
false
;
Thread
.
currentThread
().
setContextClassLoader
(
new
TestClassLoader
());
try
{
Utils
.
deserialize
(
StringUtils
.
convertHexToBytes
(
OBJECT
));
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
eb73ac3e
...
...
@@ -693,5 +693,6 @@ enhancer banana nit cglib challenging intercepted banane assertthrows
objenesis prepend detecting overridable eater forgetting tear
fork tester jaspa redirection johnny brings gone jooq iciql offline pdo mappings largely
pst patadia summertime jalpesh scheme compilable ski takanori dsts kawashima
kokoci seldom jaros ciphers srcs
kokoci seldom jaros ciphers srcs invectorate noah nfontes fontes recoding
minecraft videos youtube dataflyer bukkit alessio adamo jacopo angel leon frost
deserializing
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论