Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
7c1478a2
提交
7c1478a2
authored
8 年前
作者:
Noel Grandin
提交者:
GitHub
8 年前
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #439 from marschall/tz-jdbc-type
Fix JDBC type of TIMESTAMP WITH TIME ZONE
上级
85af6401
72be2bd2
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
18 行增加
和
1 行删除
+18
-1
changelog.html
h2/src/docsrc/html/changelog.html
+3
-0
DataType.java
h2/src/main/org/h2/value/DataType.java
+5
-1
TestTimeStampWithTimeZone.java
h2/src/test/org/h2/test/unit/TestTimeStampWithTimeZone.java
+10
-0
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
7c1478a2
...
...
@@ -21,6 +21,9 @@ Change Log
<h2>
Next Version (unreleased)
</h2>
<ul>
<li><strong>
[API CHANGE]
</strong>
#439: the JDBC type of TIMESTAMP WITH TIME ZONE
changed from Types.OTHER (1111) to Types.TIMESTAMP_WITH_TIMEZONE (2014)
</li>
<li>
#430: Subquery not cached if number of rows exceeds MAX_MEMORY_ROWS
</li>
<li>
#411: "TIMEZONE" should be "TIME ZONE" in type "TIMESTAMP WITH TIMEZONE"
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/value/DataType.java
浏览文件 @
7c1478a2
...
...
@@ -315,7 +315,11 @@ public class DataType {
// 24 for ValueTimestamp, 32 for java.sql.Timestamp
56
);
add
(
Value
.
TIMESTAMP_TZ
,
Types
.
OTHER
,
"TimestampTimeZone"
,
// 2014 is the value of Types.TIMESTAMP_WITH_TIMEZONE
// use the value instead of the reference because the code has to compile
// on Java 1.7
// can be replaced with Types.TIMESTAMP_WITH_TIMEZONE once Java 1.8 is required
add
(
Value
.
TIMESTAMP_TZ
,
2014
,
"TimestampTimeZone"
,
createDate
(
ValueTimestampTimeZone
.
PRECISION
,
"TIMESTAMP_TZ"
,
ValueTimestampTimeZone
.
DEFAULT_SCALE
,
ValueTimestampTimeZone
.
DISPLAY_SIZE
),
new
String
[]{
"TIMESTAMP WITH TIME ZONE"
},
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/unit/TestTimeStampWithTimeZone.java
浏览文件 @
7c1478a2
...
...
@@ -7,6 +7,7 @@ package org.h2.test.unit;
import
java.sql.Connection
;
import
java.sql.ResultSet
;
import
java.sql.ResultSetMetaData
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
org.h2.api.TimestampWithTimeZone
;
...
...
@@ -102,6 +103,15 @@ public class TestTimeStampWithTimeZone extends TestBase {
assertEquals
(
"2015-12-31T19:00-10:00"
,
rs
.
getObject
(
1
,
LocalDateTimeUtils
.
getOffsetDateTimeClass
()).
toString
());
}
ResultSetMetaData
metaData
=
rs
.
getMetaData
();
int
columnType
=
metaData
.
getColumnType
(
1
);
// 2014 is the value of Types.TIMESTAMP_WITH_TIMEZONE
// use the value instead of the reference because the code has to compile
// on Java 1.7
// can be replaced with Types.TIMESTAMP_WITH_TIMEZONE once Java 1.8 is required
assertEquals
(
2014
,
columnType
);
rs
.
close
();
stat
.
close
();
conn
.
close
();
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论