Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
f2ee4267
提交
f2ee4267
authored
12月 18, 2008
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
javadocs
上级
679466cf
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
84 行增加
和
0 行删除
+84
-0
Db.java
h2/src/test/org/h2/test/db/Db.java
+6
-0
TestFunctionOverload.java
h2/src/test/org/h2/test/db/TestFunctionOverload.java
+25
-0
TestFunctions.java
h2/src/test/org/h2/test/db/TestFunctions.java
+42
-0
TestOptimizations.java
h2/src/test/org/h2/test/db/TestOptimizations.java
+2
-0
TestRights.java
h2/src/test/org/h2/test/db/TestRights.java
+9
-0
没有找到文件。
h2/src/test/org/h2/test/db/Db.java
浏览文件 @
f2ee4267
...
@@ -159,6 +159,7 @@ public class Db {
...
@@ -159,6 +159,7 @@ public class Db {
* Set the value of the current parameter.
* Set the value of the current parameter.
*
*
* @param x the value
* @param x the value
* @return itself
*/
*/
public
Prepared
set
(
int
x
)
{
public
Prepared
set
(
int
x
)
{
try
{
try
{
...
@@ -173,6 +174,7 @@ public class Db {
...
@@ -173,6 +174,7 @@ public class Db {
* Set the value of the current parameter.
* Set the value of the current parameter.
*
*
* @param x the value
* @param x the value
* @return itself
*/
*/
public
Prepared
set
(
String
x
)
{
public
Prepared
set
(
String
x
)
{
try
{
try
{
...
@@ -187,6 +189,7 @@ public class Db {
...
@@ -187,6 +189,7 @@ public class Db {
* Set the value of the current parameter.
* Set the value of the current parameter.
*
*
* @param x the value
* @param x the value
* @return itself
*/
*/
public
Prepared
set
(
byte
[]
x
)
{
public
Prepared
set
(
byte
[]
x
)
{
try
{
try
{
...
@@ -201,6 +204,7 @@ public class Db {
...
@@ -201,6 +204,7 @@ public class Db {
* Set the value of the current parameter.
* Set the value of the current parameter.
*
*
* @param x the value
* @param x the value
* @return itself
*/
*/
public
Prepared
set
(
InputStream
x
)
{
public
Prepared
set
(
InputStream
x
)
{
try
{
try
{
...
@@ -224,6 +228,8 @@ public class Db {
...
@@ -224,6 +228,8 @@ public class Db {
/**
/**
* Execute the prepared query.
* Execute the prepared query.
*
* @return the result list
*/
*/
public
List
query
()
{
public
List
query
()
{
try
{
try
{
...
...
h2/src/test/org/h2/test/db/TestFunctionOverload.java
浏览文件 @
f2ee4267
...
@@ -132,6 +132,8 @@ public class TestFunctionOverload extends TestBase {
...
@@ -132,6 +132,8 @@ public class TestFunctionOverload extends TestBase {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
* @return 0
*/
*/
public
static
int
overload0
()
{
public
static
int
overload0
()
{
return
0
;
return
0
;
...
@@ -139,6 +141,9 @@ public class TestFunctionOverload extends TestBase {
...
@@ -139,6 +141,9 @@ public class TestFunctionOverload extends TestBase {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
* @param one the value
* @return the value
*/
*/
public
static
int
overload1or2
(
int
one
)
{
public
static
int
overload1or2
(
int
one
)
{
return
one
;
return
one
;
...
@@ -146,6 +151,10 @@ public class TestFunctionOverload extends TestBase {
...
@@ -146,6 +151,10 @@ public class TestFunctionOverload extends TestBase {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
* @param one the first value
* @param two the second value
* @return the sum of both
*/
*/
public
static
int
overload1or2
(
int
one
,
int
two
)
{
public
static
int
overload1or2
(
int
one
,
int
two
)
{
return
one
+
two
;
return
one
+
two
;
...
@@ -153,6 +162,10 @@ public class TestFunctionOverload extends TestBase {
...
@@ -153,6 +162,10 @@ public class TestFunctionOverload extends TestBase {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
* @param conn the connection
* @param one the value
* @return the value
*/
*/
public
static
int
overload1or2WithConn
(
Connection
conn
,
int
one
)
throws
SQLException
{
public
static
int
overload1or2WithConn
(
Connection
conn
,
int
one
)
throws
SQLException
{
conn
.
createStatement
().
executeQuery
(
"select 1 from dual"
);
conn
.
createStatement
().
executeQuery
(
"select 1 from dual"
);
...
@@ -161,6 +174,10 @@ public class TestFunctionOverload extends TestBase {
...
@@ -161,6 +174,10 @@ public class TestFunctionOverload extends TestBase {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
* @param one the first value
* @param two the second value
* @return the sum of both
*/
*/
public
static
int
overload1or2WithConn
(
int
one
,
int
two
)
{
public
static
int
overload1or2WithConn
(
int
one
,
int
two
)
{
return
one
+
two
;
return
one
+
two
;
...
@@ -168,6 +185,10 @@ public class TestFunctionOverload extends TestBase {
...
@@ -168,6 +185,10 @@ public class TestFunctionOverload extends TestBase {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
* @param one the first value
* @param two the second value
* @return the sum of both
*/
*/
public
static
int
overloadError
(
int
one
,
int
two
)
{
public
static
int
overloadError
(
int
one
,
int
two
)
{
return
one
+
two
;
return
one
+
two
;
...
@@ -175,6 +196,10 @@ public class TestFunctionOverload extends TestBase {
...
@@ -175,6 +196,10 @@ public class TestFunctionOverload extends TestBase {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
* @param one the first value
* @param two the second value
* @return the sum of both
*/
*/
public
static
int
overloadError
(
double
one
,
double
two
)
{
public
static
int
overloadError
(
double
one
,
double
two
)
{
return
(
int
)
(
one
+
two
);
return
(
int
)
(
one
+
two
);
...
...
h2/src/test/org/h2/test/db/TestFunctions.java
浏览文件 @
f2ee4267
...
@@ -337,6 +337,9 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -337,6 +337,9 @@ public class TestFunctions extends TestBase implements AggregateFunction {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
* @param value the blob
* @return the input stream
*/
*/
public
static
BufferedInputStream
blob2stream
(
Blob
value
)
throws
SQLException
{
public
static
BufferedInputStream
blob2stream
(
Blob
value
)
throws
SQLException
{
if
(
value
==
null
)
{
if
(
value
==
null
)
{
...
@@ -348,6 +351,9 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -348,6 +351,9 @@ public class TestFunctions extends TestBase implements AggregateFunction {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
* @param value the input stream
* @return the buffered input stream
*/
*/
public
static
BufferedInputStream
stream2stream
(
InputStream
value
)
{
public
static
BufferedInputStream
stream2stream
(
InputStream
value
)
{
if
(
value
==
null
)
{
if
(
value
==
null
)
{
...
@@ -359,6 +365,11 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -359,6 +365,11 @@ public class TestFunctions extends TestBase implements AggregateFunction {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
* @param conn the connection
* @param id the test id
* @param name the text
* @return the count
*/
*/
public
static
int
addRow
(
Connection
conn
,
int
id
,
String
name
)
throws
SQLException
{
public
static
int
addRow
(
Connection
conn
,
int
id
,
String
name
)
throws
SQLException
{
conn
.
createStatement
().
execute
(
"INSERT INTO TEST VALUES("
+
id
+
", '"
+
name
+
"')"
);
conn
.
createStatement
().
execute
(
"INSERT INTO TEST VALUES("
+
id
+
", '"
+
name
+
"')"
);
...
@@ -371,6 +382,10 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -371,6 +382,10 @@ public class TestFunctions extends TestBase implements AggregateFunction {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
* @param conn the connection
* @param sql the SQL statement
* @return the result set
*/
*/
public
static
ResultSet
select
(
Connection
conn
,
String
sql
)
throws
SQLException
{
public
static
ResultSet
select
(
Connection
conn
,
String
sql
)
throws
SQLException
{
Statement
stat
=
conn
.
createStatement
(
ResultSet
.
TYPE_SCROLL_INSENSITIVE
,
ResultSet
.
CONCUR_READ_ONLY
);
Statement
stat
=
conn
.
createStatement
(
ResultSet
.
TYPE_SCROLL_INSENSITIVE
,
ResultSet
.
CONCUR_READ_ONLY
);
...
@@ -379,6 +394,9 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -379,6 +394,9 @@ public class TestFunctions extends TestBase implements AggregateFunction {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
* @param conn the connection
* @return the result set
*/
*/
public
static
ResultSet
selectMaxId
(
Connection
conn
)
throws
SQLException
{
public
static
ResultSet
selectMaxId
(
Connection
conn
)
throws
SQLException
{
return
conn
.
createStatement
().
executeQuery
(
"SELECT MAX(ID) FROM TEST"
);
return
conn
.
createStatement
().
executeQuery
(
"SELECT MAX(ID) FROM TEST"
);
...
@@ -386,6 +404,8 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -386,6 +404,8 @@ public class TestFunctions extends TestBase implements AggregateFunction {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
* @return the test array
*/
*/
public
static
Object
[]
getArray
()
{
public
static
Object
[]
getArray
()
{
return
new
Object
[]
{
new
Integer
(
0
),
"Hello"
};
return
new
Object
[]
{
new
Integer
(
0
),
"Hello"
};
...
@@ -393,6 +413,9 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -393,6 +413,9 @@ public class TestFunctions extends TestBase implements AggregateFunction {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
* @param conn the connection
* @return the result set
*/
*/
public
static
ResultSet
nullResultSet
(
Connection
conn
)
throws
SQLException
{
public
static
ResultSet
nullResultSet
(
Connection
conn
)
throws
SQLException
{
PreparedStatement
statement
=
conn
.
prepareStatement
(
"select null from system_range(1,1)"
);
PreparedStatement
statement
=
conn
.
prepareStatement
(
"select null from system_range(1,1)"
);
...
@@ -438,6 +461,9 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -438,6 +461,9 @@ public class TestFunctions extends TestBase implements AggregateFunction {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
* @param value the value
* @return the square root
*/
*/
public
static
int
root
(
int
value
)
{
public
static
int
root
(
int
value
)
{
if
(
value
<
0
)
{
if
(
value
<
0
)
{
...
@@ -448,6 +474,8 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -448,6 +474,8 @@ public class TestFunctions extends TestBase implements AggregateFunction {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
* @return 1
*/
*/
public
static
double
mean
()
{
public
static
double
mean
()
{
return
1
;
return
1
;
...
@@ -455,6 +483,9 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -455,6 +483,9 @@ public class TestFunctions extends TestBase implements AggregateFunction {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
* @param dec the value
* @return the value
*/
*/
public
static
BigDecimal
noOp
(
BigDecimal
dec
)
{
public
static
BigDecimal
noOp
(
BigDecimal
dec
)
{
return
dec
;
return
dec
;
...
@@ -462,6 +493,9 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -462,6 +493,9 @@ public class TestFunctions extends TestBase implements AggregateFunction {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
* @param values the values
* @return the mean value
*/
*/
//## Java 1.5 begin ##
//## Java 1.5 begin ##
public
static
double
mean
(
double
...
values
)
{
public
static
double
mean
(
double
...
values
)
{
...
@@ -475,6 +509,10 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -475,6 +509,10 @@ public class TestFunctions extends TestBase implements AggregateFunction {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
* @param conn the connection
* @param values the values
* @return the mean value
*/
*/
//## Java 1.5 begin ##
//## Java 1.5 begin ##
public
static
double
mean2
(
Connection
conn
,
double
...
values
)
{
public
static
double
mean2
(
Connection
conn
,
double
...
values
)
{
...
@@ -489,6 +527,10 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -489,6 +527,10 @@ public class TestFunctions extends TestBase implements AggregateFunction {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
* @param prefix the print prefix
* @param values the values
* @return the text
*/
*/
//## Java 1.5 begin ##
//## Java 1.5 begin ##
public
static
String
printMean
(
String
prefix
,
double
...
values
)
{
public
static
String
printMean
(
String
prefix
,
double
...
values
)
{
...
...
h2/src/test/org/h2/test/db/TestOptimizations.java
浏览文件 @
f2ee4267
...
@@ -131,6 +131,8 @@ public class TestOptimizations extends TestBase {
...
@@ -131,6 +131,8 @@ public class TestOptimizations extends TestBase {
/**
/**
* This method is called via reflection from the database.
* This method is called via reflection from the database.
*
* @return a result set
*/
*/
public
static
ResultSet
optimizeInJoinSelect
()
throws
SQLException
{
public
static
ResultSet
optimizeInJoinSelect
()
throws
SQLException
{
SimpleResultSet
rs
=
new
SimpleResultSet
();
SimpleResultSet
rs
=
new
SimpleResultSet
();
...
...
h2/src/test/org/h2/test/db/TestRights.java
浏览文件 @
f2ee4267
...
@@ -22,6 +22,15 @@ public class TestRights extends TestBase {
...
@@ -22,6 +22,15 @@ public class TestRights extends TestBase {
private
Statement
stat
;
private
Statement
stat
;
/**
* Run just this test.
*
* @param a ignored
*/
public
static
void
main
(
String
[]
a
)
throws
Exception
{
TestBase
.
createCaller
().
init
().
test
();
}
public
void
test
()
throws
SQLException
{
public
void
test
()
throws
SQLException
{
testDropTempTables
();
testDropTempTables
();
// testLowerCaseUser();
// testLowerCaseUser();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论