Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
4f50464a
提交
4f50464a
authored
1月 17, 2017
作者:
Noel Grandin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#411: "TIMEZONE" should be "TIME ZONE" in type "TIMESTAMP WITH TIMEZONE"
上级
72f706f5
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
30 行增加
和
20 行删除
+30
-20
help.csv
h2/src/docsrc/help/help.csv
+4
-4
changelog.html
h2/src/docsrc/html/changelog.html
+2
-0
_docs_en.utf8.txt
h2/src/docsrc/text/_docs_en.utf8.txt
+1
-1
_docs_ja.utf8.txt
h2/src/docsrc/text/_docs_ja.utf8.txt
+1
-1
_docs_en.properties
h2/src/docsrc/textbase/_docs_en.properties
+1
-1
Parser.java
h2/src/main/org/h2/command/Parser.java
+10
-2
help.csv
h2/src/main/org/h2/res/help.csv
+2
-2
DataType.java
h2/src/main/org/h2/value/DataType.java
+1
-1
Value.java
h2/src/main/org/h2/value/Value.java
+1
-1
ValueTimestampTimeZone.java
h2/src/main/org/h2/value/ValueTimestampTimeZone.java
+5
-5
TestTimeStampWithTimeZone.java
h2/src/test/org/h2/test/unit/TestTimeStampWithTimeZone.java
+2
-2
没有找到文件。
h2/src/docsrc/help/help.csv
浏览文件 @
4f50464a
...
@@ -2335,17 +2335,17 @@ Mapped to ""java.sql.Timestamp"" (""java.util.Date"" is also supported).
...
@@ -2335,17 +2335,17 @@ Mapped to ""java.sql.Timestamp"" (""java.util.Date"" is also supported).
TIMESTAMP
TIMESTAMP
"
"
"Data Types","TIMESTAMP WITH TIMEZONE Type","
"Data Types","TIMESTAMP WITH TIME
ZONE Type","
TIMESTAMP WITH TIMEZONE
TIMESTAMP WITH TIME
ZONE
","
","
VERY MUCH STILL IN TESTING.
VERY MUCH STILL IN TESTING.
The timestamp with timezone data type.
The timestamp with time
zone data type.
Stored internally as a BCD-encoded date, nano-seconds since midnight, and timezone offset in minutes.
Stored internally as a BCD-encoded date, nano-seconds since midnight, and timezone offset in minutes.
Note that range queries on this datatype may do some weird stuff close to DST boundaries.
Note that range queries on this datatype may do some weird stuff close to DST boundaries.
Mapped to ""org.h2.api.TimestampWithTimeZone""
Mapped to ""org.h2.api.TimestampWithTimeZone""
","
","
TIMESTAMP WITH TIMEZONE
TIMESTAMP WITH TIME
ZONE
"
"
"Data Types","BINARY Type","
"Data Types","BINARY Type","
...
...
h2/src/docsrc/html/changelog.html
浏览文件 @
4f50464a
...
@@ -21,6 +21,8 @@ Change Log
...
@@ -21,6 +21,8 @@ Change Log
<h2>
Next Version (unreleased)
</h2>
<h2>
Next Version (unreleased)
</h2>
<ul>
<ul>
<li>
#411: "TIMEZONE" should be "TIME ZONE" in type "TIMESTAMP WITH TIMEZONE"
</li>
<li>
#429: Tables not found : Fix some turkish locale bugs around uppercasing
<li>
#429: Tables not found : Fix some turkish locale bugs around uppercasing
</li>
</li>
<li>
Fixed bug in metadata locking, obscure combination of DDL and SELECT SEQUENCE.NEXTVAL required
<li>
Fixed bug in metadata locking, obscure combination of DDL and SELECT SEQUENCE.NEXTVAL required
...
...
h2/src/docsrc/text/_docs_en.utf8.txt
浏览文件 @
4f50464a
...
@@ -10271,7 +10271,7 @@ Issue 50: Oracle compatibility: support calling 0-parameters functions without p
...
@@ -10271,7 +10271,7 @@ Issue 50: Oracle compatibility: support calling 0-parameters functions without p
MySQL, HSQLDB compatibility: support where 'a'=1 (not supported by Derby, PostgreSQL)
MySQL, HSQLDB compatibility: support where 'a'=1 (not supported by Derby, PostgreSQL)
@roadmap_1272_li
@roadmap_1272_li
Support a data type "timestamp with timezone" using java.util.Calendar.
Support a data type "timestamp with time
zone" using java.util.Calendar.
@roadmap_1273_li
@roadmap_1273_li
Finer granularity for SLF4J trace - See http://code.google.com/p/h2database/issues/detail?id=62
Finer granularity for SLF4J trace - See http://code.google.com/p/h2database/issues/detail?id=62
...
...
h2/src/docsrc/text/_docs_ja.utf8.txt
浏览文件 @
4f50464a
...
@@ -10271,7 +10271,7 @@ H2 コンソール アプリケーション
...
@@ -10271,7 +10271,7 @@ H2 コンソール アプリケーション
#MySQL, HSQLDB compatibility: support where 'a'=1 (not supported by Derby, PostgreSQL)
#MySQL, HSQLDB compatibility: support where 'a'=1 (not supported by Derby, PostgreSQL)
@roadmap_1272_li
@roadmap_1272_li
#Support a data type "timestamp with timezone" using java.util.Calendar.
#Support a data type "timestamp with time
zone" using java.util.Calendar.
@roadmap_1273_li
@roadmap_1273_li
#Finer granularity for SLF4J trace - See http://code.google.com/p/h2database/issues/detail?id=62
#Finer granularity for SLF4J trace - See http://code.google.com/p/h2database/issues/detail?id=62
...
...
h2/src/docsrc/textbase/_docs_en.properties
浏览文件 @
4f50464a
...
@@ -3422,7 +3422,7 @@ roadmap_1268_li=Javadoc search\: weight for titles should be higher ('random' sh
...
@@ -3422,7 +3422,7 @@ roadmap_1268_li=Javadoc search\: weight for titles should be higher ('random' sh
roadmap_1269_li
=
Replace information_schema tables with regular tables that are automatically re-built when needed. Use indexes.
roadmap_1269_li
=
Replace information_schema tables with regular tables that are automatically re-built when needed. Use indexes.
roadmap_1270_li
=
Issue 50
\:
Oracle compatibility
\:
support calling 0-parameters functions without parenthesis. Make constants obsolete.
roadmap_1270_li
=
Issue 50
\:
Oracle compatibility
\:
support calling 0-parameters functions without parenthesis. Make constants obsolete.
roadmap_1271_li
=
MySQL, HSQLDB compatibility
\:
support where 'a'
\=
1 (not supported by Derby, PostgreSQL)
roadmap_1271_li
=
MySQL, HSQLDB compatibility
\:
support where 'a'
\=
1 (not supported by Derby, PostgreSQL)
roadmap_1272_li
=
Support a data type "timestamp with timezone" using java.util.Calendar.
roadmap_1272_li
=
Support a data type "timestamp with time
zone" using java.util.Calendar.
roadmap_1273_li
=
Finer granularity for SLF4J trace - See http
\:
//code.google.com/p/h2database/issues/detail?id
\=
62
roadmap_1273_li
=
Finer granularity for SLF4J trace - See http
\:
//code.google.com/p/h2database/issues/detail?id
\=
62
roadmap_1274_li
=
Add database creation date and time to the database.
roadmap_1274_li
=
Add database creation date and time to the database.
roadmap_1275_li
=
Support ASSERTION.
roadmap_1275_li
=
Support ASSERTION.
...
...
h2/src/main/org/h2/command/Parser.java
浏览文件 @
4f50464a
...
@@ -4104,8 +4104,16 @@ public class Parser {
...
@@ -4104,8 +4104,16 @@ public class Parser {
}
}
}
else
if
(
readIf
(
"TIMESTAMP"
))
{
}
else
if
(
readIf
(
"TIMESTAMP"
))
{
if
(
readIf
(
"WITH"
))
{
if
(
readIf
(
"WITH"
))
{
read
(
"TIMEZONE"
);
// originally we used TIMEZONE, which turns out not to be standards-compliant,
original
+=
" WITH TIMEZONE"
;
// but lets keep backwards compatibility
if
(
readIf
(
"TIMEZONE"
))
{
read
(
"TIMEZONE"
);
original
+=
" WITH TIMEZONE"
;
}
else
{
read
(
"TIME"
);
read
(
"ZONE"
);
original
+=
" WITH TIME ZONE"
;
}
}
}
}
else
{
}
else
{
regular
=
true
;
regular
=
true
;
...
...
h2/src/main/org/h2/res/help.csv
浏览文件 @
4f50464a
...
@@ -789,8 +789,8 @@ The date data type."
...
@@ -789,8 +789,8 @@ The date data type."
{ TIMESTAMP | DATETIME | SMALLDATETIME }
{ TIMESTAMP | DATETIME | SMALLDATETIME }
","
","
The timestamp data type."
The timestamp data type."
"Data Types","TIMESTAMP WITH TIMEZONE Type","
"Data Types","TIMESTAMP WITH TIME
ZONE Type","
TIMESTAMP WITH TIMEZONE
TIMESTAMP WITH TIME
ZONE
","
","
VERY MUCH STILL IN TESTING."
VERY MUCH STILL IN TESTING."
"Data Types","BINARY Type","
"Data Types","BINARY Type","
...
...
h2/src/main/org/h2/value/DataType.java
浏览文件 @
4f50464a
...
@@ -318,7 +318,7 @@ public class DataType {
...
@@ -318,7 +318,7 @@ public class DataType {
add
(
Value
.
TIMESTAMP_TZ
,
Types
.
OTHER
,
"TimestampTimeZone"
,
add
(
Value
.
TIMESTAMP_TZ
,
Types
.
OTHER
,
"TimestampTimeZone"
,
createDate
(
ValueTimestampTimeZone
.
PRECISION
,
"TIMESTAMP_TZ"
,
createDate
(
ValueTimestampTimeZone
.
PRECISION
,
"TIMESTAMP_TZ"
,
ValueTimestampTimeZone
.
DEFAULT_SCALE
,
ValueTimestampTimeZone
.
DISPLAY_SIZE
),
ValueTimestampTimeZone
.
DEFAULT_SCALE
,
ValueTimestampTimeZone
.
DISPLAY_SIZE
),
new
String
[]{
"TIMESTAMP WITH TIMEZONE"
},
new
String
[]{
"TIMESTAMP WITH TIME
ZONE"
},
// 26 for ValueTimestampUtc, 32 for java.sql.Timestamp
// 26 for ValueTimestampUtc, 32 for java.sql.Timestamp
58
58
);
);
...
...
h2/src/main/org/h2/value/Value.java
浏览文件 @
4f50464a
...
@@ -162,7 +162,7 @@ public abstract class Value {
...
@@ -162,7 +162,7 @@ public abstract class Value {
* 23 was a short-lived experiment "TIMESTAMP UTC" which has been removed.
* 23 was a short-lived experiment "TIMESTAMP UTC" which has been removed.
*/
*/
/**
/**
* The value type for TIMESTAMP WITH TIMEZONE values.
* The value type for TIMESTAMP WITH TIME
ZONE values.
*/
*/
public
static
final
int
TIMESTAMP_TZ
=
24
;
public
static
final
int
TIMESTAMP_TZ
=
24
;
...
...
h2/src/main/org/h2/value/ValueTimestampTimeZone.java
浏览文件 @
4f50464a
...
@@ -18,7 +18,7 @@ import org.h2.util.MathUtils;
...
@@ -18,7 +18,7 @@ import org.h2.util.MathUtils;
import
org.h2.util.StringUtils
;
import
org.h2.util.StringUtils
;
/**
/**
* Implementation of the TIMESTAMP WITH TIMEZONE data type.
* Implementation of the TIMESTAMP WITH TIME
ZONE data type.
*
*
* @see <a href="https://en.wikipedia.org/wiki/ISO_8601#Time_zone_designators">
* @see <a href="https://en.wikipedia.org/wiki/ISO_8601#Time_zone_designators">
* ISO 8601 Time zone designators</a>
* ISO 8601 Time zone designators</a>
...
@@ -113,7 +113,7 @@ public class ValueTimestampTimeZone extends Value {
...
@@ -113,7 +113,7 @@ public class ValueTimestampTimeZone extends Value {
return
parseTry
(
s
);
return
parseTry
(
s
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
DbException
.
get
(
ErrorCode
.
INVALID_DATETIME_CONSTANT_2
,
e
,
throw
DbException
.
get
(
ErrorCode
.
INVALID_DATETIME_CONSTANT_2
,
e
,
"TIMESTAMP WITH TIMEZONE"
,
s
);
"TIMESTAMP WITH TIME
ZONE"
,
s
);
}
}
}
}
...
@@ -249,7 +249,7 @@ public class ValueTimestampTimeZone extends Value {
...
@@ -249,7 +249,7 @@ public class ValueTimestampTimeZone extends Value {
@Override
@Override
public
String
getSQL
()
{
public
String
getSQL
()
{
return
"TIMESTAMP WITH TIMEZONE '"
+
getString
()
+
"'"
;
return
"TIMESTAMP WITH TIME
ZONE '"
+
getString
()
+
"'"
;
}
}
@Override
@Override
...
@@ -353,13 +353,13 @@ public class ValueTimestampTimeZone extends Value {
...
@@ -353,13 +353,13 @@ public class ValueTimestampTimeZone extends Value {
@Override
@Override
public
Value
add
(
Value
v
)
{
public
Value
add
(
Value
v
)
{
throw
DbException
.
getUnsupportedException
(
throw
DbException
.
getUnsupportedException
(
"manipulating TIMESTAMP WITH TIMEZONE values is unsupported"
);
"manipulating TIMESTAMP WITH TIME
ZONE values is unsupported"
);
}
}
@Override
@Override
public
Value
subtract
(
Value
v
)
{
public
Value
subtract
(
Value
v
)
{
throw
DbException
.
getUnsupportedException
(
throw
DbException
.
getUnsupportedException
(
"manipulating TIMESTAMP WITH TIMEZONE values is unsupported"
);
"manipulating TIMESTAMP WITH TIME
ZONE values is unsupported"
);
}
}
}
}
h2/src/test/org/h2/test/unit/TestTimeStampWithTimeZone.java
浏览文件 @
4f50464a
...
@@ -41,7 +41,7 @@ public class TestTimeStampWithTimeZone extends TestBase {
...
@@ -41,7 +41,7 @@ public class TestTimeStampWithTimeZone extends TestBase {
private
void
test1
()
throws
SQLException
{
private
void
test1
()
throws
SQLException
{
Connection
conn
=
getConnection
(
getTestName
());
Connection
conn
=
getConnection
(
getTestName
());
Statement
stat
=
conn
.
createStatement
();
Statement
stat
=
conn
.
createStatement
();
stat
.
execute
(
"create table test(id identity, t1 timestamp with timezone)"
);
stat
.
execute
(
"create table test(id identity, t1 timestamp with time
zone)"
);
stat
.
execute
(
"insert into test(t1) values('1970-01-01 12:00:00.00+00:15')"
);
stat
.
execute
(
"insert into test(t1) values('1970-01-01 12:00:00.00+00:15')"
);
// verify NanosSinceMidnight is in local time and not UTC
// verify NanosSinceMidnight is in local time and not UTC
stat
.
execute
(
"insert into test(t1) values('2016-09-24 00:00:00.000000001+00:01')"
);
stat
.
execute
(
"insert into test(t1) values('2016-09-24 00:00:00.000000001+00:01')"
);
...
@@ -131,7 +131,7 @@ public class TestTimeStampWithTimeZone extends TestBase {
...
@@ -131,7 +131,7 @@ public class TestTimeStampWithTimeZone extends TestBase {
private
void
testOrder
()
throws
SQLException
{
private
void
testOrder
()
throws
SQLException
{
Connection
conn
=
getConnection
(
getTestName
());
Connection
conn
=
getConnection
(
getTestName
());
Statement
stat
=
conn
.
createStatement
();
Statement
stat
=
conn
.
createStatement
();
stat
.
execute
(
"create table test_order(id identity, t1 timestamp with timezone)"
);
stat
.
execute
(
"create table test_order(id identity, t1 timestamp with time
zone)"
);
stat
.
execute
(
"insert into test_order(t1) values('1970-01-01 12:00:00.00+00:15')"
);
stat
.
execute
(
"insert into test_order(t1) values('1970-01-01 12:00:00.00+00:15')"
);
stat
.
execute
(
"insert into test_order(t1) values('1970-01-01 12:00:01.00+01:15')"
);
stat
.
execute
(
"insert into test_order(t1) values('1970-01-01 12:00:01.00+01:15')"
);
ResultSet
rs
=
stat
.
executeQuery
(
"select t1 from test_order order by t1"
);
ResultSet
rs
=
stat
.
executeQuery
(
"select t1 from test_order order by t1"
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论