Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
fbb95e9d
提交
fbb95e9d
authored
6月 28, 2007
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
ce7fd11d
隐藏空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
66 行增加
和
51 行删除
+66
-51
features.html
h2/src/docsrc/html/features.html
+2
-0
history.html
h2/src/docsrc/html/history.html
+11
-9
Database.java
h2/src/main/org/h2/engine/Database.java
+3
-3
Session.java
h2/src/main/org/h2/engine/Session.java
+1
-1
SessionRemote.java
h2/src/main/org/h2/engine/SessionRemote.java
+1
-1
JdbcDataSourceFactory.java
h2/src/main/org/h2/jdbcx/JdbcDataSourceFactory.java
+1
-1
TraceSystem.java
h2/src/main/org/h2/message/TraceSystem.java
+10
-4
OdbcServer.java
h2/src/main/org/h2/server/OdbcServer.java
+11
-1
TcpServer.java
h2/src/main/org/h2/server/TcpServer.java
+10
-1
WebServer.java
h2/src/main/org/h2/server/web/WebServer.java
+9
-0
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+4
-28
TestBase.java
h2/src/test/org/h2/test/TestBase.java
+1
-1
TestFileLock.java
h2/src/test/org/h2/test/unit/TestFileLock.java
+1
-1
dictionary.txt
h2/src/tools/org/h2/tools/doc/dictionary.txt
+1
-0
没有找到文件。
h2/src/docsrc/html/features.html
浏览文件 @
fbb95e9d
...
...
@@ -466,6 +466,8 @@ The database URL for connecting to a local database is <code>jdbc:h2:[file:][<
The prefix
<code>
file:
</code>
is optional. If no or only a relative path is used, then the current working
directory is used as a starting point. The case sensitivity of the path and database name depend on the
operating system, however it is suggested to use lowercase letters only.
The database name must be at least three characters long (a limitation of File.createTempFile).
To point to the user directory, use ~/, as in: jdbc:h2:~/test.
<h3>
Memory-Only Databases
</h3>
<p>
...
...
h2/src/docsrc/html/history.html
浏览文件 @
fbb95e9d
...
...
@@ -37,25 +37,27 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
<h3>
Version 1.0 (Current)
</h3>
<h3>
Version 1.0 / TODO (Build TODO)
</h3><ul>
<li>
PooledConnection.getConnection took a long time if only one connection was open at any time. Fixed.
<li>
The default trace level for JdbcDataSourceFactory was DEBUG, so when using data sources a trace file
was always created. Now the default trace level is ERROR, and the file is only created if necessary.
</li><li>
PooledConnection.getConnection took a long time if only one connection was open at any time. Fixed.
</li><li>
Referential integrity violation: Two different SQL states are now used for missing parent / existing child.
</li><li>
DatabaseEventListener.exceptionThrown has a new parameter: SQL
</li><li>
For compatibility reasons, the catalog name can now be used in queries: SELECT * FROM TESTDB.PUBLIC.TEST
</li><li>
If SHUTDOWN IMMEDIATELY was called, then the connection was not closed and the database
opened from somebody else at the same time, in some cases this could result in errors with LOB files. Fixed.
opened from somebody else at the same time, in some cases this could result in errors with LOB files. Fixed.
</li><li>
The new view implementation is now enabled by default.
To use the old implementation, set the system property 'h2.indexOld' to true
(java -Dh2.indexOld=true ..., or in source code Constants.INDEX_OLD = true).
To use the old implementation, set the system property 'h2.indexOld' to true
(java -Dh2.indexOld=true ..., or in source code Constants.INDEX_OLD = true).
If no problems are found, the old implementation will be removed in the next release.
The old implementation does not work with multi-level nested temporary views
(select * from (select * from (select * from test))).
</li><li>
The new view implementation did not work with
<
and
<
= comparison,
and did not allow conditions on aggregates or grouped columns (HAVING). Fixed.. Fixed.
and did not allow conditions on aggregates or grouped columns (HAVING). Fixed.. Fixed.
</li><li>
Both view implementations did not work with multiple levels of nested temporary views (FROM (SELECT...)). Fixed.
</li><li>
The H2 Console can now be run as a standalone web application,
or it can be embedded as a servlet into any existing web application. To build the
'H2 Console' web application, execute 'ant warConsole'.
See src/tools/org/h2/server/web and src/tools/WEB-INF for details.
or it can be embedded as a servlet into any existing web application. To build the
'H2 Console' web application, execute 'ant warConsole'.
See src/tools/org/h2/server/web and src/tools/WEB-INF for details.
</li><li>
Deleting database files didn't work for Windows if the database was on the root directory of a drive.
</li><li>
The Polish translation is available. Thanks a lot to Tomek!
</li><li>
Windows service: the CLASSPATH was not included when starting the service. Fixed.
...
...
@@ -833,7 +835,7 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
</li><li>
Row level locking
</li><li>
Read-only databases inside a jar (splitting large files to speed up random access)
</li><li>
System table: open sessions and locks of a database
</li><li>
Function in management db: open connections and databases of a (TCP) server
</li><li>
Function in management db:
list
open connections and databases of a (TCP) server
</li><li>
Fix right outer joins
</li><li>
Full outer joins
</li><li>
Long running queries / errors / trace system table
...
...
h2/src/main/org/h2/engine/Database.java
浏览文件 @
fbb95e9d
...
...
@@ -410,9 +410,9 @@ public class Database implements DataHandler {
dummy
=
DataPage
.
create
(
this
,
0
);
if
(
persistent
)
{
if
(
readOnly
||
FileUtils
.
isInMemory
(
databaseName
))
{
traceSystem
=
new
TraceSystem
(
null
);
traceSystem
=
new
TraceSystem
(
null
,
false
);
}
else
{
traceSystem
=
new
TraceSystem
(
databaseName
+
Constants
.
SUFFIX_TRACE_FILE
);
traceSystem
=
new
TraceSystem
(
databaseName
+
Constants
.
SUFFIX_TRACE_FILE
,
true
);
}
if
(
cipher
!=
null
)
{
traceSystem
.
setManualEnabling
(
false
);
...
...
@@ -447,7 +447,7 @@ public class Database implements DataHandler {
reserveLobFileObjectIds
();
writer
=
WriterThread
.
create
(
this
,
writeDelay
);
}
else
{
traceSystem
=
new
TraceSystem
(
null
);
traceSystem
=
new
TraceSystem
(
null
,
false
);
log
=
new
LogSystem
(
null
,
null
,
false
,
null
);
}
systemUser
=
new
User
(
this
,
0
,
Constants
.
DBA_NAME
,
true
);
...
...
h2/src/main/org/h2/engine/Session.java
浏览文件 @
fbb95e9d
...
...
@@ -317,7 +317,7 @@ public class Session implements SessionInterface {
traceModuleName
=
Trace
.
JDBC
+
"["
+
id
+
"]"
;
}
if
(
database
==
null
)
{
return
new
TraceSystem
(
null
).
getTrace
(
traceModuleName
);
return
new
TraceSystem
(
null
,
false
).
getTrace
(
traceModuleName
);
}
return
database
.
getTrace
(
traceModuleName
);
}
...
...
h2/src/main/org/h2/engine/SessionRemote.java
浏览文件 @
fbb95e9d
...
...
@@ -172,7 +172,7 @@ public class SessionRemote implements SessionInterface, DataHandler {
}
databaseName
=
name
.
substring
(
idx
+
1
);
String
server
=
name
.
substring
(
0
,
idx
);
traceSystem
=
new
TraceSystem
(
null
);
traceSystem
=
new
TraceSystem
(
null
,
false
);
try
{
String
traceLevelFile
=
ci
.
getProperty
(
SetTypes
.
TRACE_LEVEL_FILE
,
null
);
if
(
traceLevelFile
!=
null
)
{
...
...
h2/src/main/org/h2/jdbcx/JdbcDataSourceFactory.java
浏览文件 @
fbb95e9d
...
...
@@ -22,7 +22,7 @@ public class JdbcDataSourceFactory implements ObjectFactory {
static
{
org
.
h2
.
Driver
.
load
();
traceSystem
=
new
TraceSystem
(
Constants
.
CLIENT_TRACE_DIRECTORY
+
"h2datasource"
+
Constants
.
SUFFIX_TRACE_FILE
);
traceSystem
=
new
TraceSystem
(
Constants
.
CLIENT_TRACE_DIRECTORY
+
"h2datasource"
+
Constants
.
SUFFIX_TRACE_FILE
,
false
);
traceSystem
.
setLevelFile
(
Constants
.
DATASOURCE_TRACE_LEVEL
);
}
...
...
h2/src/main/org/h2/message/TraceSystem.java
浏览文件 @
fbb95e9d
...
...
@@ -46,6 +46,7 @@ public class TraceSystem {
private
int
checkSize
;
private
boolean
closed
;
private
boolean
manualEnabling
=
true
;
private
boolean
writingErrorLogged
;
public
static
void
traceThrowable
(
Throwable
e
)
{
PrintWriter
writer
=
DriverManager
.
getLogWriter
();
...
...
@@ -58,11 +59,11 @@ public class TraceSystem {
this
.
manualEnabling
=
value
;
}
public
TraceSystem
(
String
fileName
)
{
public
TraceSystem
(
String
fileName
,
boolean
init
)
{
this
.
fileName
=
fileName
;
traces
=
new
SmallLRUCache
(
100
);
dateFormat
=
new
SimpleDateFormat
(
"MM-dd HH:mm:ss "
);
if
(
fileName
!=
null
)
{
if
(
fileName
!=
null
&&
init
)
{
try
{
openWriter
();
}
catch
(
Exception
e
)
{
...
...
@@ -185,6 +186,10 @@ public class TraceSystem {
}
private
void
logWritingError
(
Exception
e
)
{
if
(
writingErrorLogged
)
{
return
;
}
writingErrorLogged
=
true
;
// TODO translate trace messages
SQLException
se
=
Message
.
getSQLException
(
Message
.
LOG_FILE_ERROR_1
,
new
String
[]
{
fileName
},
e
);
// print this error only once
...
...
@@ -193,7 +198,7 @@ public class TraceSystem {
se
.
printStackTrace
();
}
private
boolean
openWriter
()
throws
IOException
{
private
boolean
openWriter
()
{
if
(
printWriter
==
null
)
{
try
{
FileUtils
.
createDirs
(
fileName
);
...
...
@@ -203,7 +208,8 @@ public class TraceSystem {
}
fileWriter
=
FileUtils
.
openFileWriter
(
fileName
,
true
);
printWriter
=
new
PrintWriter
(
fileWriter
,
true
);
}
catch
(
SQLException
e
)
{
}
catch
(
Exception
e
)
{
logWritingError
(
e
);
return
false
;
}
}
...
...
h2/src/main/org/h2/server/OdbcServer.java
浏览文件 @
fbb95e9d
...
...
@@ -12,6 +12,7 @@ import java.sql.SQLException;
import
java.util.ArrayList
;
import
java.util.HashSet
;
import
org.h2.message.TraceSystem
;
import
org.h2.util.MathUtils
;
import
org.h2.util.NetUtils
;
...
...
@@ -31,6 +32,7 @@ public class OdbcServer implements Service {
private
String
url
;
private
boolean
allowOthers
;
private
boolean
ifExists
;
private
Thread
listenerThread
;
boolean
getLog
()
{
return
log
;
...
...
@@ -88,7 +90,8 @@ public class OdbcServer implements Service {
}
public
void
listen
()
{
String
threadName
=
Thread
.
currentThread
().
getName
();
listenerThread
=
Thread
.
currentThread
();
String
threadName
=
listenerThread
.
getName
();
try
{
while
(!
stop
)
{
Socket
s
=
serverSocket
.
accept
();
...
...
@@ -124,6 +127,13 @@ public class OdbcServer implements Service {
}
serverSocket
=
null
;
}
if
(
listenerThread
!=
null
)
{
try
{
listenerThread
.
join
(
1000
);
}
catch
(
InterruptedException
e
)
{
TraceSystem
.
traceThrowable
(
e
);
}
}
}
// TODO server: using a boolean 'now' argument? a timeout?
ArrayList
list
=
new
ArrayList
(
running
);
...
...
h2/src/main/org/h2/server/TcpServer.java
浏览文件 @
fbb95e9d
...
...
@@ -44,6 +44,7 @@ public class TcpServer implements Service {
private
Connection
managementDb
;
private
String
managementPassword
=
""
;
private
static
HashMap
servers
=
new
HashMap
();
private
Thread
listenerThread
;
public
static
String
getManagementDbName
(
int
port
)
{
return
"mem:"
+
Constants
.
MANAGEMENT_DB_PREFIX
+
port
;
...
...
@@ -118,7 +119,8 @@ public class TcpServer implements Service {
}
public
void
listen
()
{
String
threadName
=
Thread
.
currentThread
().
getName
();
listenerThread
=
Thread
.
currentThread
();
String
threadName
=
listenerThread
.
getName
();
try
{
while
(!
stop
)
{
Socket
s
=
serverSocket
.
accept
();
...
...
@@ -163,6 +165,13 @@ public class TcpServer implements Service {
}
serverSocket
=
null
;
}
if
(
listenerThread
!=
null
)
{
try
{
listenerThread
.
join
(
1000
);
}
catch
(
InterruptedException
e
)
{
TraceSystem
.
traceThrowable
(
e
);
}
}
}
// TODO server: using a boolean 'now' argument? a timeout?
ArrayList
list
=
new
ArrayList
(
running
);
...
...
h2/src/main/org/h2/server/web/WebServer.java
浏览文件 @
fbb95e9d
...
...
@@ -88,6 +88,7 @@ public class WebServer implements Service {
private
ServerSocket
serverSocket
;
private
String
url
;
private
boolean
allowShutdown
;
private
Thread
listenerThread
;
byte
[]
getFile
(
String
file
)
throws
IOException
{
trace
(
"getFile <"
+
file
+
">"
);
...
...
@@ -202,6 +203,7 @@ public class WebServer implements Service {
}
public
void
listen
()
{
this
.
listenerThread
=
Thread
.
currentThread
();
try
{
while
(
serverSocket
!=
null
)
{
Socket
s
=
serverSocket
.
accept
();
...
...
@@ -233,6 +235,13 @@ public class WebServer implements Service {
// TODO log exception
}
serverSocket
=
null
;
if
(
listenerThread
!=
null
)
{
try
{
listenerThread
.
join
(
1000
);
}
catch
(
InterruptedException
e
)
{
TraceSystem
.
traceThrowable
(
e
);
}
}
}
void
trace
(
String
s
)
{
...
...
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
fbb95e9d
...
...
@@ -92,24 +92,9 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
long
time
=
System
.
currentTimeMillis
();
TestAll
test
=
new
TestAll
();
test
.
printSystem
();
/*
The database name must be at least 3 characters
jdbc:h2:te
traceSystem.setLevelFile(TraceSystem.ERROR);
because of temp file limitations, database names with less than 3 characters are not supported
add test case:
prepare: select * from (select * from (select * from dual) a) b;
select * from dual;
execute prepared
add test case:
try to create a view without access rights
try to create a view with a subquery without access right
make sure INDEX_LOOKUP_NEW = is true by default.
Test Console (batch, javaw, different platforms)
test with openoffice (metadata changes)
...
...
@@ -177,18 +162,16 @@ Please note that
support translated exceptions (translated, then english at the end, for Hibernate compatibility)
keep db open as long as there are PooledConnections
make static member variables final (this helps find forgotten initializers)
Merge more from diff.zip (Pavel Ganelin)
keep db open (independent of DB_CLOSE_DELAY) while a PooledConnections exists.
*/
/*
complete recursive views:
drop all objects;
create table parent(id int primary key, parent int);
insert into parent values(1, null), (2, 1), (3, 1);
...
...
@@ -215,13 +198,6 @@ drop table parent;
*/
/*
create local temporary table abc(id varchar) on commit drop;
insert into abc select * from dual;
create local temporary table abc(id varchar) on commit drop;
insert into abc select * from dual where 1=0;
create local temporary table abc(id varchar) on commit drop;
insert into abc select * from dual;
drop table abc;
DROP TABLE TEST;
CREATE TABLE TEST(ID INT);
...
...
h2/src/test/org/h2/test/TestBase.java
浏览文件 @
fbb95e9d
...
...
@@ -222,7 +222,7 @@ public abstract class TestBase {
System
.
out
.
println
(
"ERROR: "
+
s
+
" "
+
e
.
toString
()
+
" ------------------------------"
);
e
.
printStackTrace
();
try
{
TraceSystem
ts
=
new
TraceSystem
(
null
);
TraceSystem
ts
=
new
TraceSystem
(
null
,
false
);
FileLock
lock
=
new
FileLock
(
ts
,
1000
);
lock
.
lock
(
"error.lock"
,
false
);
FileWriter
fw
=
new
FileWriter
(
"ERROR.txt"
,
true
);
...
...
h2/src/test/org/h2/test/unit/TestFileLock.java
浏览文件 @
fbb95e9d
...
...
@@ -71,7 +71,7 @@ public class TestFileLock extends TestBase implements Runnable {
public
void
run
()
{
while
(!
stop
)
{
FileLock
lock
=
new
FileLock
(
new
TraceSystem
(
null
),
100
);
FileLock
lock
=
new
FileLock
(
new
TraceSystem
(
null
,
false
),
100
);
try
{
lock
.
lock
(
FILE
,
allowSockets
);
base
.
trace
(
lock
+
" locked"
);
...
...
h2/src/tools/org/h2/tools/doc/dictionary.txt
浏览文件 @
fbb95e9d
...
...
@@ -461,6 +461,7 @@ headless
polish javaee resp xsi instances tomek realm xsd appended auth polski
signsoft intellibo jdo intelli middleware ute war sends snippet
gallery ord javaw weblica ltarget
initializers crashes openoffice member forgotten
### check those again:
populate slowly xacon inser maxbqualsize counter regards attaching official xatest
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论