Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
b9b9e11a
Unverified
提交
b9b9e11a
authored
1月 17, 2018
作者:
Noel Grandin
提交者:
GitHub
1月 17, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #774 from katzyn/misc
Assorted changes
上级
6616409f
dd400e1b
隐藏空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
64 行增加
和
53 行删除
+64
-53
.gitattributes
h2/.gitattributes
+1
-0
changelog.html
h2/src/docsrc/html/changelog.html
+5
-5
Select.java
h2/src/main/org/h2/command/dml/Select.java
+10
-10
SelectUnion.java
h2/src/main/org/h2/command/dml/SelectUnion.java
+2
-2
FullText.java
h2/src/main/org/h2/fulltext/FullText.java
+1
-1
FullTextLucene.java
h2/src/main/org/h2/fulltext/FullTextLucene.java
+4
-4
MVSecondaryIndex.java
h2/src/main/org/h2/mvstore/db/MVSecondaryIndex.java
+4
-4
TransactionStore.java
h2/src/main/org/h2/mvstore/db/TransactionStore.java
+1
-1
WebServer.java
h2/src/main/org/h2/server/web/WebServer.java
+0
-1
Column.java
h2/src/main/org/h2/table/Column.java
+1
-0
MathUtils.java
h2/src/main/org/h2/util/MathUtils.java
+1
-1
ToChar.java
h2/src/main/org/h2/util/ToChar.java
+1
-1
CharsetCollator.java
h2/src/main/org/h2/value/CharsetCollator.java
+2
-2
Value.java
h2/src/main/org/h2/value/Value.java
+1
-0
TestGeneralCommonTableQueries.java
...rc/test/org/h2/test/db/TestGeneralCommonTableQueries.java
+7
-7
TestPersistentCommonTableExpressions.java
.../org/h2/test/db/TestPersistentCommonTableExpressions.java
+17
-10
TestSetCollation.java
h2/src/test/org/h2/test/db/TestSetCollation.java
+0
-1
TestCustomDataTypesHandler.java
h2/src/test/org/h2/test/jdbc/TestCustomDataTypesHandler.java
+2
-2
TestMvccMultiThreaded2.java
h2/src/test/org/h2/test/mvcc/TestMvccMultiThreaded2.java
+3
-0
ArchiveTool.java
h2/src/tools/org/h2/dev/fs/ArchiveTool.java
+1
-1
没有找到文件。
h2/.gitattributes
浏览文件 @
b9b9e11a
*.bat eol=crlf
*.bat eol=crlf
*.sh eol=lf
*.sh eol=lf
*.java diff=java
h2/src/docsrc/html/changelog.html
浏览文件 @
b9b9e11a
...
@@ -23,7 +23,7 @@ Change Log
...
@@ -23,7 +23,7 @@ Change Log
<ul>
<ul>
<li>
Make ALL a reserved keyword
<li>
Make ALL a reserved keyword
</li>
</li>
<li>
Issue #311: Avoid calling list.toArray(new X[list.size()]) for performance
<li>
Issue #311: Avoid calling list.toArray(new X[list.size()]) for performance
</li>
</li>
<li>
PR #715: Better getObject error message
<li>
PR #715: Better getObject error message
</li>
</li>
...
@@ -43,11 +43,11 @@ Change Log
...
@@ -43,11 +43,11 @@ Change Log
</li>
</li>
<li>
Issue #699: When using an index for sorting, the index is ignored when also using NULLS LAST/FIRST
<li>
Issue #699: When using an index for sorting, the index is ignored when also using NULLS LAST/FIRST
</li>
</li>
<li>
Issue #697: FilePathDisk.newInputStream fails for contextual class loading
<li>
Issue #697: FilePathDisk.newInputStream fails for contextual class loading
</li>
</li>
<li>
Issue #695: jdbc:postgresql protocol connection issue in H2 Console Application in case of redshift driver in classpath
<li>
Issue #695: jdbc:postgresql protocol connection issue in H2 Console Application in case of redshift driver in classpath
</li>
</li>
<li>
Fix 'file not closed' when using FILE_READ
<li>
Fix 'file not closed' when using FILE_READ
</li>
</li>
<li>
Fix bug in LinkSchema tool when object exists with same name in different schemas
<li>
Fix bug in LinkSchema tool when object exists with same name in different schemas
</li>
</li>
...
@@ -57,9 +57,9 @@ Change Log
...
@@ -57,9 +57,9 @@ Change Log
</li>
</li>
<li>
Issue #654: List ENUM type values in INFORMATION_SCHEMA.COLUMNS
<li>
Issue #654: List ENUM type values in INFORMATION_SCHEMA.COLUMNS
</li>
</li>
<li>
Issue #650: Simple nested SELECT causes error for table with TIMESTAMP WITH TIMEZONE column
<li>
Issue #650: Simple nested SELECT causes error for table with TIMESTAMP WITH TIMEZONE column
</li>
</li>
<li>
Issue #654: List ENUM type values in INFORMATION_SCHEMA.COLUMNS
<li>
Issue #654: List ENUM type values in INFORMATION_SCHEMA.COLUMNS
</li>
</li>
<li>
Issue #668: Fail of an update command on large table with ENUM column
<li>
Issue #668: Fail of an update command on large table with ENUM column
</li>
</li>
...
...
h2/src/main/org/h2/command/dml/Select.java
浏览文件 @
b9b9e11a
...
@@ -43,19 +43,19 @@ import java.util.HashSet;
...
@@ -43,19 +43,19 @@ import java.util.HashSet;
* @author Joel Turkel (Group sorted query)
* @author Joel Turkel (Group sorted query)
*/
*/
public
class
Select
extends
Query
{
public
class
Select
extends
Query
{
private
TableFilter
topTableFilter
;
TableFilter
topTableFilter
;
private
final
ArrayList
<
TableFilter
>
filters
=
New
.
arrayList
();
private
final
ArrayList
<
TableFilter
>
filters
=
New
.
arrayList
();
private
final
ArrayList
<
TableFilter
>
topFilters
=
New
.
arrayList
();
private
final
ArrayList
<
TableFilter
>
topFilters
=
New
.
arrayList
();
private
ArrayList
<
Expression
>
expressions
;
ArrayList
<
Expression
>
expressions
;
private
Expression
[]
expressionArray
;
private
Expression
[]
expressionArray
;
private
Expression
having
;
private
Expression
having
;
private
Expression
condition
;
private
Expression
condition
;
private
int
visibleColumnCount
,
distinctColumnCount
;
int
visibleColumnCount
,
distinctColumnCount
;
private
ArrayList
<
SelectOrderBy
>
orderList
;
private
ArrayList
<
SelectOrderBy
>
orderList
;
private
ArrayList
<
Expression
>
group
;
private
ArrayList
<
Expression
>
group
;
private
int
[]
groupIndex
;
int
[]
groupIndex
;
private
boolean
[]
groupByExpression
;
boolean
[]
groupByExpression
;
private
HashMap
<
Expression
,
Object
>
currentGroup
;
HashMap
<
Expression
,
Object
>
currentGroup
;
private
int
havingIndex
;
private
int
havingIndex
;
private
boolean
isGroupQuery
,
isGroupSortedQuery
;
private
boolean
isGroupQuery
,
isGroupSortedQuery
;
private
boolean
isForUpdate
,
isForUpdateMvcc
;
private
boolean
isForUpdate
,
isForUpdateMvcc
;
...
@@ -64,7 +64,7 @@ public class Select extends Query {
...
@@ -64,7 +64,7 @@ public class Select extends Query {
private
boolean
isPrepared
,
checkInit
;
private
boolean
isPrepared
,
checkInit
;
private
boolean
sortUsingIndex
;
private
boolean
sortUsingIndex
;
private
SortOrder
sort
;
private
SortOrder
sort
;
private
int
currentGroupRowId
;
int
currentGroupRowId
;
public
Select
(
Session
session
)
{
public
Select
(
Session
session
)
{
super
(
session
);
super
(
session
);
...
@@ -164,7 +164,7 @@ public class Select extends Query {
...
@@ -164,7 +164,7 @@ public class Select extends Query {
return
null
;
return
null
;
}
}
private
Value
[]
createGroupSortedRow
(
Value
[]
keyValues
,
int
columnCount
)
{
Value
[]
createGroupSortedRow
(
Value
[]
keyValues
,
int
columnCount
)
{
Value
[]
row
=
new
Value
[
columnCount
];
Value
[]
row
=
new
Value
[
columnCount
];
for
(
int
j
=
0
;
groupIndex
!=
null
&&
j
<
groupIndex
.
length
;
j
++)
{
for
(
int
j
=
0
;
groupIndex
!=
null
&&
j
<
groupIndex
.
length
;
j
++)
{
row
[
groupIndex
[
j
]]
=
keyValues
[
j
];
row
[
groupIndex
[
j
]]
=
keyValues
[
j
];
...
@@ -280,7 +280,7 @@ public class Select extends Query {
...
@@ -280,7 +280,7 @@ public class Select extends Query {
return
count
;
return
count
;
}
}
private
boolean
isConditionMet
()
{
boolean
isConditionMet
()
{
return
condition
==
null
||
return
condition
==
null
||
Boolean
.
TRUE
.
equals
(
condition
.
getBooleanValue
(
session
));
Boolean
.
TRUE
.
equals
(
condition
.
getBooleanValue
(
session
));
}
}
...
@@ -640,7 +640,7 @@ public class Select extends Query {
...
@@ -640,7 +640,7 @@ public class Select extends Query {
return
null
;
return
null
;
}
}
private
void
resetJoinBatchAfterQuery
()
{
void
resetJoinBatchAfterQuery
()
{
JoinBatch
jb
=
getJoinBatch
();
JoinBatch
jb
=
getJoinBatch
();
if
(
jb
!=
null
)
{
if
(
jb
!=
null
)
{
jb
.
reset
(
false
);
jb
.
reset
(
false
);
...
...
h2/src/main/org/h2/command/dml/SelectUnion.java
浏览文件 @
b9b9e11a
...
@@ -59,8 +59,8 @@ public class SelectUnion extends Query {
...
@@ -59,8 +59,8 @@ public class SelectUnion extends Query {
public
static
final
int
INTERSECT
=
3
;
public
static
final
int
INTERSECT
=
3
;
private
int
unionType
;
private
int
unionType
;
private
final
Query
left
;
final
Query
left
;
private
Query
right
;
Query
right
;
private
ArrayList
<
Expression
>
expressions
;
private
ArrayList
<
Expression
>
expressions
;
private
Expression
[]
expressionArray
;
private
Expression
[]
expressionArray
;
private
ArrayList
<
SelectOrderBy
>
orderList
;
private
ArrayList
<
SelectOrderBy
>
orderList
;
...
...
h2/src/main/org/h2/fulltext/FullText.java
浏览文件 @
b9b9e11a
...
@@ -955,7 +955,7 @@ public class FullText {
...
@@ -955,7 +955,7 @@ public class FullText {
}
}
}
}
private
static
boolean
isMultiThread
(
Connection
conn
)
static
boolean
isMultiThread
(
Connection
conn
)
throws
SQLException
{
throws
SQLException
{
try
(
Statement
stat
=
conn
.
createStatement
())
{
try
(
Statement
stat
=
conn
.
createStatement
())
{
ResultSet
rs
=
stat
.
executeQuery
(
ResultSet
rs
=
stat
.
executeQuery
(
...
...
h2/src/main/org/h2/fulltext/FullTextLucene.java
浏览文件 @
b9b9e11a
...
@@ -581,7 +581,7 @@ public class FullTextLucene extends FullText {
...
@@ -581,7 +581,7 @@ public class FullTextLucene extends FullText {
/**
/**
* Commit all changes to the Lucene index.
* Commit all changes to the Lucene index.
*/
*/
private
void
commitIndex
()
throws
SQLException
{
void
commitIndex
()
throws
SQLException
{
try
{
try
{
indexAccess
.
commit
();
indexAccess
.
commit
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
...
@@ -697,18 +697,18 @@ public class FullTextLucene extends FullText {
...
@@ -697,18 +697,18 @@ public class FullTextLucene extends FullText {
*/
*/
private
IndexSearcher
searcher
;
private
IndexSearcher
searcher
;
private
IndexAccess
(
IndexWriter
writer
)
throws
IOException
{
IndexAccess
(
IndexWriter
writer
)
throws
IOException
{
this
.
writer
=
writer
;
this
.
writer
=
writer
;
IndexReader
reader
=
IndexReader
.
open
(
writer
,
true
);
IndexReader
reader
=
IndexReader
.
open
(
writer
,
true
);
searcher
=
new
IndexSearcher
(
reader
);
searcher
=
new
IndexSearcher
(
reader
);
}
}
private
synchronized
IndexSearcher
getSearcher
()
{
synchronized
IndexSearcher
getSearcher
()
{
++
counter
;
++
counter
;
return
searcher
;
return
searcher
;
}
}
private
synchronized
void
returnSearcher
(
IndexSearcher
searcher
)
{
synchronized
void
returnSearcher
(
IndexSearcher
searcher
)
{
if
(
this
.
searcher
==
searcher
)
{
if
(
this
.
searcher
==
searcher
)
{
--
counter
;
--
counter
;
assert
counter
>=
0
;
assert
counter
>=
0
;
...
...
h2/src/main/org/h2/mvstore/db/MVSecondaryIndex.java
浏览文件 @
b9b9e11a
...
@@ -43,7 +43,7 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex {
...
@@ -43,7 +43,7 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex {
/**
/**
* The multi-value table.
* The multi-value table.
*/
*/
private
final
MVTable
mvTable
;
final
MVTable
mvTable
;
private
final
int
keyColumns
;
private
final
int
keyColumns
;
private
final
TransactionMap
<
Value
,
Value
>
dataMap
;
private
final
TransactionMap
<
Value
,
Value
>
dataMap
;
...
@@ -85,7 +85,7 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex {
...
@@ -85,7 +85,7 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex {
private
static
final
class
Source
{
private
static
final
class
Source
{
private
final
Iterator
<
ValueArray
>
iterator
;
private
final
Iterator
<
ValueArray
>
iterator
;
private
ValueArray
currentRowData
;
ValueArray
currentRowData
;
public
Source
(
Iterator
<
ValueArray
>
iterator
)
{
public
Source
(
Iterator
<
ValueArray
>
iterator
)
{
this
.
iterator
=
iterator
;
this
.
iterator
=
iterator
;
...
@@ -338,7 +338,7 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex {
...
@@ -338,7 +338,7 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex {
* @param key the index key
* @param key the index key
* @return the row
* @return the row
*/
*/
private
SearchRow
convertToSearchRow
(
ValueArray
key
)
{
SearchRow
convertToSearchRow
(
ValueArray
key
)
{
Value
[]
array
=
key
.
getList
();
Value
[]
array
=
key
.
getList
();
SearchRow
searchRow
=
mvTable
.
getTemplateRow
();
SearchRow
searchRow
=
mvTable
.
getTemplateRow
();
searchRow
.
setKey
((
array
[
array
.
length
-
1
]).
getLong
());
searchRow
.
setKey
((
array
[
array
.
length
-
1
]).
getLong
());
...
@@ -481,7 +481,7 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex {
...
@@ -481,7 +481,7 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex {
private
SearchRow
searchRow
;
private
SearchRow
searchRow
;
private
Row
row
;
private
Row
row
;
private
MVStoreCursor
(
Session
session
,
Iterator
<
Value
>
it
,
SearchRow
last
)
{
MVStoreCursor
(
Session
session
,
Iterator
<
Value
>
it
,
SearchRow
last
)
{
this
.
session
=
session
;
this
.
session
=
session
;
this
.
it
=
it
;
this
.
it
=
it
;
this
.
last
=
last
;
this
.
last
=
last
;
...
...
h2/src/main/org/h2/mvstore/db/TransactionStore.java
浏览文件 @
b9b9e11a
...
@@ -896,7 +896,7 @@ public class TransactionStore {
...
@@ -896,7 +896,7 @@ public class TransactionStore {
*/
*/
final
MVMap
<
K
,
VersionedValue
>
map
;
final
MVMap
<
K
,
VersionedValue
>
map
;
private
final
Transaction
transaction
;
final
Transaction
transaction
;
TransactionMap
(
Transaction
transaction
,
MVMap
<
K
,
VersionedValue
>
map
,
TransactionMap
(
Transaction
transaction
,
MVMap
<
K
,
VersionedValue
>
map
,
int
mapId
)
{
int
mapId
)
{
...
...
h2/src/main/org/h2/server/web/WebServer.java
浏览文件 @
b9b9e11a
...
@@ -24,7 +24,6 @@ import java.util.Map;
...
@@ -24,7 +24,6 @@ import java.util.Map;
import
java.util.Map.Entry
;
import
java.util.Map.Entry
;
import
java.util.Properties
;
import
java.util.Properties
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.TimeZone
;
import
org.h2.engine.Constants
;
import
org.h2.engine.Constants
;
import
org.h2.engine.SysProperties
;
import
org.h2.engine.SysProperties
;
import
org.h2.message.DbException
;
import
org.h2.message.DbException
;
...
...
h2/src/main/org/h2/table/Column.java
浏览文件 @
b9b9e11a
...
@@ -497,6 +497,7 @@ public class Column {
...
@@ -497,6 +497,7 @@ public class Column {
}
}
}
}
buff
.
append
(
')'
);
buff
.
append
(
')'
);
break
;
case
Value
.
BYTES
:
case
Value
.
BYTES
:
case
Value
.
STRING
:
case
Value
.
STRING
:
case
Value
.
STRING_IGNORECASE
:
case
Value
.
STRING_IGNORECASE
:
...
...
h2/src/main/org/h2/util/MathUtils.java
浏览文件 @
b9b9e11a
...
@@ -205,7 +205,7 @@ public class MathUtils {
...
@@ -205,7 +205,7 @@ public class MathUtils {
* @param s the message to print
* @param s the message to print
* @param t the stack trace
* @param t the stack trace
*/
*/
private
static
void
warn
(
String
s
,
Throwable
t
)
{
static
void
warn
(
String
s
,
Throwable
t
)
{
// not a fatal problem, but maybe reduced security
// not a fatal problem, but maybe reduced security
System
.
out
.
println
(
"Warning: "
+
s
);
System
.
out
.
println
(
"Warning: "
+
s
);
if
(
t
!=
null
)
{
if
(
t
!=
null
)
{
...
...
h2/src/main/org/h2/util/ToChar.java
浏览文件 @
b9b9e11a
...
@@ -914,7 +914,7 @@ public class ToChar {
...
@@ -914,7 +914,7 @@ public class ToChar {
* @return the capitalization / casing strategy which should be used
* @return the capitalization / casing strategy which should be used
* when the first and second letters have the specified casing
* when the first and second letters have the specified casing
*/
*/
private
static
Capitalization
toCapitalization
(
Boolean
up1
,
Boolean
up2
)
{
static
Capitalization
toCapitalization
(
Boolean
up1
,
Boolean
up2
)
{
if
(
up1
==
null
)
{
if
(
up1
==
null
)
{
return
Capitalization
.
CAPITALIZE
;
return
Capitalization
.
CAPITALIZE
;
}
else
if
(
up2
==
null
)
{
}
else
if
(
up2
==
null
)
{
...
...
h2/src/main/org/h2/value/CharsetCollator.java
浏览文件 @
b9b9e11a
...
@@ -15,7 +15,7 @@ import java.util.Comparator;
...
@@ -15,7 +15,7 @@ import java.util.Comparator;
*/
*/
public
class
CharsetCollator
extends
Collator
{
public
class
CharsetCollator
extends
Collator
{
private
static
final
Comparator
<
byte
[]>
COMPARATOR
=
new
Comparator
<
byte
[]>()
{
static
final
Comparator
<
byte
[]>
COMPARATOR
=
new
Comparator
<
byte
[]>()
{
@Override
@Override
public
int
compare
(
byte
[]
b1
,
byte
[]
b2
)
{
public
int
compare
(
byte
[]
b1
,
byte
[]
b2
)
{
int
minLength
=
Math
.
min
(
b1
.
length
,
b2
.
length
);
int
minLength
=
Math
.
min
(
b1
.
length
,
b2
.
length
);
...
@@ -43,7 +43,7 @@ public class CharsetCollator extends Collator {
...
@@ -43,7 +43,7 @@ public class CharsetCollator extends Collator {
return
COMPARATOR
.
compare
(
toBytes
(
source
),
toBytes
(
target
));
return
COMPARATOR
.
compare
(
toBytes
(
source
),
toBytes
(
target
));
}
}
private
byte
[]
toBytes
(
String
source
)
{
byte
[]
toBytes
(
String
source
)
{
return
source
.
getBytes
(
charset
);
return
source
.
getBytes
(
charset
);
}
}
...
...
h2/src/main/org/h2/value/Value.java
浏览文件 @
b9b9e11a
...
@@ -985,6 +985,7 @@ public abstract class Value {
...
@@ -985,6 +985,7 @@ public abstract class Value {
if
(
DataType
.
isGeometry
(
object
))
{
if
(
DataType
.
isGeometry
(
object
))
{
return
ValueGeometry
.
getFromGeometry
(
object
);
return
ValueGeometry
.
getFromGeometry
(
object
);
}
}
//$FALL-THROUGH$
case
TIMESTAMP_TZ:
case
TIMESTAMP_TZ:
throw
DbException
.
get
(
throw
DbException
.
get
(
ErrorCode
.
DATA_CONVERSION_ERROR_1
,
getString
());
ErrorCode
.
DATA_CONVERSION_ERROR_1
,
getString
());
...
...
h2/src/test/org/h2/test/db/TestGeneralCommonTableQueries.java
浏览文件 @
b9b9e11a
...
@@ -554,13 +554,13 @@ public class TestGeneralCommonTableQueries extends AbstractBaseForCommonTableExp
...
@@ -554,13 +554,13 @@ public class TestGeneralCommonTableQueries extends AbstractBaseForCommonTableExp
config
=
backupConfig
;
config
=
backupConfig
;
}
}
}
}
private
void
testSimple3RowRecursiveQueryDropAllObjects
()
throws
Exception
{
private
void
testSimple3RowRecursiveQueryDropAllObjects
()
throws
Exception
{
String
[]
expectedRowData
=
new
String
[]{
"|6"
};
String
[]
expectedRowData
=
new
String
[]{
"|6"
};
String
[]
expectedColumnTypes
=
new
String
[]{
"BIGINT"
};
String
[]
expectedColumnTypes
=
new
String
[]{
"BIGINT"
};
String
[]
expectedColumnNames
=
new
String
[]{
"SUM(N)"
};
String
[]
expectedColumnNames
=
new
String
[]{
"SUM(N)"
};
String
setupSQL
=
"DROP ALL OBJECTS;"
;
String
setupSQL
=
"DROP ALL OBJECTS;"
;
String
withQuery
=
"select sum(n) from ("
String
withQuery
=
"select sum(n) from ("
+
" with recursive r(n) as ("
+
" with recursive r(n) as ("
...
@@ -574,8 +574,8 @@ public class TestGeneralCommonTableQueries extends AbstractBaseForCommonTableExp
...
@@ -574,8 +574,8 @@ public class TestGeneralCommonTableQueries extends AbstractBaseForCommonTableExp
int
maxRetries
=
10
;
int
maxRetries
=
10
;
int
expectedNumberOfRows
=
expectedRowData
.
length
;
int
expectedNumberOfRows
=
expectedRowData
.
length
;
testRepeatedQueryWithSetup
(
maxRetries
,
expectedRowData
,
expectedColumnNames
,
expectedNumberOfRows
,
setupSQL
,
testRepeatedQueryWithSetup
(
maxRetries
,
expectedRowData
,
expectedColumnNames
,
expectedNumberOfRows
,
setupSQL
,
withQuery
,
maxRetries
-
1
,
expectedColumnTypes
);
withQuery
,
maxRetries
-
1
,
expectedColumnTypes
);
}
}
}
}
h2/src/test/org/h2/test/db/TestPersistentCommonTableExpressions.java
浏览文件 @
b9b9e11a
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
*/
*/
package
org
.
h2
.
test
.
db
;
package
org
.
h2
.
test
.
db
;
import
org.h2.engine.SysProperties
;
import
org.h2.test.TestBase
;
import
org.h2.test.TestBase
;
/**
/**
...
@@ -28,12 +29,18 @@ public class TestPersistentCommonTableExpressions extends AbstractBaseForCommonT
...
@@ -28,12 +29,18 @@ public class TestPersistentCommonTableExpressions extends AbstractBaseForCommonT
testPersistentNonRecursiveTableInCreateView
();
testPersistentNonRecursiveTableInCreateView
();
testPersistentRecursiveTableInCreateView
();
testPersistentRecursiveTableInCreateView
();
testPersistentNonRecursiveTableInCreateViewDropAllObjects
();
testPersistentNonRecursiveTableInCreateViewDropAllObjects
();
testPersistentRecursiveTableInCreateViewDropAllObjects
();
testPersistentRecursiveTableInCreateViewDropAllObjects
();
}
}
private
void
testRecursiveTable
()
throws
Exception
{
private
void
testRecursiveTable
()
throws
Exception
{
String
numericName
;
if
(
SysProperties
.
BIG_DECIMAL_IS_DECIMAL
)
{
numericName
=
"DECIMAL"
;
}
else
{
numericName
=
"NUMERIC"
;
}
String
[]
expectedRowData
=
new
String
[]{
"|meat|null"
,
"|fruit|3"
,
"|veg|2"
};
String
[]
expectedRowData
=
new
String
[]{
"|meat|null"
,
"|fruit|3"
,
"|veg|2"
};
String
[]
expectedColumnTypes
=
new
String
[]{
"VARCHAR"
,
"DECIMAL"
};
String
[]
expectedColumnTypes
=
new
String
[]{
"VARCHAR"
,
numericName
};
String
[]
expectedColumnNames
=
new
String
[]{
"VAL"
,
String
[]
expectedColumnNames
=
new
String
[]{
"VAL"
,
"SUM(SELECT\n"
+
"SUM(SELECT\n"
+
" X\n"
+
" X\n"
+
...
@@ -181,8 +188,8 @@ public class TestPersistentCommonTableExpressions extends AbstractBaseForCommonT
...
@@ -181,8 +188,8 @@ public class TestPersistentCommonTableExpressions extends AbstractBaseForCommonT
testRepeatedQueryWithSetup
(
maxRetries
,
expectedRowData
,
expectedColumnNames
,
expectedNumberOfRows
,
setupSQL
,
testRepeatedQueryWithSetup
(
maxRetries
,
expectedRowData
,
expectedColumnNames
,
expectedNumberOfRows
,
setupSQL
,
withQuery
,
maxRetries
-
1
,
expectedColumnTypes
);
withQuery
,
maxRetries
-
1
,
expectedColumnTypes
);
}
}
private
void
testPersistentNonRecursiveTableInCreateViewDropAllObjects
()
throws
Exception
{
private
void
testPersistentNonRecursiveTableInCreateViewDropAllObjects
()
throws
Exception
{
String
setupSQL
=
""
String
setupSQL
=
""
+
"DROP ALL OBJECTS; \n"
+
"DROP ALL OBJECTS; \n"
+
"CREATE TABLE my_table ( \n"
+
"CREATE TABLE my_table ( \n"
...
@@ -203,7 +210,7 @@ public class TestPersistentCommonTableExpressions extends AbstractBaseForCommonT
...
@@ -203,7 +210,7 @@ public class TestPersistentCommonTableExpressions extends AbstractBaseForCommonT
+
"), \n"
+
"), \n"
+
"unused_cte AS ( SELECT 1 AS unUsedColumn ) \n"
+
"unused_cte AS ( SELECT 1 AS unUsedColumn ) \n"
+
"SELECT sub_tree_root_id, tree_level, parent_fk, child_fk FROM tree_cte_nr; \n"
;
+
"SELECT sub_tree_root_id, tree_level, parent_fk, child_fk FROM tree_cte_nr; \n"
;
String
withQuery
=
"SELECT * FROM v_my_nr_tree"
;
String
withQuery
=
"SELECT * FROM v_my_nr_tree"
;
int
maxRetries
=
6
;
int
maxRetries
=
6
;
String
[]
expectedRowData
=
new
String
[]{
String
[]
expectedRowData
=
new
String
[]{
...
@@ -214,13 +221,13 @@ public class TestPersistentCommonTableExpressions extends AbstractBaseForCommonT
...
@@ -214,13 +221,13 @@ public class TestPersistentCommonTableExpressions extends AbstractBaseForCommonT
"|121|0|12|121"
,
"|121|0|12|121"
,
};
};
String
[]
expectedColumnNames
=
new
String
[]{
"SUB_TREE_ROOT_ID"
,
"TREE_LEVEL"
,
"PARENT_FK"
,
"CHILD_FK"
};
String
[]
expectedColumnNames
=
new
String
[]{
"SUB_TREE_ROOT_ID"
,
"TREE_LEVEL"
,
"PARENT_FK"
,
"CHILD_FK"
};
String
[]
expectedColumnTypes
=
new
String
[]{
"INTEGER"
,
"INTEGER"
,
"INTEGER"
,
"INTEGER"
};
String
[]
expectedColumnTypes
=
new
String
[]{
"INTEGER"
,
"INTEGER"
,
"INTEGER"
,
"INTEGER"
};
int
expectedNumberOfRows
=
5
;
int
expectedNumberOfRows
=
5
;
testRepeatedQueryWithSetup
(
maxRetries
,
expectedRowData
,
expectedColumnNames
,
expectedNumberOfRows
,
setupSQL
,
testRepeatedQueryWithSetup
(
maxRetries
,
expectedRowData
,
expectedColumnNames
,
expectedNumberOfRows
,
setupSQL
,
withQuery
,
maxRetries
-
1
,
expectedColumnTypes
);
withQuery
,
maxRetries
-
1
,
expectedColumnTypes
);
}
}
private
void
testPersistentRecursiveTableInCreateViewDropAllObjects
()
throws
Exception
{
private
void
testPersistentRecursiveTableInCreateViewDropAllObjects
()
throws
Exception
{
String
setuoSQL
=
"--SET TRACE_LEVEL_SYSTEM_OUT 3;\n"
String
setuoSQL
=
"--SET TRACE_LEVEL_SYSTEM_OUT 3;\n"
+
"DROP ALL OBJECTS; \n"
+
"DROP ALL OBJECTS; \n"
+
"CREATE TABLE my_tree ( \n"
+
"CREATE TABLE my_tree ( \n"
...
@@ -245,7 +252,7 @@ public class TestPersistentCommonTableExpressions extends AbstractBaseForCommonT
...
@@ -245,7 +252,7 @@ public class TestPersistentCommonTableExpressions extends AbstractBaseForCommonT
+
"), \n"
+
"), \n"
+
"unused_cte AS ( SELECT 1 AS unUsedColumn ) \n"
+
"unused_cte AS ( SELECT 1 AS unUsedColumn ) \n"
+
"SELECT sub_tree_root_id, tree_level, parent_fk, child_fk FROM tree_cte; \n"
;
+
"SELECT sub_tree_root_id, tree_level, parent_fk, child_fk FROM tree_cte; \n"
;
String
withQuery
=
"SELECT * FROM v_my_tree"
;
String
withQuery
=
"SELECT * FROM v_my_tree"
;
int
maxRetries
=
4
;
int
maxRetries
=
4
;
String
[]
expectedRowData
=
new
String
[]{
"|1|0|null|1"
,
String
[]
expectedRowData
=
new
String
[]{
"|1|0|null|1"
,
...
@@ -261,9 +268,9 @@ public class TestPersistentCommonTableExpressions extends AbstractBaseForCommonT
...
@@ -261,9 +268,9 @@ public class TestPersistentCommonTableExpressions extends AbstractBaseForCommonT
"|1|2|null|121"
"|1|2|null|121"
};
};
String
[]
expectedColumnNames
=
new
String
[]{
"SUB_TREE_ROOT_ID"
,
"TREE_LEVEL"
,
"PARENT_FK"
,
"CHILD_FK"
};
String
[]
expectedColumnNames
=
new
String
[]{
"SUB_TREE_ROOT_ID"
,
"TREE_LEVEL"
,
"PARENT_FK"
,
"CHILD_FK"
};
String
[]
expectedColumnTypes
=
new
String
[]{
"INTEGER"
,
"INTEGER"
,
"INTEGER"
,
"INTEGER"
};
String
[]
expectedColumnTypes
=
new
String
[]{
"INTEGER"
,
"INTEGER"
,
"INTEGER"
,
"INTEGER"
};
int
expectedNumberOfRows
=
11
;
int
expectedNumberOfRows
=
11
;
testRepeatedQueryWithSetup
(
maxRetries
,
expectedRowData
,
expectedColumnNames
,
expectedNumberOfRows
,
setuoSQL
,
testRepeatedQueryWithSetup
(
maxRetries
,
expectedRowData
,
expectedColumnNames
,
expectedNumberOfRows
,
setuoSQL
,
withQuery
,
maxRetries
-
1
,
expectedColumnTypes
);
withQuery
,
maxRetries
-
1
,
expectedColumnTypes
);
}
}
}
}
h2/src/test/org/h2/test/db/TestSetCollation.java
浏览文件 @
b9b9e11a
...
@@ -156,7 +156,6 @@ public class TestSetCollation extends TestBase {
...
@@ -156,7 +156,6 @@ public class TestSetCollation extends TestBase {
private
List
<
String
>
orderedWithCollator
(
String
collator
)
throws
SQLException
{
private
List
<
String
>
orderedWithCollator
(
String
collator
)
throws
SQLException
{
deleteDb
(
DB_NAME
);
deleteDb
(
DB_NAME
);
try
(
Connection
con
=
getConnection
(
DB_NAME
);
Statement
statement
=
con
.
createStatement
())
{
try
(
Connection
con
=
getConnection
(
DB_NAME
);
Statement
statement
=
con
.
createStatement
())
{
;
if
(
collator
!=
null
)
{
if
(
collator
!=
null
)
{
statement
.
execute
(
"SET COLLATION "
+
collator
);
statement
.
execute
(
"SET COLLATION "
+
collator
);
}
}
...
...
h2/src/test/org/h2/test/jdbc/TestCustomDataTypesHandler.java
浏览文件 @
b9b9e11a
...
@@ -439,12 +439,12 @@ public class TestCustomDataTypesHandler extends TestBase {
...
@@ -439,12 +439,12 @@ public class TestCustomDataTypesHandler extends TestBase {
/**
/**
* Real part
* Real part
*/
*/
private
double
re
;
double
re
;
/**
/**
* Imaginary part
* Imaginary part
*/
*/
private
double
im
;
double
im
;
/**
/**
* @param re real part
* @param re real part
...
...
h2/src/test/org/h2/test/mvcc/TestMvccMultiThreaded2.java
浏览文件 @
b9b9e11a
...
@@ -111,6 +111,9 @@ public class TestMvccMultiThreaded2 extends TestBase {
...
@@ -111,6 +111,9 @@ public class TestMvccMultiThreaded2 extends TestBase {
public
int
iterationsProcessed
;
public
int
iterationsProcessed
;
SelectForUpdate
()
{
}
@Override
@Override
public
void
run
()
{
public
void
run
()
{
final
long
start
=
System
.
currentTimeMillis
();
final
long
start
=
System
.
currentTimeMillis
();
...
...
h2/src/tools/org/h2/dev/fs/ArchiveTool.java
浏览文件 @
b9b9e11a
...
@@ -656,7 +656,7 @@ public class ArchiveTool {
...
@@ -656,7 +656,7 @@ public class ArchiveTool {
}
}
}
}
int
[]
key
=
new
int
[
4
];
int
[]
key
=
new
int
[
4
];
;
// TODO test if cs makes a difference
// TODO test if cs makes a difference
key
[
0
]
=
(
int
)
(
min
>>>
32
);
key
[
0
]
=
(
int
)
(
min
>>>
32
);
key
[
1
]
=
(
int
)
min
;
key
[
1
]
=
(
int
)
min
;
key
[
2
]
=
cs
;
key
[
2
]
=
cs
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论