Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
5dc54122
提交
5dc54122
authored
6 年前
作者:
Andrei Tokar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test case added
上级
3b946e53
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
50 行增加
和
0 行删除
+50
-0
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+2
-0
TestAnalyzeTableTx.java
h2/src/test/org/h2/test/db/TestAnalyzeTableTx.java
+48
-0
没有找到文件。
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
5dc54122
...
...
@@ -21,6 +21,7 @@ import org.h2.test.auth.TestAuthentication;
import
org.h2.test.bench.TestPerformance
;
import
org.h2.test.db.TestAlter
;
import
org.h2.test.db.TestAlterSchemaRename
;
import
org.h2.test.db.TestAnalyzeTableTx
;
import
org.h2.test.db.TestAutoRecompile
;
import
org.h2.test.db.TestBackup
;
import
org.h2.test.db.TestBigDb
;
...
...
@@ -845,6 +846,7 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
addTest
(
new
TestMvccMultiThreaded
());
addTest
(
new
TestMvccMultiThreaded2
());
addTest
(
new
TestRowLocks
());
addTest
(
new
TestAnalyzeTableTx
());
// synth
addTest
(
new
TestBtreeIndex
());
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/db/TestAnalyzeTableTx.java
0 → 100644
浏览文件 @
5dc54122
/*
* Copyright 2004-2017 H2 Group. Multiple-Licensed under the MPL 2.0,
* and the EPL 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package
org
.
h2
.
test
.
db
;
import
org.h2.test.TestBase
;
import
org.h2.test.TestDb
;
import
java.sql.Connection
;
import
java.sql.ResultSet
;
import
java.sql.Statement
;
public
class
TestAnalyzeTableTx
extends
TestDb
{
static
final
int
C
=
100_000
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
...
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
@Override
public
void
test
()
throws
Exception
{
deleteDb
(
getTestName
());
Connection
shared
=
getConnection
(
getTestName
());
Statement
statement
=
shared
.
createStatement
();
statement
.
executeUpdate
(
"DROP TABLE IF EXISTS TEST"
);
statement
.
executeUpdate
(
"CREATE TABLE TEST(ID INT PRIMARY KEY)"
);
Connection
[]
connections
=
new
Connection
[
C
];
for
(
int
i
=
0
;
i
<
C
;
i
++)
{
Connection
c
=
getConnection
(
getTestName
());
c
.
createStatement
().
executeUpdate
(
"INSERT INTO TEST VALUES ("
+
i
+
')'
);
connections
[
i
]
=
c
;
}
try
(
ResultSet
rs
=
statement
.
executeQuery
(
"SELECT * FROM TEST"
))
{
for
(
int
i
=
0
;
i
<
C
;
i
++)
{
if
(!
rs
.
next
())
throw
new
Exception
(
"next"
);
if
(
rs
.
getInt
(
1
)
!=
i
)
throw
new
Exception
(
Integer
.
toString
(
i
));
}
}
}
}
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论