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
...
@@ -317,7 +317,7 @@ public abstract class Expression {
...
@@ -317,7 +317,7 @@ public abstract class Expression {
public
static
Expression
[]
getExpressionColumns
(
Session
session
,
ValueArray
value
)
{
public
static
Expression
[]
getExpressionColumns
(
Session
session
,
ValueArray
value
)
{
Value
[]
list
=
value
.
getList
();
Value
[]
list
=
value
.
getList
();
ExpressionColumn
[]
expr
=
new
ExpressionColumn
[
list
.
length
];
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
];
Value
v
=
list
[
i
];
Column
col
=
new
Column
(
"C"
+
(
i
+
1
),
v
.
getType
(),
v
.
getPrecision
(),
v
.
getScale
(),
Column
col
=
new
Column
(
"C"
+
(
i
+
1
),
v
.
getType
(),
v
.
getPrecision
(),
v
.
getScale
(),
v
.
getDisplaySize
());
v
.
getDisplaySize
());
...
...
h2/src/main/org/h2/expression/JavaAggregate.java
浏览文件 @
c940fbb4
...
@@ -99,16 +99,17 @@ public class JavaAggregate extends Expression {
...
@@ -99,16 +99,17 @@ public class JavaAggregate extends Expression {
}
}
public
void
mapColumns
(
ColumnResolver
resolver
,
int
level
)
{
public
void
mapColumns
(
ColumnResolver
resolver
,
int
level
)
{
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++
)
{
for
(
Expression
arg
:
args
)
{
arg
s
[
i
]
.
mapColumns
(
resolver
,
level
);
arg
.
mapColumns
(
resolver
,
level
);
}
}
}
}
public
Expression
optimize
(
Session
session
)
{
public
Expression
optimize
(
Session
session
)
{
userConnection
=
session
.
createConnection
(
false
);
userConnection
=
session
.
createConnection
(
false
);
argTypes
=
new
int
[
args
.
length
];
int
len
=
args
.
length
;
int
[]
argSqlTypes
=
new
int
[
args
.
length
];
argTypes
=
new
int
[
len
];
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++)
{
int
[]
argSqlTypes
=
new
int
[
len
];
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
Expression
expr
=
args
[
i
];
Expression
expr
=
args
[
i
];
args
[
i
]
=
expr
.
optimize
(
session
);
args
[
i
]
=
expr
.
optimize
(
session
);
int
type
=
expr
.
getType
();
int
type
=
expr
.
getType
();
...
@@ -178,7 +179,7 @@ public class JavaAggregate extends Expression {
...
@@ -178,7 +179,7 @@ public class JavaAggregate extends Expression {
}
}
Object
[]
argValues
=
new
Object
[
args
.
length
];
Object
[]
argValues
=
new
Object
[
args
.
length
];
Object
arg
=
null
;
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
);
Value
v
=
args
[
i
].
getValue
(
session
);
v
=
v
.
convertTo
(
argTypes
[
i
]);
v
=
v
.
convertTo
(
argTypes
[
i
]);
arg
=
v
.
getObject
();
arg
=
v
.
getObject
();
...
...
h2/src/main/org/h2/expression/JavaFunction.java
浏览文件 @
c940fbb4
...
@@ -53,7 +53,7 @@ public class JavaFunction extends Expression implements FunctionCall {
...
@@ -53,7 +53,7 @@ public class JavaFunction extends Expression implements FunctionCall {
public
Expression
optimize
(
Session
session
)
{
public
Expression
optimize
(
Session
session
)
{
boolean
allConst
=
isDeterministic
();
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
);
Expression
e
=
args
[
i
].
optimize
(
session
);
args
[
i
]
=
e
;
args
[
i
]
=
e
;
allConst
&=
e
.
isConstant
();
allConst
&=
e
.
isConstant
();
...
@@ -160,9 +160,9 @@ public class JavaFunction extends Expression implements FunctionCall {
...
@@ -160,9 +160,9 @@ public class JavaFunction extends Expression implements FunctionCall {
public
Expression
[]
getExpressionColumns
(
Session
session
)
{
public
Expression
[]
getExpressionColumns
(
Session
session
)
{
switch
(
getType
())
{
switch
(
getType
())
{
case
Value
.
RESULT_SET
:
case
Value
.
RESULT_SET
:
ValueResultSet
v
rs
=
getValueForColumnList
(
session
,
getArgs
());
ValueResultSet
rs
=
getValueForColumnList
(
session
,
getArgs
());
try
{
try
{
return
getExpressionColumns
(
session
,
v
rs
.
getResultSet
());
return
getExpressionColumns
(
session
,
rs
.
getResultSet
());
}
catch
(
SQLException
e
)
{
}
catch
(
SQLException
e
)
{
throw
DbException
.
convert
(
e
);
throw
DbException
.
convert
(
e
);
}
}
...
...
h2/src/main/org/h2/expression/Subquery.java
浏览文件 @
c940fbb4
...
@@ -96,14 +96,14 @@ public class Subquery extends Expression {
...
@@ -96,14 +96,14 @@ public class Subquery extends Expression {
private
Expression
getExpression
()
{
private
Expression
getExpression
()
{
if
(
expression
==
null
)
{
if
(
expression
==
null
)
{
ArrayList
<
Expression
>
exprs
=
query
.
getExpressions
();
ArrayList
<
Expression
>
expr
ession
s
=
query
.
getExpressions
();
int
columnCount
=
query
.
getColumnCount
();
int
columnCount
=
query
.
getColumnCount
();
if
(
columnCount
==
1
)
{
if
(
columnCount
==
1
)
{
expression
=
exprs
.
get
(
0
);
expression
=
expr
ession
s
.
get
(
0
);
}
else
{
}
else
{
Expression
[]
list
=
new
Expression
[
columnCount
];
Expression
[]
list
=
new
Expression
[
columnCount
];
for
(
int
i
=
0
;
i
<
columnCount
;
i
++)
{
for
(
int
i
=
0
;
i
<
columnCount
;
i
++)
{
list
[
i
]
=
exprs
.
get
(
i
);
list
[
i
]
=
expr
ession
s
.
get
(
i
);
}
}
expression
=
new
ExpressionList
(
list
);
expression
=
new
ExpressionList
(
list
);
}
}
...
...
h2/src/main/org/h2/fulltext/FullText.java
浏览文件 @
c940fbb4
...
@@ -961,8 +961,7 @@ public class FullText {
...
@@ -961,8 +961,7 @@ public class FullText {
private
int
[]
getWordIds
(
Object
[]
row
)
throws
SQLException
{
private
int
[]
getWordIds
(
Object
[]
row
)
throws
SQLException
{
HashSet
<
String
>
words
=
New
.
hashSet
();
HashSet
<
String
>
words
=
New
.
hashSet
();
for
(
int
i
=
0
;
i
<
index
.
indexColumns
.
length
;
i
++)
{
for
(
int
idx
:
index
.
indexColumns
)
{
int
idx
=
index
.
indexColumns
[
i
];
int
type
=
columnTypes
[
idx
];
int
type
=
columnTypes
[
idx
];
Object
data
=
row
[
idx
];
Object
data
=
row
[
idx
];
if
(
type
==
Types
.
CLOB
&&
data
!=
null
)
{
if
(
type
==
Types
.
CLOB
&&
data
!=
null
)
{
...
...
h2/src/main/org/h2/fulltext/FullTextLucene.java
浏览文件 @
c940fbb4
...
@@ -430,8 +430,9 @@ public class FullTextLucene extends FullText {
...
@@ -430,8 +430,9 @@ public class FullTextLucene extends FullText {
if (limit == 0) {
if (limit == 0) {
limit = docs.totalHits;
limit = docs.totalHits;
}
}
for (int i = 0; i < limit && i + offset < docs.totalHits
for (int i = 0, len = docs.scoreDocs.length;
&& i + offset < docs.scoreDocs.length; i++) {
i < limit && i + offset < docs.totalHits
&& i + offset < len; i++) {
ScoreDoc sd = docs.scoreDocs[i + offset];
ScoreDoc sd = docs.scoreDocs[i + offset];
Document doc = searcher.doc(sd.doc);
Document doc = searcher.doc(sd.doc);
float score = sd.score;
float score = sd.score;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论