Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
5c555202
提交
5c555202
authored
12月 26, 2015
作者:
Thomas Mueller Graf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Formatting, Javadocs
上级
986af2a3
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
194 行增加
和
167 行删除
+194
-167
Driver.java
h2/src/main/org/h2/Driver.java
+1
-0
Parser.java
h2/src/main/org/h2/command/Parser.java
+1
-1
ConditionExists.java
h2/src/main/org/h2/expression/ConditionExists.java
+0
-1
ConditionInSelect.java
h2/src/main/org/h2/expression/ConditionInSelect.java
+0
-1
Subquery.java
h2/src/main/org/h2/expression/Subquery.java
+0
-1
IndexLookupBatch.java
h2/src/main/org/h2/index/IndexLookupBatch.java
+10
-10
ViewIndex.java
h2/src/main/org/h2/index/ViewIndex.java
+3
-4
RowFactory.java
h2/src/main/org/h2/result/RowFactory.java
+1
-1
RowImpl.java
h2/src/main/org/h2/result/RowImpl.java
+10
-0
JoinBatch.java
h2/src/main/org/h2/table/JoinBatch.java
+65
-66
Table.java
h2/src/main/org/h2/table/Table.java
+12
-2
TableFilter.java
h2/src/main/org/h2/table/TableFilter.java
+2
-4
SourceCompiler.java
h2/src/main/org/h2/util/SourceCompiler.java
+1
-1
TestAnnotationProcessor.java
h2/src/test/org/h2/test/ap/TestAnnotationProcessor.java
+25
-13
TestRowFactory.java
h2/src/test/org/h2/test/db/TestRowFactory.java
+2
-2
TestTableEngines.java
h2/src/test/org/h2/test/db/TestTableEngines.java
+56
-57
TestMvcc4.java
h2/src/test/org/h2/test/mvcc/TestMvcc4.java
+4
-1
BuildBase.java
h2/src/tools/org/h2/build/BuildBase.java
+1
-2
没有找到文件。
h2/src/main/org/h2/Driver.java
浏览文件 @
5c555202
...
@@ -144,6 +144,7 @@ public class Driver implements java.sql.Driver {
...
@@ -144,6 +144,7 @@ public class Driver implements java.sql.Driver {
* [Not supported]
* [Not supported]
*/
*/
/*## Java 1.7 ##
/*## Java 1.7 ##
@Override
public Logger getParentLogger() {
public Logger getParentLogger() {
return null;
return null;
}
}
...
...
h2/src/main/org/h2/command/Parser.java
浏览文件 @
5c555202
...
@@ -1913,7 +1913,7 @@ public class Parser {
...
@@ -1913,7 +1913,7 @@ public class Parser {
}
}
}
}
private
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/expression/ConditionExists.java
浏览文件 @
5c555202
...
@@ -9,7 +9,6 @@ import org.h2.command.dml.Query;
...
@@ -9,7 +9,6 @@ import org.h2.command.dml.Query;
import
org.h2.engine.Session
;
import
org.h2.engine.Session
;
import
org.h2.result.LocalResult
;
import
org.h2.result.LocalResult
;
import
org.h2.table.ColumnResolver
;
import
org.h2.table.ColumnResolver
;
import
org.h2.table.SubQueryInfo
;
import
org.h2.table.TableFilter
;
import
org.h2.table.TableFilter
;
import
org.h2.util.StringUtils
;
import
org.h2.util.StringUtils
;
import
org.h2.value.Value
;
import
org.h2.value.Value
;
...
...
h2/src/main/org/h2/expression/ConditionInSelect.java
浏览文件 @
5c555202
...
@@ -13,7 +13,6 @@ import org.h2.index.IndexCondition;
...
@@ -13,7 +13,6 @@ import org.h2.index.IndexCondition;
import
org.h2.message.DbException
;
import
org.h2.message.DbException
;
import
org.h2.result.LocalResult
;
import
org.h2.result.LocalResult
;
import
org.h2.table.ColumnResolver
;
import
org.h2.table.ColumnResolver
;
import
org.h2.table.SubQueryInfo
;
import
org.h2.table.TableFilter
;
import
org.h2.table.TableFilter
;
import
org.h2.util.StringUtils
;
import
org.h2.util.StringUtils
;
import
org.h2.value.Value
;
import
org.h2.value.Value
;
...
...
h2/src/main/org/h2/expression/Subquery.java
浏览文件 @
5c555202
...
@@ -12,7 +12,6 @@ import org.h2.engine.Session;
...
@@ -12,7 +12,6 @@ import org.h2.engine.Session;
import
org.h2.message.DbException
;
import
org.h2.message.DbException
;
import
org.h2.result.ResultInterface
;
import
org.h2.result.ResultInterface
;
import
org.h2.table.ColumnResolver
;
import
org.h2.table.ColumnResolver
;
import
org.h2.table.SubQueryInfo
;
import
org.h2.table.TableFilter
;
import
org.h2.table.TableFilter
;
import
org.h2.value.Value
;
import
org.h2.value.Value
;
import
org.h2.value.ValueArray
;
import
org.h2.value.ValueArray
;
...
...
h2/src/main/org/h2/index/IndexLookupBatch.java
浏览文件 @
5c555202
...
@@ -14,39 +14,39 @@ import org.h2.result.SearchRow;
...
@@ -14,39 +14,39 @@ import org.h2.result.SearchRow;
* H2 engine will be calling {@link #addSearchRows(SearchRow, SearchRow)} until
* H2 engine will be calling {@link #addSearchRows(SearchRow, SearchRow)} until
* method {@link #isBatchFull()}} will return {@code true} or there are no more
* method {@link #isBatchFull()}} will return {@code true} or there are no more
* search rows to add. Then method {@link #find()} will be called to execute batched lookup.
* search rows to add. Then method {@link #find()} will be called to execute batched lookup.
* Note that a single instance of {@link IndexLookupBatch} can be reused for multiple
* Note that a single instance of {@link IndexLookupBatch} can be reused for multiple
* sequential batched lookups, moreover it can be reused for multiple queries for
* sequential batched lookups, moreover it can be reused for multiple queries for
* the same prepared statement.
* the same prepared statement.
*
*
* @see Index#createLookupBatch(org.h2.table.TableFilter)
* @see Index#createLookupBatch(org.h2.table.TableFilter)
* @author Sergi Vladykin
* @author Sergi Vladykin
*/
*/
public
interface
IndexLookupBatch
{
public
interface
IndexLookupBatch
{
/**
/**
* Add search row pair to the batch.
* Add search row pair to the batch.
*
*
* @param first the first row, or null for no limit
* @param first the first row, or null for no limit
* @param last the last row, or null for no limit
* @param last the last row, or null for no limit
* @return {@code false} if this search row pair is known to produce no results
* @return {@code false} if this search row pair is known to produce no results
* and thus the given row pair was not added
* and thus the given row pair was not added
* @see Index#find(TableFilter, SearchRow, SearchRow)
* @see Index#find(
org.h2.table.
TableFilter, SearchRow, SearchRow)
*/
*/
boolean
addSearchRows
(
SearchRow
first
,
SearchRow
last
);
boolean
addSearchRows
(
SearchRow
first
,
SearchRow
last
);
/**
/**
* Check if this batch is full.
* Check if this batch is full.
*
*
* @return {@code true} If batch is full, will not accept any
* @return {@code true} If batch is full, will not accept any
* more rows and {@link #find()} can be executed.
* more rows and {@link #find()} can be executed.
*/
*/
boolean
isBatchFull
();
boolean
isBatchFull
();
/**
/**
* Execute batched lookup and return future cursor for each provided
* Execute batched lookup and return future cursor for each provided
* search row pair. Note that this method must return exactly the same number
* search row pair. Note that this method must return exactly the same number
* of future cursors in result list as number of {@link #addSearchRows(SearchRow, SearchRow)}
* of future cursors in result list as number of {@link #addSearchRows(SearchRow, SearchRow)}
* calls has been done before {@link #find()} call exactly in the same order.
* calls has been done before {@link #find()} call exactly in the same order.
*
*
* @return List of future cursors for collected search rows.
* @return List of future cursors for collected search rows.
*/
*/
List
<
Future
<
Cursor
>>
find
();
List
<
Future
<
Cursor
>>
find
();
...
...
h2/src/main/org/h2/index/ViewIndex.java
浏览文件 @
5c555202
...
@@ -69,7 +69,7 @@ public class ViewIndex extends BaseIndex implements SpatialIndex {
...
@@ -69,7 +69,7 @@ public class ViewIndex extends BaseIndex implements SpatialIndex {
columns
=
new
Column
[
0
];
columns
=
new
Column
[
0
];
this
.
createSession
=
null
;
this
.
createSession
=
null
;
this
.
indexMasks
=
null
;
this
.
indexMasks
=
null
;
// this is a main index of TableView, it does not need eviction time stamp
// this is a main index of TableView, it does not need eviction time stamp
evaluatedAt
=
Long
.
MIN_VALUE
;
evaluatedAt
=
Long
.
MIN_VALUE
;
}
}
...
@@ -171,8 +171,7 @@ public class ViewIndex extends BaseIndex implements SpatialIndex {
...
@@ -171,8 +171,7 @@ public class ViewIndex extends BaseIndex implements SpatialIndex {
return
(
Query
)
p
;
return
(
Query
)
p
;
}
}
private
Cursor
findRecursive
(
Session
session
,
SearchRow
first
,
SearchRow
last
,
private
Cursor
findRecursive
(
SearchRow
first
,
SearchRow
last
)
{
SearchRow
intersection
)
{
assert
recursive
;
assert
recursive
;
LocalResult
recResult
=
view
.
getRecursiveResult
();
LocalResult
recResult
=
view
.
getRecursiveResult
();
if
(
recResult
!=
null
)
{
if
(
recResult
!=
null
)
{
...
@@ -266,7 +265,7 @@ public class ViewIndex extends BaseIndex implements SpatialIndex {
...
@@ -266,7 +265,7 @@ public class ViewIndex extends BaseIndex implements SpatialIndex {
private
Cursor
find
(
Session
session
,
SearchRow
first
,
SearchRow
last
,
private
Cursor
find
(
Session
session
,
SearchRow
first
,
SearchRow
last
,
SearchRow
intersection
)
{
SearchRow
intersection
)
{
if
(
recursive
)
{
if
(
recursive
)
{
return
findRecursive
(
session
,
first
,
last
,
intersection
);
return
findRecursive
(
first
,
last
);
}
}
setupQueryParameters
(
session
,
first
,
last
,
intersection
);
setupQueryParameters
(
session
,
first
,
last
,
intersection
);
LocalResult
result
=
query
.
query
(
0
);
LocalResult
result
=
query
.
query
(
0
);
...
...
h2/src/main/org/h2/result/RowFactory.java
浏览文件 @
5c555202
...
@@ -25,7 +25,7 @@ public abstract class RowFactory {
...
@@ -25,7 +25,7 @@ public abstract class RowFactory {
/**
/**
* Default implementation of row factory.
* Default implementation of row factory.
*/
*/
private
static
final
class
DefaultRowFactory
extends
RowFactory
{
static
final
class
DefaultRowFactory
extends
RowFactory
{
@Override
@Override
public
Row
createRow
(
Value
[]
data
,
int
memory
)
{
public
Row
createRow
(
Value
[]
data
,
int
memory
)
{
return
new
RowImpl
(
data
,
memory
);
return
new
RowImpl
(
data
,
memory
);
...
...
h2/src/main/org/h2/result/RowImpl.java
浏览文件 @
5c555202
...
@@ -33,6 +33,7 @@ public class RowImpl extends Row {
...
@@ -33,6 +33,7 @@ public class RowImpl extends Row {
*
*
* @return a new row with the same data
* @return a new row with the same data
*/
*/
@Override
public
Row
getCopy
()
{
public
Row
getCopy
()
{
Value
[]
d2
=
new
Value
[
data
.
length
];
Value
[]
d2
=
new
Value
[
data
.
length
];
System
.
arraycopy
(
data
,
0
,
d2
,
0
,
data
.
length
);
System
.
arraycopy
(
data
,
0
,
d2
,
0
,
data
.
length
);
...
@@ -54,6 +55,7 @@ public class RowImpl extends Row {
...
@@ -54,6 +55,7 @@ public class RowImpl extends Row {
return
version
;
return
version
;
}
}
@Override
public
void
setVersion
(
int
version
)
{
public
void
setVersion
(
int
version
)
{
this
.
version
=
version
;
this
.
version
=
version
;
}
}
...
@@ -79,6 +81,7 @@ public class RowImpl extends Row {
...
@@ -79,6 +81,7 @@ public class RowImpl extends Row {
* @param dummy the template buffer
* @param dummy the template buffer
* @return the number of bytes
* @return the number of bytes
*/
*/
@Override
public
int
getByteCount
(
Data
dummy
)
{
public
int
getByteCount
(
Data
dummy
)
{
int
size
=
0
;
int
size
=
0
;
for
(
Value
v
:
data
)
{
for
(
Value
v
:
data
)
{
...
@@ -96,6 +99,7 @@ public class RowImpl extends Row {
...
@@ -96,6 +99,7 @@ public class RowImpl extends Row {
}
}
}
}
@Override
public
boolean
isEmpty
()
{
public
boolean
isEmpty
()
{
return
data
==
null
;
return
data
==
null
;
}
}
...
@@ -145,14 +149,17 @@ public class RowImpl extends Row {
...
@@ -145,14 +149,17 @@ public class RowImpl extends Row {
return
buff
.
append
(
')'
).
toString
();
return
buff
.
append
(
')'
).
toString
();
}
}
@Override
public
void
setDeleted
(
boolean
deleted
)
{
public
void
setDeleted
(
boolean
deleted
)
{
this
.
deleted
=
deleted
;
this
.
deleted
=
deleted
;
}
}
@Override
public
void
setSessionId
(
int
sessionId
)
{
public
void
setSessionId
(
int
sessionId
)
{
this
.
sessionId
=
sessionId
;
this
.
sessionId
=
sessionId
;
}
}
@Override
public
int
getSessionId
()
{
public
int
getSessionId
()
{
return
sessionId
;
return
sessionId
;
}
}
...
@@ -160,14 +167,17 @@ public class RowImpl extends Row {
...
@@ -160,14 +167,17 @@ public class RowImpl extends Row {
/**
/**
* This record has been committed. The session id is reset.
* This record has been committed. The session id is reset.
*/
*/
@Override
public
void
commit
()
{
public
void
commit
()
{
this
.
sessionId
=
0
;
this
.
sessionId
=
0
;
}
}
@Override
public
boolean
isDeleted
()
{
public
boolean
isDeleted
()
{
return
deleted
;
return
deleted
;
}
}
@Override
public
Value
[]
getValueList
()
{
public
Value
[]
getValueList
()
{
return
data
;
return
data
;
}
}
...
...
h2/src/main/org/h2/table/JoinBatch.java
浏览文件 @
5c555202
差异被折叠。
点击展开。
h2/src/main/org/h2/table/Table.java
浏览文件 @
5c555202
...
@@ -240,6 +240,16 @@ public abstract class Table extends SchemaObjectBase {
...
@@ -240,6 +240,16 @@ public abstract class Table extends SchemaObjectBase {
*/
*/
public
abstract
Index
getScanIndex
(
Session
session
);
public
abstract
Index
getScanIndex
(
Session
session
);
/**
* Get the scan index for this table.
*
* @param session the session
* @param masks the search mask
* @param filters the table filters
* @param filter the filer index
* @param sortOrder the sort order
* @return the scan index
*/
public
Index
getScanIndex
(
Session
session
,
int
[]
masks
,
public
Index
getScanIndex
(
Session
session
,
int
[]
masks
,
TableFilter
[]
filters
,
int
filter
,
SortOrder
sortOrder
)
{
TableFilter
[]
filters
,
int
filter
,
SortOrder
sortOrder
)
{
return
getScanIndex
(
session
);
return
getScanIndex
(
session
);
...
@@ -699,7 +709,7 @@ public abstract class Table extends SchemaObjectBase {
...
@@ -699,7 +709,7 @@ public abstract class Table extends SchemaObjectBase {
item
.
cost
=
item
.
getIndex
().
getCost
(
session
,
null
,
filters
,
filter
,
null
);
item
.
cost
=
item
.
getIndex
().
getCost
(
session
,
null
,
filters
,
filter
,
null
);
Trace
t
=
session
.
getTrace
();
Trace
t
=
session
.
getTrace
();
if
(
t
.
isDebugEnabled
())
{
if
(
t
.
isDebugEnabled
())
{
t
.
debug
(
"Table : potential plan item cost {0} index {1}"
,
t
.
debug
(
"Table : potential plan item cost {0} index {1}"
,
item
.
cost
,
item
.
getIndex
().
getPlanSQL
());
item
.
cost
,
item
.
getIndex
().
getPlanSQL
());
}
}
ArrayList
<
Index
>
indexes
=
getIndexes
();
ArrayList
<
Index
>
indexes
=
getIndexes
();
...
@@ -708,7 +718,7 @@ public abstract class Table extends SchemaObjectBase {
...
@@ -708,7 +718,7 @@ public abstract class Table extends SchemaObjectBase {
Index
index
=
indexes
.
get
(
i
);
Index
index
=
indexes
.
get
(
i
);
double
cost
=
index
.
getCost
(
session
,
masks
,
filters
,
filter
,
sortOrder
);
double
cost
=
index
.
getCost
(
session
,
masks
,
filters
,
filter
,
sortOrder
);
if
(
t
.
isDebugEnabled
())
{
if
(
t
.
isDebugEnabled
())
{
t
.
debug
(
"Table : potential plan item cost {0} index {1}"
,
t
.
debug
(
"Table : potential plan item cost {0} index {1}"
,
cost
,
index
.
getPlanSQL
());
cost
,
index
.
getPlanSQL
());
}
}
if
(
cost
<
item
.
cost
)
{
if
(
cost
<
item
.
cost
)
{
...
...
h2/src/main/org/h2/table/TableFilter.java
浏览文件 @
5c555202
...
@@ -21,7 +21,6 @@ import org.h2.index.Index;
...
@@ -21,7 +21,6 @@ import org.h2.index.Index;
import
org.h2.index.IndexCondition
;
import
org.h2.index.IndexCondition
;
import
org.h2.index.IndexCursor
;
import
org.h2.index.IndexCursor
;
import
org.h2.index.IndexLookupBatch
;
import
org.h2.index.IndexLookupBatch
;
import
org.h2.index.ScanIndex
;
import
org.h2.index.ViewIndex
;
import
org.h2.index.ViewIndex
;
import
org.h2.message.DbException
;
import
org.h2.message.DbException
;
import
org.h2.result.Row
;
import
org.h2.result.Row
;
...
@@ -213,9 +212,9 @@ public class TableFilter implements ColumnResolver {
...
@@ -213,9 +212,9 @@ public class TableFilter implements ColumnResolver {
item
.
cost
-=
item
.
cost
*
indexConditions
.
size
()
/
100
/
(
filter
+
1
);
item
.
cost
-=
item
.
cost
*
indexConditions
.
size
()
/
100
/
(
filter
+
1
);
if
(
item1
!=
null
&&
item1
.
cost
<
item
.
cost
)
{
if
(
item1
!=
null
&&
item1
.
cost
<
item
.
cost
)
{
item
=
item1
;
item
=
item1
;
}
}
if
(
nestedJoin
!=
null
)
{
if
(
nestedJoin
!=
null
)
{
setEvaluatable
(
nestedJoin
);
setEvaluatable
(
nestedJoin
);
item
.
setNestedJoinPlan
(
nestedJoin
.
getBestPlanItem
(
s
,
filters
,
filter
));
item
.
setNestedJoinPlan
(
nestedJoin
.
getBestPlanItem
(
s
,
filters
,
filter
));
...
@@ -374,7 +373,6 @@ public class TableFilter implements ColumnResolver {
...
@@ -374,7 +373,6 @@ public class TableFilter implements ColumnResolver {
/**
/**
* Attempt to initialize batched join.
* Attempt to initialize batched join.
*
*
* @param id join filter id (index of this table filter in join list)
* @param jb join batch if it is already created
* @param jb join batch if it is already created
* @return join batch if query runs over index which supports batched lookups, {@code null} otherwise
* @return join batch if query runs over index which supports batched lookups, {@code null} otherwise
*/
*/
...
...
h2/src/main/org/h2/util/SourceCompiler.java
浏览文件 @
5c555202
...
@@ -366,7 +366,7 @@ public class SourceCompiler {
...
@@ -366,7 +366,7 @@ public class SourceCompiler {
boolean
syntaxError
=
false
;
boolean
syntaxError
=
false
;
final
BufferedReader
reader
=
new
BufferedReader
(
new
StringReader
(
output
));
final
BufferedReader
reader
=
new
BufferedReader
(
new
StringReader
(
output
));
try
{
try
{
for
(
String
line
;
(
line
=
reader
.
readLine
())
!=
null
;
)
{
for
(
String
line
;
(
line
=
reader
.
readLine
())
!=
null
;)
{
if
(
line
.
startsWith
(
"Note:"
)
||
line
.
startsWith
(
"warning:"
))
{
if
(
line
.
startsWith
(
"Note:"
)
||
line
.
startsWith
(
"warning:"
))
{
// just a warning (e.g. unchecked or unsafe operations)
// just a warning (e.g. unchecked or unsafe operations)
}
else
{
}
else
{
...
...
h2/src/test/org/h2/test/ap/TestAnnotationProcessor.java
浏览文件 @
5c555202
/*
* Copyright 2004-2014 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
.
test
.
ap
;
package
org
.
h2
.
test
.
ap
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -11,10 +16,14 @@ import javax.lang.model.SourceVersion;
...
@@ -11,10 +16,14 @@ import javax.lang.model.SourceVersion;
import
javax.lang.model.element.TypeElement
;
import
javax.lang.model.element.TypeElement
;
import
javax.tools.Diagnostic
;
import
javax.tools.Diagnostic
;
/**
* An annotation processor for testing.
*/
public
class
TestAnnotationProcessor
extends
AbstractProcessor
{
public
class
TestAnnotationProcessor
extends
AbstractProcessor
{
public
static
final
String
MESSAGES_KEY
=
TestAnnotationProcessor
.
class
.
getName
()
+
"-messages"
;
public
static
final
String
MESSAGES_KEY
=
TestAnnotationProcessor
.
class
.
getName
()
+
"-messages"
;
@Override
public
Set
<
String
>
getSupportedAnnotationTypes
()
{
public
Set
<
String
>
getSupportedAnnotationTypes
()
{
for
(
OutputMessage
outputMessage
:
findMessages
())
{
for
(
OutputMessage
outputMessage
:
findMessages
())
{
...
@@ -24,26 +33,26 @@ public class TestAnnotationProcessor extends AbstractProcessor {
...
@@ -24,26 +33,26 @@ public class TestAnnotationProcessor extends AbstractProcessor {
return
Collections
.
emptySet
();
return
Collections
.
emptySet
();
}
}
private
List
<
OutputMessage
>
findMessages
()
{
private
static
List
<
OutputMessage
>
findMessages
()
{
final
String
messagesStr
=
System
.
getProperty
(
MESSAGES_KEY
);
final
String
messagesStr
=
System
.
getProperty
(
MESSAGES_KEY
);
if
(
messagesStr
==
null
||
messagesStr
.
isEmpty
())
{
if
(
messagesStr
==
null
||
messagesStr
.
isEmpty
())
{
return
Collections
.
emptyList
();
return
Collections
.
emptyList
();
}
else
{
}
final
List
<
OutputMessage
>
outputMessages
=
new
ArrayList
<
OutputMessage
>();
List
<
OutputMessage
>
outputMessages
=
new
ArrayList
<
OutputMessage
>();
for
(
String
msg
:
messagesStr
.
split
(
"\\|"
))
{
for
(
String
msg
:
messagesStr
.
split
(
"\\|"
))
{
final
String
[]
split
=
msg
.
split
(
","
);
String
[]
split
=
msg
.
split
(
","
);
if
(
split
.
length
==
2
)
{
if
(
split
.
length
==
2
)
{
outputMessages
.
add
(
new
OutputMessage
(
Diagnostic
.
Kind
.
valueOf
(
split
[
0
]),
split
[
1
]));
outputMessages
.
add
(
new
OutputMessage
(
Diagnostic
.
Kind
.
valueOf
(
split
[
0
]),
split
[
1
]));
}
else
{
}
else
{
throw
new
IllegalStateException
(
"Unable to parse messages definition for: '"
+
messagesStr
+
"'"
);
throw
new
IllegalStateException
(
"Unable to parse messages definition for: '"
+
messagesStr
+
"'"
);
}
}
}
return
outputMessages
;
}
}
return
outputMessages
;
}
}
@Override
public
SourceVersion
getSupportedSourceVersion
()
{
public
SourceVersion
getSupportedSourceVersion
()
{
return
SourceVersion
.
latest
();
return
SourceVersion
.
latest
();
}
}
...
@@ -53,11 +62,14 @@ public class TestAnnotationProcessor extends AbstractProcessor {
...
@@ -53,11 +62,14 @@ public class TestAnnotationProcessor extends AbstractProcessor {
return
false
;
return
false
;
}
}
/**
* An output message.
*/
private
static
class
OutputMessage
{
private
static
class
OutputMessage
{
public
final
Diagnostic
.
Kind
kind
;
public
final
Diagnostic
.
Kind
kind
;
public
final
String
message
;
public
final
String
message
;
private
OutputMessage
(
Diagnostic
.
Kind
kind
,
String
message
)
{
OutputMessage
(
Diagnostic
.
Kind
kind
,
String
message
)
{
this
.
kind
=
kind
;
this
.
kind
=
kind
;
this
.
message
=
message
;
this
.
message
=
message
;
}
}
...
...
h2/src/test/org/h2/test/db/TestRowFactory.java
浏览文件 @
5c555202
...
@@ -33,7 +33,7 @@ public class TestRowFactory extends TestBase {
...
@@ -33,7 +33,7 @@ public class TestRowFactory extends TestBase {
@Override
@Override
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
deleteDb
(
"rowFactory"
);
deleteDb
(
"rowFactory"
);
Connection
conn
=
getConnection
(
"rowFactory;ROW_FACTORY=\""
+
Connection
conn
=
getConnection
(
"rowFactory;ROW_FACTORY=\""
+
MyTestRowFactory
.
class
.
getName
()
+
'"'
);
MyTestRowFactory
.
class
.
getName
()
+
'"'
);
Statement
stat
=
conn
.
createStatement
();
Statement
stat
=
conn
.
createStatement
();
stat
.
execute
(
"create table t1(id int, name varchar)"
);
stat
.
execute
(
"create table t1(id int, name varchar)"
);
...
@@ -49,7 +49,7 @@ public class TestRowFactory extends TestBase {
...
@@ -49,7 +49,7 @@ public class TestRowFactory extends TestBase {
*/
*/
public
static
class
MyTestRowFactory
extends
RowFactory
{
public
static
class
MyTestRowFactory
extends
RowFactory
{
private
static
final
AtomicInteger
COUNTER
=
new
AtomicInteger
();
static
final
AtomicInteger
COUNTER
=
new
AtomicInteger
();
@Override
@Override
public
Row
createRow
(
Value
[]
data
,
int
memory
)
{
public
Row
createRow
(
Value
[]
data
,
int
memory
)
{
...
...
h2/src/test/org/h2/test/db/TestTableEngines.java
浏览文件 @
5c555202
差异被折叠。
点击展开。
h2/src/test/org/h2/test/mvcc/TestMvcc4.java
浏览文件 @
5c555202
...
@@ -71,6 +71,7 @@ public class TestMvcc4 extends TestBase {
...
@@ -71,6 +71,7 @@ public class TestMvcc4 extends TestBase {
final
Thread
mainThread
=
Thread
.
currentThread
();
final
Thread
mainThread
=
Thread
.
currentThread
();
final
CountDownLatch
executedUpdate
=
new
CountDownLatch
(
1
);
final
CountDownLatch
executedUpdate
=
new
CountDownLatch
(
1
);
new
Thread
()
{
new
Thread
()
{
@Override
public
void
run
()
{
public
void
run
()
{
try
{
try
{
Connection
c2
=
getConnection
(
"mvcc4"
);
Connection
c2
=
getConnection
(
"mvcc4"
);
...
@@ -96,6 +97,7 @@ public class TestMvcc4 extends TestBase {
...
@@ -96,6 +97,7 @@ public class TestMvcc4 extends TestBase {
try
{
try
{
executedUpdate
.
await
();
executedUpdate
.
await
();
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
// ignore
}
}
// Execute an update. This should initially fail, and enter the waiting
// Execute an update. This should initially fail, and enter the waiting
...
@@ -120,7 +122,7 @@ public class TestMvcc4 extends TestBase {
...
@@ -120,7 +122,7 @@ public class TestMvcc4 extends TestBase {
setup
.
close
();
setup
.
close
();
}
}
private
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
// implementation details
// implementation details
...
@@ -135,6 +137,7 @@ public class TestMvcc4 extends TestBase {
...
@@ -135,6 +137,7 @@ public class TestMvcc4 extends TestBase {
try
{
try
{
Thread
.
sleep
(
10
);
Thread
.
sleep
(
10
);
}
catch
(
InterruptedException
e1
)
{
}
catch
(
InterruptedException
e1
)
{
// ignore
}
}
}
}
}
}
...
...
h2/src/tools/org/h2/build/BuildBase.java
浏览文件 @
5c555202
...
@@ -315,9 +315,8 @@ public class BuildBase {
...
@@ -315,9 +315,8 @@ public class BuildBase {
newArgs
.
add
(
script
);
newArgs
.
add
(
script
);
newArgs
.
addAll
(
args
);
newArgs
.
addAll
(
args
);
return
exec
(
"cmd"
,
newArgs
);
return
exec
(
"cmd"
,
newArgs
);
}
else
{
return
exec
(
script
,
args
);
}
}
return
exec
(
script
,
args
);
}
}
/**
/**
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论