Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
f27c631e
Unverified
提交
f27c631e
authored
1月 14, 2019
作者:
Evgenij Ryazanov
提交者:
GitHub
1月 14, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1663 from katzyn/console
Display correct types of H2's columns in Console
上级
5dab1f7f
74901b94
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
57 行增加
和
28 行删除
+57
-28
help.csv
h2/src/docsrc/help/help.csv
+8
-2
changelog.html
h2/src/docsrc/html/changelog.html
+8
-0
DbColumn.java
h2/src/main/org/h2/bnf/context/DbColumn.java
+13
-14
DbSchema.java
h2/src/main/org/h2/bnf/context/DbSchema.java
+15
-9
DbTableOrView.java
h2/src/main/org/h2/bnf/context/DbTableOrView.java
+12
-2
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+1
-1
没有找到文件。
h2/src/docsrc/help/help.csv
浏览文件 @
f27c631e
...
@@ -3543,10 +3543,13 @@ The default separator is a ',' (without space).
...
@@ -3543,10 +3543,13 @@ The default separator is a ',' (without space).
This method returns a string.
This method returns a string.
If no rows are selected, the result is NULL.
If no rows are selected, the result is NULL.
If ORDER BY is not specified order of strings is not determined.
If ORDER BY is not specified order of strings is not determined.
Note that when this aggregate is used with OVER clause its ORDER BY subclause does not enforce exact order of strings.
When this aggregate is used with OVER clause that contains ORDER BY subclause
it does not enforce exact order of strings.
This aggregate needs additional own ORDER BY clause to make it deterministic.
Aggregates are only allowed in select statements.
Aggregates are only allowed in select statements.
","
","
GROUP_CONCAT(NAME ORDER BY ID SEPARATOR ', ')
GROUP_CONCAT(NAME ORDER BY ID SEPARATOR ', ')
GROUP_CONCAT(ID ORDER BY ID SEPARATOR ', ') OVER (ORDER BY ID)
"
"
"Functions (Aggregate)","ARRAY_AGG","
"Functions (Aggregate)","ARRAY_AGG","
...
@@ -3558,10 +3561,13 @@ Aggregate the value into an array.
...
@@ -3558,10 +3561,13 @@ Aggregate the value into an array.
This method returns an array.
This method returns an array.
If no rows are selected, the result is NULL.
If no rows are selected, the result is NULL.
If ORDER BY is not specified order of values is not determined.
If ORDER BY is not specified order of values is not determined.
Note that when this aggregate is used with OVER clause its ORDER BY subclause does not enforce exact order of values.
When this aggregate is used with OVER clause that contains ORDER BY subclause
it does not enforce exact order of values.
This aggregate needs additional own ORDER BY clause to make it deterministic.
Aggregates are only allowed in select statements.
Aggregates are only allowed in select statements.
","
","
ARRAY_AGG(NAME ORDER BY ID)
ARRAY_AGG(NAME ORDER BY ID)
ARRAY_AGG(ID ORDER BY ID) OVER (ORDER BY ID)
"
"
"Functions (Aggregate)","MAX","
"Functions (Aggregate)","MAX","
...
...
h2/src/docsrc/html/changelog.html
浏览文件 @
f27c631e
...
@@ -21,8 +21,16 @@ Change Log
...
@@ -21,8 +21,16 @@ Change Log
<h2>
Next Version (unreleased)
</h2>
<h2>
Next Version (unreleased)
</h2>
<ul>
<ul>
<li>
Issue #1576: H2 Console should not display precision and scale for data types that don't have them
</li>
<li>
PR #1662: Fix Alter Table Drop Column In View when table name is wrapped by Double Quotes
</li>
<li>
PR #1660: Optimize window aggregates with AND UNBOUNDED FOLLOWING and no exclusions
<li>
PR #1660: Optimize window aggregates with AND UNBOUNDED FOLLOWING and no exclusions
</li>
</li>
<li>
PR #1658: Assorted small changes
</li>
<li>
PR #1657: Failure to stop background thread
</li>
<li>
PR #1656: Optimize window aggregates with ORDER BY + UNBOUNDED PRECEDING + no exclusions
<li>
PR #1656: Optimize window aggregates with ORDER BY + UNBOUNDED PRECEDING + no exclusions
</li>
</li>
<li>
Issue #1654: OOM in TestMemoryUsage, in big mode
<li>
Issue #1654: OOM in TestMemoryUsage, in big mode
...
...
h2/src/main/org/h2/bnf/context/DbColumn.java
浏览文件 @
f27c631e
...
@@ -27,31 +27,30 @@ public class DbColumn {
...
@@ -27,31 +27,30 @@ public class DbColumn {
throws
SQLException
{
throws
SQLException
{
name
=
rs
.
getString
(
"COLUMN_NAME"
);
name
=
rs
.
getString
(
"COLUMN_NAME"
);
quotedName
=
contents
.
quoteIdentifier
(
name
);
quotedName
=
contents
.
quoteIdentifier
(
name
);
position
=
rs
.
getInt
(
"ORDINAL_POSITION"
);
if
(
contents
.
isH2
()
&&
!
procedureColumn
)
{
dataType
=
rs
.
getString
(
"COLUMN_TYPE"
);
return
;
}
String
type
=
rs
.
getString
(
"TYPE_NAME"
);
String
type
=
rs
.
getString
(
"TYPE_NAME"
);
// a procedures column size is identified by PRECISION, for table this
// a procedures column size is identified by PRECISION, for table this
// is COLUMN_SIZE
// is COLUMN_SIZE
String
precisionColumnName
;
String
precisionColumnName
,
scaleColumnName
;
if
(
procedureColumn
)
{
if
(
procedureColumn
)
{
precisionColumnName
=
"PRECISION"
;
precisionColumnName
=
"PRECISION"
;
scaleColumnName
=
"SCALE"
;
}
else
{
}
else
{
precisionColumnName
=
"COLUMN_SIZE"
;
precisionColumnName
=
"COLUMN_SIZE"
;
scaleColumnName
=
"DECIMAL_DIGITS"
;
}
}
int
precision
=
rs
.
getInt
(
precisionColumnName
);
int
precision
=
rs
.
getInt
(
precisionColumnName
);
position
=
rs
.
getInt
(
"ORDINAL_POSITION"
);
if
(
precision
>
0
&&
!
contents
.
isSQLite
())
{
boolean
isSQLite
=
contents
.
isSQLite
();
int
scale
=
rs
.
getInt
(
scaleColumnName
);
if
(
precision
>
0
&&
!
isSQLite
)
{
if
(
scale
>
0
)
{
type
+=
"("
+
precision
;
type
=
type
+
'('
+
precision
+
", "
+
scale
+
')'
;
String
scaleColumnName
;
if
(
procedureColumn
)
{
scaleColumnName
=
"SCALE"
;
}
else
{
}
else
{
scaleColumnName
=
"DECIMAL_DIGITS"
;
type
=
type
+
'('
+
precision
+
')'
;
}
int
prec
=
rs
.
getInt
(
scaleColumnName
);
if
(
prec
>
0
)
{
type
+=
", "
+
prec
;
}
}
type
+=
")"
;
}
}
if
(
rs
.
getInt
(
"NULLABLE"
)
==
DatabaseMetaData
.
columnNoNulls
)
{
if
(
rs
.
getInt
(
"NULLABLE"
)
==
DatabaseMetaData
.
columnNoNulls
)
{
type
+=
" NOT NULL"
;
type
+=
" NOT NULL"
;
...
...
h2/src/main/org/h2/bnf/context/DbSchema.java
浏览文件 @
f27c631e
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
package
org
.
h2
.
bnf
.
context
;
package
org
.
h2
.
bnf
.
context
;
import
java.sql.DatabaseMetaData
;
import
java.sql.DatabaseMetaData
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -119,9 +120,13 @@ public class DbSchema {
...
@@ -119,9 +120,13 @@ public class DbSchema {
rs
.
close
();
rs
.
close
();
tables
=
list
.
toArray
(
new
DbTableOrView
[
0
]);
tables
=
list
.
toArray
(
new
DbTableOrView
[
0
]);
if
(
tables
.
length
<
SysProperties
.
CONSOLE_MAX_TABLES_LIST_COLUMNS
)
{
if
(
tables
.
length
<
SysProperties
.
CONSOLE_MAX_TABLES_LIST_COLUMNS
)
{
try
(
PreparedStatement
ps
=
contents
.
isH2
()
?
meta
.
getConnection
().
prepareStatement
(
"SELECT COLUMN_NAME, ORDINAL_POSITION, COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS"
+
" WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ?"
)
:
null
)
{
for
(
DbTableOrView
tab
:
tables
)
{
for
(
DbTableOrView
tab
:
tables
)
{
try
{
try
{
tab
.
readColumns
(
meta
);
tab
.
readColumns
(
meta
,
ps
);
}
catch
(
SQLException
e
)
{
}
catch
(
SQLException
e
)
{
// MySQL:
// MySQL:
// View '...' references invalid table(s) or column(s)
// View '...' references invalid table(s) or column(s)
...
@@ -132,6 +137,7 @@ public class DbSchema {
...
@@ -132,6 +137,7 @@ public class DbSchema {
}
}
}
}
}
}
}
/**
/**
* Read all procedures in the database.
* Read all procedures in the database.
...
...
h2/src/main/org/h2/bnf/context/DbTableOrView.java
浏览文件 @
f27c631e
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
package
org
.
h2
.
bnf
.
context
;
package
org
.
h2
.
bnf
.
context
;
import
java.sql.DatabaseMetaData
;
import
java.sql.DatabaseMetaData
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -88,9 +89,18 @@ public class DbTableOrView {
...
@@ -88,9 +89,18 @@ public class DbTableOrView {
* Read the column for this table from the database meta data.
* Read the column for this table from the database meta data.
*
*
* @param meta the database meta data
* @param meta the database meta data
* @param ps prepared statement with custom query for H2 database, null for
* others
*/
*/
public
void
readColumns
(
DatabaseMetaData
meta
)
throws
SQLException
{
public
void
readColumns
(
DatabaseMetaData
meta
,
PreparedStatement
ps
)
throws
SQLException
{
ResultSet
rs
=
meta
.
getColumns
(
null
,
schema
.
name
,
name
,
null
);
ResultSet
rs
;
if
(
schema
.
getContents
().
isH2
())
{
ps
.
setString
(
1
,
schema
.
name
);
ps
.
setString
(
2
,
name
);
rs
=
ps
.
executeQuery
();
}
else
{
rs
=
meta
.
getColumns
(
null
,
schema
.
name
,
name
,
null
);
}
ArrayList
<
DbColumn
>
list
=
new
ArrayList
<>();
ArrayList
<
DbColumn
>
list
=
new
ArrayList
<>();
while
(
rs
.
next
())
{
while
(
rs
.
next
())
{
DbColumn
column
=
DbColumn
.
getColumn
(
schema
.
getContents
(),
rs
);
DbColumn
column
=
DbColumn
.
getColumn
(
schema
.
getContents
(),
rs
);
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
f27c631e
...
@@ -805,4 +805,4 @@ queryparser tokenized freeze factorings recompilation unenclosed rfe dsync
...
@@ -805,4 +805,4 @@ queryparser tokenized freeze factorings recompilation unenclosed rfe dsync
econd irst bcef ordinality nord unnest
econd irst bcef ordinality nord unnest
analyst occupation distributive josaph aor engineer sajeewa isuru randil kevin doctor businessman artist ashan
analyst occupation distributive josaph aor engineer sajeewa isuru randil kevin doctor businessman artist ashan
corrupts splitted disruption unintentional octets preconditions predicates subq objectweb insn opcodes
corrupts splitted disruption unintentional octets preconditions predicates subq objectweb insn opcodes
preserves masking holder unboxing avert iae transformed subtle reevaluate exclusions subclause
preserves masking holder unboxing avert iae transformed subtle reevaluate exclusions subclause
ftbl
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论