Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
d2b963d2
提交
d2b963d2
authored
11月 20, 2012
作者:
noelgrandin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove unused parameter "quiet" in Restore#execute
上级
fb1e92ab
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
9 行增加
和
10 行删除
+9
-10
Restore.java
h2/src/main/org/h2/tools/Restore.java
+2
-3
TestBackup.java
h2/src/test/org/h2/test/db/TestBackup.java
+4
-4
TestOpenClose.java
h2/src/test/org/h2/test/db/TestOpenClose.java
+1
-1
TestCrashAPI.java
h2/src/test/org/h2/test/synth/TestCrashAPI.java
+1
-1
TestPageStoreCoverage.java
h2/src/test/org/h2/test/unit/TestPageStoreCoverage.java
+1
-1
没有找到文件。
h2/src/main/org/h2/tools/Restore.java
浏览文件 @
d2b963d2
...
@@ -69,7 +69,7 @@ public class Restore extends Tool {
...
@@ -69,7 +69,7 @@ public class Restore extends Tool {
showUsageAndThrowUnsupportedOption
(
arg
);
showUsageAndThrowUnsupportedOption
(
arg
);
}
}
}
}
execute
(
zipFileName
,
dir
,
db
,
false
);
execute
(
zipFileName
,
dir
,
db
);
}
}
private
static
String
getOriginalDbName
(
String
fileName
,
String
db
)
throws
IOException
{
private
static
String
getOriginalDbName
(
String
fileName
,
String
db
)
throws
IOException
{
...
@@ -132,10 +132,9 @@ public class Restore extends Tool {
...
@@ -132,10 +132,9 @@ public class Restore extends Tool {
* @param zipFileName the name of the backup file
* @param zipFileName the name of the backup file
* @param directory the directory name
* @param directory the directory name
* @param db the database name (null for all databases)
* @param db the database name (null for all databases)
* @param quiet don't print progress information
* @throws DbException if there is an IOException
* @throws DbException if there is an IOException
*/
*/
public
static
void
execute
(
String
zipFileName
,
String
directory
,
String
db
,
boolean
quiet
)
{
public
static
void
execute
(
String
zipFileName
,
String
directory
,
String
db
)
{
InputStream
in
=
null
;
InputStream
in
=
null
;
try
{
try
{
if
(!
FileUtils
.
exists
(
zipFileName
))
{
if
(!
FileUtils
.
exists
(
zipFileName
))
{
...
...
h2/src/test/org/h2/test/db/TestBackup.java
浏览文件 @
d2b963d2
...
@@ -83,7 +83,7 @@ public class TestBackup extends TestBase {
...
@@ -83,7 +83,7 @@ public class TestBackup extends TestBase {
updateEnd
.
set
(
System
.
currentTimeMillis
()
+
2000
);
updateEnd
.
set
(
System
.
currentTimeMillis
()
+
2000
);
stat2
.
execute
(
"backup to '"
+
getBaseDir
()+
"/backup.zip'"
);
stat2
.
execute
(
"backup to '"
+
getBaseDir
()+
"/backup.zip'"
);
stat2
.
execute
(
"checkpoint"
);
stat2
.
execute
(
"checkpoint"
);
Restore
.
execute
(
getBaseDir
()
+
"/backup.zip"
,
getBaseDir
()
+
"/t2"
,
"backup"
,
true
);
Restore
.
execute
(
getBaseDir
()
+
"/backup.zip"
,
getBaseDir
()
+
"/t2"
,
"backup"
);
Connection
conn3
;
Connection
conn3
;
conn3
=
getConnection
(
"t2/backup"
);
conn3
=
getConnection
(
"t2/backup"
);
Statement
stat3
=
conn3
.
createStatement
();
Statement
stat3
=
conn3
.
createStatement
();
...
@@ -142,7 +142,7 @@ public class TestBackup extends TestBase {
...
@@ -142,7 +142,7 @@ public class TestBackup extends TestBase {
conn
.
close
();
conn
.
close
();
Backup
.
execute
(
getBaseDir
()
+
"/backup.zip"
,
getBaseDir
(),
"backup"
,
true
);
Backup
.
execute
(
getBaseDir
()
+
"/backup.zip"
,
getBaseDir
(),
"backup"
,
true
);
deleteDb
(
"backup"
);
deleteDb
(
"backup"
);
Restore
.
execute
(
getBaseDir
()
+
"/backup.zip"
,
getBaseDir
(),
"backup"
,
true
);
Restore
.
execute
(
getBaseDir
()
+
"/backup.zip"
,
getBaseDir
(),
"backup"
);
}
}
private
void
testBackupRestoreLobStatement
()
throws
SQLException
{
private
void
testBackupRestoreLobStatement
()
throws
SQLException
{
...
@@ -152,7 +152,7 @@ public class TestBackup extends TestBase {
...
@@ -152,7 +152,7 @@ public class TestBackup extends TestBase {
conn
.
createStatement
().
execute
(
"backup to '"
+
getBaseDir
()
+
"/backup.zip"
+
"'"
);
conn
.
createStatement
().
execute
(
"backup to '"
+
getBaseDir
()
+
"/backup.zip"
+
"'"
);
conn
.
close
();
conn
.
close
();
deleteDb
(
"backup"
);
deleteDb
(
"backup"
);
Restore
.
execute
(
getBaseDir
()
+
"/backup.zip"
,
getBaseDir
(),
"backup"
,
true
);
Restore
.
execute
(
getBaseDir
()
+
"/backup.zip"
,
getBaseDir
(),
"backup"
);
}
}
private
void
testBackup
()
throws
SQLException
{
private
void
testBackup
()
throws
SQLException
{
...
@@ -177,7 +177,7 @@ public class TestBackup extends TestBase {
...
@@ -177,7 +177,7 @@ public class TestBackup extends TestBase {
conn2
.
rollback
();
conn2
.
rollback
();
assertEqualDatabases
(
stat1
,
stat2
);
assertEqualDatabases
(
stat1
,
stat2
);
Restore
.
execute
(
getBaseDir
()
+
"/backup.zip"
,
getBaseDir
(),
"restored"
,
true
);
Restore
.
execute
(
getBaseDir
()
+
"/backup.zip"
,
getBaseDir
(),
"restored"
);
conn3
=
getConnection
(
"restored"
);
conn3
=
getConnection
(
"restored"
);
stat3
=
conn3
.
createStatement
();
stat3
=
conn3
.
createStatement
();
assertEqualDatabases
(
stat1
,
stat3
);
assertEqualDatabases
(
stat1
,
stat3
);
...
...
h2/src/test/org/h2/test/db/TestOpenClose.java
浏览文件 @
d2b963d2
...
@@ -108,7 +108,7 @@ public class TestOpenClose extends TestBase implements DatabaseEventListener {
...
@@ -108,7 +108,7 @@ public class TestOpenClose extends TestBase implements DatabaseEventListener {
stat
.
execute
(
"BACKUP TO '"
+
getBaseDir
()
+
"/test.zip'"
);
stat
.
execute
(
"BACKUP TO '"
+
getBaseDir
()
+
"/test.zip'"
);
conn
.
close
();
conn
.
close
();
deleteDb
(
"openClose"
);
deleteDb
(
"openClose"
);
Restore
.
execute
(
getBaseDir
()
+
"/test.zip"
,
getBaseDir
(),
null
,
true
);
Restore
.
execute
(
getBaseDir
()
+
"/test.zip"
,
getBaseDir
(),
null
);
conn
=
DriverManager
.
getConnection
(
url
,
"sa"
,
"abc def"
);
conn
=
DriverManager
.
getConnection
(
url
,
"sa"
,
"abc def"
);
stat
=
conn
.
createStatement
();
stat
=
conn
.
createStatement
();
ResultSet
rs
=
stat
.
executeQuery
(
"SELECT * FROM TEST"
);
ResultSet
rs
=
stat
.
executeQuery
(
"SELECT * FROM TEST"
);
...
...
h2/src/test/org/h2/test/synth/TestCrashAPI.java
浏览文件 @
d2b963d2
...
@@ -121,7 +121,7 @@ public class TestCrashAPI extends TestBase implements Runnable {
...
@@ -121,7 +121,7 @@ public class TestCrashAPI extends TestBase implements Runnable {
}
}
DeleteDbFiles
.
execute
(
"data"
,
null
,
true
);
DeleteDbFiles
.
execute
(
"data"
,
null
,
true
);
try
{
try
{
Restore
.
execute
(
f
.
getAbsolutePath
(),
"data"
,
null
,
true
);
Restore
.
execute
(
f
.
getAbsolutePath
(),
"data"
,
null
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
f
.
getName
()
+
" restore error "
+
e
);
System
.
out
.
println
(
f
.
getName
()
+
" restore error "
+
e
);
// ignore
// ignore
...
...
h2/src/test/org/h2/test/unit/TestPageStoreCoverage.java
浏览文件 @
d2b963d2
...
@@ -208,7 +208,7 @@ public class TestPageStoreCoverage extends TestBase {
...
@@ -208,7 +208,7 @@ public class TestPageStoreCoverage extends TestBase {
stat
.
execute
(
"delete from test where id > 5"
);
stat
.
execute
(
"delete from test where id > 5"
);
stat
.
execute
(
"backup to '"
+
getBaseDir
()
+
"/backup.zip'"
);
stat
.
execute
(
"backup to '"
+
getBaseDir
()
+
"/backup.zip'"
);
conn
.
rollback
();
conn
.
rollback
();
Restore
.
execute
(
getBaseDir
()
+
"/backup.zip"
,
getBaseDir
(),
"pageStore2"
,
true
);
Restore
.
execute
(
getBaseDir
()
+
"/backup.zip"
,
getBaseDir
(),
"pageStore2"
);
Connection
conn2
;
Connection
conn2
;
conn2
=
getConnection
(
"pageStore2"
);
conn2
=
getConnection
(
"pageStore2"
);
Statement
stat2
=
conn2
.
createStatement
();
Statement
stat2
=
conn2
.
createStatement
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论