Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
c1010fba
提交
c1010fba
authored
9月 02, 2014
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
The Long.MIN_VALUE could not be parsed for auto-increment (identity) columns.
上级
9daa8ba8
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
26 行增加
和
16 行删除
+26
-16
changelog.html
h2/src/docsrc/html/changelog.html
+2
-1
Parser.java
h2/src/main/org/h2/command/Parser.java
+24
-15
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
c1010fba
...
...
@@ -17,7 +17,8 @@ Change Log
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
Issue 573: Add implementation for Methods "isWrapperFor()" and "unwrap()" in
<ul><li>
The Long.MIN_VALUE could not be parsed for auto-increment (identity) columns.
</li><li>
Issue 573: Add implementation for Methods "isWrapperFor()" and "unwrap()" in
other JDBC classes.
</li><li>
Issue 572: MySQL compatibility for "order by" in update statements.
</li><li>
The change in JDBC escape processing in version 1.4.181 affects both the parser
...
...
h2/src/main/org/h2/command/Parser.java
浏览文件 @
c1010fba
...
...
@@ -536,7 +536,7 @@ public class Parser {
private
Prepared
parseAnalyze
()
{
Analyze
command
=
new
Analyze
(
session
);
if
(
readIf
(
"SAMPLE_SIZE"
))
{
command
.
setTop
(
get
PositiveInt
());
command
.
setTop
(
read
PositiveInt
());
}
return
command
;
}
...
...
@@ -2966,15 +2966,15 @@ public class Parser {
return
function
;
}
private
int
get
PositiveInt
()
{
int
v
=
get
Int
();
private
int
read
PositiveInt
()
{
int
v
=
read
Int
();
if
(
v
<
0
)
{
throw
DbException
.
getInvalidValueException
(
"positive integer"
,
v
);
}
return
v
;
}
private
int
get
Int
()
{
private
int
read
Int
()
{
boolean
minus
=
false
;
if
(
currentTokenType
==
MINUS
)
{
minus
=
true
;
...
...
@@ -2982,12 +2982,16 @@ public class Parser {
}
else
if
(
currentTokenType
==
PLUS
)
{
read
();
}
if
(
currentTokenType
!=
VALUE
||
currentValue
.
getType
()
!=
Value
.
INT
)
{
if
(
currentTokenType
!=
VALUE
)
{
throw
DbException
.
getSyntaxError
(
sqlCommand
,
parseIndex
,
"integer"
);
}
if
(
minus
)
{
// must do that now, otherwise Integer.MIN_VALUE wouldn't work
currentValue
=
currentValue
.
negate
();
}
int
i
=
currentValue
.
getInt
();
read
();
return
minus
?
-
i
:
i
;
return
i
;
}
private
long
readLong
()
{
...
...
@@ -2995,14 +2999,19 @@ public class Parser {
if
(
currentTokenType
==
MINUS
)
{
minus
=
true
;
read
();
}
else
if
(
currentTokenType
==
PLUS
)
{
read
();
}
if
(
currentTokenType
!=
VALUE
||
(
currentValue
.
getType
()
!=
Value
.
INT
&&
currentValue
.
getType
()
!=
Value
.
LONG
))
{
if
(
currentTokenType
!=
VALUE
)
{
throw
DbException
.
getSyntaxError
(
sqlCommand
,
parseIndex
,
"long"
);
}
if
(
minus
)
{
// must do that now, otherwise Long.MIN_VALUE wouldn't work
currentValue
=
currentValue
.
negate
();
}
long
i
=
currentValue
.
getLong
();
read
();
return
minus
?
-
i
:
i
;
return
i
;
}
private
boolean
readBooleanSetting
()
{
...
...
@@ -3901,7 +3910,7 @@ public class Parser {
column
.
setSequence
(
sequence
);
}
if
(
readIf
(
"SELECTIVITY"
))
{
int
value
=
get
PositiveInt
();
int
value
=
read
PositiveInt
();
column
.
setSelectivity
(
value
);
}
String
comment
=
readCommentIf
();
...
...
@@ -4005,7 +4014,7 @@ public class Parser {
readIf
(
"CHAR"
);
if
(
dataType
.
supportsScale
)
{
if
(
readIf
(
","
))
{
scale
=
get
Int
();
scale
=
read
Int
();
original
+=
", "
+
scale
;
}
else
{
// special case: TIMESTAMP(5) actually means
...
...
@@ -4027,7 +4036,7 @@ public class Parser {
}
else
if
(
readIf
(
"("
))
{
// Support for MySQL: INT(11), MEDIUMINT(8) and so on.
// Just ignore the precision.
get
PositiveInt
();
read
PositiveInt
();
read
(
")"
);
}
if
(
readIf
(
"FOR"
))
{
...
...
@@ -4532,7 +4541,7 @@ public class Parser {
command
.
setRowBased
(
false
);
}
if
(
readIf
(
"QUEUE"
))
{
command
.
setQueueSize
(
get
PositiveInt
());
command
.
setQueueSize
(
read
PositiveInt
());
}
command
.
setNoWait
(
readIf
(
"NOWAIT"
));
read
(
"CALL"
);
...
...
@@ -4940,7 +4949,7 @@ public class Parser {
}
else
if
(
readIf
(
"NUMBERS"
))
{
command
.
setInt
(
Constants
.
ALLOW_LITERALS_NUMBERS
);
}
else
{
command
.
setInt
(
get
PositiveInt
());
command
.
setInt
(
read
PositiveInt
());
}
return
command
;
}
else
if
(
readIf
(
"DEFAULT_TABLE_TYPE"
))
{
...
...
@@ -4951,7 +4960,7 @@ public class Parser {
}
else
if
(
readIf
(
"CACHED"
))
{
command
.
setInt
(
Table
.
TYPE_CACHED
);
}
else
{
command
.
setInt
(
get
PositiveInt
());
command
.
setInt
(
read
PositiveInt
());
}
return
command
;
}
else
if
(
readIf
(
"CREATE"
))
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论