Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
80501d18
提交
80501d18
authored
5月 18, 2018
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Do not use concatenation with "" for converting non-constant numbers
上级
d655ba0f
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
26 个修改的文件
包含
141 行增加
和
141 行删除
+141
-141
ErrorCode.java
h2/src/main/org/h2/api/ErrorCode.java
+1
-1
Query.java
h2/src/main/org/h2/command/dml/Query.java
+1
-1
Database.java
h2/src/main/org/h2/engine/Database.java
+5
-5
Right.java
h2/src/main/org/h2/engine/Right.java
+1
-1
SettingsBase.java
h2/src/main/org/h2/engine/SettingsBase.java
+1
-1
CompareLike.java
h2/src/main/org/h2/expression/CompareLike.java
+1
-1
Function.java
h2/src/main/org/h2/expression/Function.java
+2
-2
Wildcard.java
h2/src/main/org/h2/expression/Wildcard.java
+1
-1
PageBtreeLeaf.java
h2/src/main/org/h2/index/PageBtreeLeaf.java
+1
-1
PageBtreeNode.java
h2/src/main/org/h2/index/PageBtreeNode.java
+1
-1
PageDataLeaf.java
h2/src/main/org/h2/index/PageDataLeaf.java
+2
-2
PageDataNode.java
h2/src/main/org/h2/index/PageDataNode.java
+1
-1
TcpServerThread.java
h2/src/main/org/h2/server/TcpServerThread.java
+3
-3
WebApp.java
h2/src/main/org/h2/server/web/WebApp.java
+9
-9
WebServer.java
h2/src/main/org/h2/server/web/WebServer.java
+3
-6
MetaTable.java
h2/src/main/org/h2/table/MetaTable.java
+93
-91
TableFilter.java
h2/src/main/org/h2/table/TableFilter.java
+1
-1
CompressTool.java
h2/src/main/org/h2/tools/CompressTool.java
+1
-1
MultiDimension.java
h2/src/main/org/h2/tools/MultiDimension.java
+4
-4
ColumnNamer.java
h2/src/main/org/h2/util/ColumnNamer.java
+2
-1
LazyFuture.java
h2/src/main/org/h2/util/LazyFuture.java
+1
-1
NetUtils.java
h2/src/main/org/h2/util/NetUtils.java
+1
-1
Profiler.java
h2/src/main/org/h2/util/Profiler.java
+1
-1
SortedProperties.java
h2/src/main/org/h2/util/SortedProperties.java
+1
-1
DataType.java
h2/src/main/org/h2/value/DataType.java
+1
-1
Value.java
h2/src/main/org/h2/value/Value.java
+2
-2
没有找到文件。
h2/src/main/org/h2/api/ErrorCode.java
浏览文件 @
80501d18
...
@@ -2062,7 +2062,7 @@ public class ErrorCode {
...
@@ -2062,7 +2062,7 @@ public class ErrorCode {
case
FEATURE_NOT_SUPPORTED_1:
return
"HYC00"
;
case
FEATURE_NOT_SUPPORTED_1:
return
"HYC00"
;
case
LOCK_TIMEOUT_1:
return
"HYT00"
;
case
LOCK_TIMEOUT_1:
return
"HYT00"
;
default
:
default
:
return
""
+
errorCode
;
return
Integer
.
toString
(
errorCode
)
;
}
}
}
}
...
...
h2/src/main/org/h2/command/dml/Query.java
浏览文件 @
80501d18
...
@@ -520,7 +520,7 @@ public abstract class Query extends Prepared {
...
@@ -520,7 +520,7 @@ public abstract class Query extends Prepared {
}
}
idx
-=
1
;
idx
-=
1
;
if
(
idx
<
0
||
idx
>=
expressionCount
)
{
if
(
idx
<
0
||
idx
>=
expressionCount
)
{
throw
DbException
.
get
(
ErrorCode
.
ORDER_BY_NOT_IN_RESULT
,
""
+
(
idx
+
1
));
throw
DbException
.
get
(
ErrorCode
.
ORDER_BY_NOT_IN_RESULT
,
Integer
.
toString
(
idx
+
1
));
}
}
}
}
index
[
i
]
=
idx
;
index
[
i
]
=
idx
;
...
...
h2/src/main/org/h2/engine/Database.java
浏览文件 @
80501d18
...
@@ -411,7 +411,7 @@ public class Database implements DataHandler {
...
@@ -411,7 +411,7 @@ public class Database implements DataHandler {
if
(
now
>
reconnectCheckNext
)
{
if
(
now
>
reconnectCheckNext
)
{
if
(
pending
)
{
if
(
pending
)
{
String
pos
=
pageStore
==
null
?
String
pos
=
pageStore
==
null
?
null
:
""
+
pageStore
.
getWriteCountTotal
(
);
null
:
Long
.
toString
(
pageStore
.
getWriteCountTotal
()
);
lock
.
setProperty
(
"logPos"
,
pos
);
lock
.
setProperty
(
"logPos"
,
pos
);
lock
.
save
();
lock
.
save
();
}
}
...
@@ -433,7 +433,7 @@ public class Database implements DataHandler {
...
@@ -433,7 +433,7 @@ public class Database implements DataHandler {
}
}
}
}
String
pos
=
pageStore
==
null
?
String
pos
=
pageStore
==
null
?
null
:
""
+
pageStore
.
getWriteCountTotal
(
);
null
:
Long
.
toString
(
pageStore
.
getWriteCountTotal
()
);
lock
.
setProperty
(
"logPos"
,
pos
);
lock
.
setProperty
(
"logPos"
,
pos
);
if
(
pending
)
{
if
(
pending
)
{
lock
.
setProperty
(
"changePending"
,
"true-"
+
Math
.
random
());
lock
.
setProperty
(
"changePending"
,
"true-"
+
Math
.
random
());
...
@@ -2646,7 +2646,7 @@ public class Database implements DataHandler {
...
@@ -2646,7 +2646,7 @@ public class Database implements DataHandler {
long
now
=
System
.
nanoTime
();
long
now
=
System
.
nanoTime
();
if
(
now
>
reconnectCheckNext
+
reconnectCheckDelayNs
)
{
if
(
now
>
reconnectCheckNext
+
reconnectCheckDelayNs
)
{
if
(
SysProperties
.
CHECK
&&
checkpointAllowed
<
0
)
{
if
(
SysProperties
.
CHECK
&&
checkpointAllowed
<
0
)
{
DbException
.
throwInternalError
(
""
+
checkpointAllowed
);
DbException
.
throwInternalError
(
Integer
.
toString
(
checkpointAllowed
)
);
}
}
synchronized
(
reconnectSync
)
{
synchronized
(
reconnectSync
)
{
if
(
checkpointAllowed
>
0
)
{
if
(
checkpointAllowed
>
0
)
{
...
@@ -2716,7 +2716,7 @@ public class Database implements DataHandler {
...
@@ -2716,7 +2716,7 @@ public class Database implements DataHandler {
if
(
reconnectModified
(
true
))
{
if
(
reconnectModified
(
true
))
{
checkpointAllowed
++;
checkpointAllowed
++;
if
(
SysProperties
.
CHECK
&&
checkpointAllowed
>
20
)
{
if
(
SysProperties
.
CHECK
&&
checkpointAllowed
>
20
)
{
throw
DbException
.
throwInternalError
(
""
+
checkpointAllowed
);
throw
DbException
.
throwInternalError
(
Integer
.
toString
(
checkpointAllowed
)
);
}
}
return
true
;
return
true
;
}
}
...
@@ -2738,7 +2738,7 @@ public class Database implements DataHandler {
...
@@ -2738,7 +2738,7 @@ public class Database implements DataHandler {
checkpointAllowed
--;
checkpointAllowed
--;
}
}
if
(
SysProperties
.
CHECK
&&
checkpointAllowed
<
0
)
{
if
(
SysProperties
.
CHECK
&&
checkpointAllowed
<
0
)
{
throw
DbException
.
throwInternalError
(
""
+
checkpointAllowed
);
throw
DbException
.
throwInternalError
(
Integer
.
toString
(
checkpointAllowed
)
);
}
}
}
}
...
...
h2/src/main/org/h2/engine/Right.java
浏览文件 @
80501d18
...
@@ -75,7 +75,7 @@ public class Right extends DbObjectBase {
...
@@ -75,7 +75,7 @@ public class Right extends DbObjectBase {
public
Right
(
Database
db
,
int
id
,
RightOwner
grantee
,
int
grantedRight
,
public
Right
(
Database
db
,
int
id
,
RightOwner
grantee
,
int
grantedRight
,
DbObject
grantedObject
)
{
DbObject
grantedObject
)
{
initDbObjectBase
(
db
,
id
,
""
+
id
,
Trace
.
USER
);
initDbObjectBase
(
db
,
id
,
Integer
.
toString
(
id
)
,
Trace
.
USER
);
this
.
grantee
=
grantee
;
this
.
grantee
=
grantee
;
this
.
grantedRight
=
grantedRight
;
this
.
grantedRight
=
grantedRight
;
this
.
grantedObject
=
grantedObject
;
this
.
grantedObject
=
grantedObject
;
...
...
h2/src/main/org/h2/engine/SettingsBase.java
浏览文件 @
80501d18
...
@@ -47,7 +47,7 @@ public class SettingsBase {
...
@@ -47,7 +47,7 @@ public class SettingsBase {
* @return the setting
* @return the setting
*/
*/
protected
int
get
(
String
key
,
int
defaultValue
)
{
protected
int
get
(
String
key
,
int
defaultValue
)
{
String
s
=
get
(
key
,
""
+
defaultValue
);
String
s
=
get
(
key
,
Integer
.
toString
(
defaultValue
)
);
try
{
try
{
return
Integer
.
decode
(
s
);
return
Integer
.
decode
(
s
);
}
catch
(
NumberFormatException
e
)
{
}
catch
(
NumberFormatException
e
)
{
...
...
h2/src/main/org/h2/expression/CompareLike.java
浏览文件 @
80501d18
...
@@ -333,7 +333,7 @@ public class CompareLike extends Condition {
...
@@ -333,7 +333,7 @@ public class CompareLike extends Condition {
}
}
return
false
;
return
false
;
default
:
default
:
DbException
.
throwInternalError
(
""
+
types
[
pi
]
);
DbException
.
throwInternalError
(
Integer
.
toString
(
types
[
pi
])
);
}
}
}
}
return
si
==
sLen
;
return
si
==
sLen
;
...
...
h2/src/main/org/h2/expression/Function.java
浏览文件 @
80501d18
...
@@ -557,7 +557,7 @@ public class Function extends Expression implements FunctionCall {
...
@@ -557,7 +557,7 @@ public class Function extends Expression implements FunctionCall {
}
else
{
}
else
{
if
(
index
>=
args
.
length
)
{
if
(
index
>=
args
.
length
)
{
throw
DbException
.
get
(
ErrorCode
.
INVALID_PARAMETER_COUNT_2
,
throw
DbException
.
get
(
ErrorCode
.
INVALID_PARAMETER_COUNT_2
,
info
.
name
,
""
+
args
.
length
);
info
.
name
,
Integer
.
toString
(
args
.
length
)
);
}
}
args
[
index
]
=
param
;
args
[
index
]
=
param
;
}
}
...
@@ -2165,7 +2165,7 @@ public class Function extends Expression implements FunctionCall {
...
@@ -2165,7 +2165,7 @@ public class Function extends Expression implements FunctionCall {
if
(
len
>
0
&&
args
[
len
-
1
]
==
null
)
{
if
(
len
>
0
&&
args
[
len
-
1
]
==
null
)
{
throw
DbException
.
get
(
throw
DbException
.
get
(
ErrorCode
.
INVALID_PARAMETER_COUNT_2
,
ErrorCode
.
INVALID_PARAMETER_COUNT_2
,
info
.
name
,
""
+
len
);
info
.
name
,
Integer
.
toString
(
len
)
);
}
}
}
}
}
}
...
...
h2/src/main/org/h2/expression/Wildcard.java
浏览文件 @
80501d18
...
@@ -100,7 +100,7 @@ public class Wildcard extends Expression {
...
@@ -100,7 +100,7 @@ public class Wildcard extends Expression {
if
(
visitor
.
getType
()
==
ExpressionVisitor
.
QUERY_COMPARABLE
)
{
if
(
visitor
.
getType
()
==
ExpressionVisitor
.
QUERY_COMPARABLE
)
{
return
true
;
return
true
;
}
}
throw
DbException
.
throwInternalError
(
""
+
visitor
.
getType
(
));
throw
DbException
.
throwInternalError
(
Integer
.
toString
(
visitor
.
getType
()
));
}
}
@Override
@Override
...
...
h2/src/main/org/h2/index/PageBtreeLeaf.java
浏览文件 @
80501d18
...
@@ -176,7 +176,7 @@ public class PageBtreeLeaf extends PageBtree {
...
@@ -176,7 +176,7 @@ public class PageBtreeLeaf extends PageBtree {
written
=
false
;
written
=
false
;
changeCount
=
index
.
getPageStore
().
getChangeCount
();
changeCount
=
index
.
getPageStore
().
getChangeCount
();
if
(
entryCount
<=
0
)
{
if
(
entryCount
<=
0
)
{
DbException
.
throwInternalError
(
""
+
entryCount
);
DbException
.
throwInternalError
(
Integer
.
toString
(
entryCount
)
);
}
}
int
startNext
=
at
>
0
?
offsets
[
at
-
1
]
:
index
.
getPageStore
().
getPageSize
();
int
startNext
=
at
>
0
?
offsets
[
at
-
1
]
:
index
.
getPageStore
().
getPageSize
();
int
rowLength
=
startNext
-
offsets
[
at
];
int
rowLength
=
startNext
-
offsets
[
at
];
...
...
h2/src/main/org/h2/index/PageBtreeNode.java
浏览文件 @
80501d18
...
@@ -474,7 +474,7 @@ public class PageBtreeNode extends PageBtree {
...
@@ -474,7 +474,7 @@ public class PageBtreeNode extends PageBtree {
written
=
false
;
written
=
false
;
changeCount
=
index
.
getPageStore
().
getChangeCount
();
changeCount
=
index
.
getPageStore
().
getChangeCount
();
if
(
entryCount
<
0
)
{
if
(
entryCount
<
0
)
{
DbException
.
throwInternalError
(
""
+
entryCount
);
DbException
.
throwInternalError
(
Integer
.
toString
(
entryCount
)
);
}
}
if
(
entryCount
>
i
)
{
if
(
entryCount
>
i
)
{
int
startNext
=
i
>
0
?
offsets
[
i
-
1
]
:
index
.
getPageStore
().
getPageSize
();
int
startNext
=
i
>
0
?
offsets
[
i
-
1
]
:
index
.
getPageStore
().
getPageSize
();
...
...
h2/src/main/org/h2/index/PageDataLeaf.java
浏览文件 @
80501d18
...
@@ -220,7 +220,7 @@ public class PageDataLeaf extends PageData {
...
@@ -220,7 +220,7 @@ public class PageDataLeaf extends PageData {
if
(
offset
<
start
)
{
if
(
offset
<
start
)
{
writtenData
=
false
;
writtenData
=
false
;
if
(
entryCount
>
1
)
{
if
(
entryCount
>
1
)
{
DbException
.
throwInternalError
(
""
+
entryCount
);
DbException
.
throwInternalError
(
Integer
.
toString
(
entryCount
)
);
}
}
// need to write the overflow page id
// need to write the overflow page id
start
+=
4
;
start
+=
4
;
...
@@ -283,7 +283,7 @@ public class PageDataLeaf extends PageData {
...
@@ -283,7 +283,7 @@ public class PageDataLeaf extends PageData {
}
}
entryCount
--;
entryCount
--;
if
(
entryCount
<
0
)
{
if
(
entryCount
<
0
)
{
DbException
.
throwInternalError
(
""
+
entryCount
);
DbException
.
throwInternalError
(
Integer
.
toString
(
entryCount
)
);
}
}
if
(
firstOverflowPageId
!=
0
)
{
if
(
firstOverflowPageId
!=
0
)
{
start
-=
4
;
start
-=
4
;
...
...
h2/src/main/org/h2/index/PageDataNode.java
浏览文件 @
80501d18
...
@@ -388,7 +388,7 @@ public class PageDataNode extends PageData {
...
@@ -388,7 +388,7 @@ public class PageDataNode extends PageData {
entryCount
--;
entryCount
--;
length
-=
4
+
Data
.
getVarLongLen
(
keys
[
removedKeyIndex
]);
length
-=
4
+
Data
.
getVarLongLen
(
keys
[
removedKeyIndex
]);
if
(
entryCount
<
0
)
{
if
(
entryCount
<
0
)
{
DbException
.
throwInternalError
(
""
+
entryCount
);
DbException
.
throwInternalError
(
Integer
.
toString
(
entryCount
)
);
}
}
keys
=
remove
(
keys
,
entryCount
+
1
,
removedKeyIndex
);
keys
=
remove
(
keys
,
entryCount
+
1
,
removedKeyIndex
);
childPageIds
=
remove
(
childPageIds
,
entryCount
+
2
,
i
);
childPageIds
=
remove
(
childPageIds
,
entryCount
+
2
,
i
);
...
...
h2/src/main/org/h2/server/TcpServerThread.java
浏览文件 @
80501d18
...
@@ -91,15 +91,15 @@ public class TcpServerThread implements Runnable {
...
@@ -91,15 +91,15 @@ public class TcpServerThread implements Runnable {
int
minClientVersion
=
transfer
.
readInt
();
int
minClientVersion
=
transfer
.
readInt
();
if
(
minClientVersion
<
6
)
{
if
(
minClientVersion
<
6
)
{
throw
DbException
.
get
(
ErrorCode
.
DRIVER_VERSION_ERROR_2
,
throw
DbException
.
get
(
ErrorCode
.
DRIVER_VERSION_ERROR_2
,
""
+
minClientVersion
,
""
+
Constants
.
TCP_PROTOCOL_VERSION_MIN_SUPPORTED
);
Integer
.
toString
(
minClientVersion
)
,
""
+
Constants
.
TCP_PROTOCOL_VERSION_MIN_SUPPORTED
);
}
}
int
maxClientVersion
=
transfer
.
readInt
();
int
maxClientVersion
=
transfer
.
readInt
();
if
(
maxClientVersion
<
Constants
.
TCP_PROTOCOL_VERSION_MIN_SUPPORTED
)
{
if
(
maxClientVersion
<
Constants
.
TCP_PROTOCOL_VERSION_MIN_SUPPORTED
)
{
throw
DbException
.
get
(
ErrorCode
.
DRIVER_VERSION_ERROR_2
,
throw
DbException
.
get
(
ErrorCode
.
DRIVER_VERSION_ERROR_2
,
""
+
maxClientVersion
,
""
+
Constants
.
TCP_PROTOCOL_VERSION_MIN_SUPPORTED
);
Integer
.
toString
(
maxClientVersion
)
,
""
+
Constants
.
TCP_PROTOCOL_VERSION_MIN_SUPPORTED
);
}
else
if
(
minClientVersion
>
Constants
.
TCP_PROTOCOL_VERSION_MAX_SUPPORTED
)
{
}
else
if
(
minClientVersion
>
Constants
.
TCP_PROTOCOL_VERSION_MAX_SUPPORTED
)
{
throw
DbException
.
get
(
ErrorCode
.
DRIVER_VERSION_ERROR_2
,
throw
DbException
.
get
(
ErrorCode
.
DRIVER_VERSION_ERROR_2
,
""
+
minClientVersion
,
""
+
Constants
.
TCP_PROTOCOL_VERSION_MAX_SUPPORTED
);
Integer
.
toString
(
minClientVersion
)
,
""
+
Constants
.
TCP_PROTOCOL_VERSION_MAX_SUPPORTED
);
}
}
if
(
maxClientVersion
>=
Constants
.
TCP_PROTOCOL_VERSION_MAX_SUPPORTED
)
{
if
(
maxClientVersion
>=
Constants
.
TCP_PROTOCOL_VERSION_MAX_SUPPORTED
)
{
clientVersion
=
Constants
.
TCP_PROTOCOL_VERSION_MAX_SUPPORTED
;
clientVersion
=
Constants
.
TCP_PROTOCOL_VERSION_MAX_SUPPORTED
;
...
...
h2/src/main/org/h2/server/web/WebApp.java
浏览文件 @
80501d18
...
@@ -338,8 +338,8 @@ public class WebApp {
...
@@ -338,8 +338,8 @@ public class WebApp {
}
}
private
String
admin
()
{
private
String
admin
()
{
session
.
put
(
"port"
,
""
+
server
.
getPort
(
));
session
.
put
(
"port"
,
Integer
.
toString
(
server
.
getPort
()
));
session
.
put
(
"allowOthers"
,
""
+
server
.
getAllowOthers
(
));
session
.
put
(
"allowOthers"
,
Boolean
.
toString
(
server
.
getAllowOthers
()
));
session
.
put
(
"ssl"
,
String
.
valueOf
(
server
.
getSSL
()));
session
.
put
(
"ssl"
,
String
.
valueOf
(
server
.
getSSL
()));
session
.
put
(
"sessions"
,
server
.
getSessions
());
session
.
put
(
"sessions"
,
server
.
getSessions
());
return
"admin.jsp"
;
return
"admin.jsp"
;
...
@@ -1172,16 +1172,16 @@ public class WebApp {
...
@@ -1172,16 +1172,16 @@ public class WebApp {
SimpleResultSet
rs
=
new
SimpleResultSet
();
SimpleResultSet
rs
=
new
SimpleResultSet
();
rs
.
addColumn
(
"Type"
,
Types
.
VARCHAR
,
0
,
0
);
rs
.
addColumn
(
"Type"
,
Types
.
VARCHAR
,
0
,
0
);
rs
.
addColumn
(
"KB"
,
Types
.
VARCHAR
,
0
,
0
);
rs
.
addColumn
(
"KB"
,
Types
.
VARCHAR
,
0
,
0
);
rs
.
addRow
(
"Used Memory"
,
""
+
Utils
.
getMemoryUsed
(
));
rs
.
addRow
(
"Used Memory"
,
Integer
.
toString
(
Utils
.
getMemoryUsed
()
));
rs
.
addRow
(
"Free Memory"
,
""
+
Utils
.
getMemoryFree
(
));
rs
.
addRow
(
"Free Memory"
,
Integer
.
toString
(
Utils
.
getMemoryFree
()
));
return
rs
;
return
rs
;
}
else
if
(
isBuiltIn
(
sql
,
"@info"
))
{
}
else
if
(
isBuiltIn
(
sql
,
"@info"
))
{
SimpleResultSet
rs
=
new
SimpleResultSet
();
SimpleResultSet
rs
=
new
SimpleResultSet
();
rs
.
addColumn
(
"KEY"
,
Types
.
VARCHAR
,
0
,
0
);
rs
.
addColumn
(
"KEY"
,
Types
.
VARCHAR
,
0
,
0
);
rs
.
addColumn
(
"VALUE"
,
Types
.
VARCHAR
,
0
,
0
);
rs
.
addColumn
(
"VALUE"
,
Types
.
VARCHAR
,
0
,
0
);
rs
.
addRow
(
"conn.getCatalog"
,
conn
.
getCatalog
());
rs
.
addRow
(
"conn.getCatalog"
,
conn
.
getCatalog
());
rs
.
addRow
(
"conn.getAutoCommit"
,
""
+
conn
.
getAutoCommit
(
));
rs
.
addRow
(
"conn.getAutoCommit"
,
Boolean
.
toString
(
conn
.
getAutoCommit
()
));
rs
.
addRow
(
"conn.getTransactionIsolation"
,
""
+
conn
.
getTransactionIsolation
(
));
rs
.
addRow
(
"conn.getTransactionIsolation"
,
Integer
.
toString
(
conn
.
getTransactionIsolation
()
));
rs
.
addRow
(
"conn.getWarnings"
,
""
+
conn
.
getWarnings
());
rs
.
addRow
(
"conn.getWarnings"
,
""
+
conn
.
getWarnings
());
String
map
;
String
map
;
try
{
try
{
...
@@ -1190,8 +1190,8 @@ public class WebApp {
...
@@ -1190,8 +1190,8 @@ public class WebApp {
map
=
e
.
toString
();
map
=
e
.
toString
();
}
}
rs
.
addRow
(
"conn.getTypeMap"
,
""
+
map
);
rs
.
addRow
(
"conn.getTypeMap"
,
""
+
map
);
rs
.
addRow
(
"conn.isReadOnly"
,
""
+
conn
.
isReadOnly
(
));
rs
.
addRow
(
"conn.isReadOnly"
,
Boolean
.
toString
(
conn
.
isReadOnly
()
));
rs
.
addRow
(
"conn.getHoldability"
,
""
+
conn
.
getHoldability
(
));
rs
.
addRow
(
"conn.getHoldability"
,
Integer
.
toString
(
conn
.
getHoldability
()
));
addDatabaseMetaData
(
rs
,
meta
);
addDatabaseMetaData
(
rs
,
meta
);
return
rs
;
return
rs
;
}
else
if
(
isBuiltIn
(
sql
,
"@attributes"
))
{
}
else
if
(
isBuiltIn
(
sql
,
"@attributes"
))
{
...
@@ -1328,7 +1328,7 @@ public class WebApp {
...
@@ -1328,7 +1328,7 @@ public class WebApp {
}
else
if
(
isBuiltIn
(
sql
,
"@maxrows"
))
{
}
else
if
(
isBuiltIn
(
sql
,
"@maxrows"
))
{
int
maxrows
=
(
int
)
Double
.
parseDouble
(
int
maxrows
=
(
int
)
Double
.
parseDouble
(
sql
.
substring
(
"@maxrows"
.
length
()).
trim
());
sql
.
substring
(
"@maxrows"
.
length
()).
trim
());
session
.
put
(
"maxrows"
,
""
+
maxrows
);
session
.
put
(
"maxrows"
,
Integer
.
toString
(
maxrows
)
);
return
"${text.result.maxrowsSet}"
;
return
"${text.result.maxrowsSet}"
;
}
else
if
(
isBuiltIn
(
sql
,
"@parameter_meta"
))
{
}
else
if
(
isBuiltIn
(
sql
,
"@parameter_meta"
))
{
sql
=
sql
.
substring
(
"@parameter_meta"
.
length
()).
trim
();
sql
=
sql
.
substring
(
"@parameter_meta"
.
length
()).
trim
();
...
...
h2/src/main/org/h2/server/web/WebServer.java
浏览文件 @
80501d18
...
@@ -672,14 +672,11 @@ public class WebServer implements Service {
...
@@ -672,14 +672,11 @@ public class WebServer implements Service {
Properties
old
=
loadProperties
();
Properties
old
=
loadProperties
();
prop
=
new
SortedProperties
();
prop
=
new
SortedProperties
();
prop
.
setProperty
(
"webPort"
,
prop
.
setProperty
(
"webPort"
,
""
+
SortedProperties
.
getIntProperty
(
old
,
Integer
.
toString
(
SortedProperties
.
getIntProperty
(
old
,
"webPort"
,
port
)));
"webPort"
,
port
));
prop
.
setProperty
(
"webAllowOthers"
,
prop
.
setProperty
(
"webAllowOthers"
,
""
+
SortedProperties
.
getBooleanProperty
(
old
,
Boolean
.
toString
(
SortedProperties
.
getBooleanProperty
(
old
,
"webAllowOthers"
,
allowOthers
)));
"webAllowOthers"
,
allowOthers
));
prop
.
setProperty
(
"webSSL"
,
prop
.
setProperty
(
"webSSL"
,
""
+
SortedProperties
.
getBooleanProperty
(
old
,
Boolean
.
toString
(
SortedProperties
.
getBooleanProperty
(
old
,
"webSSL"
,
ssl
)));
"webSSL"
,
ssl
));
if
(
commandHistoryString
!=
null
)
{
if
(
commandHistoryString
!=
null
)
{
prop
.
setProperty
(
COMMAND_HISTORY
,
commandHistoryString
);
prop
.
setProperty
(
COMMAND_HISTORY
,
commandHistoryString
);
}
}
...
...
h2/src/main/org/h2/table/MetaTable.java
浏览文件 @
80501d18
差异被折叠。
点击展开。
h2/src/main/org/h2/table/TableFilter.java
浏览文件 @
80501d18
...
@@ -808,7 +808,7 @@ public class TableFilter implements ColumnResolver {
...
@@ -808,7 +808,7 @@ public class TableFilter implements ColumnResolver {
IndexLookupBatch
lookupBatch
=
joinBatch
.
getLookupBatch
(
joinFilterId
);
IndexLookupBatch
lookupBatch
=
joinBatch
.
getLookupBatch
(
joinFilterId
);
if
(
lookupBatch
==
null
)
{
if
(
lookupBatch
==
null
)
{
if
(
joinFilterId
!=
0
)
{
if
(
joinFilterId
!=
0
)
{
throw
DbException
.
throwInternalError
(
""
+
joinFilterId
);
throw
DbException
.
throwInternalError
(
Integer
.
toString
(
joinFilterId
)
);
}
}
}
else
{
}
else
{
planBuff
.
append
(
"batched:"
);
planBuff
.
append
(
"batched:"
);
...
...
h2/src/main/org/h2/tools/CompressTool.java
浏览文件 @
80501d18
...
@@ -264,7 +264,7 @@ public class CompressTool {
...
@@ -264,7 +264,7 @@ public class CompressTool {
default
:
default
:
throw
DbException
.
get
(
throw
DbException
.
get
(
ErrorCode
.
UNSUPPORTED_COMPRESSION_ALGORITHM_1
,
ErrorCode
.
UNSUPPORTED_COMPRESSION_ALGORITHM_1
,
""
+
algorithm
);
Integer
.
toString
(
algorithm
)
);
}
}
}
}
...
...
h2/src/main/org/h2/tools/MultiDimension.java
浏览文件 @
80501d18
...
@@ -65,7 +65,7 @@ public class MultiDimension implements Comparator<long[]> {
...
@@ -65,7 +65,7 @@ public class MultiDimension implements Comparator<long[]> {
*/
*/
public
int
getMaxValue
(
int
dimensions
)
{
public
int
getMaxValue
(
int
dimensions
)
{
if
(
dimensions
<
2
||
dimensions
>
32
)
{
if
(
dimensions
<
2
||
dimensions
>
32
)
{
throw
new
IllegalArgumentException
(
""
+
dimensions
);
throw
new
IllegalArgumentException
(
Integer
.
toString
(
dimensions
)
);
}
}
int
bitsPerValue
=
getBitsPerValue
(
dimensions
);
int
bitsPerValue
=
getBitsPerValue
(
dimensions
);
return
(
int
)
((
1L
<<
bitsPerValue
)
-
1
);
return
(
int
)
((
1L
<<
bitsPerValue
)
-
1
);
...
@@ -270,18 +270,18 @@ public class MultiDimension implements Comparator<long[]> {
...
@@ -270,18 +270,18 @@ public class MultiDimension implements Comparator<long[]> {
private
void
addMortonRanges
(
ArrayList
<
long
[]>
list
,
int
[]
min
,
int
[]
max
,
private
void
addMortonRanges
(
ArrayList
<
long
[]>
list
,
int
[]
min
,
int
[]
max
,
int
len
,
int
level
)
{
int
len
,
int
level
)
{
if
(
level
>
100
)
{
if
(
level
>
100
)
{
throw
new
IllegalArgumentException
(
""
+
level
);
throw
new
IllegalArgumentException
(
Integer
.
toString
(
level
)
);
}
}
int
largest
=
0
,
largestDiff
=
0
;
int
largest
=
0
,
largestDiff
=
0
;
long
size
=
1
;
long
size
=
1
;
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
int
diff
=
max
[
i
]
-
min
[
i
];
int
diff
=
max
[
i
]
-
min
[
i
];
if
(
diff
<
0
)
{
if
(
diff
<
0
)
{
throw
new
IllegalArgumentException
(
""
+
diff
);
throw
new
IllegalArgumentException
(
Integer
.
toString
(
diff
)
);
}
}
size
*=
diff
+
1
;
size
*=
diff
+
1
;
if
(
size
<
0
)
{
if
(
size
<
0
)
{
throw
new
IllegalArgumentException
(
""
+
size
);
throw
new
IllegalArgumentException
(
Long
.
toString
(
size
)
);
}
}
if
(
diff
>
largestDiff
)
{
if
(
diff
>
largestDiff
)
{
largestDiff
=
diff
;
largestDiff
=
diff
;
...
...
h2/src/main/org/h2/util/ColumnNamer.java
浏览文件 @
80501d18
...
@@ -102,7 +102,8 @@ public class ColumnNamer {
...
@@ -102,7 +102,8 @@ public class ColumnNamer {
}
}
// go with a innocuous default name pattern
// go with a innocuous default name pattern
if
(
columnName
==
null
)
{
if
(
columnName
==
null
)
{
columnName
=
configuration
.
getDefaultColumnNamePattern
().
replace
(
"$$"
,
""
+
(
indexOfColumn
+
1
));
columnName
=
configuration
.
getDefaultColumnNamePattern
()
.
replace
(
"$$"
,
Integer
.
toString
(
indexOfColumn
+
1
));
}
}
if
(
existingColumnNames
.
contains
(
columnName
)
&&
configuration
.
isGenerateUniqueColumnNames
())
{
if
(
existingColumnNames
.
contains
(
columnName
)
&&
configuration
.
isGenerateUniqueColumnNames
())
{
columnName
=
generateUniqueName
(
columnName
);
columnName
=
generateUniqueName
(
columnName
);
...
...
h2/src/main/org/h2/util/LazyFuture.java
浏览文件 @
80501d18
...
@@ -86,7 +86,7 @@ public abstract class LazyFuture<T> implements Future<T> {
...
@@ -86,7 +86,7 @@ public abstract class LazyFuture<T> implements Future<T> {
case
S_CANCELED:
case
S_CANCELED:
throw
new
CancellationException
();
throw
new
CancellationException
();
default
:
default
:
throw
DbException
.
throwInternalError
(
""
+
state
);
throw
DbException
.
throwInternalError
(
Integer
.
toString
(
state
)
);
}
}
}
}
...
...
h2/src/main/org/h2/util/NetUtils.java
浏览文件 @
80501d18
...
@@ -178,7 +178,7 @@ public class NetUtils {
...
@@ -178,7 +178,7 @@ public class NetUtils {
return
new
ServerSocket
(
port
,
0
,
bindAddress
);
return
new
ServerSocket
(
port
,
0
,
bindAddress
);
}
catch
(
BindException
be
)
{
}
catch
(
BindException
be
)
{
throw
DbException
.
get
(
ErrorCode
.
EXCEPTION_OPENING_PORT_2
,
throw
DbException
.
get
(
ErrorCode
.
EXCEPTION_OPENING_PORT_2
,
be
,
""
+
port
,
be
.
toString
());
be
,
Integer
.
toString
(
port
)
,
be
.
toString
());
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
DbException
.
convertIOException
(
e
,
"port: "
+
port
+
" ssl: "
+
ssl
);
throw
DbException
.
convertIOException
(
e
,
"port: "
+
port
+
" ssl: "
+
ssl
);
}
}
...
...
h2/src/main/org/h2/util/Profiler.java
浏览文件 @
80501d18
...
@@ -207,7 +207,7 @@ public class Profiler implements Runnable {
...
@@ -207,7 +207,7 @@ public class Profiler implements Runnable {
private
static
List
<
Object
[]>
readRunnableStackTraces
(
int
pid
)
{
private
static
List
<
Object
[]>
readRunnableStackTraces
(
int
pid
)
{
try
{
try
{
String
jstack
=
exec
(
"jstack"
,
""
+
pid
);
String
jstack
=
exec
(
"jstack"
,
Integer
.
toString
(
pid
)
);
LineNumberReader
r
=
new
LineNumberReader
(
LineNumberReader
r
=
new
LineNumberReader
(
new
StringReader
(
jstack
));
new
StringReader
(
jstack
));
return
readStackTrace
(
r
);
return
readStackTrace
(
r
);
...
...
h2/src/main/org/h2/util/SortedProperties.java
浏览文件 @
80501d18
...
@@ -69,7 +69,7 @@ public class SortedProperties extends Properties {
...
@@ -69,7 +69,7 @@ public class SortedProperties extends Properties {
* @return the value if set, or the default value if not
* @return the value if set, or the default value if not
*/
*/
public
static
int
getIntProperty
(
Properties
prop
,
String
key
,
int
def
)
{
public
static
int
getIntProperty
(
Properties
prop
,
String
key
,
int
def
)
{
String
value
=
prop
.
getProperty
(
key
,
""
+
def
);
String
value
=
prop
.
getProperty
(
key
,
Integer
.
toString
(
def
)
);
try
{
try
{
return
Integer
.
decode
(
value
);
return
Integer
.
decode
(
value
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
h2/src/main/org/h2/value/DataType.java
浏览文件 @
80501d18
...
@@ -948,7 +948,7 @@ public class DataType {
...
@@ -948,7 +948,7 @@ public class DataType {
return
Value
.
RESULT_SET
;
return
Value
.
RESULT_SET
;
default
:
default
:
throw
DbException
.
get
(
throw
DbException
.
get
(
ErrorCode
.
UNKNOWN_DATA_TYPE_1
,
""
+
sqlType
);
ErrorCode
.
UNKNOWN_DATA_TYPE_1
,
Integer
.
toString
(
sqlType
)
);
}
}
}
}
...
...
h2/src/main/org/h2/value/Value.java
浏览文件 @
80501d18
...
@@ -779,7 +779,7 @@ public abstract class Value {
...
@@ -779,7 +779,7 @@ public abstract class Value {
double
d
=
getDouble
();
double
d
=
getDouble
();
if
(
Double
.
isInfinite
(
d
)
||
Double
.
isNaN
(
d
))
{
if
(
Double
.
isInfinite
(
d
)
||
Double
.
isNaN
(
d
))
{
throw
DbException
.
get
(
throw
DbException
.
get
(
ErrorCode
.
DATA_CONVERSION_ERROR_1
,
""
+
d
);
ErrorCode
.
DATA_CONVERSION_ERROR_1
,
Double
.
toString
(
d
)
);
}
}
return
ValueDecimal
.
get
(
BigDecimal
.
valueOf
(
d
));
return
ValueDecimal
.
get
(
BigDecimal
.
valueOf
(
d
));
}
}
...
@@ -787,7 +787,7 @@ public abstract class Value {
...
@@ -787,7 +787,7 @@ public abstract class Value {
float
f
=
getFloat
();
float
f
=
getFloat
();
if
(
Float
.
isInfinite
(
f
)
||
Float
.
isNaN
(
f
))
{
if
(
Float
.
isInfinite
(
f
)
||
Float
.
isNaN
(
f
))
{
throw
DbException
.
get
(
throw
DbException
.
get
(
ErrorCode
.
DATA_CONVERSION_ERROR_1
,
""
+
f
);
ErrorCode
.
DATA_CONVERSION_ERROR_1
,
Float
.
toString
(
f
)
);
}
}
// better rounding behavior than BigDecimal.valueOf(f)
// better rounding behavior than BigDecimal.valueOf(f)
return
ValueDecimal
.
get
(
new
BigDecimal
(
Float
.
toString
(
f
)));
return
ValueDecimal
.
get
(
new
BigDecimal
(
Float
.
toString
(
f
)));
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论