Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
aabd4a1b
提交
aabd4a1b
authored
5月 05, 2014
作者:
noelgrandin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Follow JDBC specification on Procedures MetaData, use P0 as return type of procedure.
上级
5985e7be
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
53 行增加
和
0 行删除
+53
-0
changelog.html
h2/src/docsrc/html/changelog.html
+2
-0
MetaTable.java
h2/src/main/org/h2/table/MetaTable.java
+40
-0
TestFunctions.java
h2/src/test/org/h2/test/db/TestFunctions.java
+6
-0
TestMetaData.java
h2/src/test/org/h2/test/jdbc/TestMetaData.java
+5
-0
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
aabd4a1b
...
...
@@ -36,6 +36,8 @@ Change Log
</li><li>
Remove the "h2.MAX_MEMORY_ROWS_DISTINCT" system property to reduce confusion.
We already have the MAX_MEMORY_ROWS setting which does a very similar thing, and is better documented.
</li><li>
Issue 554: Web Console in an IFrame was not fully supported.
</li><li>
Follow JDBC specification on Procedures MetaData, use P0 as
return type of procedure.
</li></ul>
<h2>
Version 1.4.177 Beta (2014-04-12)
</h2>
...
...
h2/src/main/org/h2/table/MetaTable.java
浏览文件 @
aabd4a1b
...
...
@@ -1235,6 +1235,46 @@ public class MetaTable extends Table {
database
.
getAllSchemaObjects
(
DbObject
.
FUNCTION_ALIAS
))
{
FunctionAlias
alias
=
(
FunctionAlias
)
aliasAsSchemaObject
;
for
(
FunctionAlias
.
JavaMethod
method
:
alias
.
getJavaMethods
())
{
// Add return column index 0
if
(
method
.
getDataType
()
!=
Value
.
NULL
)
{
DataType
dt
=
DataType
.
getDataType
(
method
.
getDataType
());
add
(
rows
,
// ALIAS_CATALOG
catalog
,
// ALIAS_SCHEMA
alias
.
getSchema
().
getName
(),
// ALIAS_NAME
identifier
(
alias
.
getName
()),
// JAVA_CLASS
alias
.
getJavaClassName
(),
// JAVA_METHOD
alias
.
getJavaMethodName
(),
// COLUMN_COUNT
""
+
method
.
getParameterCount
(),
// POS INT
"0"
,
// COLUMN_NAME
"P0"
,
// DATA_TYPE
""
+
DataType
.
convertTypeToSQLType
(
method
.
getDataType
()),
// TYPE_NAME
dt
.
name
,
// PRECISION INT
""
+
MathUtils
.
convertLongToInt
(
dt
.
defaultPrecision
),
// SCALE
""
+
dt
.
defaultScale
,
// RADIX
"10"
,
// NULLABLE SMALLINT
""
+
DatabaseMetaData
.
columnNullableUnknown
,
// COLUMN_TYPE
""
+
DatabaseMetaData
.
procedureColumnReturn
,
// REMARKS
""
,
// COLUMN_DEFAULT
null
);
}
Class
<?>[]
columnList
=
method
.
getColumnClasses
();
for
(
int
k
=
0
;
k
<
columnList
.
length
;
k
++)
{
if
(
method
.
hasConnectionParam
()
&&
k
==
0
)
{
...
...
h2/src/test/org/h2/test/db/TestFunctions.java
浏览文件 @
aabd4a1b
...
...
@@ -544,6 +544,8 @@ public class TestFunctions extends TestBase implements AggregateFunction {
DatabaseMetaData
meta
=
conn
.
getMetaData
();
rs
=
meta
.
getProcedureColumns
(
null
,
null
,
"MEAN2"
,
null
);
assertTrue
(
rs
.
next
());
assertEquals
(
"P0"
,
rs
.
getString
(
"COLUMN_NAME"
));
assertTrue
(
rs
.
next
());
assertEquals
(
"FUNCTIONS"
,
rs
.
getString
(
"PROCEDURE_CAT"
));
assertEquals
(
"PUBLIC"
,
rs
.
getString
(
"PROCEDURE_SCHEM"
));
assertEquals
(
"MEAN2"
,
rs
.
getString
(
"PROCEDURE_NAME"
));
...
...
@@ -768,6 +770,8 @@ public class TestFunctions extends TestBase implements AggregateFunction {
DatabaseMetaData
meta
=
conn
.
getMetaData
();
rs
=
meta
.
getProcedureColumns
(
null
,
null
,
"ADD_ROW"
,
null
);
assertTrue
(
rs
.
next
());
assertEquals
(
"P0"
,
rs
.
getString
(
"COLUMN_NAME"
));
assertTrue
(
rs
.
next
());
assertEquals
(
"FUNCTIONS"
,
rs
.
getString
(
"PROCEDURE_CAT"
));
assertEquals
(
"PUBLIC"
,
rs
.
getString
(
"PROCEDURE_SCHEM"
));
assertEquals
(
"ADD_ROW"
,
rs
.
getString
(
"PROCEDURE_NAME"
));
...
...
@@ -1017,6 +1021,8 @@ public class TestFunctions extends TestBase implements AggregateFunction {
assertEquals
(
"NULL_RESULT"
,
rs
.
getString
(
"SPECIFIC_NAME"
));
rs
=
meta
.
getProcedureColumns
(
null
,
null
,
"NULL_RESULT"
,
null
);
assertTrue
(
rs
.
next
());
assertEquals
(
"P0"
,
rs
.
getString
(
"COLUMN_NAME"
));
assertFalse
(
rs
.
next
());
stat
.
execute
(
"CREATE ALIAS RESULT_WITH_NULL FOR \""
+
...
...
h2/src/test/org/h2/test/jdbc/TestMetaData.java
浏览文件 @
aabd4a1b
...
...
@@ -243,6 +243,11 @@ public class TestMetaData extends TestBase {
""
+
DatabaseMetaData
.
procedureColumnIn
,
""
+
Types
.
INTEGER
,
"INTEGER"
,
"10"
,
"10"
,
"0"
,
"10"
,
""
+
DatabaseMetaData
.
procedureNoNulls
},
{
CATALOG
,
Constants
.
SCHEMA_MAIN
,
"PROP"
,
"P0"
,
""
+
DatabaseMetaData
.
procedureColumnReturn
,
""
+
Types
.
VARCHAR
,
"VARCHAR"
,
""
+
Integer
.
MAX_VALUE
,
""
+
Integer
.
MAX_VALUE
,
"0"
,
"10"
,
""
+
DatabaseMetaData
.
procedureNullableUnknown
},
{
CATALOG
,
Constants
.
SCHEMA_MAIN
,
"PROP"
,
"P1"
,
""
+
DatabaseMetaData
.
procedureColumnIn
,
""
+
Types
.
VARCHAR
,
"VARCHAR"
,
""
+
Integer
.
MAX_VALUE
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论