Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
88a7bfaa
Unverified
提交
88a7bfaa
authored
2月 05, 2018
作者:
Noel Grandin
提交者:
GitHub
2月 05, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #843 from katzyn/misc
Add MEDIAN to help.csv and fix building of documentation
上级
13796c1a
3e9267f8
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
33 行增加
和
18 行删除
+33
-18
help.csv
h2/src/docsrc/help/help.csv
+15
-2
Select.java
h2/src/main/org/h2/command/dml/Select.java
+1
-1
Aggregate.java
h2/src/main/org/h2/expression/Aggregate.java
+1
-1
Operation.java
h2/src/main/org/h2/expression/Operation.java
+8
-8
TestIndex.java
h2/src/test/org/h2/test/db/TestIndex.java
+2
-1
TestValue.java
h2/src/test/org/h2/test/unit/TestValue.java
+3
-3
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+3
-2
没有找到文件。
h2/src/docsrc/help/help.csv
浏览文件 @
88a7bfaa
...
...
@@ -498,7 +498,7 @@ qualified class name. The class must implement the interface
Admin rights are required to execute this command.
This command commits an open transaction in this connection.
","
CREATE AGGREGATE MEDIAN FOR ""com.acme.db.Median""
CREATE AGGREGATE
SIMPLE_
MEDIAN FOR ""com.acme.db.Median""
"
"Commands (DDL)","CREATE ALIAS","
...
...
@@ -821,7 +821,7 @@ Drops an existing user-defined aggregate function.
Admin rights are required to execute this command.
This command commits an open transaction in this connection.
","
DROP AGGREGATE MEDIAN
DROP AGGREGATE
SIMPLE_
MEDIAN
"
"Commands (DDL)","DROP ALIAS","
...
...
@@ -2801,6 +2801,19 @@ Aggregates are only allowed in select statements.
VAR_SAMP(X)
"
"Functions (Aggregate)","MEDIAN","
MEDIAN( [ DISTINCT ] value )
","
The value separating the higher half of a values from the lower half.
Returns the middle value or an interpolated value between two middle values if number of values is even.
Interpolation is only supported for numeric, date, and time data types.
NULL values are ignored in the calculation.
If no rows are selected, the result is NULL.
Aggregates are only allowed in select statements.
","
MEDIAN(X)
"
"Functions (Numeric)","ABS","
ABS ( { numeric } )
","
...
...
h2/src/main/org/h2/command/dml/Select.java
浏览文件 @
88a7bfaa
...
...
@@ -77,7 +77,7 @@ public class Select extends Query {
boolean
[]
groupByExpression
;
/**
* Th
h
e current group-by values.
* The current group-by values.
*/
HashMap
<
Expression
,
Object
>
currentGroup
;
...
...
h2/src/main/org/h2/expression/Aggregate.java
浏览文件 @
88a7bfaa
...
...
@@ -131,7 +131,7 @@ public class Aggregate extends Expression {
MEDIAN
}
private
static
final
HashMap
<
String
,
AggregateType
>
AGGREGATES
=
new
HashMap
<>(
2
4
);
private
static
final
HashMap
<
String
,
AggregateType
>
AGGREGATES
=
new
HashMap
<>(
2
5
);
private
final
AggregateType
type
;
private
final
Select
select
;
...
...
h2/src/main/org/h2/expression/Operation.java
浏览文件 @
88a7bfaa
...
...
@@ -27,38 +27,38 @@ public class Operation extends Expression {
* This operation represents a string concatenation as in
* 'Hello' || 'World'.
*/
CONCAT
,
CONCAT
,
/**
* This operation represents an addition as in 1 + 2.
*/
PLUS
,
PLUS
,
/**
* This operation represents a subtraction as in 2 - 1.
*/
MINUS
,
MINUS
,
/**
* This operation represents a multiplication as in 2 * 3.
*/
MULTIPLY
,
MULTIPLY
,
/**
* This operation represents a division as in 4 * 2.
*/
DIVIDE
,
DIVIDE
,
/**
* This operation represents a negation as in - ID.
*/
NEGATE
,
NEGATE
,
/**
* This operation represents a modulus as in 5 % 2.
*/
MODULUS
}
;
MODULUS
}
private
OpType
opType
;
private
Expression
left
,
right
;
...
...
h2/src/test/org/h2/test/db/TestIndex.java
浏览文件 @
88a7bfaa
...
...
@@ -262,7 +262,8 @@ public class TestIndex extends TestBase {
c
.
close
();
}
private
void
testConcurrentUpdateRun
(
ConcurrentUpdateThread
[]
threads
,
PreparedStatement
check
)
throws
SQLException
{
private
void
testConcurrentUpdateRun
(
ConcurrentUpdateThread
[]
threads
,
PreparedStatement
check
)
throws
SQLException
{
for
(
ConcurrentUpdateThread
t
:
threads
)
{
t
.
start
();
}
...
...
h2/src/test/org/h2/test/unit/TestValue.java
浏览文件 @
88a7bfaa
...
...
@@ -307,10 +307,10 @@ public class TestValue extends TestBase {
}
private
void
testTimestamp
()
{
ValueTimestamp
v
t
s
=
ValueTimestamp
.
parse
(
"2000-01-15 10:20:30.333222111"
);
ValueTimestamp
v
alueT
s
=
ValueTimestamp
.
parse
(
"2000-01-15 10:20:30.333222111"
);
Timestamp
ts
=
Timestamp
.
valueOf
(
"2000-01-15 10:20:30.333222111"
);
assertEquals
(
ts
.
toString
(),
v
t
s
.
getString
());
assertEquals
(
ts
,
v
t
s
.
getTimestamp
());
assertEquals
(
ts
.
toString
(),
v
alueT
s
.
getString
());
assertEquals
(
ts
,
v
alueT
s
.
getTimestamp
());
Calendar
c
=
Calendar
.
getInstance
(
TimeZone
.
getTimeZone
(
"Europe/Berlin"
));
c
.
set
(
2018
,
02
,
25
,
1
,
59
,
00
);
c
.
set
(
Calendar
.
MILLISECOND
,
123
);
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
88a7bfaa
...
...
@@ -760,5 +760,6 @@ zzbbzz cldr booleans maria enquotes mtc cbuf checksummed nreturn despite bbzz re
unconditionally coco aren eecccc decimals charsets zzbb lsb msb usecount outdir endian misleading precompiled
assorted reimplemented hangups confirmation predefined
mdy destfile hclf forbids spellchecking selfdestruct expects accident jacocoagent cli historic mitigate
jacoco xdata invokes sourcefiles classfiles duplication crypto stacktraces prt directions handled overly asm hardcoded
mdy destfile hclf forbids spellchecking selfdestruct expects accident jacocoagent cli historic mitigate
jacoco xdata invokes sourcefiles classfiles duplication crypto stacktraces prt directions handled overly asm hardcoded
interpolated thead
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论