Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
c940fbb4
提交
c940fbb4
authored
10月 09, 2010
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Small improvements.
上级
aa455b32
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
23 行增加
和
22 行删除
+23
-22
Expression.java
h2/src/main/org/h2/expression/Expression.java
+6
-6
JavaAggregate.java
h2/src/main/org/h2/expression/JavaAggregate.java
+7
-6
JavaFunction.java
h2/src/main/org/h2/expression/JavaFunction.java
+3
-3
Subquery.java
h2/src/main/org/h2/expression/Subquery.java
+3
-3
FullText.java
h2/src/main/org/h2/fulltext/FullText.java
+1
-2
FullTextLucene.java
h2/src/main/org/h2/fulltext/FullTextLucene.java
+3
-2
没有找到文件。
h2/src/main/org/h2/expression/Expression.java
浏览文件 @
c940fbb4
...
...
@@ -300,7 +300,7 @@ public abstract class Expression {
/**
* If this expression consists of column expressions it should return them.
*
*
* @return array of expression columns if applicable, null otherwise
*/
public
Expression
[]
getExpressionColumns
(
Session
session
)
{
...
...
@@ -309,7 +309,7 @@ public abstract class Expression {
/**
* Extracts expression columns from ValueArray
*
*
* @param session the current session
* @param value the value to extract columns from
* @return array of expression columns
...
...
@@ -317,7 +317,7 @@ public abstract class Expression {
public
static
Expression
[]
getExpressionColumns
(
Session
session
,
ValueArray
value
)
{
Value
[]
list
=
value
.
getList
();
ExpressionColumn
[]
expr
=
new
ExpressionColumn
[
list
.
length
];
for
(
int
i
=
0
;
i
<
list
.
length
;
i
++)
{
for
(
int
i
=
0
,
len
=
list
.
length
;
i
<
len
;
i
++)
{
Value
v
=
list
[
i
];
Column
col
=
new
Column
(
"C"
+
(
i
+
1
),
v
.
getType
(),
v
.
getPrecision
(),
v
.
getScale
(),
v
.
getDisplaySize
());
...
...
@@ -327,11 +327,11 @@ public abstract class Expression {
}
/**
* Extracts expression columns from the given result set.
*
* Extracts expression columns from the given result set.
*
* @param session the session
* @param rs the result set
* @return an array of expression columns
* @return an array of expression columns
* @throws SQLException
*/
public
static
Expression
[]
getExpressionColumns
(
Session
session
,
ResultSet
rs
)
throws
SQLException
{
...
...
h2/src/main/org/h2/expression/JavaAggregate.java
浏览文件 @
c940fbb4
...
...
@@ -99,16 +99,17 @@ public class JavaAggregate extends Expression {
}
public
void
mapColumns
(
ColumnResolver
resolver
,
int
level
)
{
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++
)
{
arg
s
[
i
]
.
mapColumns
(
resolver
,
level
);
for
(
Expression
arg
:
args
)
{
arg
.
mapColumns
(
resolver
,
level
);
}
}
public
Expression
optimize
(
Session
session
)
{
userConnection
=
session
.
createConnection
(
false
);
argTypes
=
new
int
[
args
.
length
];
int
[]
argSqlTypes
=
new
int
[
args
.
length
];
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++)
{
int
len
=
args
.
length
;
argTypes
=
new
int
[
len
];
int
[]
argSqlTypes
=
new
int
[
len
];
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
Expression
expr
=
args
[
i
];
args
[
i
]
=
expr
.
optimize
(
session
);
int
type
=
expr
.
getType
();
...
...
@@ -178,7 +179,7 @@ public class JavaAggregate extends Expression {
}
Object
[]
argValues
=
new
Object
[
args
.
length
];
Object
arg
=
null
;
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++)
{
for
(
int
i
=
0
,
len
=
args
.
length
;
i
<
len
;
i
++)
{
Value
v
=
args
[
i
].
getValue
(
session
);
v
=
v
.
convertTo
(
argTypes
[
i
]);
arg
=
v
.
getObject
();
...
...
h2/src/main/org/h2/expression/JavaFunction.java
浏览文件 @
c940fbb4
...
...
@@ -53,7 +53,7 @@ public class JavaFunction extends Expression implements FunctionCall {
public
Expression
optimize
(
Session
session
)
{
boolean
allConst
=
isDeterministic
();
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++)
{
for
(
int
i
=
0
,
len
=
args
.
length
;
i
<
len
;
i
++)
{
Expression
e
=
args
[
i
].
optimize
(
session
);
args
[
i
]
=
e
;
allConst
&=
e
.
isConstant
();
...
...
@@ -160,9 +160,9 @@ public class JavaFunction extends Expression implements FunctionCall {
public
Expression
[]
getExpressionColumns
(
Session
session
)
{
switch
(
getType
())
{
case
Value
.
RESULT_SET
:
ValueResultSet
v
rs
=
getValueForColumnList
(
session
,
getArgs
());
ValueResultSet
rs
=
getValueForColumnList
(
session
,
getArgs
());
try
{
return
getExpressionColumns
(
session
,
v
rs
.
getResultSet
());
return
getExpressionColumns
(
session
,
rs
.
getResultSet
());
}
catch
(
SQLException
e
)
{
throw
DbException
.
convert
(
e
);
}
...
...
h2/src/main/org/h2/expression/Subquery.java
浏览文件 @
c940fbb4
...
...
@@ -96,14 +96,14 @@ public class Subquery extends Expression {
private
Expression
getExpression
()
{
if
(
expression
==
null
)
{
ArrayList
<
Expression
>
exprs
=
query
.
getExpressions
();
ArrayList
<
Expression
>
expr
ession
s
=
query
.
getExpressions
();
int
columnCount
=
query
.
getColumnCount
();
if
(
columnCount
==
1
)
{
expression
=
exprs
.
get
(
0
);
expression
=
expr
ession
s
.
get
(
0
);
}
else
{
Expression
[]
list
=
new
Expression
[
columnCount
];
for
(
int
i
=
0
;
i
<
columnCount
;
i
++)
{
list
[
i
]
=
exprs
.
get
(
i
);
list
[
i
]
=
expr
ession
s
.
get
(
i
);
}
expression
=
new
ExpressionList
(
list
);
}
...
...
h2/src/main/org/h2/fulltext/FullText.java
浏览文件 @
c940fbb4
...
...
@@ -961,8 +961,7 @@ public class FullText {
private
int
[]
getWordIds
(
Object
[]
row
)
throws
SQLException
{
HashSet
<
String
>
words
=
New
.
hashSet
();
for
(
int
i
=
0
;
i
<
index
.
indexColumns
.
length
;
i
++)
{
int
idx
=
index
.
indexColumns
[
i
];
for
(
int
idx
:
index
.
indexColumns
)
{
int
type
=
columnTypes
[
idx
];
Object
data
=
row
[
idx
];
if
(
type
==
Types
.
CLOB
&&
data
!=
null
)
{
...
...
h2/src/main/org/h2/fulltext/FullTextLucene.java
浏览文件 @
c940fbb4
...
...
@@ -430,8 +430,9 @@ public class FullTextLucene extends FullText {
if (limit == 0) {
limit = docs.totalHits;
}
for (int i = 0; i < limit && i + offset < docs.totalHits
&& i + offset < docs.scoreDocs.length; i++) {
for (int i = 0, len = docs.scoreDocs.length;
i < limit && i + offset < docs.totalHits
&& i + offset < len; i++) {
ScoreDoc sd = docs.scoreDocs[i + offset];
Document doc = searcher.doc(sd.doc);
float score = sd.score;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论