Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
326ed1ff
提交
326ed1ff
authored
1月 14, 2011
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Small changes.
上级
b1858d05
显示空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
204 行增加
和
222 行删除
+204
-222
RuleList.java
h2/src/main/org/h2/bnf/RuleList.java
+6
-7
Parser.java
h2/src/main/org/h2/command/Parser.java
+6
-7
ConnectionInfo.java
h2/src/main/org/h2/engine/ConnectionInfo.java
+5
-6
FunctionIndex.java
h2/src/main/org/h2/index/FunctionIndex.java
+1
-2
DocumentedMBean.java
h2/src/main/org/h2/jmx/DocumentedMBean.java
+1
-2
Trace.java
h2/src/main/org/h2/message/Trace.java
+3
-3
LobStorage.java
h2/src/main/org/h2/store/LobStorage.java
+2
-2
PageStore.java
h2/src/main/org/h2/store/PageStore.java
+2
-2
TableFilter.java
h2/src/main/org/h2/table/TableFilter.java
+2
-2
SimpleResultSet.java
h2/src/main/org/h2/tools/SimpleResultSet.java
+1
-1
CacheTQ.java
h2/src/main/org/h2/util/CacheTQ.java
+1
-2
Utils.java
h2/src/main/org/h2/util/Utils.java
+2
-4
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+148
-149
TestMultiDimension.java
h2/src/test/org/h2/test/db/TestMultiDimension.java
+1
-1
TestLobApi.java
h2/src/test/org/h2/test/jdbc/TestLobApi.java
+2
-4
TestNestedJoins.java
h2/src/test/org/h2/test/synth/TestNestedJoins.java
+9
-11
TestOuterJoins.java
h2/src/test/org/h2/test/synth/TestOuterJoins.java
+9
-11
TestRandomCompare.java
h2/src/test/org/h2/test/synth/TestRandomCompare.java
+3
-5
TestCache.java
h2/src/test/org/h2/test/unit/TestCache.java
+0
-1
没有找到文件。
h2/src/main/org/h2/bnf/RuleList.java
浏览文件 @
326ed1ff
...
...
@@ -58,7 +58,7 @@ public class RuleList implements Rule {
}
}
return
false
;
}
else
{
}
for
(
Rule
r
:
list
)
{
if
(!
r
.
autoComplete
(
sentence
))
{
sentence
.
setQuery
(
old
);
...
...
@@ -67,6 +67,5 @@ public class RuleList implements Rule {
}
return
true
;
}
}
}
h2/src/main/org/h2/command/Parser.java
浏览文件 @
326ed1ff
...
...
@@ -4770,7 +4770,7 @@ public class Parser {
if
(
readIf
(
"NO"
))
{
read
(
"ACTION"
);
return
ConstraintReferential
.
RESTRICT
;
}
else
{
}
read
(
"SET"
);
if
(
readIf
(
"NULL"
))
{
return
ConstraintReferential
.
SET_NULL
;
...
...
@@ -4778,7 +4778,6 @@ public class Parser {
read
(
"DEFAULT"
);
return
ConstraintReferential
.
SET_DEFAULT
;
}
}
private
Integer
parseCascadeOrRestrict
()
{
if
(
readIf
(
"CASCADE"
))
{
...
...
h2/src/main/org/h2/engine/ConnectionInfo.java
浏览文件 @
326ed1ff
...
...
@@ -278,14 +278,13 @@ public class ConnectionInfo implements Cloneable {
private
byte
[]
hashPassword
(
boolean
passwordHash
,
String
userName
,
char
[]
password
)
{
if
(
passwordHash
)
{
return
StringUtils
.
convertStringToBytes
(
new
String
(
password
));
}
else
{
}
if
(
userName
.
length
()
==
0
&&
password
.
length
==
0
&&
SysProperties
.
EMPTY_PASSWORD
)
{
return
new
byte
[
0
];
}
SHA256
sha
=
new
SHA256
();
return
sha
.
getKeyPasswordHash
(
userName
,
password
);
}
}
/**
* Get a boolean property if it is set and return the value.
...
...
h2/src/main/org/h2/index/FunctionIndex.java
浏览文件 @
326ed1ff
...
...
@@ -41,9 +41,8 @@ public class FunctionIndex extends BaseIndex {
public
Cursor
find
(
Session
session
,
SearchRow
first
,
SearchRow
last
)
{
if
(
functionTable
.
isFast
())
{
return
new
FunctionCursorResultSet
(
session
,
functionTable
.
getResultSet
(
session
));
}
else
{
return
new
FunctionCursor
(
functionTable
.
getResult
(
session
));
}
return
new
FunctionCursor
(
functionTable
.
getResult
(
session
));
}
public
double
getCost
(
Session
session
,
int
[]
masks
)
{
...
...
h2/src/main/org/h2/jmx/DocumentedMBean.java
浏览文件 @
326ed1ff
...
...
@@ -68,9 +68,8 @@ public class DocumentedMBean extends StandardMBean {
protected
int
getImpact
(
MBeanOperationInfo
info
)
{
if
(
info
.
getName
().
startsWith
(
"list"
))
{
return
MBeanOperationInfo
.
INFO
;
}
else
{
return
MBeanOperationInfo
.
ACTION
;
}
return
MBeanOperationInfo
.
ACTION
;
}
}
h2/src/main/org/h2/message/Trace.java
浏览文件 @
326ed1ff
...
...
@@ -162,7 +162,7 @@ public class Trace {
*/
public
void
error
(
Throwable
t
,
String
s
,
Object
...
params
)
{
if
(
isEnabled
(
TraceSystem
.
ERROR
))
{
s
=
MessageFormat
.
format
(
s
,
(
Object
[])
params
);
s
=
MessageFormat
.
format
(
s
,
params
);
traceWriter
.
write
(
TraceSystem
.
ERROR
,
module
,
s
,
t
);
}
}
...
...
@@ -186,7 +186,7 @@ public class Trace {
*/
public
void
info
(
String
s
,
Object
...
params
)
{
if
(
isEnabled
(
TraceSystem
.
INFO
))
{
s
=
MessageFormat
.
format
(
s
,
(
Object
[])
params
);
s
=
MessageFormat
.
format
(
s
,
params
);
traceWriter
.
write
(
TraceSystem
.
INFO
,
module
,
s
,
null
);
}
}
...
...
@@ -255,7 +255,7 @@ public class Trace {
*/
public
void
debug
(
String
s
,
Object
...
params
)
{
if
(
isEnabled
(
TraceSystem
.
DEBUG
))
{
s
=
MessageFormat
.
format
(
s
,
(
Object
[])
params
);
s
=
MessageFormat
.
format
(
s
,
params
);
traceWriter
.
write
(
TraceSystem
.
DEBUG
,
module
,
s
,
null
);
}
}
...
...
h2/src/main/org/h2/store/LobStorage.java
浏览文件 @
326ed1ff
...
...
@@ -422,7 +422,7 @@ public class LobStorage {
private
long
getHashCacheBlock
(
int
hash
)
{
if
(
HASH_CACHE_SIZE
>
0
)
{
int
index
=
(
int
)
(
hash
&
(
HASH_CACHE_SIZE
-
1
)
);
int
index
=
hash
&
(
HASH_CACHE_SIZE
-
1
);
long
oldHash
=
hashBlocks
[
index
];
if
(
oldHash
==
hash
)
{
return
hashBlocks
[
index
+
HASH_CACHE_SIZE
];
...
...
@@ -433,7 +433,7 @@ public class LobStorage {
private
void
setHashCacheBlock
(
int
hash
,
long
block
)
{
if
(
HASH_CACHE_SIZE
>
0
)
{
int
index
=
(
int
)
(
hash
&
(
HASH_CACHE_SIZE
-
1
)
);
int
index
=
hash
&
(
HASH_CACHE_SIZE
-
1
);
hashBlocks
[
index
]
=
hash
;
hashBlocks
[
index
+
HASH_CACHE_SIZE
]
=
block
;
}
...
...
h2/src/main/org/h2/store/PageStore.java
浏览文件 @
326ed1ff
...
...
@@ -1492,7 +1492,7 @@ public class PageStore implements CacheWriter {
if
(
add
)
{
addMeta
(
row
,
systemSession
,
true
);
}
else
{
removeMeta
(
logPos
,
row
);
removeMeta
(
row
);
}
}
Index
index
=
metaObjects
.
get
(
tableId
);
...
...
@@ -1565,7 +1565,7 @@ public class PageStore implements CacheWriter {
}
}
private
void
removeMeta
(
int
logPos
,
Row
row
)
{
private
void
removeMeta
(
Row
row
)
{
int
id
=
row
.
getValue
(
0
).
getInt
();
PageIndex
index
=
metaObjects
.
get
(
id
);
index
.
getTable
().
removeIndex
(
index
);
...
...
h2/src/main/org/h2/table/TableFilter.java
浏览文件 @
326ed1ff
...
...
@@ -621,7 +621,7 @@ public class TableFilter implements ColumnResolver {
do
{
buffNested
.
append
(
n
.
getPlanSQL
(
n
!=
nestedJoin
));
buffNested
.
append
(
"\n"
);
n
=
(
TableFilter
)
n
.
getJoin
();
n
=
n
.
getJoin
();
}
while
(
n
!=
null
);
buff
.
append
(
"(\n"
);
...
...
@@ -943,7 +943,7 @@ public class TableFilter implements ColumnResolver {
if
(
n
!=
null
)
{
n
.
visit
(
visitor
);
}
f
=
(
TableFilter
)
f
.
join
;
f
=
f
.
join
;
}
while
(
f
!=
null
);
}
...
...
h2/src/main/org/h2/tools/SimpleResultSet.java
浏览文件 @
326ed1ff
...
...
@@ -1622,7 +1622,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
private
void
checkColumnIndex
(
int
columnIndex
)
throws
SQLException
{
if
(
columnIndex
<
0
||
columnIndex
>=
columns
.
size
())
{
throw
DbException
.
getInvalidValueException
(
"columnIndex"
,
columnIndex
).
getSQLException
();
throw
DbException
.
getInvalidValueException
(
"columnIndex"
,
columnIndex
+
1
).
getSQLException
();
}
}
...
...
h2/src/main/org/h2/util/CacheTQ.java
浏览文件 @
326ed1ff
...
...
@@ -114,9 +114,8 @@ public class CacheTQ implements Cache {
public
CacheObject
update
(
int
pos
,
CacheObject
record
)
{
if
(
lru
.
find
(
pos
)
!=
null
)
{
return
lru
.
update
(
pos
,
record
);
}
else
{
return
fifo
.
update
(
pos
,
record
);
}
return
fifo
.
update
(
pos
,
record
);
}
}
h2/src/main/org/h2/util/Utils.java
浏览文件 @
326ed1ff
...
...
@@ -455,9 +455,8 @@ public class Utils {
in
=
Utils
.
class
.
getResourceAsStream
(
name
);
if
(
in
==
null
)
{
return
null
;
}
else
{
return
IOUtils
.
readBytesAndClose
(
in
,
0
);
}
return
IOUtils
.
readBytesAndClose
(
in
,
0
);
}
ZipInputStream
zipIn
=
new
ZipInputStream
(
in
);
try
{
...
...
@@ -475,9 +474,8 @@ public class Utils {
IOUtils
.
copy
(
zipIn
,
out
);
zipIn
.
closeEntry
();
return
out
.
toByteArray
();
}
else
{
zipIn
.
closeEntry
();
}
zipIn
.
closeEntry
();
}
}
catch
(
IOException
e
)
{
// if this happens we have a real problem
...
...
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
326ed1ff
...
...
@@ -326,7 +326,6 @@ java org.h2.test.TestAll timer
System
.
setProperty
(
"h2.maxMemoryRowsDistinct"
,
"128"
);
System
.
setProperty
(
"h2.check2"
,
"true"
);
int
initialTest
;
// System.setProperty("h2.lobInDatabase", "true");
// test.nestedJoins = true;
// System.setProperty("h2.largeTransactions", "true");
...
...
@@ -335,7 +334,7 @@ java org.h2.test.TestAll timer
// System.setProperty("h2.queryCacheSize", "100");
// System.setProperty("h2.dropRestrict", "true");
int
speedup
;
// speedup
// System.setProperty("h2.syncMethod", "");
/*
...
...
@@ -524,159 +523,159 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
beforeTest
();
// db
new
TestScriptSimple
().
runTest
(
this
);
new
TestScript
().
runTest
(
this
);
new
TestAlter
().
runTest
(
this
);
new
TestAlterSchemaRename
().
runTest
(
this
);
new
TestAutoRecompile
().
runTest
(
this
);
new
TestBitField
().
runTest
(
this
);
new
TestBackup
().
runTest
(
this
);
new
TestBigDb
().
runTest
(
this
);
new
TestBigResult
().
runTest
(
this
);
new
TestCases
().
runTest
(
this
);
new
TestCheckpoint
().
runTest
(
this
);
new
TestCluster
().
runTest
(
this
);
new
TestCompatibility
().
runTest
(
this
);
new
TestCsv
().
runTest
(
this
);
new
TestDeadlock
().
runTest
(
this
);
new
TestEncryptedDb
().
runTest
(
this
);
new
TestExclusive
().
runTest
(
this
);
new
TestFullText
().
runTest
(
this
);
new
TestFunctionOverload
().
runTest
(
this
);
new
TestFunctions
().
runTest
(
this
);
new
TestInit
().
runTest
(
this
);
new
TestIndex
().
runTest
(
this
);
new
TestLargeBlob
().
runTest
(
this
);
new
TestLinkedTable
().
runTest
(
this
);
new
TestListener
().
runTest
(
this
);
new
TestLob
().
runTest
(
this
);
new
TestMemoryUsage
().
runTest
(
this
);
new
TestMultiConn
().
runTest
(
this
);
new
TestMultiDimension
().
runTest
(
this
);
new
TestMultiThread
().
runTest
(
this
);
new
TestMultiThreadedKernel
().
runTest
(
this
);
//
new TestScriptSimple().runTest(this);
//
new TestScript().runTest(this);
//
new TestAlter().runTest(this);
//
new TestAlterSchemaRename().runTest(this);
//
new TestAutoRecompile().runTest(this);
//
new TestBitField().runTest(this);
//
new TestBackup().runTest(this);
//
new TestBigDb().runTest(this);
//
new TestBigResult().runTest(this);
//
new TestCases().runTest(this);
//
new TestCheckpoint().runTest(this);
//
new TestCluster().runTest(this);
//
new TestCompatibility().runTest(this);
//
new TestCsv().runTest(this);
//
new TestDeadlock().runTest(this);
//
new TestEncryptedDb().runTest(this);
//
new TestExclusive().runTest(this);
//
new TestFullText().runTest(this);
//
new TestFunctionOverload().runTest(this);
//
new TestFunctions().runTest(this);
//
new TestInit().runTest(this);
//
new TestIndex().runTest(this);
//
new TestLargeBlob().runTest(this);
//
new TestLinkedTable().runTest(this);
//
new TestListener().runTest(this);
//
new TestLob().runTest(this);
//
new TestMemoryUsage().runTest(this);
//
new TestMultiConn().runTest(this);
//
new TestMultiDimension().runTest(this);
//
new TestMultiThread().runTest(this);
//
new TestMultiThreadedKernel().runTest(this);
new
TestOpenClose
().
runTest
(
this
);
new
TestOptimizations
().
runTest
(
this
);
new
TestOutOfMemory
().
runTest
(
this
);
new
TestPowerOff
().
runTest
(
this
);
new
TestQueryCache
().
runTest
(
this
);
new
TestReadOnly
().
runTest
(
this
);
new
TestRecursiveQueries
().
runTest
(
this
);
new
TestRights
().
runTest
(
this
);
new
TestRunscript
().
runTest
(
this
);
new
TestSQLInjection
().
runTest
(
this
);
new
TestSessionsLocks
().
runTest
(
this
);
new
TestSequence
().
runTest
(
this
);
new
TestSpaceReuse
().
runTest
(
this
);
new
TestSpeed
().
runTest
(
this
);
new
TestTableEngines
().
runTest
(
this
);
new
TestTempTables
().
runTest
(
this
);
new
TestTransaction
().
runTest
(
this
);
new
TestTriggersConstraints
().
runTest
(
this
);
new
TestTwoPhaseCommit
().
runTest
(
this
);
new
TestView
().
runTest
(
this
);
new
TestViewAlterTable
().
runTest
(
this
);
new
TestViewDropView
().
runTest
(
this
);
// jaqu
new
AliasMapTest
().
runTest
(
this
);
new
SamplesTest
().
runTest
(
this
);
new
UpdateTest
().
runTest
(
this
);
// jdbc
new
TestBatchUpdates
().
runTest
(
this
);
new
TestCallableStatement
().
runTest
(
this
);
new
TestCancel
().
runTest
(
this
);
new
TestDatabaseEventListener
().
runTest
(
this
);
new
TestDriver
().
runTest
(
this
);
new
TestLobApi
().
runTest
(
this
);
new
TestManyJdbcObjects
().
runTest
(
this
);
new
TestMetaData
().
runTest
(
this
);
new
TestNativeSQL
().
runTest
(
this
);
new
TestPreparedStatement
().
runTest
(
this
);
new
TestResultSet
().
runTest
(
this
);
new
TestStatement
().
runTest
(
this
);
new
TestTransactionIsolation
().
runTest
(
this
);
new
TestUpdatableResultSet
().
runTest
(
this
);
new
TestZloty
().
runTest
(
this
);
// jdbcx
new
TestConnectionPool
().
runTest
(
this
);
new
TestDataSource
().
runTest
(
this
);
new
TestXA
().
runTest
(
this
);
new
TestXASimple
().
runTest
(
this
);
// server
new
TestAutoServer
().
runTest
(
this
);
new
TestNestedLoop
().
runTest
(
this
);
new
TestWeb
().
runTest
(
this
);
// mvcc & row level locking
new
TestMvcc1
().
runTest
(
this
);
new
TestMvcc2
().
runTest
(
this
);
new
TestMvcc3
().
runTest
(
this
);
new
TestMvccMultiThreaded
().
runTest
(
this
);
new
TestRowLocks
().
runTest
(
this
);
// synth
new
TestBtreeIndex
().
runTest
(
this
);
new
TestCrashAPI
().
runTest
(
this
);
new
TestFuzzOptimizations
().
runTest
(
this
);
new
TestRandomSQL
().
runTest
(
this
);
new
TestRandomCompare
().
runTest
(
this
);
new
TestKillRestart
().
runTest
(
this
);
new
TestKillRestartMulti
().
runTest
(
this
);
new
TestMultiThreaded
().
runTest
(
this
);
new
TestOuterJoins
().
runTest
(
this
);
new
TestNestedJoins
().
runTest
(
this
);
//
new TestOptimizations().runTest(this);
//
new TestOutOfMemory().runTest(this);
//
new TestPowerOff().runTest(this);
//
new TestQueryCache().runTest(this);
//
new TestReadOnly().runTest(this);
//
new TestRecursiveQueries().runTest(this);
//
new TestRights().runTest(this);
//
new TestRunscript().runTest(this);
//
new TestSQLInjection().runTest(this);
//
new TestSessionsLocks().runTest(this);
//
new TestSequence().runTest(this);
//
new TestSpaceReuse().runTest(this);
//
new TestSpeed().runTest(this);
//
new TestTableEngines().runTest(this);
//
new TestTempTables().runTest(this);
//
new TestTransaction().runTest(this);
//
new TestTriggersConstraints().runTest(this);
//
new TestTwoPhaseCommit().runTest(this);
//
new TestView().runTest(this);
//
new TestViewAlterTable().runTest(this);
//
new TestViewDropView().runTest(this);
//
//
// jaqu
//
new AliasMapTest().runTest(this);
//
new SamplesTest().runTest(this);
//
new UpdateTest().runTest(this);
//
//
// jdbc
//
new TestBatchUpdates().runTest(this);
//
new TestCallableStatement().runTest(this);
//
new TestCancel().runTest(this);
//
new TestDatabaseEventListener().runTest(this);
//
new TestDriver().runTest(this);
//
new TestLobApi().runTest(this);
//
new TestManyJdbcObjects().runTest(this);
//
new TestMetaData().runTest(this);
//
new TestNativeSQL().runTest(this);
//
new TestPreparedStatement().runTest(this);
//
new TestResultSet().runTest(this);
//
new TestStatement().runTest(this);
//
new TestTransactionIsolation().runTest(this);
//
new TestUpdatableResultSet().runTest(this);
//
new TestZloty().runTest(this);
//
//
// jdbcx
//
new TestConnectionPool().runTest(this);
//
new TestDataSource().runTest(this);
//
new TestXA().runTest(this);
//
new TestXASimple().runTest(this);
//
//
// server
//
new TestAutoServer().runTest(this);
//
new TestNestedLoop().runTest(this);
//
new TestWeb().runTest(this);
//
//
// mvcc & row level locking
//
new TestMvcc1().runTest(this);
//
new TestMvcc2().runTest(this);
//
new TestMvcc3().runTest(this);
//
new TestMvccMultiThreaded().runTest(this);
//
new TestRowLocks().runTest(this);
//
//
// synth
//
new TestBtreeIndex().runTest(this);
//
new TestCrashAPI().runTest(this);
//
new TestFuzzOptimizations().runTest(this);
//
new TestRandomSQL().runTest(this);
//
new TestRandomCompare().runTest(this);
//
new TestKillRestart().runTest(this);
//
new TestKillRestartMulti().runTest(this);
//
new TestMultiThreaded().runTest(this);
//
new TestOuterJoins().runTest(this);
//
new TestNestedJoins().runTest(this);
afterTest
();
}
private
void
testUnit
()
{
new
TestAutoReconnect
().
runTest
(
this
);
new
TestCache
().
runTest
(
this
);
new
TestClearReferences
().
runTest
(
this
);
new
TestCompress
().
runTest
(
this
);
new
TestConnectionInfo
().
runTest
(
this
);
new
TestDataPage
().
runTest
(
this
);
new
TestDate
().
runTest
(
this
);
new
TestDateIso8601
().
runTest
(
this
);
new
TestExit
().
runTest
(
this
);
new
TestFile
().
runTest
(
this
);
new
TestFileLock
().
runTest
(
this
);
new
TestFileLockSerialized
().
runTest
(
this
);
new
TestFtp
().
runTest
(
this
);
new
TestFileSystem
().
runTest
(
this
);
new
TestIntArray
().
runTest
(
this
);
new
TestIntIntHashMap
().
runTest
(
this
);
new
TestJmx
().
runTest
(
this
);
new
TestMathUtils
().
runTest
(
this
);
new
TestOldVersion
().
runTest
(
this
);
new
TestNetUtils
().
runTest
(
this
);
new
TestMultiThreadedKernel
().
runTest
(
this
);
new
TestOverflow
().
runTest
(
this
);
new
TestPageStore
().
runTest
(
this
);
new
TestPageStoreCoverage
().
runTest
(
this
);
new
TestPattern
().
runTest
(
this
);
new
TestPgServer
().
runTest
(
this
);
new
TestReader
().
runTest
(
this
);
new
TestRecovery
().
runTest
(
this
);
new
TestSampleApps
().
runTest
(
this
);
new
TestScriptReader
().
runTest
(
this
);
runTest
(
"org.h2.test.unit.TestServlet"
);
new
TestSecurity
().
runTest
(
this
);
new
TestShell
().
runTest
(
this
);
new
TestStreams
().
runTest
(
this
);
new
TestStringCache
().
runTest
(
this
);
new
TestStringUtils
().
runTest
(
this
);
new
TestTools
().
runTest
(
this
);
new
TestTraceSystem
().
runTest
(
this
);
new
TestUpgrade
().
runTest
(
this
);
new
TestUtils
().
runTest
(
this
);
new
TestValue
().
runTest
(
this
);
new
TestValueHashMap
().
runTest
(
this
);
new
TestValueMemory
().
runTest
(
this
);
//
new TestAutoReconnect().runTest(this);
//
new TestCache().runTest(this);
//
new TestClearReferences().runTest(this);
//
new TestCompress().runTest(this);
//
new TestConnectionInfo().runTest(this);
//
new TestDataPage().runTest(this);
//
new TestDate().runTest(this);
//
new TestDateIso8601().runTest(this);
//
new TestExit().runTest(this);
//
new TestFile().runTest(this);
//
new TestFileLock().runTest(this);
//
new TestFileLockSerialized().runTest(this);
//
new TestFtp().runTest(this);
//
new TestFileSystem().runTest(this);
//
new TestIntArray().runTest(this);
//
new TestIntIntHashMap().runTest(this);
//
new TestJmx().runTest(this);
//
new TestMathUtils().runTest(this);
//
new TestOldVersion().runTest(this);
//
new TestNetUtils().runTest(this);
//
new TestMultiThreadedKernel().runTest(this);
//
new TestOverflow().runTest(this);
//
new TestPageStore().runTest(this);
//
new TestPageStoreCoverage().runTest(this);
//
new TestPattern().runTest(this);
//
new TestPgServer().runTest(this);
//
new TestReader().runTest(this);
//
new TestRecovery().runTest(this);
//
new TestSampleApps().runTest(this);
//
new TestScriptReader().runTest(this);
//
runTest("org.h2.test.unit.TestServlet");
//
new TestSecurity().runTest(this);
//
new TestShell().runTest(this);
//
new TestStreams().runTest(this);
//
new TestStringCache().runTest(this);
//
new TestStringUtils().runTest(this);
//
new TestTools().runTest(this);
//
new TestTraceSystem().runTest(this);
//
new TestUpgrade().runTest(this);
//
new TestUtils().runTest(this);
//
new TestValue().runTest(this);
//
new TestValueHashMap().runTest(this);
//
new TestValueMemory().runTest(this);
}
private
void
runTest
(
String
className
)
{
...
...
h2/src/test/org/h2/test/db/TestMultiDimension.java
浏览文件 @
326ed1ff
...
...
@@ -53,7 +53,7 @@ public class TestMultiDimension extends TestBase {
assertEquals
(
5
,
m
.
interleave
(
new
int
[]{
3
,
0
}));
assertEquals
(
10
,
m
.
interleave
(
0
,
3
));
assertEquals
(
10
,
m
.
interleave
(
new
int
[]
{
0
,
3
}));
long
v
=
(
long
)
Integer
.
MAX_VALUE
|
((
long
)
Integer
.
MAX_VALUE
<<
31L
);
long
v
=
Integer
.
MAX_VALUE
|
((
long
)
Integer
.
MAX_VALUE
<<
31L
);
assertEquals
(
v
,
m
.
interleave
(
Integer
.
MAX_VALUE
,
Integer
.
MAX_VALUE
));
assertEquals
(
v
,
m
.
interleave
(
new
int
[]
{
Integer
.
MAX_VALUE
,
Integer
.
MAX_VALUE
}));
Random
random
=
new
Random
(
1
);
...
...
h2/src/test/org/h2/test/jdbc/TestLobApi.java
浏览文件 @
326ed1ff
...
...
@@ -73,9 +73,8 @@ public class TestLobApi extends TestBase {
if
(
pos
>
100001
)
{
if
(
ioException
)
{
throw
new
IOException
(
""
);
}
else
{
throw
new
IllegalStateException
();
}
throw
new
IllegalStateException
();
}
return
len
;
}
...
...
@@ -99,9 +98,8 @@ public class TestLobApi extends TestBase {
if
(
pos
>
100001
)
{
if
(
ioException
)
{
throw
new
IOException
(
""
);
}
else
{
throw
new
IllegalStateException
();
}
throw
new
IllegalStateException
();
}
return
0
;
}
...
...
h2/src/test/org/h2/test/synth/TestNestedJoins.java
浏览文件 @
326ed1ff
...
...
@@ -127,14 +127,12 @@ public class TestNestedJoins extends TestBase {
// System.out.println(se);
// System.out.println(" " + sql);
}
if
(
e
!=
null
)
{
if
(
shortest
==
null
||
sql
.
length
()
<
shortest
.
length
())
{
shortest
=
sql
;
shortestEx
=
e
;
}
}
}
}
if
(
shortest
!=
null
)
{
shortestEx
.
printStackTrace
();
fail
(
shortest
+
" "
+
shortestEx
);
...
...
@@ -338,7 +336,7 @@ public class TestNestedJoins extends TestBase {
stat
.
execute
(
"insert into t4 values(1,1), (2,2), (3,3), (4,4)"
);
rs
=
stat
.
executeQuery
(
"explain select distinct t1.a, t2.a, t3.a from t1 right outer join t3 on t1.b=t3.a right outer join t2 on t2.b=t1.a"
);
assertTrue
(
rs
.
next
());
sql
=
cleanRemarks
(
conn
,
rs
.
getString
(
1
));
sql
=
cleanRemarks
(
rs
.
getString
(
1
));
assertEquals
(
"SELECT DISTINCT T1.A, T2.A, T3.A FROM PUBLIC.T2 LEFT OUTER JOIN ( PUBLIC.T3 LEFT OUTER JOIN ( PUBLIC.T1 ) ON T1.B = T3.A ) ON T2.B = T1.A"
,
sql
);
rs
=
stat
.
executeQuery
(
"select distinct t1.a, t2.a, t3.a from t1 right outer join t3 on t1.b=t3.a right outer join t2 on t2.b=t1.a"
);
// expected: 1 1 1; null 2 null
...
...
@@ -372,7 +370,7 @@ public class TestNestedJoins extends TestBase {
stat
.
execute
(
"insert into c values(1), (2)"
);
rs
=
stat
.
executeQuery
(
"explain select a.x, b.x, c.x from a inner join b on a.x = b.x right outer join c on c.x = a.x"
);
assertTrue
(
rs
.
next
());
sql
=
cleanRemarks
(
conn
,
rs
.
getString
(
1
));
sql
=
cleanRemarks
(
rs
.
getString
(
1
));
assertEquals
(
"SELECT A.X, B.X, C.X FROM PUBLIC.C LEFT OUTER JOIN ( PUBLIC.A INNER JOIN PUBLIC.B ON A.X = B.X ) ON C.X = A.X"
,
sql
);
rs
=
stat
.
executeQuery
(
"select a.x, b.x, c.x from a inner join b on a.x = b.x right outer join c on c.x = a.x"
);
// expected result: 1 1 1; null null 2
...
...
@@ -414,7 +412,7 @@ public class TestNestedJoins extends TestBase {
"on b.x = c.y) "
+
"on a.x = c.x"
);
assertTrue
(
rs
.
next
());
sql
=
cleanRemarks
(
conn
,
rs
.
getString
(
1
));
sql
=
cleanRemarks
(
rs
.
getString
(
1
));
assertEquals
(
"SELECT A.X, B.X, C.X, C.Y FROM PUBLIC.A "
+
"LEFT OUTER JOIN ( PUBLIC.B "
+
"LEFT OUTER JOIN PUBLIC.C "
+
...
...
@@ -495,7 +493,7 @@ public class TestNestedJoins extends TestBase {
"left outer join (b "
+
"inner join c on c.x = 1) on a.x = b.x"
);
assertTrue
(
rs
.
next
());
sql
=
cleanRemarks
(
conn
,
rs
.
getString
(
1
));
sql
=
cleanRemarks
(
rs
.
getString
(
1
));
assertEquals
(
"SELECT A.X, B.X, C.X FROM PUBLIC.A "
+
"LEFT OUTER JOIN ( PUBLIC.B "
+
"INNER JOIN PUBLIC.C ON C.X = 1 ) ON A.X = B.X"
,
sql
);
...
...
@@ -541,7 +539,7 @@ public class TestNestedJoins extends TestBase {
"left outer join (b inner join base b_base "
+
"on b.pk = b_base.pk and b_base.deleted = 0) on 1=1"
);
assertTrue
(
rs
.
next
());
sql
=
cleanRemarks
(
conn
,
rs
.
getString
(
1
));
sql
=
cleanRemarks
(
rs
.
getString
(
1
));
assertEquals
(
"SELECT A.PK, A_BASE.PK, B.PK, B_BASE.PK FROM PUBLIC.BASE A_BASE "
+
"LEFT OUTER JOIN ( PUBLIC.B "
+
"INNER JOIN PUBLIC.BASE B_BASE "
+
...
...
@@ -571,7 +569,7 @@ public class TestNestedJoins extends TestBase {
deleteDb
(
"nestedJoins"
);
}
private
String
cleanRemarks
(
Connection
conn
,
String
sql
)
throws
SQLException
{
private
String
cleanRemarks
(
String
sql
)
throws
SQLException
{
ScriptReader
r
=
new
ScriptReader
(
new
StringReader
(
sql
));
r
.
setSkipRemarks
(
true
);
sql
=
r
.
readStatement
();
...
...
h2/src/test/org/h2/test/synth/TestOuterJoins.java
浏览文件 @
326ed1ff
...
...
@@ -118,14 +118,12 @@ public class TestOuterJoins extends TestBase {
// SQLException se = (SQLException) e;
// System.out.println(se);
}
if
(
e
!=
null
)
{
if
(
shortest
==
null
||
sql
.
length
()
<
shortest
.
length
())
{
shortest
=
sql
;
shortestEx
=
e
;
}
}
}
}
if
(
shortest
!=
null
)
{
shortestEx
.
printStackTrace
();
fail
(
shortest
+
" "
+
shortestEx
);
...
...
@@ -330,7 +328,7 @@ public class TestOuterJoins extends TestBase {
stat
.
execute
(
"insert into t4 values(1,1), (2,2), (3,3), (4,4)"
);
rs
=
stat
.
executeQuery
(
"explain select distinct t1.a, t2.a, t3.a from t1 right outer join t3 on t1.b=t3.a right outer join t2 on t2.b=t1.a"
);
assertTrue
(
rs
.
next
());
sql
=
cleanRemarks
(
conn
,
rs
.
getString
(
1
));
sql
=
cleanRemarks
(
rs
.
getString
(
1
));
assertEquals
(
"SELECT DISTINCT T1.A, T2.A, T3.A FROM PUBLIC.T2 LEFT OUTER JOIN ( PUBLIC.T3 LEFT OUTER JOIN ( PUBLIC.T1 ) ON T1.B = T3.A ) ON T2.B = T1.A"
,
sql
);
rs
=
stat
.
executeQuery
(
"select distinct t1.a, t2.a, t3.a from t1 right outer join t3 on t1.b=t3.a right outer join t2 on t2.b=t1.a"
);
// expected: 1 1 1; null 2 null
...
...
@@ -364,7 +362,7 @@ public class TestOuterJoins extends TestBase {
stat
.
execute
(
"insert into c values(1), (2)"
);
rs
=
stat
.
executeQuery
(
"explain select a.x, b.x, c.x from a inner join b on a.x = b.x right outer join c on c.x = a.x"
);
assertTrue
(
rs
.
next
());
sql
=
cleanRemarks
(
conn
,
rs
.
getString
(
1
));
sql
=
cleanRemarks
(
rs
.
getString
(
1
));
assertEquals
(
"SELECT A.X, B.X, C.X FROM PUBLIC.C LEFT OUTER JOIN ( PUBLIC.A INNER JOIN PUBLIC.B ON A.X = B.X ) ON C.X = A.X"
,
sql
);
rs
=
stat
.
executeQuery
(
"select a.x, b.x, c.x from a inner join b on a.x = b.x right outer join c on c.x = a.x"
);
// expected result: 1 1 1; null null 2
...
...
@@ -406,7 +404,7 @@ public class TestOuterJoins extends TestBase {
"on b.x = c.y) "
+
"on a.x = c.x"
);
assertTrue
(
rs
.
next
());
sql
=
cleanRemarks
(
conn
,
rs
.
getString
(
1
));
sql
=
cleanRemarks
(
rs
.
getString
(
1
));
assertEquals
(
"SELECT A.X, B.X, C.X, C.Y FROM PUBLIC.A "
+
"LEFT OUTER JOIN ( PUBLIC.B "
+
"LEFT OUTER JOIN PUBLIC.C "
+
...
...
@@ -487,7 +485,7 @@ public class TestOuterJoins extends TestBase {
"left outer join (b "
+
"inner join c on c.x = 1) on a.x = b.x"
);
assertTrue
(
rs
.
next
());
sql
=
cleanRemarks
(
conn
,
rs
.
getString
(
1
));
sql
=
cleanRemarks
(
rs
.
getString
(
1
));
assertEquals
(
"SELECT A.X, B.X, C.X FROM PUBLIC.A "
+
"LEFT OUTER JOIN ( PUBLIC.B "
+
"INNER JOIN PUBLIC.C ON C.X = 1 ) ON A.X = B.X"
,
sql
);
...
...
@@ -533,7 +531,7 @@ public class TestOuterJoins extends TestBase {
"left outer join (b inner join base b_base "
+
"on b.pk = b_base.pk and b_base.deleted = 0) on 1=1"
);
assertTrue
(
rs
.
next
());
sql
=
cleanRemarks
(
conn
,
rs
.
getString
(
1
));
sql
=
cleanRemarks
(
rs
.
getString
(
1
));
assertEquals
(
"SELECT A.PK, A_BASE.PK, B.PK, B_BASE.PK FROM PUBLIC.BASE A_BASE "
+
"LEFT OUTER JOIN ( PUBLIC.B "
+
"INNER JOIN PUBLIC.BASE B_BASE "
+
...
...
@@ -563,7 +561,7 @@ public class TestOuterJoins extends TestBase {
deleteDb
(
"nestedJoins"
);
}
private
String
cleanRemarks
(
Connection
conn
,
String
sql
)
throws
SQLException
{
private
String
cleanRemarks
(
String
sql
)
throws
SQLException
{
ScriptReader
r
=
new
ScriptReader
(
new
StringReader
(
sql
));
r
.
setSkipRemarks
(
true
);
sql
=
r
.
readStatement
();
...
...
h2/src/test/org/h2/test/synth/TestRandomCompare.java
浏览文件 @
326ed1ff
...
...
@@ -104,14 +104,12 @@ public class TestRandomCompare extends TestBase {
// System.out.println(se);
// System.out.println(" " + sql);
}
if
(
e
!=
null
)
{
if
(
shortest
==
null
||
sql
.
length
()
<
shortest
.
length
())
{
shortest
=
sql
;
shortestEx
=
e
;
}
}
}
}
if
(
shortest
!=
null
)
{
shortestEx
.
printStackTrace
();
fail
(
shortest
+
" "
+
shortestEx
);
...
...
h2/src/test/org/h2/test/unit/TestCache.java
浏览文件 @
326ed1ff
...
...
@@ -165,7 +165,6 @@ public class TestCache extends TestBase implements CacheWriter {
conn
.
close
();
stat
=
null
;
conn
=
null
;
rs
=
null
;
long
afterClose
=
getRealMemory
();
trace
(
"Used memory: "
+
(
afterInsert
-
afterClose
)
+
" calculated cache size: "
+
calculated
);
trace
(
"Before: "
+
before
+
" after: "
+
afterInsert
+
" after closing: "
+
afterClose
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论