Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
3aa6f180
Unverified
提交
3aa6f180
authored
2月 09, 2018
作者:
Evgenij Ryazanov
提交者:
GitHub
2月 09, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into datetime
上级
23571cda
547dfcbd
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
21 个修改的文件
包含
391 行增加
和
596 行删除
+391
-596
changelog.html
h2/src/docsrc/html/changelog.html
+0
-377
release.txt
h2/src/installer/release.txt
+55
-9
DbContextRule.java
h2/src/main/org/h2/bnf/context/DbContextRule.java
+3
-3
Parser.java
h2/src/main/org/h2/command/Parser.java
+18
-157
Comparison.java
h2/src/main/org/h2/expression/Comparison.java
+3
-1
Function.java
h2/src/main/org/h2/expression/Function.java
+49
-2
JdbcStatement.java
h2/src/main/org/h2/jdbc/JdbcStatement.java
+2
-2
LazyResult.java
h2/src/main/org/h2/result/LazyResult.java
+2
-2
LocalResult.java
h2/src/main/org/h2/result/LocalResult.java
+3
-2
ResultInterface.java
h2/src/main/org/h2/result/ResultInterface.java
+2
-2
ResultRemote.java
h2/src/main/org/h2/result/ResultRemote.java
+2
-2
Column.java
h2/src/main/org/h2/table/Column.java
+1
-1
DateTimeUtils.java
h2/src/main/org/h2/util/DateTimeUtils.java
+1
-2
ParserUtil.java
h2/src/main/org/h2/util/ParserUtil.java
+212
-0
Value.java
h2/src/main/org/h2/value/Value.java
+18
-18
ValueGeometry.java
h2/src/main/org/h2/value/ValueGeometry.java
+2
-3
ValueLob.java
h2/src/main/org/h2/value/ValueLob.java
+5
-4
ValueLobDb.java
h2/src/main/org/h2/value/ValueLobDb.java
+6
-4
ValueNull.java
h2/src/main/org/h2/value/ValueNull.java
+2
-2
TestOptimizations.java
h2/src/test/org/h2/test/db/TestOptimizations.java
+3
-1
Build.java
h2/src/tools/org/h2/build/Build.java
+2
-2
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
3aa6f180
差异被折叠。
点击展开。
h2/src/installer/release.txt
浏览文件 @
3aa6f180
...
...
@@ -17,7 +17,28 @@ Ensure lines are not overly long:
./build.sh docs
## Jar File Size Verification
## JDBC Client Jar File Size Verification
The JDBC client is supposed to not have dependencies to the database engine.
To verify, run
./build.sh clean jarClient
If this fails with eg. "Expected file size 400 - 500 KB, got: 1687", then
find out where the dependency is, and resolve. As follows:
start by renaming Database to Database2:
mv src/main/org/h2/engine/Database.java src/main/org/h2/engine/Database2.java
./build.sh clean jarClient
This will fail, the first error is for example can not compile Session because Database was not found.
So rename Session to Session2 and try again.
This will fail again, the first error is different, now for example can not compile ResultInterface
because Session was not found. Now, ResultInterface should not depend on the Session.
So this needs to be fixed (the JDBC API shouldn't indirectly depend on it).
After everything is resolved, rename the classes back.
## MVStore Jar File Size Verification
To ensure the MVStore jar file is not too large
(does not reference the database code by accident).
...
...
@@ -27,14 +48,39 @@ The file size should be about 200 KB:
## Changing Version Numbers
Update Constants.java - change version and build number
Update changelog.html - add new version, remove oldest
Update newsfeed.sql - add new version, remove oldest
Minor version change: change sourceError.html and source.html
If a beta, change download.html: Version ${version} (${versionDate}), Beta
If a beta, change mainWeb.html: Version ${version} (${versionDate}), Beta
Benchmark: use latest versions of other dbs, change version(s) in performance.html
Run ./buildRelease.sh / buildRelease.bat
Update org.h2.engine.Constants.java:
if the last build was stable (the normal case):
set BUILD_DATE_STABLE to current BUILD_DATE
set BUILD_ID_STABLE to current BUILD_ID
change the version and build number:
set BUILD_DATE to today
increment BUILD_ID
Update changelog.html:
* create a new "Next Version (unreleased)" with an empty list
* add a new version
* remove change log entries of the oldest version (keeping about 500 lines)
Update newsfeed.sql:
* add new version, for example:
* (146, '1.4.197', '2017-06-10'),
* remove oldest entry in that list
## Skipped
The following can be skipped currently, as sourceError.html and source.html
are no longer working (they can be removed, or fixed):
* Minor version change: change sourceError.html and source.html
* If a beta, change download.html: Version ${version} (${versionDate}), Beta
* If a beta, change mainWeb.html: Version ${version} (${versionDate}), Beta
The following can be skipped currently; benchmarks should probably be removed:
* To update benchmark data: use latest versions of other dbs, change version(s) in performance.html
## Build the release
Change directory to src/installer
Run ./buildRelease.sh (non-Windows) or buildRelease.bat (Windows)
Scan for viruses
Test installer, H2 Console (test new languages)
...
...
h2/src/main/org/h2/bnf/context/DbContextRule.java
浏览文件 @
3aa6f180
...
...
@@ -15,8 +15,8 @@ import org.h2.bnf.RuleElement;
import
org.h2.bnf.RuleHead
;
import
org.h2.bnf.RuleList
;
import
org.h2.bnf.Sentence
;
import
org.h2.command.Parser
;
import
org.h2.message.DbException
;
import
org.h2.util.ParserUtil
;
import
org.h2.util.StringUtils
;
/**
...
...
@@ -154,7 +154,7 @@ public class DbContextRule implements Rule {
break
;
}
String
alias
=
up
.
substring
(
0
,
i
);
if
(
Parser
.
isKeyword
(
alias
,
true
))
{
if
(
Parser
Util
.
isKeyword
(
alias
,
true
))
{
break
;
}
s
=
s
.
substring
(
alias
.
length
());
...
...
@@ -301,7 +301,7 @@ public class DbContextRule implements Rule {
return
s
;
}
String
alias
=
up
.
substring
(
0
,
i
);
if
(
"SET"
.
equals
(
alias
)
||
Parser
.
isKeyword
(
alias
,
true
))
{
if
(
"SET"
.
equals
(
alias
)
||
Parser
Util
.
isKeyword
(
alias
,
true
))
{
return
s
;
}
if
(
newAlias
)
{
...
...
h2/src/main/org/h2/command/Parser.java
浏览文件 @
3aa6f180
...
...
@@ -148,6 +148,7 @@ import org.h2.table.TableFilter.TableFilterVisitor;
import
org.h2.table.TableView
;
import
org.h2.util.MathUtils
;
import
org.h2.util.New
;
import
org.h2.util.ParserUtil
;
import
org.h2.util.StatementBuilder
;
import
org.h2.util.StringUtils
;
import
org.h2.value.CompareMode
;
...
...
@@ -186,15 +187,18 @@ public class Parser {
CHAR_DOLLAR_QUOTED_STRING
=
9
;
// this are token types
private
static
final
int
KEYWORD
=
1
,
IDENTIFIER
=
2
,
PARAMETER
=
3
,
END
=
4
,
VALUE
=
5
;
private
static
final
int
EQUAL
=
6
,
BIGGER_EQUAL
=
7
,
BIGGER
=
8
;
private
static
final
int
SMALLER
=
9
,
SMALLER_EQUAL
=
10
,
NOT_EQUAL
=
11
,
AT
=
12
;
private
static
final
int
MINUS
=
13
,
PLUS
=
14
,
STRING_CONCAT
=
15
;
private
static
final
int
OPEN
=
16
,
CLOSE
=
17
,
NULL
=
18
,
TRUE
=
19
,
FALSE
=
20
;
private
static
final
int
ROWNUM
=
24
;
private
static
final
int
KEYWORD
=
ParserUtil
.
KEYWORD
;
private
static
final
int
IDENTIFIER
=
ParserUtil
.
IDENTIFIER
;
private
static
final
int
NULL
=
ParserUtil
.
NULL
;
private
static
final
int
TRUE
=
ParserUtil
.
TRUE
;
private
static
final
int
FALSE
=
ParserUtil
.
FALSE
;
private
static
final
int
ROWNUM
=
ParserUtil
.
ROWNUM
;
private
static
final
int
PARAMETER
=
10
,
END
=
11
,
VALUE
=
12
;
private
static
final
int
EQUAL
=
13
,
BIGGER_EQUAL
=
14
,
BIGGER
=
15
;
private
static
final
int
SMALLER
=
16
,
SMALLER_EQUAL
=
17
,
NOT_EQUAL
=
18
;
private
static
final
int
AT
=
19
;
private
static
final
int
MINUS
=
20
,
PLUS
=
21
,
STRING_CONCAT
=
22
;
private
static
final
int
OPEN
=
23
,
CLOSE
=
24
;
private
static
final
int
SPATIAL_INTERSECTS
=
25
;
private
static
final
Comparator
<
TableFilter
>
TABLE_FILTER_COMPARATOR
=
...
...
@@ -4170,140 +4174,11 @@ public class Parser {
// if not yet converted to uppercase, do it now
s
=
StringUtils
.
toUpperEnglish
(
s
);
}
return
isKeyword
(
s
,
false
);
}
/**
* Checks if this string is a SQL keyword.
*
* @param s the token to check
* @param supportOffsetFetch if OFFSET and FETCH are keywords
* @return true if it is a keyword
*/
public
static
boolean
isKeyword
(
String
s
,
boolean
supportOffsetFetch
)
{
if
(
s
==
null
||
s
.
length
()
==
0
)
{
return
false
;
}
return
getSaveTokenType
(
s
,
supportOffsetFetch
,
false
)
!=
IDENTIFIER
;
return
ParserUtil
.
isKeyword
(
s
,
false
);
}
private
static
int
getSaveTokenType
(
String
s
,
boolean
supportOffsetFetch
,
boolean
functionsAsKeywords
)
{
switch
(
s
.
charAt
(
0
))
{
case
'A'
:
return
getKeywordOrIdentifier
(
s
,
"ALL"
,
KEYWORD
);
case
'C'
:
if
(
"CHECK"
.
equals
(
s
))
{
return
KEYWORD
;
}
else
if
(
"CONSTRAINT"
.
equals
(
s
))
{
return
KEYWORD
;
}
else
if
(
"CROSS"
.
equals
(
s
))
{
return
KEYWORD
;
}
if
(
functionsAsKeywords
)
{
if
(
"CURRENT_DATE"
.
equals
(
s
)
||
"CURRENT_TIME"
.
equals
(
s
)
||
"CURRENT_TIMESTAMP"
.
equals
(
s
))
{
return
KEYWORD
;
}
}
return
IDENTIFIER
;
case
'D'
:
return
getKeywordOrIdentifier
(
s
,
"DISTINCT"
,
KEYWORD
);
case
'E'
:
if
(
"EXCEPT"
.
equals
(
s
))
{
return
KEYWORD
;
}
return
getKeywordOrIdentifier
(
s
,
"EXISTS"
,
KEYWORD
);
case
'F'
:
if
(
"FROM"
.
equals
(
s
))
{
return
KEYWORD
;
}
else
if
(
"FOR"
.
equals
(
s
))
{
return
KEYWORD
;
}
else
if
(
"FOREIGN"
.
equals
(
s
))
{
return
KEYWORD
;
}
else
if
(
"FULL"
.
equals
(
s
))
{
return
KEYWORD
;
}
else
if
(
supportOffsetFetch
&&
"FETCH"
.
equals
(
s
))
{
return
KEYWORD
;
}
return
getKeywordOrIdentifier
(
s
,
"FALSE"
,
FALSE
);
case
'G'
:
return
getKeywordOrIdentifier
(
s
,
"GROUP"
,
KEYWORD
);
case
'H'
:
return
getKeywordOrIdentifier
(
s
,
"HAVING"
,
KEYWORD
);
case
'I'
:
if
(
"INNER"
.
equals
(
s
))
{
return
KEYWORD
;
}
else
if
(
"INTERSECT"
.
equals
(
s
))
{
return
KEYWORD
;
}
return
getKeywordOrIdentifier
(
s
,
"IS"
,
KEYWORD
);
case
'J'
:
return
getKeywordOrIdentifier
(
s
,
"JOIN"
,
KEYWORD
);
case
'L'
:
if
(
"LIMIT"
.
equals
(
s
))
{
return
KEYWORD
;
}
return
getKeywordOrIdentifier
(
s
,
"LIKE"
,
KEYWORD
);
case
'M'
:
return
getKeywordOrIdentifier
(
s
,
"MINUS"
,
KEYWORD
);
case
'N'
:
if
(
"NOT"
.
equals
(
s
))
{
return
KEYWORD
;
}
else
if
(
"NATURAL"
.
equals
(
s
))
{
return
KEYWORD
;
}
return
getKeywordOrIdentifier
(
s
,
"NULL"
,
NULL
);
case
'O'
:
if
(
"ON"
.
equals
(
s
))
{
return
KEYWORD
;
}
else
if
(
supportOffsetFetch
&&
"OFFSET"
.
equals
(
s
))
{
return
KEYWORD
;
}
return
getKeywordOrIdentifier
(
s
,
"ORDER"
,
KEYWORD
);
case
'P'
:
return
getKeywordOrIdentifier
(
s
,
"PRIMARY"
,
KEYWORD
);
case
'R'
:
return
getKeywordOrIdentifier
(
s
,
"ROWNUM"
,
ROWNUM
);
case
'S'
:
if
(
"SELECT"
.
equals
(
s
))
{
return
KEYWORD
;
}
if
(
functionsAsKeywords
)
{
if
(
"SYSDATE"
.
equals
(
s
)
||
"SYSTIME"
.
equals
(
s
)
||
"SYSTIMESTAMP"
.
equals
(
s
))
{
return
KEYWORD
;
}
}
return
IDENTIFIER
;
case
'T'
:
if
(
"TRUE"
.
equals
(
s
))
{
return
TRUE
;
}
if
(
functionsAsKeywords
)
{
if
(
"TODAY"
.
equals
(
s
))
{
return
KEYWORD
;
}
}
return
IDENTIFIER
;
case
'U'
:
if
(
"UNIQUE"
.
equals
(
s
))
{
return
KEYWORD
;
}
return
getKeywordOrIdentifier
(
s
,
"UNION"
,
KEYWORD
);
case
'W'
:
if
(
"WITH"
.
equals
(
s
))
{
return
KEYWORD
;
}
return
getKeywordOrIdentifier
(
s
,
"WHERE"
,
KEYWORD
);
default
:
return
IDENTIFIER
;
}
}
private
static
int
getKeywordOrIdentifier
(
String
s1
,
String
s2
,
int
keywordType
)
{
if
(
s1
.
equals
(
s2
))
{
return
keywordType
;
}
return
IDENTIFIER
;
return
ParserUtil
.
getSaveTokenType
(
s
,
supportOffsetFetch
,
functionsAsKeywords
);
}
private
Column
parseColumnForTable
(
String
columnName
,
...
...
@@ -6890,8 +6765,9 @@ public class Parser {
if
(
s
==
null
)
{
return
"\"\""
;
}
if
(
isSimpleIdentifier
(
s
,
false
))
if
(
isSimpleIdentifier
(
s
,
false
))
{
return
s
;
}
return
StringUtils
.
quoteIdentifier
(
s
);
}
...
...
@@ -6904,22 +6780,7 @@ public class Parser {
* @throws NullPointerException if s is {@code null}
*/
public
static
boolean
isSimpleIdentifier
(
String
s
,
boolean
functionsAsKeywords
)
{
if
(
s
.
length
()
==
0
)
{
return
false
;
}
char
c
=
s
.
charAt
(
0
);
// lowercase a-z is quoted as well
if
((!
Character
.
isLetter
(
c
)
&&
c
!=
'_'
)
||
Character
.
isLowerCase
(
c
))
{
return
false
;
}
for
(
int
i
=
1
,
length
=
s
.
length
();
i
<
length
;
i
++)
{
c
=
s
.
charAt
(
i
);
if
((!
Character
.
isLetterOrDigit
(
c
)
&&
c
!=
'_'
)
||
Character
.
isLowerCase
(
c
))
{
return
false
;
}
}
return
getSaveTokenType
(
s
,
true
,
functionsAsKeywords
)
==
IDENTIFIER
;
return
ParserUtil
.
isSimpleIdentifier
(
s
,
functionsAsKeywords
);
}
public
void
setLiteralsChecked
(
boolean
literalsChecked
)
{
...
...
h2/src/main/org/h2/expression/Comparison.java
浏览文件 @
3aa6f180
...
...
@@ -12,6 +12,7 @@ import org.h2.engine.Session;
import
org.h2.engine.SysProperties
;
import
org.h2.index.IndexCondition
;
import
org.h2.message.DbException
;
import
org.h2.table.Column
;
import
org.h2.table.ColumnResolver
;
import
org.h2.table.TableFilter
;
import
org.h2.util.MathUtils
;
...
...
@@ -202,9 +203,10 @@ public class Comparison extends Condition {
// to constant type, but vise versa, then let's do this here
// once.
if
(
constType
!=
resType
)
{
Column
column
=
((
ExpressionColumn
)
left
).
getColumn
();
right
=
ValueExpression
.
get
(
r
.
convertTo
(
resType
,
MathUtils
.
convertLongToInt
(
left
.
getPrecision
()),
session
.
getDatabase
().
getMode
(),
((
ExpressionColumn
)
left
).
getColumn
()));
session
.
getDatabase
().
getMode
(),
column
,
column
.
getEnumerators
()));
}
}
else
if
(
right
instanceof
Parameter
)
{
((
Parameter
)
right
).
setColumn
(
...
...
h2/src/main/org/h2/expression/Function.java
浏览文件 @
3aa6f180
...
...
@@ -17,6 +17,7 @@ import java.sql.SQLException;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.GregorianCalendar
;
import
java.util.HashMap
;
import
java.util.Locale
;
import
java.util.regex.Pattern
;
...
...
@@ -854,7 +855,7 @@ public class Function extends Expression implements FunctionCall {
case
SECOND:
case
WEEK:
case
YEAR:
result
=
ValueInt
.
get
(
DateTimeUtils
.
getDatePart
(
v0
,
info
.
type
));
result
=
ValueInt
.
get
(
getDatePart
(
v0
,
info
.
type
));
break
;
case
MONTH_NAME:
{
SimpleDateFormat
monthName
=
new
SimpleDateFormat
(
"MMMM"
,
...
...
@@ -1492,7 +1493,7 @@ public class Function extends Expression implements FunctionCall {
break
;
case
EXTRACT:
{
int
field
=
getDatePart
(
v0
.
getString
());
result
=
ValueInt
.
get
(
DateTimeUtils
.
getDatePart
(
v1
,
field
));
result
=
ValueInt
.
get
(
getDatePart
(
v1
,
field
));
break
;
}
case
FORMATDATETIME:
{
...
...
@@ -2798,6 +2799,52 @@ public class Function extends Expression implements FunctionCall {
}
}
/**
* Get the specified field of a date, however with years normalized to
* positive or negative, and month starting with 1.
*
* @param date the date value
* @param field the field type, see {@link Function} for constants
* @return the value
*/
public
static
int
getDatePart
(
Value
date
,
int
field
)
{
long
[]
a
=
DateTimeUtils
.
dateAndTimeFromValue
(
date
);
long
dateValue
=
a
[
0
];
long
timeNanos
=
a
[
1
];
switch
(
field
)
{
case
Function
.
YEAR
:
return
DateTimeUtils
.
yearFromDateValue
(
dateValue
);
case
Function
.
MONTH
:
return
DateTimeUtils
.
monthFromDateValue
(
dateValue
);
case
Function
.
DAY_OF_MONTH
:
return
DateTimeUtils
.
dayFromDateValue
(
dateValue
);
case
Function
.
HOUR
:
return
(
int
)
(
timeNanos
/
3_600_000_000_000L
%
24
);
case
Function
.
MINUTE
:
return
(
int
)
(
timeNanos
/
60_000_000_000L
%
60
);
case
Function
.
SECOND
:
return
(
int
)
(
timeNanos
/
1_000_000_000
%
60
);
case
Function
.
MILLISECOND
:
return
(
int
)
(
timeNanos
/
1_000_000
%
1_000
);
case
Function
.
DAY_OF_YEAR
:
return
DateTimeUtils
.
getDayOfYear
(
dateValue
);
case
Function
.
DAY_OF_WEEK
:
return
DateTimeUtils
.
getSundayDayOfWeek
(
dateValue
);
case
Function
.
WEEK
:
GregorianCalendar
gc
=
DateTimeUtils
.
getCalendar
();
return
DateTimeUtils
.
getWeekOfYear
(
dateValue
,
gc
.
getFirstDayOfWeek
()
-
1
,
gc
.
getMinimalDaysInFirstWeek
());
case
Function
.
QUARTER
:
return
(
DateTimeUtils
.
monthFromDateValue
(
dateValue
)
-
1
)
/
3
+
1
;
case
Function
.
ISO_YEAR
:
return
DateTimeUtils
.
getIsoWeekYear
(
dateValue
);
case
Function
.
ISO_WEEK
:
return
DateTimeUtils
.
getIsoWeekOfYear
(
dateValue
);
case
Function
.
ISO_DAY_OF_WEEK
:
return
DateTimeUtils
.
getIsoDayOfWeek
(
dateValue
);
}
throw
DbException
.
getUnsupportedException
(
"getDatePart("
+
date
+
", "
+
field
+
')'
);
}
@Override
public
Expression
[]
getArgs
()
{
return
args
;
...
...
h2/src/main/org/h2/jdbc/JdbcStatement.java
浏览文件 @
3aa6f180
...
...
@@ -13,13 +13,13 @@ import java.sql.Statement;
import
java.util.ArrayList
;
import
org.h2.api.ErrorCode
;
import
org.h2.command.CommandInterface
;
import
org.h2.command.Parser
;
import
org.h2.engine.SessionInterface
;
import
org.h2.engine.SysProperties
;
import
org.h2.message.DbException
;
import
org.h2.message.TraceObject
;
import
org.h2.result.ResultInterface
;
import
org.h2.util.New
;
import
org.h2.util.ParserUtil
;
import
org.h2.util.StringUtils
;
/**
...
...
@@ -1333,7 +1333,7 @@ public class JdbcStatement extends TraceObject implements Statement, JdbcStateme
*/
@Override
public
boolean
isSimpleIdentifier
(
String
identifier
)
throws
SQLException
{
return
Parser
.
isSimpleIdentifier
(
identifier
,
true
);
return
Parser
Util
.
isSimpleIdentifier
(
identifier
,
true
);
}
/**
...
...
h2/src/main/org/h2/result/LazyResult.java
浏览文件 @
3aa6f180
...
...
@@ -5,7 +5,7 @@
*/
package
org
.
h2
.
result
;
import
org.h2.engine.Session
;
import
org.h2.engine.Session
Interface
;
import
org.h2.expression.Expression
;
import
org.h2.message.DbException
;
import
org.h2.value.Value
;
...
...
@@ -180,7 +180,7 @@ public abstract class LazyResult implements ResultInterface {
}
@Override
public
ResultInterface
createShallowCopy
(
Session
targetSession
)
{
public
ResultInterface
createShallowCopy
(
Session
Interface
targetSession
)
{
// Copying is impossible with lazy result.
return
null
;
}
...
...
h2/src/main/org/h2/result/LocalResult.java
浏览文件 @
3aa6f180
...
...
@@ -12,6 +12,7 @@ import java.util.Arrays;
import
org.h2.engine.Database
;
import
org.h2.engine.Session
;
import
org.h2.engine.SessionInterface
;
import
org.h2.expression.Expression
;
import
org.h2.message.DbException
;
import
org.h2.util.New
;
...
...
@@ -125,7 +126,7 @@ public class LocalResult implements ResultInterface, ResultTarget {
* @return the copy if possible, or null if copying is not possible
*/
@Override
public
LocalResult
createShallowCopy
(
Session
targetSession
)
{
public
LocalResult
createShallowCopy
(
Session
Interface
targetSession
)
{
if
(
external
==
null
&&
(
rows
==
null
||
rows
.
size
()
<
rowCount
))
{
return
null
;
}
...
...
@@ -141,7 +142,7 @@ public class LocalResult implements ResultInterface, ResultTarget {
}
LocalResult
copy
=
new
LocalResult
();
copy
.
maxMemoryRows
=
this
.
maxMemoryRows
;
copy
.
session
=
targetSession
;
copy
.
session
=
(
Session
)
targetSession
;
copy
.
visibleColumnCount
=
this
.
visibleColumnCount
;
copy
.
expressions
=
this
.
expressions
;
copy
.
rowId
=
-
1
;
...
...
h2/src/main/org/h2/result/ResultInterface.java
浏览文件 @
3aa6f180
...
...
@@ -5,7 +5,7 @@
*/
package
org
.
h2
.
result
;
import
org.h2.engine.Session
;
import
org.h2.engine.Session
Interface
;
import
org.h2.value.Value
;
/**
...
...
@@ -200,7 +200,7 @@ public interface ResultInterface extends AutoCloseable {
* @param targetSession the session of the copy
* @return the copy if possible, or null if copying is not possible
*/
ResultInterface
createShallowCopy
(
Session
targetSession
);
ResultInterface
createShallowCopy
(
Session
Interface
targetSession
);
/**
* Check if this result set contains the given row.
...
...
h2/src/main/org/h2/result/ResultRemote.java
浏览文件 @
3aa6f180
...
...
@@ -7,7 +7,7 @@ package org.h2.result;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
org.h2.engine.Session
;
import
org.h2.engine.Session
Interface
;
import
org.h2.engine.SessionRemote
;
import
org.h2.engine.SysProperties
;
import
org.h2.message.DbException
;
...
...
@@ -271,7 +271,7 @@ public class ResultRemote implements ResultInterface {
}
@Override
public
ResultInterface
createShallowCopy
(
Session
targetSession
)
{
public
ResultInterface
createShallowCopy
(
Session
Interface
targetSession
)
{
// The operation is not supported on remote result.
return
null
;
}
...
...
h2/src/main/org/h2/table/Column.java
浏览文件 @
3aa6f180
...
...
@@ -173,7 +173,7 @@ public class Column {
*/
public
Value
convert
(
Value
v
,
Mode
mode
)
{
try
{
return
v
.
convertTo
(
type
,
MathUtils
.
convertLongToInt
(
precision
),
mode
,
this
);
return
v
.
convertTo
(
type
,
MathUtils
.
convertLongToInt
(
precision
),
mode
,
this
,
getEnumerators
()
);
}
catch
(
DbException
e
)
{
if
(
e
.
getErrorCode
()
==
ErrorCode
.
DATA_CONVERSION_ERROR_1
)
{
String
target
=
(
table
==
null
?
""
:
table
.
getName
()
+
": "
)
+
...
...
h2/src/main/org/h2/util/DateTimeUtils.java
浏览文件 @
3aa6f180
...
...
@@ -16,7 +16,6 @@ import java.util.Locale;
import
java.util.TimeZone
;
import
org.h2.api.ErrorCode
;
import
org.h2.engine.Mode
;
import
org.h2.expression.Function
;
import
org.h2.message.DbException
;
import
org.h2.value.Value
;
import
org.h2.value.ValueDate
;
...
...
@@ -111,7 +110,7 @@ public class DateTimeUtils {
*
* @return a calendar instance. A cached instance is returned where possible
*/
p
rivate
static
GregorianCalendar
getCalendar
()
{
p
ublic
static
GregorianCalendar
getCalendar
()
{
GregorianCalendar
c
=
CACHED_CALENDAR
.
get
();
if
(
c
==
null
)
{
c
=
DateTimeUtils
.
createGregorianCalendar
();
...
...
h2/src/main/org/h2/util/ParserUtil.java
0 → 100644
浏览文件 @
3aa6f180
/*
* Copyright 2004-2018 H2 Group. Multiple-Licensed under the MPL 2.0,
* and the EPL 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package
org
.
h2
.
util
;
public
class
ParserUtil
{
/**
* A keyword.
*/
public
static
final
int
KEYWORD
=
1
;
/**
* An identifier (table name, column name,...).
*/
public
static
final
int
IDENTIFIER
=
2
;
/**
* The token "null".
*/
public
static
final
int
NULL
=
3
;
/**
* The token "true".
*/
public
static
final
int
TRUE
=
4
;
/**
* The token "false".
*/
public
static
final
int
FALSE
=
5
;
/**
* The token "rownum".
*/
public
static
final
int
ROWNUM
=
6
;
private
ParserUtil
()
{
// utility class
}
/**
* Checks if this string is a SQL keyword.
*
* @param s the token to check
* @param supportOffsetFetch if OFFSET and FETCH are keywords
* @return true if it is a keyword
*/
public
static
boolean
isKeyword
(
String
s
,
boolean
supportOffsetFetch
)
{
if
(
s
==
null
||
s
.
length
()
==
0
)
{
return
false
;
}
return
getSaveTokenType
(
s
,
supportOffsetFetch
,
false
)
!=
IDENTIFIER
;
}
/**
* Is this a simple identifier (in the JDBC specification sense).
*
* @param s identifier to check
* @param functionsAsKeywords treat system functions as keywords
* @return is specified identifier may be used without quotes
* @throws NullPointerException if s is {@code null}
*/
public
static
boolean
isSimpleIdentifier
(
String
s
,
boolean
functionsAsKeywords
)
{
if
(
s
.
length
()
==
0
)
{
return
false
;
}
char
c
=
s
.
charAt
(
0
);
// lowercase a-z is quoted as well
if
((!
Character
.
isLetter
(
c
)
&&
c
!=
'_'
)
||
Character
.
isLowerCase
(
c
))
{
return
false
;
}
for
(
int
i
=
1
,
length
=
s
.
length
();
i
<
length
;
i
++)
{
c
=
s
.
charAt
(
i
);
if
((!
Character
.
isLetterOrDigit
(
c
)
&&
c
!=
'_'
)
||
Character
.
isLowerCase
(
c
))
{
return
false
;
}
}
return
getSaveTokenType
(
s
,
true
,
functionsAsKeywords
)
==
IDENTIFIER
;
}
/**
* Get the token type.
*
* @param s the token
* @param supportOffsetFetch whether offset / fetch are supported
* @param functionsAsKeywords whether "current data / time" functions are keywords
* @return the token type
*/
public
static
int
getSaveTokenType
(
String
s
,
boolean
supportOffsetFetch
,
boolean
functionsAsKeywords
)
{
switch
(
s
.
charAt
(
0
))
{
case
'A'
:
return
getKeywordOrIdentifier
(
s
,
"ALL"
,
KEYWORD
);
case
'C'
:
if
(
"CHECK"
.
equals
(
s
))
{
return
KEYWORD
;
}
else
if
(
"CONSTRAINT"
.
equals
(
s
))
{
return
KEYWORD
;
}
else
if
(
"CROSS"
.
equals
(
s
))
{
return
KEYWORD
;
}
if
(
functionsAsKeywords
)
{
if
(
"CURRENT_DATE"
.
equals
(
s
)
||
"CURRENT_TIME"
.
equals
(
s
)
||
"CURRENT_TIMESTAMP"
.
equals
(
s
))
{
return
KEYWORD
;
}
}
return
IDENTIFIER
;
case
'D'
:
return
getKeywordOrIdentifier
(
s
,
"DISTINCT"
,
KEYWORD
);
case
'E'
:
if
(
"EXCEPT"
.
equals
(
s
))
{
return
KEYWORD
;
}
return
getKeywordOrIdentifier
(
s
,
"EXISTS"
,
KEYWORD
);
case
'F'
:
if
(
"FROM"
.
equals
(
s
))
{
return
KEYWORD
;
}
else
if
(
"FOR"
.
equals
(
s
))
{
return
KEYWORD
;
}
else
if
(
"FOREIGN"
.
equals
(
s
))
{
return
KEYWORD
;
}
else
if
(
"FULL"
.
equals
(
s
))
{
return
KEYWORD
;
}
else
if
(
supportOffsetFetch
&&
"FETCH"
.
equals
(
s
))
{
return
KEYWORD
;
}
return
getKeywordOrIdentifier
(
s
,
"FALSE"
,
FALSE
);
case
'G'
:
return
getKeywordOrIdentifier
(
s
,
"GROUP"
,
KEYWORD
);
case
'H'
:
return
getKeywordOrIdentifier
(
s
,
"HAVING"
,
KEYWORD
);
case
'I'
:
if
(
"INNER"
.
equals
(
s
))
{
return
KEYWORD
;
}
else
if
(
"INTERSECT"
.
equals
(
s
))
{
return
KEYWORD
;
}
return
getKeywordOrIdentifier
(
s
,
"IS"
,
KEYWORD
);
case
'J'
:
return
getKeywordOrIdentifier
(
s
,
"JOIN"
,
KEYWORD
);
case
'L'
:
if
(
"LIMIT"
.
equals
(
s
))
{
return
KEYWORD
;
}
return
getKeywordOrIdentifier
(
s
,
"LIKE"
,
KEYWORD
);
case
'M'
:
return
getKeywordOrIdentifier
(
s
,
"MINUS"
,
KEYWORD
);
case
'N'
:
if
(
"NOT"
.
equals
(
s
))
{
return
KEYWORD
;
}
else
if
(
"NATURAL"
.
equals
(
s
))
{
return
KEYWORD
;
}
return
getKeywordOrIdentifier
(
s
,
"NULL"
,
NULL
);
case
'O'
:
if
(
"ON"
.
equals
(
s
))
{
return
KEYWORD
;
}
else
if
(
supportOffsetFetch
&&
"OFFSET"
.
equals
(
s
))
{
return
KEYWORD
;
}
return
getKeywordOrIdentifier
(
s
,
"ORDER"
,
KEYWORD
);
case
'P'
:
return
getKeywordOrIdentifier
(
s
,
"PRIMARY"
,
KEYWORD
);
case
'R'
:
return
getKeywordOrIdentifier
(
s
,
"ROWNUM"
,
ROWNUM
);
case
'S'
:
if
(
"SELECT"
.
equals
(
s
))
{
return
KEYWORD
;
}
if
(
functionsAsKeywords
)
{
if
(
"SYSDATE"
.
equals
(
s
)
||
"SYSTIME"
.
equals
(
s
)
||
"SYSTIMESTAMP"
.
equals
(
s
))
{
return
KEYWORD
;
}
}
return
IDENTIFIER
;
case
'T'
:
if
(
"TRUE"
.
equals
(
s
))
{
return
TRUE
;
}
if
(
functionsAsKeywords
)
{
if
(
"TODAY"
.
equals
(
s
))
{
return
KEYWORD
;
}
}
return
IDENTIFIER
;
case
'U'
:
if
(
"UNIQUE"
.
equals
(
s
))
{
return
KEYWORD
;
}
return
getKeywordOrIdentifier
(
s
,
"UNION"
,
KEYWORD
);
case
'W'
:
if
(
"WITH"
.
equals
(
s
))
{
return
KEYWORD
;
}
return
getKeywordOrIdentifier
(
s
,
"WHERE"
,
KEYWORD
);
default
:
return
IDENTIFIER
;
}
}
private
static
int
getKeywordOrIdentifier
(
String
s1
,
String
s2
,
int
keywordType
)
{
if
(
s1
.
equals
(
s2
))
{
return
keywordType
;
}
return
IDENTIFIER
;
}
}
h2/src/main/org/h2/value/Value.java
浏览文件 @
3aa6f180
...
...
@@ -24,7 +24,6 @@ import org.h2.engine.Mode;
import
org.h2.engine.SysProperties
;
import
org.h2.message.DbException
;
import
org.h2.store.DataHandler
;
import
org.h2.table.Column
;
import
org.h2.tools.SimpleResultSet
;
import
org.h2.util.Bits
;
import
org.h2.util.DateTimeUtils
;
...
...
@@ -604,7 +603,7 @@ public abstract class Value {
* @return the converted value
*/
public
final
Value
convertTo
(
int
targetType
,
int
precision
,
Mode
mode
)
{
return
convertTo
(
targetType
,
precision
,
mode
,
null
);
return
convertTo
(
targetType
,
precision
,
mode
,
null
,
null
);
}
/**
...
...
@@ -615,11 +614,12 @@ public abstract class Value {
* The special constant <code>-1</code> is used to indicate that
* the precision plays no role when converting the value
* @param mode the conversion mode
* @param column the column that contains the ENUM datatype enumerators,
* @param column the column (if any), used for to improve the error message if conversion fails
* @param enumerators the ENUM datatype enumerators (if any),
* for dealing with ENUM conversions
* @return the converted value
*/
public
Value
convertTo
(
int
targetType
,
int
precision
,
Mode
mode
,
Column
column
)
{
public
Value
convertTo
(
int
targetType
,
int
precision
,
Mode
mode
,
Object
column
,
String
[]
enumerators
)
{
// converting NULL is done in ValueNull
// converting BLOB to CLOB and vice versa is done in ValueLob
if
(
getType
()
==
targetType
)
{
...
...
@@ -938,11 +938,11 @@ public abstract class Value {
case
INT:
case
LONG:
case
DECIMAL:
return
ValueEnum
.
get
(
column
.
getEnumerators
()
,
getInt
());
return
ValueEnum
.
get
(
enumerators
,
getInt
());
case
STRING:
case
STRING_IGNORECASE:
case
STRING_FIXED:
return
ValueEnum
.
get
(
column
.
getEnumerators
()
,
getString
());
return
ValueEnum
.
get
(
enumerators
,
getString
());
default
:
throw
DbException
.
get
(
ErrorCode
.
DATA_CONVERSION_ERROR_1
,
getString
());
...
...
@@ -1154,51 +1154,51 @@ public abstract class Value {
return
this
;
}
private
static
byte
convertToByte
(
long
x
,
Column
col
)
{
private
static
byte
convertToByte
(
long
x
,
Object
column
)
{
if
(
x
>
Byte
.
MAX_VALUE
||
x
<
Byte
.
MIN_VALUE
)
{
throw
DbException
.
get
(
ErrorCode
.
NUMERIC_VALUE_OUT_OF_RANGE_2
,
Long
.
toString
(
x
),
getColumnName
(
col
));
ErrorCode
.
NUMERIC_VALUE_OUT_OF_RANGE_2
,
Long
.
toString
(
x
),
getColumnName
(
col
umn
));
}
return
(
byte
)
x
;
}
private
static
short
convertToShort
(
long
x
,
Column
col
)
{
private
static
short
convertToShort
(
long
x
,
Object
column
)
{
if
(
x
>
Short
.
MAX_VALUE
||
x
<
Short
.
MIN_VALUE
)
{
throw
DbException
.
get
(
ErrorCode
.
NUMERIC_VALUE_OUT_OF_RANGE_2
,
Long
.
toString
(
x
),
getColumnName
(
col
));
ErrorCode
.
NUMERIC_VALUE_OUT_OF_RANGE_2
,
Long
.
toString
(
x
),
getColumnName
(
col
umn
));
}
return
(
short
)
x
;
}
private
static
int
convertToInt
(
long
x
,
Column
col
)
{
private
static
int
convertToInt
(
long
x
,
Object
column
)
{
if
(
x
>
Integer
.
MAX_VALUE
||
x
<
Integer
.
MIN_VALUE
)
{
throw
DbException
.
get
(
ErrorCode
.
NUMERIC_VALUE_OUT_OF_RANGE_2
,
Long
.
toString
(
x
),
getColumnName
(
col
));
ErrorCode
.
NUMERIC_VALUE_OUT_OF_RANGE_2
,
Long
.
toString
(
x
),
getColumnName
(
col
umn
));
}
return
(
int
)
x
;
}
private
static
long
convertToLong
(
double
x
,
Column
col
)
{
private
static
long
convertToLong
(
double
x
,
Object
column
)
{
if
(
x
>
Long
.
MAX_VALUE
||
x
<
Long
.
MIN_VALUE
)
{
// TODO document that +Infinity, -Infinity throw an exception and
// NaN returns 0
throw
DbException
.
get
(
ErrorCode
.
NUMERIC_VALUE_OUT_OF_RANGE_2
,
Double
.
toString
(
x
),
getColumnName
(
col
));
ErrorCode
.
NUMERIC_VALUE_OUT_OF_RANGE_2
,
Double
.
toString
(
x
),
getColumnName
(
col
umn
));
}
return
Math
.
round
(
x
);
}
private
static
long
convertToLong
(
BigDecimal
x
,
Column
col
)
{
private
static
long
convertToLong
(
BigDecimal
x
,
Object
column
)
{
if
(
x
.
compareTo
(
MAX_LONG_DECIMAL
)
>
0
||
x
.
compareTo
(
Value
.
MIN_LONG_DECIMAL
)
<
0
)
{
throw
DbException
.
get
(
ErrorCode
.
NUMERIC_VALUE_OUT_OF_RANGE_2
,
x
.
toString
(),
getColumnName
(
col
));
ErrorCode
.
NUMERIC_VALUE_OUT_OF_RANGE_2
,
x
.
toString
(),
getColumnName
(
col
umn
));
}
return
x
.
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
();
}
private
static
String
getColumnName
(
Column
col
)
{
return
col
==
null
?
""
:
col
.
getName
();
private
static
String
getColumnName
(
Object
column
)
{
return
col
umn
==
null
?
""
:
column
.
toString
();
}
/**
...
...
h2/src/main/org/h2/value/ValueGeometry.java
浏览文件 @
3aa6f180
...
...
@@ -10,7 +10,6 @@ import java.sql.SQLException;
import
java.util.Arrays
;
import
org.h2.engine.Mode
;
import
org.h2.message.DbException
;
import
org.h2.table.Column
;
import
org.h2.util.StringUtils
;
import
com.vividsolutions.jts.geom.CoordinateSequence
;
import
com.vividsolutions.jts.geom.CoordinateSequenceFilter
;
...
...
@@ -273,11 +272,11 @@ public class ValueGeometry extends Value {
}
@Override
public
Value
convertTo
(
int
targetType
,
int
precision
,
Mode
mode
,
Column
column
)
{
public
Value
convertTo
(
int
targetType
,
int
precision
,
Mode
mode
,
Object
column
,
String
[]
enumerators
)
{
if
(
targetType
==
Value
.
JAVA_OBJECT
)
{
return
this
;
}
return
super
.
convertTo
(
targetType
,
precision
,
mode
,
column
);
return
super
.
convertTo
(
targetType
,
precision
,
mode
,
column
,
null
);
}
/**
...
...
h2/src/main/org/h2/value/ValueLob.java
浏览文件 @
3aa6f180
...
...
@@ -14,6 +14,7 @@ import java.io.Reader;
import
java.nio.charset.StandardCharsets
;
import
java.sql.PreparedStatement
;
import
java.sql.SQLException
;
import
org.h2.engine.Constants
;
import
org.h2.engine.Mode
;
import
org.h2.engine.SysProperties
;
...
...
@@ -26,7 +27,6 @@ import org.h2.store.FileStoreOutputStream;
import
org.h2.store.RangeInputStream
;
import
org.h2.store.RangeReader
;
import
org.h2.store.fs.FileUtils
;
import
org.h2.table.Column
;
import
org.h2.util.IOUtils
;
import
org.h2.util.MathUtils
;
import
org.h2.util.SmallLRUCache
;
...
...
@@ -499,12 +499,13 @@ public class ValueLob extends Value {
* The special constant <code>-1</code> is used to indicate that
* the precision plays no role when converting the value
* @param mode the database mode
* @param column the column that contains the ENUM datatype enumerators,
* @param column the column (if any), used for to improve the error message if conversion fails
* @param enumerators the ENUM datatype enumerators (if any),
* for dealing with ENUM conversions
* @return the converted value
*/
@Override
public
Value
convertTo
(
int
t
,
int
precision
,
Mode
mode
,
Column
column
)
{
public
Value
convertTo
(
int
t
,
int
precision
,
Mode
mode
,
Object
column
,
String
[]
enumerators
)
{
if
(
t
==
type
)
{
return
this
;
}
else
if
(
t
==
Value
.
CLOB
)
{
...
...
@@ -514,7 +515,7 @@ public class ValueLob extends Value {
ValueLob
copy
=
ValueLob
.
createBlob
(
getInputStream
(),
-
1
,
handler
);
return
copy
;
}
return
super
.
convertTo
(
t
,
precision
,
mode
,
column
);
return
super
.
convertTo
(
t
,
precision
,
mode
,
column
,
null
);
}
@Override
...
...
h2/src/main/org/h2/value/ValueLobDb.java
浏览文件 @
3aa6f180
...
...
@@ -14,6 +14,7 @@ import java.io.Reader;
import
java.nio.charset.StandardCharsets
;
import
java.sql.PreparedStatement
;
import
java.sql.SQLException
;
import
org.h2.engine.Constants
;
import
org.h2.engine.Mode
;
import
org.h2.engine.SysProperties
;
...
...
@@ -26,7 +27,6 @@ import org.h2.store.FileStoreOutputStream;
import
org.h2.store.LobStorageFrontend
;
import
org.h2.store.LobStorageInterface
;
import
org.h2.store.fs.FileUtils
;
import
org.h2.table.Column
;
import
org.h2.util.IOUtils
;
import
org.h2.util.MathUtils
;
import
org.h2.util.StringUtils
;
...
...
@@ -186,11 +186,13 @@ public class ValueLobDb extends Value implements Value.ValueClob,
* @param t the new type
* @param precision the precision
* @param mode the mode
* @param column the column
* @param column the column (if any), used for to improve the error message if conversion fails
* @param enumerators the ENUM datatype enumerators (if any),
* for dealing with ENUM conversions
* @return the converted value
*/
@Override
public
Value
convertTo
(
int
t
,
int
precision
,
Mode
mode
,
Column
column
)
{
public
Value
convertTo
(
int
t
,
int
precision
,
Mode
mode
,
Object
column
,
String
[]
enumerators
)
{
if
(
t
==
type
)
{
return
this
;
}
else
if
(
t
==
Value
.
CLOB
)
{
...
...
@@ -210,7 +212,7 @@ public class ValueLobDb extends Value implements Value.ValueClob,
return
ValueLobDb
.
createSmallLob
(
t
,
small
);
}
}
return
super
.
convertTo
(
t
,
precision
,
mode
,
column
);
return
super
.
convertTo
(
t
,
precision
,
mode
,
column
,
null
);
}
@Override
...
...
h2/src/main/org/h2/value/ValueNull.java
浏览文件 @
3aa6f180
...
...
@@ -13,9 +13,9 @@ import java.sql.PreparedStatement;
import
java.sql.SQLException
;
import
java.sql.Time
;
import
java.sql.Timestamp
;
import
org.h2.engine.Mode
;
import
org.h2.message.DbException
;
import
org.h2.table.Column
;
/**
* Implementation of NULL. NULL is not a regular data type.
...
...
@@ -133,7 +133,7 @@ public class ValueNull extends Value {
}
@Override
public
Value
convertTo
(
int
type
,
int
precision
,
Mode
mode
,
Column
column
)
{
public
Value
convertTo
(
int
type
,
int
precision
,
Mode
mode
,
Object
column
,
String
[]
enumerators
)
{
return
this
;
}
...
...
h2/src/test/org/h2/test/db/TestOptimizations.java
浏览文件 @
3aa6f180
...
...
@@ -808,7 +808,9 @@ public class TestOptimizations extends TestBase {
totalTime
+=
measureQuerySpeed
(
stat
,
sql
,
false
);
totalTimeOptimized
+=
measureQuerySpeed
(
stat
,
sql
,
true
);
}
System
.
out
.
println
(
TimeUnit
.
NANOSECONDS
.
toMillis
(
totalTime
)+
" "
+
TimeUnit
.
NANOSECONDS
.
toMillis
(
totalTimeOptimized
));
// System.out.println(
// TimeUnit.NANOSECONDS.toMillis(totalTime) + " " +
// TimeUnit.NANOSECONDS.toMillis(totalTimeOptimized));
if
(
totalTimeOptimized
>
totalTime
)
{
fail
(
"not optimized: "
+
TimeUnit
.
NANOSECONDS
.
toMillis
(
totalTime
)
+
" optimized: "
+
TimeUnit
.
NANOSECONDS
.
toMillis
(
totalTimeOptimized
)
+
...
...
h2/src/tools/org/h2/build/Build.java
浏览文件 @
3aa6f180
...
...
@@ -610,8 +610,8 @@ public class Build extends BuildBase {
exclude
(
"*.DS_Store"
);
files
=
excludeTestMetaInfFiles
(
files
);
long
kb
=
jar
(
"bin/h2-client"
+
getJarSuffix
(),
files
,
"temp"
);
if
(
kb
<
350
||
kb
>
45
0
)
{
throw
new
RuntimeException
(
"Expected file size
350 - 45
0 KB, got: "
+
kb
);
if
(
kb
<
400
||
kb
>
50
0
)
{
throw
new
RuntimeException
(
"Expected file size
400 - 50
0 KB, got: "
+
kb
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论