Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
5064d142
提交
5064d142
authored
7月 30, 2007
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
ab655816
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
91 行增加
和
59 行删除
+91
-59
advanced.html
h2/src/docsrc/html/advanced.html
+9
-9
download.html
h2/src/docsrc/html/download.html
+1
-1
features.html
h2/src/docsrc/html/features.html
+2
-2
history.html
h2/src/docsrc/html/history.html
+20
-20
tutorial.html
h2/src/docsrc/html/tutorial.html
+2
-2
Parser.java
h2/src/main/org/h2/command/Parser.java
+1
-1
help.csv
h2/src/main/org/h2/res/help.csv
+1
-1
PgServerThread.java
h2/src/main/org/h2/server/pg/PgServerThread.java
+1
-1
pg_catalog.sql
h2/src/main/org/h2/server/pg/pg_catalog.sql
+6
-6
ObjectUtils.java
h2/src/main/org/h2/util/ObjectUtils.java
+4
-0
MixedMode.java
h2/src/test/org/h2/samples/MixedMode.java
+5
-1
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+18
-2
test.in.txt
h2/src/test/org/h2/test/test.in.txt
+11
-11
XMLChecker.java
h2/src/tools/org/h2/tools/doc/XMLChecker.java
+5
-1
dictionary.txt
h2/src/tools/org/h2/tools/doc/dictionary.txt
+5
-1
没有找到文件。
h2/src/docsrc/html/advanced.html
浏览文件 @
5064d142
...
...
@@ -342,7 +342,7 @@ The PG server can be started and stopped from within a Java application as follo
Server server = Server.createPgServer(new String[]{"-baseDir", "~"});
server.start();
...
server.stop();
server.stop();
</pre>
By default, only connections from localhost are allowed. To allow remote connections, use
<code>
-pgAllowOthers true
</code>
when starting the server.
...
...
@@ -356,16 +356,16 @@ and select the PostgreSQL Unicode driver. Then click 'Finish'.
You will be able to change the connection properties:
</p>
<table>
<tr><th>
Property
</th><th>
Example
</th><th>
Remarks
</th></t
h
>
<tr><th>
Property
</th><th>
Example
</th><th>
Remarks
</th></t
r
>
<tr><td>
Data Source
</td><td>
H2 Test
</td><td>
The name of the ODBC Data Source
</td></tr>
<tr><td>
Database
</td><td>
test
</td>
<td>
The database name. Only simple names are supported at this time;
<br
/>
relative or absolute path are not supported in the database name.
<br
/>
By default, the database is stored in the current working directory
<br
/>
where the Server is started except when the -baseDir setting is used.
<br
/>
The name must be at least 3 characters.
</td></tr>
<td>
The database name. Only simple names are supported at this time;
<br
/>
relative or absolute path are not supported in the database name.
<br
/>
By default, the database is stored in the current working directory
<br
/>
where the Server is started except when the -baseDir setting is used.
<br
/>
The name must be at least 3 characters.
</td></tr>
<tr><td>
Server
</td><td>
localhost
</td><td>
The server name or IP address.
<br
/>
By default, only remote connections are allowed
</td></tr>
<tr><td>
User Name
</td><td>
sa
</td><td>
The database user name.
</td></tr>
<tr><td>
SSL Mode
</td><td>
disabled
</td><td>
At this time, SSL is not supported.
</td></tr>
...
...
h2/src/docsrc/html/download.html
浏览文件 @
5064d142
...
...
@@ -30,7 +30,7 @@ H2 Database Engine
<h3>
Download Mirror
</h3>
<p>
<a
href=
"http://code.google.com/p/h2database/downloads/list"
>
Platform-Independent Zip
s
</a><br
/>
<a
href=
"http://code.google.com/p/h2database/downloads/list"
>
Platform-Independent Zip
</a><br
/>
</p>
<h3>
Subversion Source Repository
</h3>
...
...
h2/src/docsrc/html/features.html
浏览文件 @
5064d142
...
...
@@ -1226,8 +1226,8 @@ a lot of data in a database), one sometimes wants to shrink the size of the data
(compact a database). Here is a sample function to do this:
<pre>
public static void compact(String dir, String dbName,
String user, String password) throws Exception {
String url = "jdbc:h2:" + dir + "/" + dbName;
String user, String password) throws Exception {
String url = "jdbc:h2:" + dir + "/" + dbName;
String file = "data/test.sql";
Script.execute(url, user, password, file);
DeleteDbFiles.execute(dir, dbName, true);
...
...
h2/src/docsrc/html/history.html
浏览文件 @
5064d142
...
...
@@ -40,42 +40,42 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
<h3>
Version 1.0 / 2007-TODO
</h3><ul>
<li>
Some Unicode characters where not supported as identifier name.
Thanks Yusuke Fukushima for reporting this problem.
Thanks Yusuke Fukushima for reporting this problem.
</li><li>
The default value DEFAULT_MAX_LENGTH_INPLACE_LOB has been changed from 128 to 1024.
</li><li>
A server that implements the PostgreSQL protocol is now included and documented.
That means, the PostgreSQL ODBC driver can be used to access a H2 database.
See in the documentation for details.
That means, the PostgreSQL ODBC driver can be used to access a H2 database.
See in the documentation for details.
</li><li>
The experimental H2 ODBC driver has been removed.
</li><li>
The default value for h2.defaultMaxMemoryUndo is now 50000.
This avoids out of memory problems when using large transactions,
however large transactions are slower because they are buffered to disk.
To disable, use -Dh2.defaultMaxMemoryUndo=2000000000.
This avoids out of memory problems when using large transactions,
however large transactions are slower because they are buffered to disk.
To disable, use -Dh2.defaultMaxMemoryUndo=2000000000.
</li><li>
Support for regular expression function REGEXP_REPLACE(expression, regex, replacement)
and regular expression LIKE: expression REGEXP matchExpression. However, indexes are not yet used.
and regular expression LIKE: expression REGEXP matchExpression. However, indexes are not yet used.
</li><li>
The old view implementation has been removed.
</li><li>
The SysTray tool has been removed, because JDK 1.6 has native support for system tray icons.
Use the Console tool (org.h2.tools.Console) automatically installs a system tray icon if JDK 1.6 is used.
Use the Console tool (org.h2.tools.Console) automatically installs a system tray icon if JDK 1.6 is used.
</li><li>
H2 Console: In the last release, the shutdown button did not work. Fixed.
</li><li>
Referential integrity can now be disabled using
SET REFERENTIAL_INTEGRITY FALSE. It can also be disable only
for one table using ALTER TABLE SET REFERENTIAL_INTEGRITY FALSE.
SET REFERENTIAL_INTEGRITY FALSE. It can also be disable only
for one table using ALTER TABLE SET REFERENTIAL_INTEGRITY FALSE.
</li><li>
The Backup and Restore tools, and the BACKUP command did not back up LOBs when
h2.lobFilesInDirectories was enabled. Fixed.
h2.lobFilesInDirectories was enabled. Fixed.
</li><li>
Calculation of cache memory usage has been improved.
</li><li>
In some situations record were released too late from the cache. Fixed.
</li><li>
The cache size is now measured in KB instead of blocks of 128 byte.
</li><li>
CREATE TABLE ... AS SELECT now needs less memory. While inserting the rows, the undo
log is temporarily disabled. This avoid out of memory problems when creating large tables.
log is temporarily disabled. This avoid out of memory problems when creating large tables.
</li><li>
The per session undo log can now be disabled. This setting is useful for bulk operations
that don't need to be atomic, like bulk delete or update.
</li><li>
The database file could get corruted when there was an OutOfMemoryException in the middle of inserting a row.
that don't need to be atomic, like bulk delete or update.
</li><li>
The database file could get corru
p
ted when there was an OutOfMemoryException in the middle of inserting a row.
</li><li>
Optimization for WHERE NOT(...) and WHERE [NOT] booleanFlagColumn.
This can be disabled using the system property h2.optimizeNot.
This can be disabled using the system property h2.optimizeNot.
</li><li>
Optimization for conditions like WHERE A=B AND B=X (A=X is added). This often appears in joins.
This can be disabled using the system property h2.optimizeTwoEquals.
This can be disabled using the system property h2.optimizeTwoEquals.
</li><li>
Documentation: the source code in 'Compacting a Database' was incorrect. Fixed.
</li><li>
In the H2 Console, result sets could not be modified because the default result set type is now forward only.
For H2, now uses scrollable result sets. Also for other databases, but only when the query starts with @EDIT.
For H2, now uses scrollable result sets. Also for other databases, but only when the query starts with @EDIT.
</li><li>
Views using UNION did not work correctly. Fixed.
</li><li>
Function tables did not work with views and EXPLAIN. Fixed.
</li></ul>
...
...
@@ -827,8 +827,8 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
</li><li>
Support Oracle RPAD and LPAD(string, n[, pad]) (truncate the end if longer)
</li><li>
Allow editing NULL values in the Console
</li><li>
Updatable result sets: DatabaseMetaData.ownUpdatesAreVisible = true (for insert, delete, update)
Simple solution: automatically calls 'refresh' when the result was changed.
Compare with other databases.
Simple solution: automatically calls 'refresh' when the result was changed.
Compare with other databases.
</li></ul>
<h3>
Priority 2
</h3>
...
...
@@ -1085,7 +1085,7 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
</li><li>
Index usage for REGEXP LIKE.
</li><li>
Add a role DBA (like ADMIN).
</li><li>
Automatic mode: jdbc:h2:auto: (embedded mode if possible, if not use server mode).
Problem: what to do when server stops while others are connected to it.
Problem: what to do when server stops while others are connected to it.
</li><li>
Access rights: remember the owner of an object. COMMENT: allow owner of object to change it.
</li></ul>
...
...
h2/src/docsrc/html/tutorial.html
浏览文件 @
5064d142
...
...
@@ -32,7 +32,7 @@ Tutorial
<a
href=
"#open_office"
>
Using OpenOffice Base
</a><br
/>
<a
href=
"#web_start"
>
Java Web Start / JNLP
</a><br
/>
Java Web Start / JNLP
</a><br
/>
<br
/><a
name=
"tutorial_starting_h2_console"
></a>
<h2>
Starting and Using the H2 Console
</h2>
...
...
@@ -448,7 +448,7 @@ exception will occur: java.security.AccessControlException: access denied (java.
Example permission tags:
<pre>
<
security>
<
all-permissions/>
<
all-permissions/>
<
/security>
</pre>
...
...
h2/src/main/org/h2/command/Parser.java
浏览文件 @
5064d142
...
...
@@ -2613,7 +2613,7 @@ public class Parser {
}
else
if
(
c
>=
'0'
&&
c
<=
'9'
)
{
type
=
CHAR_VALUE
;
}
else
{
// $ is not supported at this time (compatbility for PostgreSQL: $1 )
// $ is not supported at this time (compat
i
bility for PostgreSQL: $1 )
if
(
Character
.
isJavaIdentifierPart
(
c
))
{
type
=
CHAR_NAME
;
char
u
=
Character
.
toUpperCase
(
c
);
...
...
h2/src/main/org/h2/res/help.csv
浏览文件 @
5064d142
...
...
@@ -2171,7 +2171,7 @@ REGEXP_REPLACE(inputString, regexString, replacementString): string
Replaces each substring that matches a regular expression.
For details, see the Java String.replaceAll() method.
","
REGEXP_REPLACE('H
oohoho', 'o+', 'o
')
REGEXP_REPLACE('H
ello World', ' +', '
')
"
"Functions (String)","REPEAT","
...
...
h2/src/main/org/h2/server/pg/PgServerThread.java
浏览文件 @
5064d142
...
...
@@ -580,7 +580,7 @@ public class PgServerThread implements Runnable {
boolean
tableFound
=
rs
.
next
();
stat
=
conn
.
createStatement
();
if
(
tableFound
)
{
rs
=
stat
.
executeQuery
(
"SELECT VERION FROM PG_CATALOG.PG_VERSION"
);
rs
=
stat
.
executeQuery
(
"SELECT VER
S
ION FROM PG_CATALOG.PG_VERSION"
);
if
(
rs
.
next
())
{
if
(
rs
.
getInt
(
1
)
==
1
)
{
// already installed
...
...
h2/src/main/org/h2/server/pg/pg_catalog.sql
浏览文件 @
5064d142
...
...
@@ -13,10 +13,10 @@ set search_path = PUBLIC, pg_catalog;
create
view
pg_catalog
.
pg_roles
-- (oid, rolname, rolcreaterole, rolcreatedb)
as
select
id
oid
,
cast
(
name
as
varchar_ignorecase
)
rolname
,
case
when
admin
then
't'
else
'f'
end
as
rolcreaterole
,
case
when
admin
then
't'
else
'f'
end
as
rolcreatedb
id
oid
,
cast
(
name
as
varchar_ignorecase
)
rolname
,
case
when
admin
then
't'
else
'f'
end
as
rolcreaterole
,
case
when
admin
then
't'
else
'f'
end
as
rolcreatedb
from
information_schema
.
users
;
create
view
pg_catalog
.
pg_namespace
-- (oid, nspname)
...
...
@@ -283,7 +283,7 @@ from pg_catalog.pg_database;
create
table
pg_catalog
.
pg_group
-- oid, groname
as
select
0
oid
,
cast
(
''
as
varchar_ignorecase
)
groname
0
oid
,
cast
(
''
as
varchar_ignorecase
)
groname
from
pg_catalog
.
pg_database
where
1
=
0
;
h2/src/main/org/h2/util/ObjectUtils.java
浏览文件 @
5064d142
/*
* Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package
org
.
h2
.
util
;
public
class
ObjectUtils
{
...
...
h2/src/test/org/h2/samples/MixedMode.java
浏览文件 @
5064d142
/*
* Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package
org
.
h2
.
samples
;
import
java.sql.Connection
;
...
...
@@ -32,7 +36,7 @@ public class MixedMode {
Thread
.
sleep
(
1000
);
}
}
catch
(
SQLException
e
)
{
System
.
out
.
println
(
"Err
r
or: "
+
e
.
toString
());
System
.
out
.
println
(
"Error: "
+
e
.
toString
());
}
conn
.
close
();
...
...
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
5064d142
...
...
@@ -94,14 +94,16 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
/*
test odbc again a few times (debug catalog creation)
Openfire server uses this script to setup a user permissions
on the fresh-installed server. The database is [current] HSQLDB :
CREATE SCHEMA PUBLIC AUTHORIZATION DBA
CREATE USER SA PASSWORD ""
GRANT DBA TO SA
SET SCHEMA PUBLIC
Unfortunately, this does not work (first string has a different semantic)
on the H2...
Unfortunately, this does not work in H2
Wrong user name or password [08004-55]
merge html-ja
...
...
@@ -182,6 +184,20 @@ Document org.h2.samples.MixedMode
http://www.igniterealtime.org/projects/openfire/index.jsp
translation:
src/org.h2.server.web.res/_text_en.properties
src/org.h2.res/messages.properties
src/org.h2.res/help.csv (using ${.} like .jsp?)
javadocs (using generated ${.} ?)
html (using generated ${.} ?)
how do multi line properties files work? xml? [key]...?
converter between properties and [key] ...?
checksum marker
glossary
spell check / word list per language
html-jp
*/
/*
...
...
h2/src/test/org/h2/test/test.in.txt
浏览文件 @
5064d142
--- special grammar and test cases ---------------------------------------------------------------------------------------------
CALL REGEXP_REPLACE('
K
aboooom', 'o+', 'o');
> '
K
abom'
> -------
>
K
abom
CALL REGEXP_REPLACE('
abck
aboooom', 'o+', 'o');
> '
abck
abom'
> -------
---
>
abck
abom
> rows: 1
SELECT 'Hello' ~ 'He.*' T1, 'HELLO' ~ 'He.*' F2, CAST('HELLO' AS VARCHAR_IGNORECASE) ~ 'He.*' T3;
...
...
@@ -136,7 +136,7 @@ explain select * from table(id int = (1, 2), name varchar=('Hello', 'World'));
CREATE TABLE TEST(ID INT PRIMARY KEY, FLAG BOOLEAN, NAME VARCHAR);
> ok
CREATE INDEX IDXFLAG ON TEST(FLAG, NAME);
CREATE INDEX IDX
_
FLAG ON TEST(FLAG, NAME);
> ok
INSERT INTO TEST VALUES(1, TRUE, 'Hello'), (2, FALSE, 'World');
...
...
@@ -144,26 +144,26 @@ INSERT INTO TEST VALUES(1, TRUE, 'Hello'), (2, FALSE, 'World');
EXPLAIN SELECT * FROM TEST WHERE FLAG;
> PLAN
> --------------------------------------------------------------------------------------------------
> SELECT TEST.ID, TEST.FLAG, TEST.NAME FROM PUBLIC.TEST /* PUBLIC.IDXFLAG: FLAG = TRUE */ WHERE FLAG
> --------------------------------------------------------------------------------------------------
-
> SELECT TEST.ID, TEST.FLAG, TEST.NAME FROM PUBLIC.TEST /* PUBLIC.IDX
_
FLAG: FLAG = TRUE */ WHERE FLAG
> rows: 1
EXPLAIN SELECT * FROM TEST WHERE FLAG AND NAME>'I';
> PLAN
> ----------------------------------------------------------------------------------------------------------------------------------
> SELECT TEST.ID, TEST.FLAG, TEST.NAME FROM PUBLIC.TEST /* PUBLIC.IDXFLAG: FLAG = TRUE AND NAME > 'I' */ WHERE FLAG AND (NAME > 'I')
> ----------------------------------------------------------------------------------------------------------------------------------
-
> SELECT TEST.ID, TEST.FLAG, TEST.NAME FROM PUBLIC.TEST /* PUBLIC.IDX
_
FLAG: FLAG = TRUE AND NAME > 'I' */ WHERE FLAG AND (NAME > 'I')
> rows: 1
DROP TABLE TEST;
> ok
CREATE TABLE test_table (first
col varchar(20), second
col integer);
CREATE TABLE test_table (first
_col varchar(20), second_
col integer);
> ok
insert into test_table values('a', 10), ('a', 4), ('b', 30), ('b', 3);
> update count: 4
CREATE VIEW test_view AS SELECT first
col AS renamed_col, MIN(secondcol) AS also_renamed FROM test_table GROUP BY first
col;
CREATE VIEW test_view AS SELECT first
_col AS renamed_col, MIN(second_col) AS also_renamed FROM test_table GROUP BY first_
col;
> ok
SELECT * FROM test_view WHERE renamed_col = 'a';
...
...
h2/src/tools/org/h2/tools/doc/XMLChecker.java
浏览文件 @
5064d142
...
...
@@ -128,7 +128,11 @@ public class XMLChecker {
if
(
pop
.
equals
(
name
))
{
break
;
}
throw
new
Exception
(
"Unclosed element "
+
pop
+
" at "
+
parser
.
getRemaining
());
String
remaining
=
parser
.
getRemaining
();
if
(
remaining
.
length
()
>
100
)
{
remaining
=
remaining
.
substring
(
0
,
100
);
}
throw
new
Exception
(
"Unclosed element "
+
pop
+
" at "
+
remaining
);
}
}
else
if
(
event
==
XMLParser
.
CHARACTERS
)
{
// lastElement = parser.getText();
...
...
h2/src/tools/org/h2/tools/doc/dictionary.txt
浏览文件 @
5064d142
...
...
@@ -494,4 +494,8 @@ latin tgconstrname datallowconn atttypmod dattablespace attrelid ctid timestampt
nspname objsubid typnamespace rolcreaterole tgrelid spclocation relhasrules dont indkey postmaster
relkind autovacuum datlastsysoid attisdropped amname datacl deallocate tgdeferrable stats
spcacl relname rolvaliduntil attnotnull authid aclitem
plpgsql interrupting spring oids plperl regex newest
\ No newline at end of file
plpgsql interrupting spring oids plperl regex newest
xhtml transactionally remotly jnlp launch mirror subversion matcher hoohoho matching bulk
prorettype pronamespace groname inlining nopmd openfire joda fastutil ibatis igniterealtime unimi dsi
irstv trac iict geosysin fukushima yusuke msi odbcad recent viewed calculation installs embedding relation
resizing
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论