Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
8722b796
Unverified
提交
8722b796
authored
6 年前
作者:
Noel Grandin
提交者:
GitHub
6 年前
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1642 from grandinj/javadoc3
update javadoc
上级
120d9255
1b6823d7
隐藏空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
83 行增加
和
13 行删除
+83
-13
Parser.java
h2/src/main/org/h2/command/Parser.java
+1
-1
Optimizer.java
h2/src/main/org/h2/command/dml/Optimizer.java
+1
-1
Select.java
h2/src/main/org/h2/command/dml/Select.java
+9
-1
SelectGroups.java
h2/src/main/org/h2/command/dml/SelectGroups.java
+1
-1
ConstraintReferential.java
h2/src/main/org/h2/constraint/ConstraintReferential.java
+3
-0
Database.java
h2/src/main/org/h2/engine/Database.java
+4
-0
ExpressionColumn.java
h2/src/main/org/h2/expression/ExpressionColumn.java
+5
-0
Function.java
h2/src/main/org/h2/expression/function/Function.java
+10
-0
DbException.java
h2/src/main/org/h2/message/DbException.java
+1
-1
Transaction.java
h2/src/main/org/h2/mvstore/tx/Transaction.java
+4
-0
Plan.java
h2/src/main/org/h2/table/Plan.java
+1
-0
Console.java
h2/src/main/org/h2/tools/Console.java
+8
-0
IntervalUtils.java
h2/src/main/org/h2/util/IntervalUtils.java
+1
-1
StringUtils.java
h2/src/main/org/h2/util/StringUtils.java
+9
-0
GeometryUtils.java
h2/src/main/org/h2/util/geometry/GeometryUtils.java
+7
-2
JTSUtils.java
h2/src/main/org/h2/util/geometry/JTSUtils.java
+3
-0
ExtTypeInfoEnum.java
h2/src/main/org/h2/value/ExtTypeInfoEnum.java
+10
-0
Value.java
h2/src/main/org/h2/value/Value.java
+1
-1
ValueInterval.java
h2/src/main/org/h2/value/ValueInterval.java
+3
-3
TestAnalyzeTableTx.java
h2/src/test/org/h2/test/db/TestAnalyzeTableTx.java
+1
-1
没有找到文件。
h2/src/main/org/h2/command/Parser.java
浏览文件 @
8722b796
...
@@ -6941,7 +6941,7 @@ public class Parser {
...
@@ -6941,7 +6941,7 @@ public class Parser {
}
}
/**
/**
*
Checks the table is the DUAL special table.
*
Is this the Oracle DUAL table or the IBM/DB2 SYSIBM table?
*
*
* @param tableName table name.
* @param tableName table name.
* @return {@code true} if the table is DUAL special table. Otherwise returns {@code false}.
* @return {@code true} if the table is DUAL special table. Otherwise returns {@code false}.
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/command/dml/Optimizer.java
浏览文件 @
8722b796
...
@@ -47,7 +47,7 @@ class Optimizer {
...
@@ -47,7 +47,7 @@ class Optimizer {
private
TableFilter
topFilter
;
private
TableFilter
topFilter
;
private
double
cost
;
private
double
cost
;
private
Random
random
;
private
Random
random
;
final
AllColumnsForPlan
allColumnsSet
;
private
final
AllColumnsForPlan
allColumnsSet
;
Optimizer
(
TableFilter
[]
filters
,
Expression
condition
,
Session
session
)
{
Optimizer
(
TableFilter
[]
filters
,
Expression
condition
,
Session
session
)
{
this
.
filters
=
filters
;
this
.
filters
=
filters
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/command/dml/Select.java
浏览文件 @
8722b796
...
@@ -105,6 +105,9 @@ public class Select extends Query {
...
@@ -105,6 +105,9 @@ public class Select extends Query {
*/
*/
boolean
[]
groupByExpression
;
boolean
[]
groupByExpression
;
/**
* Grouped data for aggregates.
*/
SelectGroups
groupData
;
SelectGroups
groupData
;
private
int
havingIndex
;
private
int
havingIndex
;
...
@@ -161,6 +164,9 @@ public class Select extends Query {
...
@@ -161,6 +164,9 @@ public class Select extends Query {
this
.
expressions
=
expressions
;
this
.
expressions
=
expressions
;
}
}
/**
* Sets a wildcard expression as in "SELECT * FROM TEST".
*/
public
void
setWildcard
()
{
public
void
setWildcard
()
{
expressions
=
new
ArrayList
<>(
1
);
expressions
=
new
ArrayList
<>(
1
);
expressions
.
add
(
new
Wildcard
(
null
,
null
));
expressions
.
add
(
new
Wildcard
(
null
,
null
));
...
@@ -201,7 +207,9 @@ public class Select extends Query {
...
@@ -201,7 +207,9 @@ public class Select extends Query {
}
}
/**
/**
* Set the distinct expressions.
* Set the DISTINCT ON expressions.
*
* @param distinctExpressions array of expressions
*/
*/
public
void
setDistinct
(
Expression
[]
distinctExpressions
)
{
public
void
setDistinct
(
Expression
[]
distinctExpressions
)
{
if
(
distinct
)
{
if
(
distinct
)
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/command/dml/SelectGroups.java
浏览文件 @
8722b796
...
@@ -195,7 +195,7 @@ public abstract class SelectGroups {
...
@@ -195,7 +195,7 @@ public abstract class SelectGroups {
}
}
/**
/**
* The session.
* The
database
session.
*/
*/
final
Session
session
;
final
Session
session
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/constraint/ConstraintReferential.java
浏览文件 @
8722b796
...
@@ -471,6 +471,9 @@ public class ConstraintReferential extends Constraint {
...
@@ -471,6 +471,9 @@ public class ConstraintReferential extends Constraint {
buildDeleteSQL
();
buildDeleteSQL
();
}
}
/**
* Update the constraint SQL when a referenced column is renamed.
*/
public
void
updateOnTableColumnRename
()
{
public
void
updateOnTableColumnRename
()
{
if
(
deleteAction
!=
null
)
{
if
(
deleteAction
!=
null
)
{
deleteSQL
=
null
;
deleteSQL
=
null
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/Database.java
浏览文件 @
8722b796
...
@@ -1149,6 +1149,10 @@ public class Database implements DataHandler {
...
@@ -1149,6 +1149,10 @@ public class Database implements DataHandler {
}
}
}
}
/**
* Mark some database ids as unused.
* @param idsToRelease the ids to release
*/
void
releaseDatabaseObjectIds
(
BitSet
idsToRelease
)
{
void
releaseDatabaseObjectIds
(
BitSet
idsToRelease
)
{
synchronized
(
objectIds
)
{
synchronized
(
objectIds
)
{
objectIds
.
andNot
(
idsToRelease
);
objectIds
.
andNot
(
idsToRelease
);
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/expression/ExpressionColumn.java
浏览文件 @
8722b796
...
@@ -155,6 +155,11 @@ public class ExpressionColumn extends Expression {
...
@@ -155,6 +155,11 @@ public class ExpressionColumn extends Expression {
return
columnResolver
.
optimize
(
this
,
column
);
return
columnResolver
.
optimize
(
this
,
column
);
}
}
/**
* Get exception to throw, with column and table info added
* @param code SQL error code
* @return DbException
*/
public
DbException
getColumnException
(
int
code
)
{
public
DbException
getColumnException
(
int
code
)
{
String
name
=
columnName
;
String
name
=
columnName
;
if
(
tableAlias
!=
null
)
{
if
(
tableAlias
!=
null
)
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/expression/function/Function.java
浏览文件 @
8722b796
...
@@ -1141,6 +1141,16 @@ public class Function extends Expression implements FunctionCall {
...
@@ -1141,6 +1141,16 @@ public class Function extends Expression implements FunctionCall {
return
new
Parser
(
session
).
parseTableName
(
tableName
.
getString
());
return
new
Parser
(
session
).
parseTableName
(
tableName
.
getString
());
}
}
/**
* Get value transformed by expression, or null if i is out of range or
* the input value is null.
*
* @param session database session
* @param args expressions
* @param values array of input values
* @param i index of value of transform
* @return value or null
*/
protected
static
Value
getNullOrValue
(
Session
session
,
Expression
[]
args
,
protected
static
Value
getNullOrValue
(
Session
session
,
Expression
[]
args
,
Value
[]
values
,
int
i
)
{
Value
[]
values
,
int
i
)
{
if
(
i
>=
args
.
length
)
{
if
(
i
>=
args
.
length
)
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/message/DbException.java
浏览文件 @
8722b796
...
@@ -56,7 +56,7 @@ public class DbException extends RuntimeException {
...
@@ -56,7 +56,7 @@ public class DbException extends RuntimeException {
private
static
final
Properties
MESSAGES
=
new
Properties
();
private
static
final
Properties
MESSAGES
=
new
Properties
();
/**
/**
* Thrown when OOME exception
is happened
on handle error
* Thrown when OOME exception
happens
on handle error
* inside {@link #convert(java.lang.Throwable)}.
* inside {@link #convert(java.lang.Throwable)}.
*/
*/
public
static
final
SQLException
SQL_OOME
=
public
static
final
SQLException
SQL_OOME
=
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/mvstore/tx/Transaction.java
浏览文件 @
8722b796
...
@@ -64,6 +64,10 @@ public class Transaction {
...
@@ -64,6 +64,10 @@ public class Transaction {
private
static
final
String
[]
STATUS_NAMES
=
{
private
static
final
String
[]
STATUS_NAMES
=
{
"CLOSED"
,
"OPEN"
,
"PREPARED"
,
"COMMITTED"
,
"ROLLING_BACK"
,
"ROLLED_BACK"
"CLOSED"
,
"OPEN"
,
"PREPARED"
,
"COMMITTED"
,
"ROLLING_BACK"
,
"ROLLED_BACK"
};
};
/**
* How many bits of the "operation id" we store in the transaction belong to the
* log id (the rest belong to the transaction id).
*/
static
final
int
LOG_ID_BITS
=
40
;
static
final
int
LOG_ID_BITS
=
40
;
private
static
final
int
LOG_ID_BITS1
=
LOG_ID_BITS
+
1
;
private
static
final
int
LOG_ID_BITS1
=
LOG_ID_BITS
+
1
;
private
static
final
long
LOG_ID_LIMIT
=
1L
<<
LOG_ID_BITS
;
private
static
final
long
LOG_ID_LIMIT
=
1L
<<
LOG_ID_BITS
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/table/Plan.java
浏览文件 @
8722b796
...
@@ -102,6 +102,7 @@ public class Plan {
...
@@ -102,6 +102,7 @@ public class Plan {
* Calculate the cost of this query plan.
* Calculate the cost of this query plan.
*
*
* @param session the session
* @param session the session
* @param allColumnsSet calculates all columns on-demand
* @return the cost
* @return the cost
*/
*/
public
double
calculateCost
(
Session
session
,
AllColumnsForPlan
allColumnsSet
)
{
public
double
calculateCost
(
Session
session
,
AllColumnsForPlan
allColumnsSet
)
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/tools/Console.java
浏览文件 @
8722b796
...
@@ -255,6 +255,9 @@ public class Console extends Tool implements ShutdownHandler {
...
@@ -255,6 +255,9 @@ public class Console extends Tool implements ShutdownHandler {
}
}
}
}
/**
* Overridden by GUIConsole to show a window
*/
void
show
()
{
void
show
()
{
}
}
...
@@ -287,6 +290,11 @@ public class Console extends Tool implements ShutdownHandler {
...
@@ -287,6 +290,11 @@ public class Console extends Tool implements ShutdownHandler {
}
}
}
}
/**
* Open a new browser tab or window with the given URL.
*
* @param url the URL to open
*/
void
openBrowser
(
String
url
)
{
void
openBrowser
(
String
url
)
{
try
{
try
{
Server
.
openBrowser
(
url
);
Server
.
openBrowser
(
url
);
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/util/IntervalUtils.java
浏览文件 @
8722b796
...
@@ -328,7 +328,7 @@ public class IntervalUtils {
...
@@ -328,7 +328,7 @@ public class IntervalUtils {
return
ValueInterval
.
from
(
qualifier
,
negative
,
leading
,
remaining
);
return
ValueInterval
.
from
(
qualifier
,
negative
,
leading
,
remaining
);
}
}
static
ValueInterval
parseInterval2
(
IntervalQualifier
qualifier
,
String
s
,
char
ch
,
int
max
,
boolean
negative
)
{
private
static
ValueInterval
parseInterval2
(
IntervalQualifier
qualifier
,
String
s
,
char
ch
,
int
max
,
boolean
negative
)
{
long
leading
;
long
leading
;
long
remaining
;
long
remaining
;
int
dash
=
s
.
indexOf
(
ch
,
1
);
int
dash
=
s
.
indexOf
(
ch
,
1
);
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/util/StringUtils.java
浏览文件 @
8722b796
...
@@ -172,6 +172,15 @@ public class StringUtils {
...
@@ -172,6 +172,15 @@ public class StringUtils {
return
buff
.
toString
();
return
buff
.
toString
();
}
}
/**
* Convert a string to a Java literal using the correct escape sequences.
* The literal is not enclosed in double quotes. The result can be used in
* properties files or in Java source code.
*
* @param s the text to convert
* @param buff the Java representation to return
* @param forSQL true if we embedding this inside a STRINGDECODE SQL command
*/
public
static
void
javaEncode
(
String
s
,
StringBuilder
buff
,
boolean
forSQL
)
{
public
static
void
javaEncode
(
String
s
,
StringBuilder
buff
,
boolean
forSQL
)
{
int
length
=
s
.
length
();
int
length
=
s
.
length
();
for
(
int
i
=
0
;
i
<
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
length
;
i
++)
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/util/geometry/GeometryUtils.java
浏览文件 @
8722b796
...
@@ -167,7 +167,7 @@ public final class GeometryUtils {
...
@@ -167,7 +167,7 @@ public final class GeometryUtils {
*/
*/
private
boolean
set
;
private
boolean
set
;
double
minX
,
maxX
,
minY
,
maxY
;
private
double
minX
,
maxX
,
minY
,
maxY
;
/**
/**
* Creates a new envelope calculation target.
* Creates a new envelope calculation target.
...
@@ -295,7 +295,7 @@ public final class GeometryUtils {
...
@@ -295,7 +295,7 @@ public final class GeometryUtils {
*/
*/
private
boolean
set
;
private
boolean
set
;
double
minX
,
maxX
,
minY
,
maxY
;
private
double
minX
,
maxX
,
minY
,
maxY
;
private
boolean
hasZ
;
private
boolean
hasZ
;
...
@@ -567,6 +567,11 @@ public final class GeometryUtils {
...
@@ -567,6 +567,11 @@ public final class GeometryUtils {
return
Double
.
isNaN
(
d
)
?
Double
.
NaN
:
d
==
0
d
?
0
d
:
d
;
return
Double
.
isNaN
(
d
)
?
Double
.
NaN
:
d
==
0
d
?
0
d
:
d
;
}
}
/**
* Throw exception if param is not finite value (ie. NaN/inf/etc)
* @param d double value
* @return same double value
*/
static
double
checkFinite
(
double
d
)
{
static
double
checkFinite
(
double
d
)
{
// Do not push this negation down, it will break NaN rejection
// Do not push this negation down, it will break NaN rejection
if
(!(
Math
.
abs
(
d
)
<=
Double
.
MAX_VALUE
))
{
if
(!(
Math
.
abs
(
d
)
<=
Double
.
MAX_VALUE
))
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/util/geometry/JTSUtils.java
浏览文件 @
8722b796
...
@@ -56,6 +56,9 @@ public final class JTSUtils {
...
@@ -56,6 +56,9 @@ public final class JTSUtils {
*/
*/
public
static
final
boolean
M_IS_SUPPORTED
;
public
static
final
boolean
M_IS_SUPPORTED
;
/**
* create(int,int,int) method from CoordinateSequenceFactory, if it exists
*/
static
final
Method
CREATE
;
static
final
Method
CREATE
;
private
static
final
Method
GET_MEASURES
;
private
static
final
Method
GET_MEASURES
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/value/ExtTypeInfoEnum.java
浏览文件 @
8722b796
...
@@ -132,6 +132,11 @@ public final class ExtTypeInfoEnum extends ExtTypeInfo {
...
@@ -132,6 +132,11 @@ public final class ExtTypeInfoEnum extends ExtTypeInfo {
return
enumerators
[
ordinal
];
return
enumerators
[
ordinal
];
}
}
/**
* Get ValueEnum instance for an ordinal.
* @param ordinal ordinal value of an enum
* @return ValueEnum instance
*/
public
ValueEnum
getValue
(
int
ordinal
)
{
public
ValueEnum
getValue
(
int
ordinal
)
{
if
(
ordinal
<
0
||
ordinal
>=
enumerators
.
length
)
{
if
(
ordinal
<
0
||
ordinal
>=
enumerators
.
length
)
{
throw
DbException
.
get
(
ErrorCode
.
ENUM_VALUE_NOT_PERMITTED
,
enumerators
.
toString
(),
throw
DbException
.
get
(
ErrorCode
.
ENUM_VALUE_NOT_PERMITTED
,
enumerators
.
toString
(),
...
@@ -140,6 +145,11 @@ public final class ExtTypeInfoEnum extends ExtTypeInfo {
...
@@ -140,6 +145,11 @@ public final class ExtTypeInfoEnum extends ExtTypeInfo {
return
new
ValueEnum
(
this
,
enumerators
[
ordinal
],
ordinal
);
return
new
ValueEnum
(
this
,
enumerators
[
ordinal
],
ordinal
);
}
}
/**
* Get ValueEnum instance for a label string.
* @param label label string
* @return ValueEnum instance
*/
public
ValueEnum
getValue
(
String
label
)
{
public
ValueEnum
getValue
(
String
label
)
{
ValueEnum
value
=
getValueOrNull
(
label
);
ValueEnum
value
=
getValueOrNull
(
label
);
if
(
value
==
null
)
{
if
(
value
==
null
)
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/value/Value.java
浏览文件 @
8722b796
...
@@ -1496,7 +1496,7 @@ public abstract class Value extends VersionedValue {
...
@@ -1496,7 +1496,7 @@ public abstract class Value extends VersionedValue {
}
}
/**
/**
* C
hecks value by Integer type numeric
range.
* C
onvert to integer, throwing exception if out of
range.
*
*
* @param x integer value.
* @param x integer value.
* @param column Column info.
* @param column Column info.
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/value/ValueInterval.java
浏览文件 @
8722b796
...
@@ -53,8 +53,8 @@ public class ValueInterval extends Value {
...
@@ -53,8 +53,8 @@ public class ValueInterval extends Value {
private
final
long
remaining
;
private
final
long
remaining
;
/**
/**
* Create
s interval valu
e.
* Create
a ValueInterval instanc
e.
*
*
* @param qualifier
* @param qualifier
* qualifier
* qualifier
* @param negative
* @param negative
...
@@ -82,7 +82,7 @@ public class ValueInterval extends Value {
...
@@ -82,7 +82,7 @@ public class ValueInterval extends Value {
* @param scale
* @param scale
* fractional seconds precision. Ignored if specified type of
* fractional seconds precision. Ignored if specified type of
* interval does not have seconds.
* interval does not have seconds.
* @return display
ed size.
* @return display
size
*/
*/
public
static
int
getDisplaySize
(
int
type
,
int
precision
,
int
scale
)
{
public
static
int
getDisplaySize
(
int
type
,
int
precision
,
int
scale
)
{
switch
(
type
)
{
switch
(
type
)
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/db/TestAnalyzeTableTx.java
浏览文件 @
8722b796
...
@@ -12,7 +12,7 @@ import java.sql.ResultSet;
...
@@ -12,7 +12,7 @@ import java.sql.ResultSet;
import
java.sql.Statement
;
import
java.sql.Statement
;
public
class
TestAnalyzeTableTx
extends
TestDb
{
public
class
TestAnalyzeTableTx
extends
TestDb
{
static
final
int
C
=
10_000
;
private
static
final
int
C
=
10_000
;
/**
/**
* Run just this test.
* Run just this test.
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论