Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
f945dbb6
提交
f945dbb6
authored
11月 03, 2010
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
For an invalid value exception, the parameter name and value was switched in some cases.
上级
49ae2b23
隐藏空白字符变更
内嵌
并排
正在显示
21 个修改的文件
包含
48 行增加
和
52 行删除
+48
-52
Parser.java
h2/src/main/org/h2/command/Parser.java
+2
-2
AlterSequence.java
h2/src/main/org/h2/command/dml/AlterSequence.java
+1
-1
Select.java
h2/src/main/org/h2/command/dml/Select.java
+1
-1
Set.java
h2/src/main/org/h2/command/dml/Set.java
+8
-8
ConnectionInfo.java
h2/src/main/org/h2/engine/ConnectionInfo.java
+1
-1
Database.java
h2/src/main/org/h2/engine/Database.java
+1
-1
JdbcArray.java
h2/src/main/org/h2/jdbc/JdbcArray.java
+4
-4
JdbcCallableStatement.java
h2/src/main/org/h2/jdbc/JdbcCallableStatement.java
+3
-3
JdbcConnection.java
h2/src/main/org/h2/jdbc/JdbcConnection.java
+5
-5
JdbcParameterMetaData.java
h2/src/main/org/h2/jdbc/JdbcParameterMetaData.java
+1
-1
JdbcPreparedStatement.java
h2/src/main/org/h2/jdbc/JdbcPreparedStatement.java
+1
-1
JdbcResultSet.java
h2/src/main/org/h2/jdbc/JdbcResultSet.java
+5
-6
JdbcResultSetMetaData.java
h2/src/main/org/h2/jdbc/JdbcResultSetMetaData.java
+1
-1
JdbcStatement.java
h2/src/main/org/h2/jdbc/JdbcStatement.java
+4
-4
DbException.java
h2/src/main/org/h2/message/DbException.java
+3
-3
Sequence.java
h2/src/main/org/h2/schema/Sequence.java
+1
-2
CipherFactory.java
h2/src/main/org/h2/security/CipherFactory.java
+1
-1
SimpleResultSet.java
h2/src/main/org/h2/tools/SimpleResultSet.java
+1
-1
CacheLRU.java
h2/src/main/org/h2/util/CacheLRU.java
+1
-1
MathUtils.java
h2/src/main/org/h2/util/MathUtils.java
+2
-4
ValueTimestamp.java
h2/src/main/org/h2/value/ValueTimestamp.java
+1
-1
没有找到文件。
h2/src/main/org/h2/command/Parser.java
浏览文件 @
f945dbb6
...
...
@@ -2287,7 +2287,7 @@ public class Parser {
}
int
index
=
currentValue
.
getInt
()
-
1
;
if
(
index
<
0
||
index
>=
Constants
.
MAX_PARAMETER_INDEX
)
{
throw
DbException
.
getInvalidValueException
(
"
"
+
index
,
"Parameter Index"
);
throw
DbException
.
getInvalidValueException
(
"
parameter index"
,
index
);
}
if
(
indexedParameterList
.
size
()
<=
index
)
{
indexedParameterList
.
ensureCapacity
(
index
+
1
);
...
...
@@ -2544,7 +2544,7 @@ public class Parser {
private
int
getPositiveInt
()
{
int
v
=
getInt
();
if
(
v
<
0
)
{
throw
DbException
.
getInvalidValueException
(
"
"
+
v
,
"positive integer"
);
throw
DbException
.
getInvalidValueException
(
"
positive integer"
,
v
);
}
return
v
;
}
...
...
h2/src/main/org/h2/command/dml/AlterSequence.java
浏览文件 @
f945dbb6
...
...
@@ -70,7 +70,7 @@ public class AlterSequence extends SchemaCommand {
if
(
increment
!=
null
)
{
long
incrementValue
=
increment
.
optimize
(
session
).
getValue
(
session
).
getLong
();
if
(
incrementValue
==
0
)
{
throw
DbException
.
get
(
ErrorCode
.
INVALID_VALUE_2
,
"0"
,
"INCREMENT"
);
throw
DbException
.
get
InvalidValueException
(
"INCREMENT"
,
0
);
}
sequence
.
setIncrement
(
incrementValue
);
}
...
...
h2/src/main/org/h2/command/dml/Select.java
浏览文件 @
f945dbb6
...
...
@@ -386,7 +386,7 @@ public class Select extends Query {
ArrayList
<
Column
>
sortColumns
=
New
.
arrayList
();
for
(
int
idx
:
sort
.
getIndexes
())
{
if
(
idx
<
0
||
idx
>=
expressions
.
size
())
{
throw
DbException
.
getInvalidValueException
(
"
"
+
(
idx
+
1
),
"ORDER BY"
);
throw
DbException
.
getInvalidValueException
(
"
ORDER BY"
,
idx
+
1
);
}
Expression
expr
=
expressions
.
get
(
idx
);
expr
=
expr
.
getNonAliasExpression
();
...
...
h2/src/main/org/h2/command/dml/Set.java
浏览文件 @
f945dbb6
...
...
@@ -72,7 +72,7 @@ public class Set extends Prepared {
session
.
getUser
().
checkAdmin
();
int
value
=
getIntValue
();
if
(
value
<
0
||
value
>
2
)
{
throw
DbException
.
getInvalidValueException
(
"
"
+
getIntValue
(),
"ALLOW_LITERALS"
);
throw
DbException
.
getInvalidValueException
(
"
ALLOW_LITERALS"
,
getIntValue
()
);
}
database
.
setAllowLiterals
(
value
);
addOrUpdateSetting
(
name
,
null
,
value
);
...
...
@@ -181,7 +181,7 @@ public class Set extends Prepared {
database
.
setExclusiveSession
(
session
,
true
);
break
;
default
:
throw
DbException
.
getInvalidValueException
(
"
"
+
value
,
"EXCLUSIVE"
);
throw
DbException
.
getInvalidValueException
(
"
EXCLUSIVE"
,
value
);
}
break
;
}
...
...
@@ -201,7 +201,7 @@ public class Set extends Prepared {
case
SetTypes
.
LOG
:
{
int
value
=
getIntValue
();
if
(
value
<
0
||
value
>
2
)
{
throw
DbException
.
getInvalidValueException
(
"
"
+
getIntValue
(),
"LOG"
);
throw
DbException
.
getInvalidValueException
(
"
LOG"
,
getIntValue
()
);
}
if
(
value
==
0
)
{
session
.
getUser
().
checkAdmin
();
...
...
@@ -211,7 +211,7 @@ public class Set extends Prepared {
}
case
SetTypes
.
MAX_LENGTH_INPLACE_LOB
:
{
if
(
getIntValue
()
<
0
)
{
throw
DbException
.
getInvalidValueException
(
"
"
+
getIntValue
(),
"MAX_LENGTH_INPLACE_LOB"
);
throw
DbException
.
getInvalidValueException
(
"
MAX_LENGTH_INPLACE_LOB"
,
getIntValue
()
);
}
session
.
getUser
().
checkAdmin
();
database
.
setMaxLengthInplaceLob
(
getIntValue
());
...
...
@@ -231,7 +231,7 @@ public class Set extends Prepared {
}
case
SetTypes
.
MAX_MEMORY_UNDO
:
{
if
(
getIntValue
()
<
0
)
{
throw
DbException
.
getInvalidValueException
(
"
"
+
getIntValue
(),
"MAX_MEMORY_UNDO"
);
throw
DbException
.
getInvalidValueException
(
"
MAX_MEMORY_UNDO"
,
getIntValue
()
);
}
session
.
getUser
().
checkAdmin
();
database
.
setMaxMemoryUndo
(
getIntValue
());
...
...
@@ -282,7 +282,7 @@ public class Set extends Prepared {
session
.
getUser
().
checkAdmin
();
int
value
=
getIntValue
();
if
(
value
<
0
||
value
>
1
)
{
throw
DbException
.
getInvalidValueException
(
"
"
+
getIntValue
(),
"REFERENTIAL_INTEGRITY"
);
throw
DbException
.
getInvalidValueException
(
"
REFERENTIAL_INTEGRITY"
,
getIntValue
()
);
}
database
.
setReferentialIntegrity
(
value
==
1
);
break
;
...
...
@@ -323,7 +323,7 @@ public class Set extends Prepared {
}
case
SetTypes
.
THROTTLE
:
{
if
(
getIntValue
()
<
0
)
{
throw
DbException
.
getInvalidValueException
(
"
"
+
getIntValue
(),
"THROTTLE"
);
throw
DbException
.
getInvalidValueException
(
"
THROTTLE"
,
getIntValue
()
);
}
session
.
setThrottle
(
getIntValue
());
break
;
...
...
@@ -331,7 +331,7 @@ public class Set extends Prepared {
case
SetTypes
.
UNDO_LOG
:
{
int
value
=
getIntValue
();
if
(
value
<
0
||
value
>
1
)
{
throw
DbException
.
getInvalidValueException
(
"
"
+
getIntValue
(),
"UNDO_LOG"
);
throw
DbException
.
getInvalidValueException
(
"
UNDO_LOG"
,
getIntValue
()
);
}
session
.
setUndoLogEnabled
(
value
==
1
);
break
;
...
...
h2/src/main/org/h2/engine/ConnectionInfo.java
浏览文件 @
f945dbb6
...
...
@@ -66,7 +66,7 @@ public class ConnectionInfo implements Cloneable {
public
ConnectionInfo
(
String
u
,
Properties
info
)
{
this
.
originalURL
=
u
;
if
(!
u
.
startsWith
(
Constants
.
START_URL
))
{
throw
DbException
.
getInvalidValueException
(
u
,
"url"
);
throw
DbException
.
getInvalidValueException
(
"url"
,
u
);
}
this
.
url
=
u
;
readProperties
(
info
);
...
...
h2/src/main/org/h2/engine/Database.java
浏览文件 @
f945dbb6
...
...
@@ -1797,7 +1797,7 @@ public class Database implements DataHandler {
case
Constants
.
LOCK_MODE_TABLE_GC
:
break
;
default
:
throw
DbException
.
getInvalidValueException
(
"lock mode"
,
""
+
lockMode
);
throw
DbException
.
getInvalidValueException
(
"lock mode"
,
lockMode
);
}
this
.
lockMode
=
lockMode
;
}
...
...
h2/src/main/org/h2/jdbc/JdbcArray.java
浏览文件 @
f945dbb6
...
...
@@ -251,12 +251,12 @@ public class JdbcArray extends TraceObject implements Array {
private
Object
[]
get
(
long
index
,
int
count
)
{
Object
[]
array
=
get
();
if
(
count
<
0
||
count
>
array
.
length
)
{
throw
DbException
.
getInvalidValueException
(
"
"
+
count
,
"
count (1.."
+
array
.
length
+
")"
);
throw
DbException
.
getInvalidValueException
(
"count (1.."
+
array
.
length
+
")"
,
count
);
}
if
(
index
<
1
||
index
>
array
.
length
)
{
throw
DbException
.
getInvalidValueException
(
"
"
+
index
,
"
index (1.."
+
array
.
length
+
")"
);
throw
DbException
.
getInvalidValueException
(
"index (1.."
+
array
.
length
+
")"
,
index
);
}
Object
[]
subset
=
new
Object
[
count
];
System
.
arraycopy
(
array
,
(
int
)
(
index
-
1
),
subset
,
0
,
count
);
...
...
h2/src/main/org/h2/jdbc/JdbcCallableStatement.java
浏览文件 @
f945dbb6
...
...
@@ -1485,7 +1485,7 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
private
void
checkIndexBounds
(
int
parameterIndex
)
throws
SQLException
{
checkClosed
();
if
(
parameterIndex
<
1
||
parameterIndex
>
maxOutParameters
)
{
throw
DbException
.
getInvalidValueException
(
"
"
+
parameterIndex
,
"parameterIndex"
);
throw
DbException
.
getInvalidValueException
(
"
parameterIndex"
,
parameterIndex
);
}
}
...
...
@@ -1513,7 +1513,7 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
try
{
checkIndexBounds
(
parameterIndex
);
if
(!
outParameters
.
get
(
parameterIndex
-
1
))
{
throw
DbException
.
getInvalidValueException
(
"
"
+
parameterIndex
,
"parameterIndex"
);
throw
DbException
.
getInvalidValueException
(
"
parameterIndex"
,
parameterIndex
);
}
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
...
...
@@ -1534,7 +1534,7 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
}
Integer
index
=
namedParameters
.
get
(
parameterName
);
if
(
index
==
null
)
{
throw
DbException
.
getInvalidValueException
(
parameterName
,
"parameterName"
);
throw
DbException
.
getInvalidValueException
(
"parameterName"
,
parameterName
);
}
return
index
;
}
catch
(
Exception
e
)
{
...
...
h2/src/main/org/h2/jdbc/JdbcConnection.java
浏览文件 @
f945dbb6
...
...
@@ -629,7 +629,7 @@ public class JdbcConnection extends TraceObject implements Connection {
lockMode
=
Constants
.
LOCK_MODE_TABLE
;
break
;
default
:
throw
DbException
.
getInvalidValueException
(
"
"
+
level
,
"level"
);
throw
DbException
.
getInvalidValueException
(
"
level"
,
level
);
}
commit
();
setLockMode
=
prepareCommand
(
"SET LOCK_MODE ?"
,
setLockMode
);
...
...
@@ -1142,7 +1142,7 @@ public class JdbcConnection extends TraceObject implements Connection {
*/
String
translateSQL
(
String
sql
,
boolean
escapeProcessing
)
{
if
(
sql
==
null
)
{
throw
DbException
.
getInvalidValueException
(
sql
,
"SQL"
);
throw
DbException
.
getInvalidValueException
(
"SQL"
,
sql
);
}
if
(!
escapeProcessing
)
{
return
sql
;
...
...
@@ -1275,14 +1275,14 @@ public class JdbcConnection extends TraceObject implements Connection {
case
ResultSet
.
TYPE_SCROLL_SENSITIVE
:
break
;
default
:
throw
DbException
.
getInvalidValueException
(
"
"
+
resultSetType
,
"resultSetType"
);
throw
DbException
.
getInvalidValueException
(
"
resultSetType"
,
resultSetType
);
}
switch
(
resultSetConcurrency
)
{
case
ResultSet
.
CONCUR_READ_ONLY
:
case
ResultSet
.
CONCUR_UPDATABLE
:
break
;
default
:
throw
DbException
.
getInvalidValueException
(
"
"
+
resultSetConcurrency
,
"resultSetConcurrency"
);
throw
DbException
.
getInvalidValueException
(
"
resultSetConcurrency"
,
resultSetConcurrency
);
}
}
...
...
@@ -1292,7 +1292,7 @@ public class JdbcConnection extends TraceObject implements Connection {
//## Java 1.4 begin ##
if
(
resultSetHoldability
!=
ResultSet
.
HOLD_CURSORS_OVER_COMMIT
&&
resultSetHoldability
!=
ResultSet
.
CLOSE_CURSORS_AT_COMMIT
)
{
throw
DbException
.
getInvalidValueException
(
"
"
+
resultSetHoldability
,
"resultSetHoldability"
);
throw
DbException
.
getInvalidValueException
(
"
resultSetHoldability"
,
resultSetHoldability
);
}
//## Java 1.4 end ##
}
...
...
h2/src/main/org/h2/jdbc/JdbcParameterMetaData.java
浏览文件 @
f945dbb6
...
...
@@ -205,7 +205,7 @@ implements ParameterMetaData
private
ParameterInterface
getParameter
(
int
param
)
throws
SQLException
{
checkClosed
();
if
(
param
<
1
||
param
>
paramCount
)
{
throw
DbException
.
getInvalidValueException
(
"
"
+
param
,
"param"
);
throw
DbException
.
getInvalidValueException
(
"
param"
,
param
);
}
return
parameters
.
get
(
param
-
1
);
}
...
...
h2/src/main/org/h2/jdbc/JdbcPreparedStatement.java
浏览文件 @
f945dbb6
...
...
@@ -1256,7 +1256,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
parameterIndex
--;
ArrayList
<
?
extends
ParameterInterface
>
parameters
=
command
.
getParameters
();
if
(
parameterIndex
<
0
||
parameterIndex
>=
parameters
.
size
())
{
throw
DbException
.
getInvalidValueException
(
"
"
+
(
parameterIndex
+
1
),
"parameterIndex"
);
throw
DbException
.
getInvalidValueException
(
"
parameterIndex"
,
parameterIndex
+
1
);
}
ParameterInterface
param
=
parameters
.
get
(
parameterIndex
);
// can only delete old temp files if they are not in the batch
...
...
h2/src/main/org/h2/jdbc/JdbcResultSet.java
浏览文件 @
f945dbb6
...
...
@@ -709,7 +709,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"getBigDecimal("
+
StringUtils
.
quoteJavaString
(
columnLabel
)+
", "
+
scale
+
");"
);
}
if
(
scale
<
0
)
{
throw
DbException
.
getInvalidValueException
(
"
"
+
scale
,
"scale"
);
throw
DbException
.
getInvalidValueException
(
"
scale"
,
scale
);
}
BigDecimal
bd
=
get
(
columnLabel
).
getBigDecimal
();
return
bd
==
null
?
null
:
MathUtils
.
setScale
(
bd
,
scale
);
...
...
@@ -734,7 +734,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"getBigDecimal("
+
columnIndex
+
", "
+
scale
+
");"
);
}
if
(
scale
<
0
)
{
throw
DbException
.
getInvalidValueException
(
"
"
+
scale
,
"scale"
);
throw
DbException
.
getInvalidValueException
(
"
scale"
,
scale
);
}
BigDecimal
bd
=
get
(
columnIndex
).
getBigDecimal
();
return
bd
==
null
?
null
:
MathUtils
.
setScale
(
bd
,
scale
);
...
...
@@ -2377,14 +2377,13 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"setFetchSize"
,
rows
);
checkClosed
();
if
(
rows
<
0
)
{
throw
DbException
.
getInvalidValueException
(
"
"
+
rows
,
"rows"
);
throw
DbException
.
getInvalidValueException
(
"
rows"
,
rows
);
}
else
if
(
rows
>
0
)
{
if
(
stat
!=
null
)
{
int
maxRows
=
stat
.
getMaxRows
();
if
(
maxRows
>
0
&&
rows
>
maxRows
)
{
throw
DbException
.
getInvalidValueException
(
"
"
+
rows
,
"rows"
);
throw
DbException
.
getInvalidValueException
(
"
rows"
,
rows
);
}
}
}
else
{
...
...
@@ -2914,7 +2913,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
private
void
checkColumnIndex
(
int
columnIndex
)
throws
SQLException
{
checkClosed
();
if
(
columnIndex
<
1
||
columnIndex
>
columnCount
)
{
throw
DbException
.
getInvalidValueException
(
"
"
+
columnIndex
,
"columnIndex"
);
throw
DbException
.
getInvalidValueException
(
"
columnIndex"
,
columnIndex
);
}
}
...
...
h2/src/main/org/h2/jdbc/JdbcResultSetMetaData.java
浏览文件 @
f945dbb6
...
...
@@ -425,7 +425,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
private
void
checkColumnIndex
(
int
columnIndex
)
throws
SQLException
{
checkClosed
();
if
(
columnIndex
<
1
||
columnIndex
>
columnCount
)
{
throw
DbException
.
getInvalidValueException
(
"
"
+
columnIndex
,
"columnIndex"
);
throw
DbException
.
getInvalidValueException
(
"
columnIndex"
,
columnIndex
);
}
}
...
...
h2/src/main/org/h2/jdbc/JdbcStatement.java
浏览文件 @
f945dbb6
...
...
@@ -378,7 +378,7 @@ public class JdbcStatement extends TraceObject implements Statement {
debugCodeCall
(
"setMaxRows"
,
maxRows
);
checkClosed
();
if
(
maxRows
<
0
)
{
throw
DbException
.
getInvalidValueException
(
"
"
+
maxRows
,
"maxRows"
);
throw
DbException
.
getInvalidValueException
(
"
maxRows"
,
maxRows
);
}
this
.
maxRows
=
maxRows
;
}
catch
(
Exception
e
)
{
...
...
@@ -402,7 +402,7 @@ public class JdbcStatement extends TraceObject implements Statement {
debugCodeCall
(
"setFetchSize"
,
rows
);
checkClosed
();
if
(
rows
<
0
||
(
rows
>
0
&&
maxRows
>
0
&&
rows
>
maxRows
))
{
throw
DbException
.
getInvalidValueException
(
"
"
+
rows
,
"rows"
);
throw
DbException
.
getInvalidValueException
(
"
rows"
,
rows
);
}
if
(
rows
==
0
)
{
rows
=
SysProperties
.
SERVER_RESULT_SET_FETCH_SIZE
;
...
...
@@ -570,7 +570,7 @@ public class JdbcStatement extends TraceObject implements Statement {
debugCodeCall
(
"setQueryTimeout"
,
seconds
);
checkClosed
();
if
(
seconds
<
0
)
{
throw
DbException
.
getInvalidValueException
(
"
"
+
seconds
,
"seconds"
);
throw
DbException
.
getInvalidValueException
(
"
seconds"
,
seconds
);
}
conn
.
setQueryTimeout
(
seconds
);
}
catch
(
Exception
e
)
{
...
...
@@ -695,7 +695,7 @@ public class JdbcStatement extends TraceObject implements Statement {
// nothing to do
break
;
default
:
throw
DbException
.
getInvalidValueException
(
"
"
+
current
,
"current"
);
throw
DbException
.
getInvalidValueException
(
"
current"
,
current
);
}
return
false
;
}
catch
(
Exception
e
)
{
...
...
h2/src/main/org/h2/message/DbException.java
浏览文件 @
f945dbb6
...
...
@@ -205,12 +205,12 @@ public class DbException extends RuntimeException {
/**
* Gets a SQL exception meaning this value is invalid.
*
* @param value the value passed
* @param param the name of the parameter
* @param value the value passed
* @return the IllegalArgumentException object
*/
public
static
DbException
getInvalidValueException
(
String
value
,
String
param
)
{
return
get
(
ErrorCode
.
INVALID_VALUE_2
,
value
,
param
);
public
static
DbException
getInvalidValueException
(
String
param
,
Object
value
)
{
return
get
(
ErrorCode
.
INVALID_VALUE_2
,
value
==
null
?
"null"
:
value
.
toString
()
,
param
);
}
/**
...
...
h2/src/main/org/h2/schema/Sequence.java
浏览文件 @
f945dbb6
...
...
@@ -6,7 +6,6 @@
*/
package
org
.
h2
.
schema
;
import
org.h2.constant.ErrorCode
;
import
org.h2.engine.DbObject
;
import
org.h2.engine.Session
;
import
org.h2.message.DbException
;
...
...
@@ -50,7 +49,7 @@ public class Sequence extends SchemaObjectBase {
public
void
setIncrement
(
long
inc
)
{
if
(
inc
==
0
)
{
throw
DbException
.
get
(
ErrorCode
.
INVALID_VALUE_2
,
"0"
,
"INCREMENT"
);
throw
DbException
.
get
InvalidValueException
(
"INCREMENT"
,
0
);
}
this
.
increment
=
inc
;
}
...
...
h2/src/main/org/h2/security/CipherFactory.java
浏览文件 @
f945dbb6
...
...
@@ -79,7 +79,7 @@ public class CipherFactory {
if
(
"SHA256"
.
equalsIgnoreCase
(
algorithm
))
{
return
new
SHA256
();
}
throw
DbException
.
getInvalidValueException
(
algorithm
,
"algorithm"
);
throw
DbException
.
getInvalidValueException
(
"algorithm"
,
algorithm
);
}
/**
...
...
h2/src/main/org/h2/tools/SimpleResultSet.java
浏览文件 @
f945dbb6
...
...
@@ -1619,7 +1619,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
private
void
checkColumnIndex
(
int
columnIndex
)
throws
SQLException
{
if
(
columnIndex
<
0
||
columnIndex
>=
columns
.
size
())
{
throw
DbException
.
getInvalidValueException
(
"
"
+
columnIndex
,
"columnIndex"
).
getSQLException
();
throw
DbException
.
getInvalidValueException
(
"
columnIndex"
,
columnIndex
).
getSQLException
();
}
}
...
...
h2/src/main/org/h2/util/CacheLRU.java
浏览文件 @
f945dbb6
...
...
@@ -68,7 +68,7 @@ public class CacheLRU implements Cache {
if
(
CacheLRU
.
TYPE_NAME
.
equals
(
cacheType
))
{
cache
=
new
CacheLRU
(
writer
,
cacheSize
);
}
else
{
throw
DbException
.
getInvalidValueException
(
cacheType
,
"CACHE_TYPE"
);
throw
DbException
.
getInvalidValueException
(
"CACHE_TYPE"
,
cacheType
);
}
if
(
secondLevel
!=
null
)
{
cache
=
new
CacheSecondLevel
(
cache
,
secondLevel
);
...
...
h2/src/main/org/h2/util/MathUtils.java
浏览文件 @
f945dbb6
...
...
@@ -253,10 +253,8 @@ public class MathUtils {
* @return the scaled value
*/
public
static
BigDecimal
setScale
(
BigDecimal
bd
,
int
scale
)
{
if
(
scale
>
BIG_DECIMAL_SCALE_MAX
)
{
throw
DbException
.
getInvalidValueException
(
""
+
scale
,
"scale"
);
}
else
if
(
scale
<
-
BIG_DECIMAL_SCALE_MAX
)
{
throw
DbException
.
getInvalidValueException
(
""
+
scale
,
"scale"
);
if
(
scale
>
BIG_DECIMAL_SCALE_MAX
||
scale
<
-
BIG_DECIMAL_SCALE_MAX
)
{
throw
DbException
.
getInvalidValueException
(
"scale"
,
scale
);
}
return
bd
.
setScale
(
scale
,
BigDecimal
.
ROUND_HALF_UP
);
}
...
...
h2/src/main/org/h2/value/ValueTimestamp.java
浏览文件 @
f945dbb6
...
...
@@ -151,7 +151,7 @@ public class ValueTimestamp extends Value {
public
Value
convertScale
(
boolean
onlyToSmallerScale
,
int
targetScale
)
{
if
(
targetScale
<
0
||
targetScale
>
DEFAULT_SCALE
)
{
// TODO convertScale for Timestamps: may throw an exception?
throw
DbException
.
getInvalidValueException
(
"
"
+
targetScale
,
"scale"
);
throw
DbException
.
getInvalidValueException
(
"
scale"
,
targetScale
);
}
int
nanos
=
value
.
getNanos
();
BigDecimal
bd
=
BigDecimal
.
valueOf
(
nanos
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论