Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
ad68f1ec
提交
ad68f1ec
authored
9月 13, 2018
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add ExtTypeInfo.getCreateSQL()
上级
74188a32
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
23 行增加
和
11 行删除
+23
-11
Parser.java
h2/src/main/org/h2/command/Parser.java
+2
-2
Column.java
h2/src/main/org/h2/table/Column.java
+1
-1
ExtTypeInfo.java
h2/src/main/org/h2/value/ExtTypeInfo.java
+12
-0
ExtTypeInfoEnum.java
h2/src/main/org/h2/value/ExtTypeInfoEnum.java
+4
-4
ExtTypeInfoGeometry.java
h2/src/main/org/h2/value/ExtTypeInfoGeometry.java
+4
-4
没有找到文件。
h2/src/main/org/h2/command/Parser.java
浏览文件 @
ad68f1ec
...
@@ -5027,7 +5027,7 @@ public class Parser {
...
@@ -5027,7 +5027,7 @@ public class Parser {
}
catch
(
DbException
e
)
{
}
catch
(
DbException
e
)
{
throw
e
.
addSQL
(
original
);
throw
e
.
addSQL
(
original
);
}
}
original
+=
extTypeInfo
.
toString
();
original
+=
extTypeInfo
.
getCreateSQL
();
}
}
}
else
if
(
dataType
.
type
==
Value
.
GEOMETRY
)
{
}
else
if
(
dataType
.
type
==
Value
.
GEOMETRY
)
{
if
(
extTypeInfo
==
null
)
{
if
(
extTypeInfo
==
null
)
{
...
@@ -5051,7 +5051,7 @@ public class Parser {
...
@@ -5051,7 +5051,7 @@ public class Parser {
}
}
read
(
CLOSE_PAREN
);
read
(
CLOSE_PAREN
);
extTypeInfo
=
new
ExtTypeInfoGeometry
(
type
,
srid
);
extTypeInfo
=
new
ExtTypeInfoGeometry
(
type
,
srid
);
original
+=
extTypeInfo
.
toString
();
original
+=
extTypeInfo
.
getCreateSQL
();
}
}
}
}
}
else
if
(
readIf
(
OPEN_PAREN
))
{
}
else
if
(
readIf
(
OPEN_PAREN
))
{
...
...
h2/src/main/org/h2/table/Column.java
浏览文件 @
ad68f1ec
...
@@ -515,7 +515,7 @@ public class Column {
...
@@ -515,7 +515,7 @@ public class Column {
}
}
//$FALL-THROUGH$
//$FALL-THROUGH$
case
Value
.
ENUM
:
case
Value
.
ENUM
:
buff
.
append
(
extTypeInfo
.
toString
());
buff
.
append
(
extTypeInfo
.
getCreateSQL
());
break
;
break
;
case
Value
.
BYTES
:
case
Value
.
BYTES
:
case
Value
.
STRING
:
case
Value
.
STRING
:
...
...
h2/src/main/org/h2/value/ExtTypeInfo.java
浏览文件 @
ad68f1ec
...
@@ -19,4 +19,16 @@ public abstract class ExtTypeInfo {
...
@@ -19,4 +19,16 @@ public abstract class ExtTypeInfo {
*/
*/
public
abstract
Value
cast
(
Value
value
);
public
abstract
Value
cast
(
Value
value
);
/**
* Returns SQL including parentheses that should be appended to a type name.
*
* @return SQL including parentheses that should be appended to a type name
*/
public
abstract
String
getCreateSQL
();
@Override
public
String
toString
()
{
return
getCreateSQL
();
}
}
}
h2/src/main/org/h2/value/ExtTypeInfoEnum.java
浏览文件 @
ad68f1ec
...
@@ -43,7 +43,7 @@ public final class ExtTypeInfoEnum extends ExtTypeInfo {
...
@@ -43,7 +43,7 @@ public final class ExtTypeInfoEnum extends ExtTypeInfo {
return
label
==
null
?
null
:
label
.
trim
().
toUpperCase
(
Locale
.
ENGLISH
);
return
label
==
null
?
null
:
label
.
trim
().
toUpperCase
(
Locale
.
ENGLISH
);
}
}
private
static
String
toS
tring
(
String
[]
enumerators
)
{
private
static
String
toS
QL
(
String
[]
enumerators
)
{
StringBuilder
result
=
new
StringBuilder
();
StringBuilder
result
=
new
StringBuilder
();
result
.
append
(
'('
);
result
.
append
(
'('
);
for
(
int
i
=
0
;
i
<
enumerators
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
enumerators
.
length
;
i
++)
{
...
@@ -83,7 +83,7 @@ public final class ExtTypeInfoEnum extends ExtTypeInfo {
...
@@ -83,7 +83,7 @@ public final class ExtTypeInfoEnum extends ExtTypeInfo {
}
}
for
(
int
j
=
0
;
j
<
i
;
j
++)
{
for
(
int
j
=
0
;
j
<
i
;
j
++)
{
if
(
l
.
equals
(
cleaned
[
j
]))
{
if
(
l
.
equals
(
cleaned
[
j
]))
{
throw
DbException
.
get
(
ErrorCode
.
ENUM_DUPLICATE
,
toS
tring
(
enumerators
));
throw
DbException
.
get
(
ErrorCode
.
ENUM_DUPLICATE
,
toS
QL
(
enumerators
));
}
}
}
}
cleaned
[
i
]
=
l
;
cleaned
[
i
]
=
l
;
...
@@ -177,8 +177,8 @@ public final class ExtTypeInfoEnum extends ExtTypeInfo {
...
@@ -177,8 +177,8 @@ public final class ExtTypeInfoEnum extends ExtTypeInfo {
}
}
@Override
@Override
public
String
toString
()
{
public
String
getCreateSQL
()
{
return
toS
tring
(
enumerators
);
return
toS
QL
(
enumerators
);
}
}
}
}
h2/src/main/org/h2/value/ExtTypeInfoGeometry.java
浏览文件 @
ad68f1ec
...
@@ -18,7 +18,7 @@ public final class ExtTypeInfoGeometry extends ExtTypeInfo {
...
@@ -18,7 +18,7 @@ public final class ExtTypeInfoGeometry extends ExtTypeInfo {
private
final
Integer
srid
;
private
final
Integer
srid
;
private
static
String
toS
tring
(
int
type
,
Integer
srid
)
{
private
static
String
toS
QL
(
int
type
,
Integer
srid
)
{
if
(
type
==
0
&&
srid
==
null
)
{
if
(
type
==
0
&&
srid
==
null
)
{
return
""
;
return
""
;
}
}
...
@@ -58,14 +58,14 @@ public final class ExtTypeInfoGeometry extends ExtTypeInfo {
...
@@ -58,14 +58,14 @@ public final class ExtTypeInfoGeometry extends ExtTypeInfo {
ValueGeometry
g
=
(
ValueGeometry
)
value
;
ValueGeometry
g
=
(
ValueGeometry
)
value
;
if
(
type
!=
0
&&
g
.
getTypeAndDimensionSystem
()
!=
type
||
srid
!=
null
&&
g
.
getSRID
()
!=
srid
)
{
if
(
type
!=
0
&&
g
.
getTypeAndDimensionSystem
()
!=
type
||
srid
!=
null
&&
g
.
getSRID
()
!=
srid
)
{
throw
DbException
.
get
(
ErrorCode
.
CHECK_CONSTRAINT_VIOLATED_1
,
throw
DbException
.
get
(
ErrorCode
.
CHECK_CONSTRAINT_VIOLATED_1
,
toS
tring
(
g
.
getTypeAndDimensionSystem
(),
g
.
getSRID
())
+
" <> "
+
toString
());
toS
QL
(
g
.
getTypeAndDimensionSystem
(),
g
.
getSRID
())
+
" <> "
+
toString
());
}
}
return
g
;
return
g
;
}
}
@Override
@Override
public
String
toString
()
{
public
String
getCreateSQL
()
{
return
toS
tring
(
type
,
srid
);
return
toS
QL
(
type
,
srid
);
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论