Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
edeb2c89
提交
edeb2c89
authored
6 年前
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add missing type conversions to extractObjectOfType()
上级
26000a01
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
16 行增加
和
3 行删除
+16
-3
JdbcResultSet.java
h2/src/main/org/h2/jdbc/JdbcResultSet.java
+2
-2
TestSpatial.java
h2/src/test/org/h2/test/db/TestSpatial.java
+7
-0
TestTimeStampWithTimeZone.java
h2/src/test/org/h2/test/unit/TestTimeStampWithTimeZone.java
+7
-1
没有找到文件。
h2/src/main/org/h2/jdbc/JdbcResultSet.java
浏览文件 @
edeb2c89
...
...
@@ -3928,9 +3928,9 @@ public class JdbcResultSet extends TraceObject implements ResultSet, JdbcResultS
return
type
.
cast
(
value
==
ValueNull
.
INSTANCE
?
null
:
new
JdbcSQLXML
(
conn
,
value
,
JdbcLob
.
State
.
WITH_VALUE
,
id
));
}
else
if
(
type
==
TimestampWithTimeZone
.
class
)
{
return
type
.
cast
(
value
.
getObject
());
return
type
.
cast
(
value
.
convertTo
(
Value
.
TIMESTAMP_TZ
).
getObject
());
}
else
if
(
DataType
.
isGeometryClass
(
type
))
{
return
type
.
cast
(
value
.
getObject
());
return
type
.
cast
(
value
.
convertTo
(
Value
.
GEOMETRY
).
getObject
());
}
else
if
(
type
==
LocalDateTimeUtils
.
LOCAL_DATE
)
{
return
type
.
cast
(
LocalDateTimeUtils
.
valueToLocalDate
(
value
));
}
else
if
(
type
==
LocalDateTimeUtils
.
LOCAL_TIME
)
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/db/TestSpatial.java
浏览文件 @
edeb2c89
...
...
@@ -149,6 +149,13 @@ public class TestSpatial extends TestDb {
new
Coordinate
(
2
,
2
),
new
Coordinate
(
1
,
1
)
});
assertTrue
(
polygon
.
equals
(
rs
.
getObject
(
2
)));
rs
.
close
();
rs
=
stat
.
executeQuery
(
"select id, cast(polygon as varchar) from test"
);
assertTrue
(
rs
.
next
());
assertEquals
(
1
,
rs
.
getInt
(
1
));
assertEquals
(
"POLYGON ((1 1, 1 2, 2 2, 1 1))"
,
rs
.
getObject
(
2
));
assertTrue
(
polygon
.
equals
(
rs
.
getObject
(
2
,
Geometry
.
class
)));
rs
.
close
();
rs
=
stat
.
executeQuery
(
"select * from test where polygon = "
+
"'POLYGON ((1 1, 1 2, 2 2, 1 1))'"
);
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/unit/TestTimeStampWithTimeZone.java
浏览文件 @
edeb2c89
...
...
@@ -69,7 +69,8 @@ public class TestTimeStampWithTimeZone extends TestDb {
assertEquals
(
1
,
ts
.
getMonth
());
assertEquals
(
1
,
ts
.
getDay
());
assertEquals
(
15
,
ts
.
getTimeZoneOffsetMins
());
assertEquals
(
new
TimestampWithTimeZone
(
1008673L
,
43200000000000L
,
(
short
)
15
),
ts
);
TimestampWithTimeZone
firstExpected
=
new
TimestampWithTimeZone
(
1008673L
,
43200000000000L
,
(
short
)
15
);
assertEquals
(
firstExpected
,
ts
);
if
(
LocalDateTimeUtils
.
isJava8DateApiPresent
())
{
assertEquals
(
"1970-01-01T12:00+00:15"
,
rs
.
getObject
(
1
,
LocalDateTimeUtils
.
OFFSET_DATE_TIME
).
toString
());
...
...
@@ -125,6 +126,11 @@ public class TestTimeStampWithTimeZone extends TestDb {
assertEquals
(
2014
,
columnType
);
rs
.
close
();
rs
=
stat
.
executeQuery
(
"select cast(t1 as varchar) from test"
);
assertTrue
(
rs
.
next
());
assertEquals
(
firstExpected
,
rs
.
getObject
(
1
,
TimestampWithTimeZone
.
class
));
stat
.
close
();
conn
.
close
();
}
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论