Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
f31539cc
提交
f31539cc
authored
1月 21, 2016
作者:
Thomas Mueller Graf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Javadocs
上级
d69c4432
全部展开
显示空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
269 行增加
和
50 行删除
+269
-50
Parser.java
h2/src/main/org/h2/command/Parser.java
+7
-0
BaseIndex.java
h2/src/main/org/h2/index/BaseIndex.java
+1
-0
ViewIndex.java
h2/src/main/org/h2/index/ViewIndex.java
+8
-0
JoinBatch.java
h2/src/main/org/h2/table/JoinBatch.java
+27
-1
TableFilter.java
h2/src/main/org/h2/table/TableFilter.java
+17
-2
TableView.java
h2/src/main/org/h2/table/TableView.java
+5
-0
DateTimeUtils.java
h2/src/main/org/h2/util/DateTimeUtils.java
+8
-3
ToDateParser.java
h2/src/main/org/h2/util/ToDateParser.java
+20
-0
ToDateTokenizer.java
h2/src/main/org/h2/util/ToDateTokenizer.java
+124
-30
ValueTimestampUtc.java
h2/src/main/org/h2/value/ValueTimestampUtc.java
+10
-1
TestAnnotationProcessor.java
h2/src/test/org/h2/test/ap/TestAnnotationProcessor.java
+3
-0
TestFunctions.java
h2/src/test/org/h2/test/db/TestFunctions.java
+16
-8
TestRowFactory.java
h2/src/test/org/h2/test/db/TestRowFactory.java
+3
-0
TestTableEngines.java
h2/src/test/org/h2/test/db/TestTableEngines.java
+6
-0
TestView.java
h2/src/test/org/h2/test/db/TestView.java
+1
-1
TestPreparedStatement.java
h2/src/test/org/h2/test/jdbc/TestPreparedStatement.java
+2
-1
TestMvcc4.java
h2/src/test/org/h2/test/mvcc/TestMvcc4.java
+6
-0
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+1
-0
Doclet.java
h2/src/tools/org/h2/build/doclet/Doclet.java
+2
-1
ArchiveTool.java
h2/src/tools/org/h2/dev/fs/ArchiveTool.java
+2
-2
没有找到文件。
h2/src/main/org/h2/command/Parser.java
浏览文件 @
f31539cc
...
@@ -1913,6 +1913,13 @@ public class Parser {
...
@@ -1913,6 +1913,13 @@ public class Parser {
}
}
}
}
/**
* Find out which of the table filters appears first in the "from" clause.
*
* @param o1 the first table filter
* @param o2 the second table filter
* @return -1 if o1 appears first, and 1 if o2 appears first
*/
static
int
compareTableFilters
(
TableFilter
o1
,
TableFilter
o2
)
{
static
int
compareTableFilters
(
TableFilter
o1
,
TableFilter
o2
)
{
assert
o1
.
getOrderInFrom
()
!=
o2
.
getOrderInFrom
();
assert
o1
.
getOrderInFrom
()
!=
o2
.
getOrderInFrom
();
return
o1
.
getOrderInFrom
()
>
o2
.
getOrderInFrom
()
?
1
:
-
1
;
return
o1
.
getOrderInFrom
()
>
o2
.
getOrderInFrom
()
?
1
:
-
1
;
...
...
h2/src/main/org/h2/index/BaseIndex.java
浏览文件 @
f31539cc
...
@@ -159,6 +159,7 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index {
...
@@ -159,6 +159,7 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index {
* @param filters all joined table filters
* @param filters all joined table filters
* @param filter the current table filter index
* @param filter the current table filter index
* @param sortOrder the sort order
* @param sortOrder the sort order
* @param isScanIndex whether this is a "table scan" index
* @return the estimated cost
* @return the estimated cost
*/
*/
protected
final
long
getCostRangeIndex
(
int
[]
masks
,
long
rowCount
,
protected
final
long
getCostRangeIndex
(
int
[]
masks
,
long
rowCount
,
...
...
h2/src/main/org/h2/index/ViewIndex.java
浏览文件 @
f31539cc
...
@@ -225,6 +225,14 @@ public class ViewIndex extends BaseIndex implements SpatialIndex {
...
@@ -225,6 +225,14 @@ public class ViewIndex extends BaseIndex implements SpatialIndex {
return
new
ViewCursor
(
this
,
result
,
first
,
last
);
return
new
ViewCursor
(
this
,
result
,
first
,
last
);
}
}
/**
* Set the query parameters.
*
* @param session the session
* @param first the lower bound
* @param last the upper bound
* @param intersection the intersection
*/
public
void
setupQueryParameters
(
Session
session
,
SearchRow
first
,
SearchRow
last
,
public
void
setupQueryParameters
(
Session
session
,
SearchRow
first
,
SearchRow
last
,
SearchRow
intersection
)
{
SearchRow
intersection
)
{
ArrayList
<
Parameter
>
paramList
=
query
.
getParameters
();
ArrayList
<
Parameter
>
paramList
=
query
.
getParameters
();
...
...
h2/src/main/org/h2/table/JoinBatch.java
浏览文件 @
f31539cc
...
@@ -37,6 +37,10 @@ import org.h2.value.ValueLong;
...
@@ -37,6 +37,10 @@ import org.h2.value.ValueLong;
* @author Sergi Vladykin
* @author Sergi Vladykin
*/
*/
public
final
class
JoinBatch
{
public
final
class
JoinBatch
{
/**
* An empty cursor.
*/
static
final
Cursor
EMPTY_CURSOR
=
new
Cursor
()
{
static
final
Cursor
EMPTY_CURSOR
=
new
Cursor
()
{
@Override
@Override
public
boolean
previous
()
{
public
boolean
previous
()
{
...
@@ -64,11 +68,29 @@ public final class JoinBatch {
...
@@ -64,11 +68,29 @@ public final class JoinBatch {
}
}
};
};
/**
* An empty future cursor.
*/
static
final
Future
<
Cursor
>
EMPTY_FUTURE_CURSOR
=
new
DoneFuture
<
Cursor
>(
EMPTY_CURSOR
);
static
final
Future
<
Cursor
>
EMPTY_FUTURE_CURSOR
=
new
DoneFuture
<
Cursor
>(
EMPTY_CURSOR
);
/**
* The top cursor.
*/
Future
<
Cursor
>
viewTopFutureCursor
;
Future
<
Cursor
>
viewTopFutureCursor
;
/**
* The top filter.
*/
JoinFilter
top
;
JoinFilter
top
;
/**
* The filters.
*/
JoinFilter
[]
filters
;
JoinFilter
[]
filters
;
/**
* Whether this is a batched subquery.
*/
boolean
batchedSubQuery
;
boolean
batchedSubQuery
;
private
boolean
started
;
private
boolean
started
;
...
@@ -125,6 +147,8 @@ public final class JoinBatch {
...
@@ -125,6 +147,8 @@ public final class JoinBatch {
}
}
/**
/**
* Register the table filter and lookup batch.
*
* @param filter table filter
* @param filter table filter
* @param lookupBatch lookup batch
* @param lookupBatch lookup batch
*/
*/
...
@@ -135,8 +159,10 @@ public final class JoinBatch {
...
@@ -135,8 +159,10 @@ public final class JoinBatch {
}
}
/**
/**
* Get the value for the given column.
*
* @param filterId table filter id
* @param filterId table filter id
* @param column column
* @param column
the
column
* @return column value for current row
* @return column value for current row
*/
*/
public
Value
getValue
(
int
filterId
,
Column
column
)
{
public
Value
getValue
(
int
filterId
,
Column
column
)
{
...
...
h2/src/main/org/h2/table/TableFilter.java
浏览文件 @
f31539cc
...
@@ -123,8 +123,8 @@ public class TableFilter implements ColumnResolver {
...
@@ -123,8 +123,8 @@ public class TableFilter implements ColumnResolver {
* @param alias the alias name
* @param alias the alias name
* @param rightsChecked true if rights are already checked
* @param rightsChecked true if rights are already checked
* @param select the select statement
* @param select the select statement
* @param orderInFrom
Original order number of this table filter in FROM
* @param orderInFrom
original order number (index) of this table filter in
*
clause.
*
FROM clause (0, 1, 2,...)
*/
*/
public
TableFilter
(
Session
session
,
Table
table
,
String
alias
,
public
TableFilter
(
Session
session
,
Table
table
,
String
alias
,
boolean
rightsChecked
,
Select
select
,
int
orderInFrom
)
{
boolean
rightsChecked
,
Select
select
,
int
orderInFrom
)
{
...
@@ -140,6 +140,12 @@ public class TableFilter implements ColumnResolver {
...
@@ -140,6 +140,12 @@ public class TableFilter implements ColumnResolver {
this
.
orderInFrom
=
orderInFrom
;
this
.
orderInFrom
=
orderInFrom
;
}
}
/**
* Get the order number (index) of this table filter in the "from" clause of
* the query.
*
* @return the index (0, 1, 2,...)
*/
public
int
getOrderInFrom
()
{
public
int
getOrderInFrom
()
{
return
orderInFrom
;
return
orderInFrom
;
}
}
...
@@ -375,6 +381,8 @@ public class TableFilter implements ColumnResolver {
...
@@ -375,6 +381,8 @@ public class TableFilter implements ColumnResolver {
* Attempt to initialize batched join.
* Attempt to initialize batched join.
*
*
* @param jb join batch if it is already created
* @param jb join batch if it is already created
* @param filters the table filters
* @param filter the filter index (0, 1,...)
* @return join batch if query runs over index which supports batched
* @return join batch if query runs over index which supports batched
* lookups, {@code null} otherwise
* lookups, {@code null} otherwise
*/
*/
...
@@ -555,6 +563,13 @@ public class TableFilter implements ColumnResolver {
...
@@ -555,6 +563,13 @@ public class TableFilter implements ColumnResolver {
// scanCount);
// scanCount);
}
}
/**
* Whether the current value of the condition is true, or there is no
* condition.
*
* @param condition the condition (null for no condition)
* @return true if yes
*/
boolean
isOk
(
Expression
condition
)
{
boolean
isOk
(
Expression
condition
)
{
if
(
condition
==
null
)
{
if
(
condition
==
null
)
{
return
true
;
return
true
;
...
...
h2/src/main/org/h2/table/TableView.java
浏览文件 @
f31539cc
...
@@ -414,6 +414,11 @@ public class TableView extends Table {
...
@@ -414,6 +414,11 @@ public class TableView extends Table {
invalidate
();
invalidate
();
}
}
/**
* Clear the cached indexes for all sessions.
*
* @param database the database
*/
public
static
void
clearIndexCaches
(
Database
database
)
{
public
static
void
clearIndexCaches
(
Database
database
)
{
for
(
Session
s
:
database
.
getSessions
(
true
))
{
for
(
Session
s
:
database
.
getSessions
(
true
))
{
s
.
clearViewIndexCache
();
s
.
clearViewIndexCache
();
...
...
h2/src/main/org/h2/util/DateTimeUtils.java
浏览文件 @
f31539cc
...
@@ -906,12 +906,17 @@ public class DateTimeUtils {
...
@@ -906,12 +906,17 @@ public class DateTimeUtils {
}
}
/**
/**
* Adds the number of months to the date. If the resulting month's number of days is less than the original's day-of-month, the resulting
* Adds the number of months to the date. If the resulting month's number of
* days is less than the original's day-of-month, the resulting
* day-of-months gets adjusted accordingly:
* day-of-months gets adjusted accordingly:
*
*
<br>
* 30.04.2007 - 2 months = 28.02.2007
* 30.04.2007 - 2 months = 28.02.2007
*
* @param refDate the original date
* @param nrOfMonthsToAdd the number of months to add
* @return the new timestamp
*/
*/
public
static
Timestamp
addMonths
(
final
Timestamp
refDate
,
final
int
nrOfMonthsToAdd
)
{
public
static
Timestamp
addMonths
(
Timestamp
refDate
,
int
nrOfMonthsToAdd
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
refDate
);
calendar
.
setTime
(
refDate
);
calendar
.
add
(
Calendar
.
MONTH
,
nrOfMonthsToAdd
);
calendar
.
add
(
Calendar
.
MONTH
,
nrOfMonthsToAdd
);
...
...
h2/src/main/org/h2/util/ToDateParser.java
浏览文件 @
f31539cc
...
@@ -137,6 +137,12 @@ public class ToDateParser {
...
@@ -137,6 +137,12 @@ public class ToDateParser {
return
p
;
return
p
;
}
}
/**
* Remove a token from a string.
*
* @param inputFragmentStr the input fragment
* @param formatFragment the format fragment
*/
void
remove
(
String
inputFragmentStr
,
String
formatFragment
)
{
void
remove
(
String
inputFragmentStr
,
String
formatFragment
)
{
if
(
inputFragmentStr
!=
null
&&
inputStr
.
length
()
>=
inputFragmentStr
.
length
())
{
if
(
inputFragmentStr
!=
null
&&
inputStr
.
length
()
>=
inputFragmentStr
.
length
())
{
inputStr
=
inputStr
.
substring
(
inputFragmentStr
.
length
());
inputStr
=
inputStr
.
substring
(
inputFragmentStr
.
length
());
...
@@ -167,11 +173,25 @@ public class ToDateParser {
...
@@ -167,11 +173,25 @@ public class ToDateParser {
return
sb
.
toString
();
return
sb
.
toString
();
}
}
/**
* Parse a string as a timestamp with the given format.
*
* @param input the input
* @param format the format
* @return the timestamp
*/
public
static
Timestamp
toTimestamp
(
String
input
,
String
format
)
{
public
static
Timestamp
toTimestamp
(
String
input
,
String
format
)
{
ToDateParser
parser
=
getTimestampParser
(
input
,
format
);
ToDateParser
parser
=
getTimestampParser
(
input
,
format
);
return
parser
.
getResultingTimestamp
();
return
parser
.
getResultingTimestamp
();
}
}
/**
* Parse a string as a date with the given format.
*
* @param input the input
* @param format the format
* @return the date as a timestamp
*/
public
static
Timestamp
toDate
(
String
input
,
String
format
)
{
public
static
Timestamp
toDate
(
String
input
,
String
format
)
{
ToDateParser
parser
=
getDateParser
(
input
,
format
);
ToDateParser
parser
=
getDateParser
(
input
,
format
);
return
parser
.
getResultingTimestamp
();
return
parser
.
getResultingTimestamp
();
...
...
h2/src/main/org/h2/util/ToDateTokenizer.java
浏览文件 @
f31539cc
差异被折叠。
点击展开。
h2/src/main/org/h2/value/ValueTimestampUtc.java
浏览文件 @
f31539cc
...
@@ -96,7 +96,9 @@ public final class ValueTimestampUtc extends Value {
...
@@ -96,7 +96,9 @@ public final class ValueTimestampUtc extends Value {
/**
/**
* Time in nanoseconds since 1 Jan 1970 i.e. similar format to
* Time in nanoseconds since 1 Jan 1970 i.e. similar format to
* System.currentTimeMillis()
* System.currentTimeMillis().
*
* @return the number of milliseconds
*/
*/
public
long
getUtcDateTimeNanos
()
{
public
long
getUtcDateTimeNanos
()
{
return
utcDateTimeNanos
;
return
utcDateTimeNanos
;
...
@@ -105,11 +107,18 @@ public final class ValueTimestampUtc extends Value {
...
@@ -105,11 +107,18 @@ public final class ValueTimestampUtc extends Value {
/**
/**
* Time in milliseconds since 1 Jan 1970 i.e. same format as
* Time in milliseconds since 1 Jan 1970 i.e. same format as
* System.currentTimeMillis()
* System.currentTimeMillis()
*
* @return the number of milliseconds
*/
*/
public
long
getUtcDateTimeMillis
()
{
public
long
getUtcDateTimeMillis
()
{
return
utcDateTimeNanos
/
1000
/
1000
;
return
utcDateTimeNanos
/
1000
/
1000
;
}
}
/**
* Get the number of nanoseconds since the last full millisecond.
*
* @return the number of nanoseconds
*/
int
getNanosSinceLastMillis
()
{
int
getNanosSinceLastMillis
()
{
return
(
int
)
(
utcDateTimeNanos
%
(
1000
*
1000
));
return
(
int
)
(
utcDateTimeNanos
%
(
1000
*
1000
));
}
}
...
...
h2/src/test/org/h2/test/ap/TestAnnotationProcessor.java
浏览文件 @
f31539cc
...
@@ -21,6 +21,9 @@ import javax.tools.Diagnostic;
...
@@ -21,6 +21,9 @@ import javax.tools.Diagnostic;
*/
*/
public
class
TestAnnotationProcessor
extends
AbstractProcessor
{
public
class
TestAnnotationProcessor
extends
AbstractProcessor
{
/**
* The message key.
*/
public
static
final
String
MESSAGES_KEY
=
public
static
final
String
MESSAGES_KEY
=
TestAnnotationProcessor
.
class
.
getName
()
+
"-messages"
;
TestAnnotationProcessor
.
class
.
getName
()
+
"-messages"
;
...
...
h2/src/test/org/h2/test/db/TestFunctions.java
浏览文件 @
f31539cc
...
@@ -1414,23 +1414,31 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -1414,23 +1414,31 @@ public class TestFunctions extends TestBase implements AggregateFunction {
Timestamp
expected
;
Timestamp
expected
;
// 01-Aug-03 + 3 months = 01-Nov-03
// 01-Aug-03 + 3 months = 01-Nov-03
date
=
new
Timestamp
(
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
parse
(
"2003-08-01"
).
getTime
());
date
=
new
Timestamp
(
expected
=
new
Timestamp
(
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
parse
(
"2003-11-01"
).
getTime
());
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
parse
(
"2003-08-01"
).
getTime
());
expected
=
new
Timestamp
(
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
parse
(
"2003-11-01"
).
getTime
());
assertEquals
(
expected
,
DateTimeUtils
.
addMonths
(
new
Timestamp
(
date
.
getTime
()),
3
));
assertEquals
(
expected
,
DateTimeUtils
.
addMonths
(
new
Timestamp
(
date
.
getTime
()),
3
));
// 31-Jan-03 + 1 month = 28-Feb-2003
// 31-Jan-03 + 1 month = 28-Feb-2003
date
=
new
Timestamp
(
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
parse
(
"2003-01-31"
).
getTime
());
date
=
new
Timestamp
(
expected
=
new
Timestamp
(
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
parse
(
"2003-02-28"
).
getTime
());
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
parse
(
"2003-01-31"
).
getTime
());
expected
=
new
Timestamp
(
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
parse
(
"2003-02-28"
).
getTime
());
assertEquals
(
expected
,
DateTimeUtils
.
addMonths
(
new
Timestamp
(
date
.
getTime
()),
1
));
assertEquals
(
expected
,
DateTimeUtils
.
addMonths
(
new
Timestamp
(
date
.
getTime
()),
1
));
// 21-Aug-2003 - 3 months = 21-May-2003
// 21-Aug-2003 - 3 months = 21-May-2003
date
=
new
Timestamp
(
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
parse
(
"2003-08-21"
).
getTime
());
date
=
new
Timestamp
(
expected
=
new
Timestamp
(
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
parse
(
"2003-05-21"
).
getTime
());
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
parse
(
"2003-08-21"
).
getTime
());
expected
=
new
Timestamp
(
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
parse
(
"2003-05-21"
).
getTime
());
assertEquals
(
expected
,
DateTimeUtils
.
addMonths
(
new
Timestamp
(
date
.
getTime
()),
-
3
));
assertEquals
(
expected
,
DateTimeUtils
.
addMonths
(
new
Timestamp
(
date
.
getTime
()),
-
3
));
// 21-Aug-2003 00:00:00:333 - 3 months = 21-May-2003 00:00:00:333
// 21-Aug-2003 00:00:00:333 - 3 months = 21-May-2003 00:00:00:333
date
=
new
Timestamp
(
new
SimpleDateFormat
(
"yyyy-MM-dd SSS"
).
parse
(
"2003-08-21 333"
).
getTime
());
date
=
new
Timestamp
(
expected
=
new
Timestamp
(
new
SimpleDateFormat
(
"yyyy-MM-dd SSS"
).
parse
(
"2003-05-21 333"
).
getTime
());
new
SimpleDateFormat
(
"yyyy-MM-dd SSS"
).
parse
(
"2003-08-21 333"
).
getTime
());
expected
=
new
Timestamp
(
new
SimpleDateFormat
(
"yyyy-MM-dd SSS"
).
parse
(
"2003-05-21 333"
).
getTime
());
assertEquals
(
expected
,
DateTimeUtils
.
addMonths
(
new
Timestamp
(
date
.
getTime
()),
-
3
));
assertEquals
(
expected
,
DateTimeUtils
.
addMonths
(
new
Timestamp
(
date
.
getTime
()),
-
3
));
}
}
...
...
h2/src/test/org/h2/test/db/TestRowFactory.java
浏览文件 @
f31539cc
...
@@ -49,6 +49,9 @@ public class TestRowFactory extends TestBase {
...
@@ -49,6 +49,9 @@ public class TestRowFactory extends TestBase {
*/
*/
public
static
class
MyTestRowFactory
extends
RowFactory
{
public
static
class
MyTestRowFactory
extends
RowFactory
{
/**
* A simple counter.
*/
static
final
AtomicInteger
COUNTER
=
new
AtomicInteger
();
static
final
AtomicInteger
COUNTER
=
new
AtomicInteger
();
@Override
@Override
...
...
h2/src/test/org/h2/test/db/TestTableEngines.java
浏览文件 @
f31539cc
...
@@ -684,6 +684,12 @@ public class TestTableEngines extends TestBase {
...
@@ -684,6 +684,12 @@ public class TestTableEngines extends TestBase {
}
}
}
}
/**
* A static assertion method.
*
* @param condition the condition
* @param message the error message
*/
static
void
assert0
(
boolean
condition
,
String
message
)
{
static
void
assert0
(
boolean
condition
,
String
message
)
{
if
(!
condition
)
{
if
(!
condition
)
{
throw
new
AssertionError
(
message
);
throw
new
AssertionError
(
message
);
...
...
h2/src/test/org/h2/test/db/TestView.java
浏览文件 @
f31539cc
...
@@ -52,7 +52,7 @@ public class TestView extends TestBase {
...
@@ -52,7 +52,7 @@ public class TestView extends TestBase {
deleteDb
(
"view"
);
deleteDb
(
"view"
);
}
}
p
ublic
void
testSubQueryViewIndexCache
()
throws
SQLException
{
p
rivate
void
testSubQueryViewIndexCache
()
throws
SQLException
{
if
(
config
.
networked
)
{
if
(
config
.
networked
)
{
return
;
return
;
}
}
...
...
h2/src/test/org/h2/test/jdbc/TestPreparedStatement.java
浏览文件 @
f31539cc
...
@@ -1055,7 +1055,8 @@ public class TestPreparedStatement extends TestBase {
...
@@ -1055,7 +1055,8 @@ public class TestPreparedStatement extends TestBase {
Statement
stat
=
conn
.
createStatement
();
Statement
stat
=
conn
.
createStatement
();
stat
.
execute
(
"CREATE SEQUENCE SEQ"
);
stat
.
execute
(
"CREATE SEQUENCE SEQ"
);
stat
.
execute
(
"CREATE TABLE TEST(ID INT)"
);
stat
.
execute
(
"CREATE TABLE TEST(ID INT)"
);
PreparedStatement
prep
=
conn
.
prepareStatement
(
"INSERT INTO TEST VALUES(NEXT VALUE FOR SEQ)"
);
PreparedStatement
prep
=
conn
.
prepareStatement
(
"INSERT INTO TEST VALUES(NEXT VALUE FOR SEQ)"
);
prep
.
addBatch
();
prep
.
addBatch
();
prep
.
addBatch
();
prep
.
addBatch
();
prep
.
addBatch
();
prep
.
addBatch
();
...
...
h2/src/test/org/h2/test/mvcc/TestMvcc4.java
浏览文件 @
f31539cc
...
@@ -122,6 +122,12 @@ public class TestMvcc4 extends TestBase {
...
@@ -122,6 +122,12 @@ public class TestMvcc4 extends TestBase {
setup
.
close
();
setup
.
close
();
}
}
/**
* Wait for the given thread to block on synchronizing on the database
* object.
*
* @param t the thread
*/
static
void
waitForThreadToBlockOnDB
(
Thread
t
)
{
static
void
waitForThreadToBlockOnDB
(
Thread
t
)
{
while
(
true
)
{
while
(
true
)
{
// TODO must not use getAllStackTraces, as the method names are
// TODO must not use getAllStackTraces, as the method names are
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
f31539cc
...
@@ -783,3 +783,4 @@ diagnostic filer stamp turn going cancellation fetched produced incurring
...
@@ -783,3 +783,4 @@ diagnostic filer stamp turn going cancellation fetched produced incurring
interpreter batching fewer runners imperial correspond nine purge meridian
interpreter batching fewer runners imperial correspond nine purge meridian
calendars moscow messager lookups unhandled buddha parslet
calendars moscow messager lookups unhandled buddha parslet
tzh roc xii tzm viii myydd mar vii
tzh roc xii tzm viii myydd mar vii
cristan branda fabien adam bio gomes mahon steven aug meijer lisboa todescato
h2/src/tools/org/h2/build/doclet/Doclet.java
浏览文件 @
f31539cc
...
@@ -484,7 +484,8 @@ public class Doclet {
...
@@ -484,7 +484,8 @@ public class Doclet {
&&
method
.
parameters
().
length
==
0
&&
method
.
parameters
().
length
==
0
&&
returnType
!=
null
&&
returnType
!=
null
&&
returnType
.
toString
().
equals
(
"boolean"
);
&&
returnType
.
toString
().
equals
(
"boolean"
);
if
(!
setterOrGetter
)
{
boolean
enumValueMethod
=
name
.
equals
(
"values"
)
||
name
.
equals
(
"valueOf"
);
if
(!
setterOrGetter
&&
!
enumValueMethod
)
{
addError
(
"Undocumented method "
+
" ("
addError
(
"Undocumented method "
+
" ("
+
getLink
(
clazz
,
method
.
position
().
line
())
+
") "
+
getLink
(
clazz
,
method
.
position
().
line
())
+
") "
+
clazz
+
"."
+
name
+
" "
+
raw
);
+
clazz
+
"."
+
name
+
" "
+
raw
);
...
...
h2/src/tools/org/h2/dev/fs/ArchiveTool.java
浏览文件 @
f31539cc
...
@@ -530,7 +530,7 @@ public class ArchiveTool {
...
@@ -530,7 +530,7 @@ public class ArchiveTool {
dataOut
.
flush
();
dataOut
.
flush
();
}
}
static
long
openSegments
(
List
<
Long
>
segmentStart
,
TreeSet
<
ChunkStream
>
segmentIn
,
private
static
long
openSegments
(
List
<
Long
>
segmentStart
,
TreeSet
<
ChunkStream
>
segmentIn
,
String
tempFileName
,
boolean
readKey
)
throws
IOException
{
String
tempFileName
,
boolean
readKey
)
throws
IOException
{
long
inPos
=
0
;
long
inPos
=
0
;
int
bufferTotal
=
64
*
1024
*
1024
;
int
bufferTotal
=
64
*
1024
*
1024
;
...
@@ -549,7 +549,7 @@ public class ArchiveTool {
...
@@ -549,7 +549,7 @@ public class ArchiveTool {
return
inPos
;
return
inPos
;
}
}
static
Iterator
<
Chunk
>
merge
(
final
TreeSet
<
ChunkStream
>
segmentIn
,
final
Log
log
)
{
private
static
Iterator
<
Chunk
>
merge
(
final
TreeSet
<
ChunkStream
>
segmentIn
,
final
Log
log
)
{
return
new
Iterator
<
Chunk
>()
{
return
new
Iterator
<
Chunk
>()
{
@Override
@Override
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论