Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
b6405241
提交
b6405241
authored
10月 09, 2008
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
cc172420
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
102 行增加
和
33 行删除
+102
-33
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+7
-19
TestAutoReconnect.java
h2/src/test/org/h2/test/server/TestAutoReconnect.java
+71
-3
test-1.0.txt
h2/src/test/org/h2/test/test-1.0.txt
+1
-1
test-1.1.txt
h2/src/test/org/h2/test/test-1.1.txt
+1
-1
H2Platform.java.txt
.../toplink/essentials/platform/database/H2Platform.java.txt
+8
-8
Build.java
h2/src/tools/org/h2/build/Build.java
+11
-0
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+3
-1
没有找到文件。
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
b6405241
...
@@ -60,6 +60,7 @@ import org.h2.test.jdbc.TestBatchUpdates;
...
@@ -60,6 +60,7 @@ import org.h2.test.jdbc.TestBatchUpdates;
import
org.h2.test.jdbc.TestCallableStatement
;
import
org.h2.test.jdbc.TestCallableStatement
;
import
org.h2.test.jdbc.TestCancel
;
import
org.h2.test.jdbc.TestCancel
;
import
org.h2.test.jdbc.TestDatabaseEventListener
;
import
org.h2.test.jdbc.TestDatabaseEventListener
;
import
org.h2.test.jdbc.TestDriver
;
import
org.h2.test.jdbc.TestManyJdbcObjects
;
import
org.h2.test.jdbc.TestManyJdbcObjects
;
import
org.h2.test.jdbc.TestMetaData
;
import
org.h2.test.jdbc.TestMetaData
;
import
org.h2.test.jdbc.TestNativeSQL
;
import
org.h2.test.jdbc.TestNativeSQL
;
...
@@ -276,37 +277,27 @@ java org.h2.test.TestAll timer
...
@@ -276,37 +277,27 @@ java org.h2.test.TestAll timer
/*
/*
download/local_temp_index.txt
test with 1.0
system_temp_lob.db leaks unencrypted data, even when I use
merge join test case
encrypted SCRIPT/RUNSCRIPT with an encrypted database.
Event on Re-Connect (DatabaseEventListener)
extend server protocol to keep stuff on client
(temporary linked tables, variables; identity)
osgi (derby, hsqldb)
osgi (derby, hsqldb)
support 'build test'
auto_reconnect
auto_reconnect
implemented:
implemented:
- auto_server includes auto_reconnect
- auto_server includes auto_reconnect
- works with server mode
- works with server mode
- works with auto_server mode
- works with auto_server mode
- keep temporary linked tables, variables on client
- statements
- statements
- prepared statements
- prepared statements
- small result sets (up to fetch size)
- small result sets (up to fetch size)
- throws an error when autocommit is false
- throws an error when autocommit is false
- an error is thrown when the connection is lost
- an error is thrown when the connection is lost
while looping over large result sets (larger than fetch size)
while looping over large result sets (larger than fetch size)
untested:
not implemented / not tested
- batch updates
- batch updates
- throw error in cluster mode
- ignored in embedded mode
- ignored in embedded mode
not implemented / not tested
- keep temporary linked tables, variables on client
- keep temporary tables (including data) on client
- keep temporary tables (including data) on client
- keep identity, getGeneratedKeys on client
- keep identity, getGeneratedKeys on client
- throw error when in cluster mode
- throw error when in cluster mode
...
@@ -314,8 +305,6 @@ not implemented / not tested
...
@@ -314,8 +305,6 @@ not implemented / not tested
Feature requests:
Feature requests:
SCOPE_IDENTITY
SCOPE_IDENTITY
test with system property h2.aliasColumnName.
document url parameter auto_server
document url parameter auto_server
document url parameter auto_reconnect
document url parameter auto_reconnect
document url parameter open_new
document url parameter open_new
...
@@ -352,8 +341,6 @@ optimize where x not in (select):
...
@@ -352,8 +341,6 @@ optimize where x not in (select):
SELECT c FROM color LEFT OUTER JOIN (SELECT c FROM TABLE(c
SELECT c FROM color LEFT OUTER JOIN (SELECT c FROM TABLE(c
VARCHAR= ?)) p ON color.c = p.c WHERE p.c IS NULL;
VARCHAR= ?)) p ON color.c = p.c WHERE p.c IS NULL;
Add where required // TODO: change in version 1.1
http://www.w3schools.com/sql/
http://www.w3schools.com/sql/
*/
*/
...
@@ -550,6 +537,7 @@ http://www.w3schools.com/sql/
...
@@ -550,6 +537,7 @@ http://www.w3schools.com/sql/
new
TestCallableStatement
().
runTest
(
this
);
new
TestCallableStatement
().
runTest
(
this
);
new
TestCancel
().
runTest
(
this
);
new
TestCancel
().
runTest
(
this
);
new
TestDatabaseEventListener
().
runTest
(
this
);
new
TestDatabaseEventListener
().
runTest
(
this
);
new
TestDriver
().
runTest
(
this
);
new
TestManyJdbcObjects
().
runTest
(
this
);
new
TestManyJdbcObjects
().
runTest
(
this
);
new
TestMetaData
().
runTest
(
this
);
new
TestMetaData
().
runTest
(
this
);
new
TestNativeSQL
().
runTest
(
this
);
new
TestNativeSQL
().
runTest
(
this
);
...
...
h2/src/test/org/h2/test/server/TestAutoReconnect.java
浏览文件 @
b6405241
...
@@ -7,24 +7,29 @@
...
@@ -7,24 +7,29 @@
package
org
.
h2
.
test
.
server
;
package
org
.
h2
.
test
.
server
;
import
java.sql.Connection
;
import
java.sql.Connection
;
import
java.sql.Driver
;
import
java.sql.DriverManager
;
import
java.sql.DriverManager
;
import
java.sql.PreparedStatement
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.sql.Statement
;
import
java.util.Properties
;
import
org.h2.api.DatabaseEventListener
;
import
org.h2.test.TestBase
;
import
org.h2.test.TestBase
;
import
org.h2.tools.Server
;
import
org.h2.tools.Server
;
/**
/**
* Tests automatic embedded/server mode.
* Tests automatic embedded/server mode.
*/
*/
public
class
TestAutoReconnect
extends
TestBase
{
public
class
TestAutoReconnect
extends
TestBase
implements
DatabaseEventListener
{
private
String
url
;
private
String
url
;
private
boolean
autoServer
;
private
boolean
autoServer
;
private
Server
server
;
private
Server
server
;
private
Connection
connServer
;
private
Connection
connServer
;
private
Connection
conn
;
private
String
state
;
/**
/**
* Run just this test.
* Run just this test.
...
@@ -66,9 +71,41 @@ public class TestAutoReconnect extends TestBase {
...
@@ -66,9 +71,41 @@ public class TestAutoReconnect extends TestBase {
url
=
"jdbc:h2:tcp://localhost:8181/"
+
baseDir
+
"/autoReconnect;"
+
url
=
"jdbc:h2:tcp://localhost:8181/"
+
baseDir
+
"/autoReconnect;"
+
"FILE_LOCK=SOCKET;AUTO_RECONNECT=TRUE"
;
"FILE_LOCK=SOCKET;AUTO_RECONNECT=TRUE"
;
}
}
Connection
conn
=
DriverManager
.
getConnection
(
url
);
restart
();
// test the database event listener
conn
=
DriverManager
.
getConnection
(
url
+
";DATABASE_EVENT_LISTENER='"
+
getClass
().
getName
()
+
"'"
);
conn
.
close
();
// test the database event listener object
Properties
prop
=
new
Properties
();
state
=
null
;
Driver
postgreDriver
=
null
;
try
{
postgreDriver
=
DriverManager
.
getDriver
(
"jdbc:postgresql:test"
);
if
(
postgreDriver
!=
null
)
{
DriverManager
.
deregisterDriver
(
postgreDriver
);
}
}
catch
(
Exception
e
)
{
// ignore
}
prop
.
put
(
"DATABASE_EVENT_LISTENER_OBJECT"
,
this
);
conn
=
DriverManager
.
getConnection
(
url
,
prop
);
assertEquals
(
null
,
state
);
Statement
stat
=
conn
.
createStatement
();
Statement
stat
=
conn
.
createStatement
();
stat
.
execute
(
"DROP TABLE IF EXISTS TEST"
);
restart
();
// the table is created in the database event listener
stat
.
execute
(
"SELECT * FROM TEST"
);
assertEquals
(
"state "
+
DatabaseEventListener
.
STATE_RECONNECTED
,
state
);
conn
.
close
();
if
(
postgreDriver
!=
null
)
{
DriverManager
.
registerDriver
(
postgreDriver
);
}
conn
=
DriverManager
.
getConnection
(
url
);
restart
();
stat
=
conn
.
createStatement
();
restart
();
restart
();
stat
.
execute
(
"create table test(id identity, name varchar)"
);
stat
.
execute
(
"create table test(id identity, name varchar)"
);
restart
();
restart
();
...
@@ -146,4 +183,35 @@ public class TestAutoReconnect extends TestBase {
...
@@ -146,4 +183,35 @@ public class TestAutoReconnect extends TestBase {
}
}
}
}
public
void
closingDatabase
()
{
// ignore
}
public
void
diskSpaceIsLow
(
long
stillAvailable
)
throws
SQLException
{
// ignore
}
public
void
exceptionThrown
(
SQLException
e
,
String
sql
)
{
// ignore
}
public
void
init
(
String
url
)
{
state
=
"init"
;
}
public
void
opened
()
{
state
=
"opened"
;
}
public
void
setProgress
(
int
state
,
String
name
,
int
x
,
int
max
)
{
this
.
state
=
"state "
+
state
;
if
(
state
==
DatabaseEventListener
.
STATE_RECONNECTED
)
{
try
{
conn
.
createStatement
().
execute
(
"CREATE LOCAL TEMPORARY TABLE TEST(ID INT)"
);
}
catch
(
SQLException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
}
}
h2/src/test/org/h2/test/test-1.0.txt
浏览文件 @
b6405241
...
@@ -3383,7 +3383,7 @@ script NOPASSWORDS NOSETTINGS drop;
...
@@ -3383,7 +3383,7 @@ script NOPASSWORDS NOSETTINGS drop;
> CREATE FORCE TRIGGER S.TEST_TRIGGER BEFORE INSERT ON S.TEST QUEUE 1024 CALL "org.h2.test.db.TestTriggersConstraints";
> CREATE FORCE TRIGGER S.TEST_TRIGGER BEFORE INSERT ON S.TEST QUEUE 1024 CALL "org.h2.test.db.TestTriggersConstraints";
> CREATE INDEX S.INDEX_ID ON S.TEST(ID);
> CREATE INDEX S.INDEX_ID ON S.TEST(ID);
> CREATE MEMORY TABLE S.TEST( ID INT );
> CREATE MEMORY TABLE S.TEST( ID INT );
> CREATE SCHEMA S AUTHORIZATION SA;
> CREATE SCHEMA
IF NOT EXISTS
S AUTHORIZATION SA;
> CREATE SEQUENCE S.SEQ START WITH 10;
> CREATE SEQUENCE S.SEQ START WITH 10;
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> DROP SEQUENCE IF EXISTS S.SEQ;
> DROP SEQUENCE IF EXISTS S.SEQ;
...
...
h2/src/test/org/h2/test/test-1.1.txt
浏览文件 @
b6405241
...
@@ -3383,7 +3383,7 @@ script NOPASSWORDS NOSETTINGS drop;
...
@@ -3383,7 +3383,7 @@ script NOPASSWORDS NOSETTINGS drop;
> CREATE FORCE TRIGGER S.TEST_TRIGGER BEFORE INSERT ON S.TEST QUEUE 1024 CALL "org.h2.test.db.TestTriggersConstraints";
> CREATE FORCE TRIGGER S.TEST_TRIGGER BEFORE INSERT ON S.TEST QUEUE 1024 CALL "org.h2.test.db.TestTriggersConstraints";
> CREATE INDEX S.INDEX_ID ON S.TEST(ID);
> CREATE INDEX S.INDEX_ID ON S.TEST(ID);
> CREATE MEMORY TABLE S.TEST( ID INT );
> CREATE MEMORY TABLE S.TEST( ID INT );
> CREATE SCHEMA S AUTHORIZATION SA;
> CREATE SCHEMA
IF NOT EXISTS
S AUTHORIZATION SA;
> CREATE SEQUENCE S.SEQ START WITH 10;
> CREATE SEQUENCE S.SEQ START WITH 10;
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> DROP SEQUENCE IF EXISTS S.SEQ;
> DROP SEQUENCE IF EXISTS S.SEQ;
...
...
h2/src/tools/oracle/toplink/essentials/platform/database/H2Platform.java.txt
浏览文件 @
b6405241
h2/src/tools/org/h2/build/Build.java
浏览文件 @
b6405241
...
@@ -174,6 +174,9 @@ public class Build extends BuildBase {
...
@@ -174,6 +174,9 @@ public class Build extends BuildBase {
download
(
"ext/slf4j-api-1.5.0.jar"
,
download
(
"ext/slf4j-api-1.5.0.jar"
,
"http://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.5.0/slf4j-api-1.5.0.jar"
,
"http://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.5.0/slf4j-api-1.5.0.jar"
,
"b2df265d02350ecfe87b6c1773c7c4fab2b33505"
);
"b2df265d02350ecfe87b6c1773c7c4fab2b33505"
);
download
(
"ext/org.osgi.core-1.2.0.jar"
,
"http://repo1.maven.org/maven2/org/apache/felix/org.osgi.core/1.2.0/org.osgi.core-1.2.0.jar"
,
"3006beb1ca6a83449def6127dad3c060148a0209"
);
}
}
private
String
getVersion
()
{
private
String
getVersion
()
{
...
@@ -410,6 +413,14 @@ public class Build extends BuildBase {
...
@@ -410,6 +413,14 @@ public class Build extends BuildBase {
java
(
"org.h2.build.doc.SpellChecker"
,
null
);
java
(
"org.h2.build.doc.SpellChecker"
,
null
);
}
}
/**
* Compile and run all tests.
*/
public
void
test
()
{
compile
();
java
(
"org.h2.test.TestAll"
,
null
);
}
/**
/**
* Build the h2console.war file.
* Build the h2console.war file.
*/
*/
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
b6405241
...
@@ -562,4 +562,6 @@ monitoring razuna asset drag pekar devx dmitry fragments onmouseup nav
...
@@ -562,4 +562,6 @@ monitoring razuna asset drag pekar devx dmitry fragments onmouseup nav
onmousedown olap valign army blitz backgammon knife abbreviate berger dhuse
onmousedown olap valign army blitz backgammon knife abbreviate berger dhuse
strictly greg germany abbreviates frontends cleversafe payload cloneable
strictly greg germany abbreviates frontends cleversafe payload cloneable
scripting jaks reconnected serverlist safes somewhere anzo war contacts helpful
scripting jaks reconnected serverlist safes somewhere anzo war contacts helpful
implies looping cataloguing mapper frees javaw
implies looping cataloguing mapper frees javaw geographic borges grass
somehow marcio groove roy gis matt targeted brazil dig opt deregister
classname recaptcha
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论