Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
c11011ec
提交
c11011ec
authored
1月 19, 2014
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Storing LOBs in separate files (outside of the database) is no longer supported for new databases.
上级
5c58a48f
显示空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
77 行增加
和
254 行删除
+77
-254
help.csv
h2/src/docsrc/help/help.csv
+1
-3
advanced.html
h2/src/docsrc/html/advanced.html
+0
-3
changelog.html
h2/src/docsrc/html/changelog.html
+2
-1
SysProperties.java
h2/src/main/org/h2/constant/SysProperties.java
+0
-6
Constants.java
h2/src/main/org/h2/engine/Constants.java
+1
-8
Database.java
h2/src/main/org/h2/engine/Database.java
+1
-2
ValueDataType.java
h2/src/main/org/h2/mvstore/db/ValueDataType.java
+10
-48
LobStorageBackend.java
h2/src/main/org/h2/store/LobStorageBackend.java
+21
-33
LobStorageFrontend.java
h2/src/main/org/h2/store/LobStorageFrontend.java
+14
-25
ValueLobDb.java
h2/src/main/org/h2/value/ValueLobDb.java
+24
-3
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+0
-1
TestLob.java
h2/src/test/org/h2/test/db/TestLob.java
+3
-117
TestLobApi.java
h2/src/test/org/h2/test/jdbc/TestLobApi.java
+0
-1
TestDiskSpaceLeak.java
h2/src/test/org/h2/test/todo/TestDiskSpaceLeak.java
+0
-1
TestTempTableCrash.java
h2/src/test/org/h2/test/todo/TestTempTableCrash.java
+0
-1
TestPageStore.java
h2/src/test/org/h2/test/unit/TestPageStore.java
+0
-1
没有找到文件。
h2/src/docsrc/help/help.csv
浏览文件 @
c11011ec
...
...
@@ -1323,10 +1323,8 @@ SET MAX_LENGTH_INPLACE_LOB int
","
Sets the maximum size of an in-place LOB object.
If the 'h2.lobInDatabase' property is true, t
his is the maximum length of an LOB that is stored with the record itself,
T
his is the maximum length of an LOB that is stored with the record itself,
and the default value is 128.
If the 'h2.lobInDatabase' property is false, this is the maximum length of an LOB that is stored in the database file,
and the default value is 4096.
This setting has no effect for in-memory databases.
...
...
h2/src/docsrc/html/advanced.html
浏览文件 @
c11011ec
...
...
@@ -140,9 +140,6 @@ should never be used for columns with a maximum size below about 200 bytes.
The best threshold depends on the use case; reading in-place objects is faster
than reading from separate files, but slows down the performance of operations
that don't involve this column.
</p><p>
It is possible to configure the database to store LOB objects outside the database file,
see the
<a
href=
"../javadoc/org/h2/constant/SysProperties.html#h2.lobInDatabase"
>
h2.lobInDatabase
</a>
property.
</p>
<h3>
Large Object Compression
</h3>
...
...
h2/src/docsrc/html/changelog.html
浏览文件 @
c11011ec
...
...
@@ -18,7 +18,8 @@ Change Log
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
Lucene 2 is no longer supported.
<ul><li>
Storing LOBs in separate files (outside of the database) is no longer supported for new databases.
</li><li>
Lucene 2 is no longer supported.
</li></ul>
<h2>
Version 1.3.175 (2014-01-18)
</h2>
...
...
h2/src/main/org/h2/constant/SysProperties.java
浏览文件 @
c11011ec
...
...
@@ -198,12 +198,6 @@ public class SysProperties {
*/
public
static
final
int
LOB_FILES_PER_DIRECTORY
=
Utils
.
getProperty
(
"h2.lobFilesPerDirectory"
,
256
);
/**
* System property <code>h2.lobInDatabase</code> (default: true).<br />
* Store LOB files in the database.
*/
public
static
final
boolean
LOB_IN_DATABASE
=
Utils
.
getProperty
(
"h2.lobInDatabase"
,
true
);
/**
* System property <code>h2.lobClientMaxSizeMemory</code> (default:
* 1048576).<br />
...
...
h2/src/main/org/h2/engine/Constants.java
浏览文件 @
c11011ec
...
...
@@ -199,18 +199,11 @@ public class Constants {
*/
public
static
final
int
DEFAULT_LOCK_MODE
=
LOCK_MODE_READ_COMMITTED
;
/**
* The default maximum length of an LOB that is stored in the database file.
* Only used if h2.lobInDatabase==false.
*/
public
static
final
int
DEFAULT_MAX_LENGTH_INPLACE_LOB
=
4096
;
/**
* The default maximum length of an LOB that is stored with the record itself,
* and not in a separate place.
* Only used if h2.lobInDatabase==true.
*/
public
static
final
int
DEFAULT_MAX_LENGTH_INPLACE_LOB
2
=
128
;
public
static
final
int
DEFAULT_MAX_LENGTH_INPLACE_LOB
=
128
;
/**
* The default value for the maximum transaction log size.
...
...
h2/src/main/org/h2/engine/Database.java
浏览文件 @
c11011ec
...
...
@@ -196,8 +196,7 @@ public class Database implements DataHandler {
this
.
fileEncryptionKey
=
ci
.
getFileEncryptionKey
();
this
.
databaseName
=
name
;
this
.
databaseShortName
=
parseDatabaseShortName
();
this
.
maxLengthInplaceLob
=
SysProperties
.
LOB_IN_DATABASE
?
Constants
.
DEFAULT_MAX_LENGTH_INPLACE_LOB2
:
Constants
.
DEFAULT_MAX_LENGTH_INPLACE_LOB
;
this
.
maxLengthInplaceLob
=
Constants
.
DEFAULT_MAX_LENGTH_INPLACE_LOB
;
this
.
cipher
=
cipher
;
String
lockMethodName
=
ci
.
getProperty
(
"FILE_LOCK"
,
null
);
this
.
accessModeData
=
StringUtils
.
toLowerEnglish
(
ci
.
getProperty
(
"ACCESS_MODE_DATA"
,
"rw"
));
...
...
h2/src/main/org/h2/mvstore/db/ValueDataType.java
浏览文件 @
c11011ec
...
...
@@ -37,7 +37,6 @@ import org.h2.value.ValueFloat;
import
org.h2.value.ValueGeometry
;
import
org.h2.value.ValueInt
;
import
org.h2.value.ValueJavaObject
;
import
org.h2.value.ValueLob
;
import
org.h2.value.ValueLobDb
;
import
org.h2.value.ValueLong
;
import
org.h2.value.ValueNull
;
...
...
@@ -332,27 +331,6 @@ public class ValueDataType implements DataType {
case
Value
.
BLOB
:
case
Value
.
CLOB
:
{
buff
.
put
((
byte
)
type
);
if
(
v
instanceof
ValueLob
)
{
ValueLob
lob
=
(
ValueLob
)
v
;
lob
.
convertToFileIfRequired
(
handler
);
byte
[]
small
=
lob
.
getSmall
();
if
(
small
==
null
)
{
int
t
=
-
1
;
if
(!
lob
.
isLinked
())
{
t
=
-
2
;
}
buff
.
putVarInt
(
t
).
putVarInt
(
lob
.
getTableId
()).
putVarInt
(
lob
.
getObjectId
()).
putVarLong
(
lob
.
getPrecision
()).
put
((
byte
)
(
lob
.
isCompressed
()
?
1
:
0
));
if
(
t
==
-
2
)
{
writeString
(
buff
,
lob
.
getFileName
());
}
}
else
{
buff
.
putVarInt
(
small
.
length
).
put
(
small
);
}
}
else
{
ValueLobDb
lob
=
(
ValueLobDb
)
v
;
byte
[]
small
=
lob
.
getSmall
();
if
(
small
==
null
)
{
...
...
@@ -364,7 +342,6 @@ public class ValueDataType implements DataType {
buff
.
putVarInt
(
small
.
length
).
put
(
small
);
}
}
break
;
}
case
Value
.
ARRAY
:
{
...
...
@@ -524,22 +501,7 @@ public class ValueDataType implements DataType {
ValueLobDb
lob
=
ValueLobDb
.
create
(
type
,
handler
,
tableId
,
lobId
,
null
,
precision
);
return
lob
;
}
else
{
int
tableId
=
readVarInt
(
buff
);
int
objectId
=
readVarInt
(
buff
);
long
precision
=
0
;
boolean
compression
=
false
;
// -1: regular
// -2: regular, but not linked (in this case: including file name)
if
(
smallLen
==
-
1
||
smallLen
==
-
2
)
{
precision
=
readVarLong
(
buff
);
compression
=
buff
.
get
()
==
1
;
}
if
(
smallLen
==
-
2
)
{
String
filename
=
readString
(
buff
);
return
ValueLob
.
openUnlinked
(
type
,
handler
,
tableId
,
objectId
,
precision
,
compression
,
filename
);
}
ValueLob
lob
=
ValueLob
.
openLinked
(
type
,
handler
,
tableId
,
objectId
,
precision
,
compression
);
return
lob
;
throw
DbException
.
get
(
ErrorCode
.
FILE_CORRUPTED_1
,
"lob type: "
+
smallLen
);
}
}
case
Value
.
ARRAY
:
{
...
...
h2/src/main/org/h2/store/LobStorageBackend.java
浏览文件 @
c11011ec
...
...
@@ -32,7 +32,6 @@ import org.h2.util.IOUtils;
import
org.h2.util.MathUtils
;
import
org.h2.util.New
;
import
org.h2.value.Value
;
import
org.h2.value.ValueLob
;
import
org.h2.value.ValueLobDb
;
/**
...
...
@@ -196,7 +195,6 @@ public class LobStorageBackend implements LobStorageInterface {
* @param tableId the table id
*/
public
void
removeAllForTable
(
int
tableId
)
{
if
(
SysProperties
.
LOB_IN_DATABASE
)
{
init
();
try
{
String
sql
=
"SELECT ID FROM "
+
LOBS
+
" WHERE TABLE = ?"
;
...
...
@@ -213,10 +211,6 @@ public class LobStorageBackend implements LobStorageInterface {
if
(
tableId
==
LobStorageFrontend
.
TABLE_ID_SESSION_VARIABLE
)
{
removeAllForTable
(
LobStorageFrontend
.
TABLE_TEMP
);
}
// remove both lobs in the database as well as in the file system
// (compatibility)
}
ValueLob
.
removeAllForTable
(
database
,
tableId
);
}
/**
...
...
@@ -554,24 +548,18 @@ public class LobStorageBackend implements LobStorageInterface {
@Override
public
Value
createBlob
(
InputStream
in
,
long
maxLength
)
{
if
(
SysProperties
.
LOB_IN_DATABASE
)
{
init
();
return
addLob
(
in
,
maxLength
,
Value
.
BLOB
,
null
);
}
return
ValueLob
.
createBlob
(
in
,
maxLength
,
database
);
}
@Override
public
Value
createClob
(
Reader
reader
,
long
maxLength
)
{
if
(
SysProperties
.
LOB_IN_DATABASE
)
{
init
();
long
max
=
maxLength
==
-
1
?
Long
.
MAX_VALUE
:
maxLength
;
CountingReaderInputStream
in
=
new
CountingReaderInputStream
(
reader
,
max
);
ValueLobDb
lob
=
addLob
(
in
,
Long
.
MAX_VALUE
,
Value
.
CLOB
,
in
);
return
lob
;
}
return
ValueLob
.
createClob
(
reader
,
maxLength
,
database
);
}
@Override
public
void
setTable
(
long
lobId
,
int
table
)
{
...
...
h2/src/main/org/h2/store/LobStorageFrontend.java
浏览文件 @
c11011ec
...
...
@@ -10,10 +10,8 @@ import java.io.BufferedInputStream;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.Reader
;
import
org.h2.constant.SysProperties
;
import
org.h2.engine.Constants
;
import
org.h2.value.Value
;
import
org.h2.value.ValueLob
;
import
org.h2.value.ValueLobDb
;
/**
...
...
@@ -77,14 +75,11 @@ public class LobStorageFrontend implements LobStorageInterface {
@Override
public
Value
createBlob
(
InputStream
in
,
long
maxLength
)
{
if
(
SysProperties
.
LOB_IN_DATABASE
)
{
// need to use a temp file, because the input stream could come from
// the same database, which would create a weird situation (trying
// to read a block while write something)
return
ValueLobDb
.
createTempBlob
(
in
,
maxLength
,
handler
);
}
return
ValueLob
.
createBlob
(
in
,
maxLength
,
handler
);
}
/**
* Create a CLOB object.
...
...
@@ -95,14 +90,11 @@ public class LobStorageFrontend implements LobStorageInterface {
*/
@Override
public
Value
createClob
(
Reader
reader
,
long
maxLength
)
{
if
(
SysProperties
.
LOB_IN_DATABASE
)
{
// need to use a temp file, because the input stream could come from
// the same database, which would create a weird situation (trying
// to read a block while write something)
return
ValueLobDb
.
createTempClob
(
reader
,
maxLength
,
handler
);
}
return
ValueLob
.
createClob
(
reader
,
maxLength
,
handler
);
}
/**
...
...
@@ -113,7 +105,6 @@ public class LobStorageFrontend implements LobStorageInterface {
* @return the LOB
*/
public
static
Value
createSmallLob
(
int
type
,
byte
[]
small
)
{
if
(
SysProperties
.
LOB_IN_DATABASE
)
{
int
precision
;
if
(
type
==
Value
.
CLOB
)
{
precision
=
new
String
(
small
,
Constants
.
UTF8
).
length
();
...
...
@@ -122,7 +113,5 @@ public class LobStorageFrontend implements LobStorageInterface {
}
return
ValueLobDb
.
createSmallLob
(
type
,
small
,
precision
);
}
return
ValueLob
.
createSmallLob
(
type
,
small
);
}
}
h2/src/main/org/h2/value/ValueLobDb.java
浏览文件 @
c11011ec
...
...
@@ -602,11 +602,32 @@ public class ValueLobDb extends Value implements Value.ValueClob, Value.ValueBlo
if
(
this
.
precision
<=
precision
)
{
return
this
;
}
ValueLob
lob
;
ValueLob
Db
lob
;
if
(
type
==
CLOB
)
{
lob
=
ValueLob
.
createClob
(
getReader
(),
precision
,
handler
);
if
(
handler
==
null
)
{
try
{
int
p
=
MathUtils
.
convertLongToInt
(
precision
);
String
s
=
IOUtils
.
readStringAndClose
(
getReader
(),
p
);
byte
[]
data
=
s
.
getBytes
(
Constants
.
UTF8
);
lob
=
ValueLobDb
.
createSmallLob
(
type
,
data
,
s
.
length
());
}
catch
(
IOException
e
)
{
throw
DbException
.
convertIOException
(
e
,
null
);
}
}
else
{
lob
=
ValueLobDb
.
createTempClob
(
getReader
(),
precision
,
handler
);
}
}
else
{
lob
=
ValueLob
.
createBlob
(
getInputStream
(),
precision
,
handler
);
if
(
handler
==
null
)
{
try
{
int
p
=
MathUtils
.
convertLongToInt
(
precision
);
byte
[]
data
=
IOUtils
.
readBytesAndClose
(
getInputStream
(),
p
);
lob
=
ValueLobDb
.
createSmallLob
(
type
,
data
,
data
.
length
);
}
catch
(
IOException
e
)
{
throw
DbException
.
convertIOException
(
e
,
null
);
}
}
else
{
lob
=
ValueLobDb
.
createTempBlob
(
getInputStream
(),
precision
,
handler
);
}
}
return
lob
;
}
...
...
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
c11011ec
...
...
@@ -427,7 +427,6 @@ kill -9 `jps -l | grep "org.h2.test." | cut -d " " -f 1`
if
(
"reopen"
.
equals
(
args
[
0
]))
{
System
.
setProperty
(
"h2.delayWrongPasswordMin"
,
"0"
);
System
.
setProperty
(
"h2.check2"
,
"false"
);
System
.
setProperty
(
"h2.lobInDatabase"
,
"true"
);
System
.
setProperty
(
"h2.analyzeAuto"
,
"100"
);
System
.
setProperty
(
"h2.pageSize"
,
"64"
);
System
.
setProperty
(
"h2.reopenShift"
,
"5"
);
...
...
h2/src/test/org/h2/test/db/TestLob.java
浏览文件 @
c11011ec
...
...
@@ -23,23 +23,20 @@ import java.sql.ResultSet;
import
java.sql.SQLException
;
import
java.sql.Savepoint
;
import
java.sql.Statement
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Random
;
import
org.h2.constant.ErrorCode
;
import
org.h2.constant.SysProperties
;
import
org.h2.jdbc.JdbcConnection
;
import
org.h2.message.DbException
;
import
org.h2.store.FileLister
;
import
org.h2.store.fs.FileUtils
;
import
org.h2.test.TestBase
;
import
org.h2.tools.DeleteDbFiles
;
import
org.h2.util.IOUtils
;
import
org.h2.util.JdbcUtils
;
import
org.h2.util.StringUtils
;
import
org.h2.util.Task
;
import
org.h2.util.Utils
;
import
org.h2.value.ValueLob
;
/**
* Tests LOB and CLOB data types.
...
...
@@ -81,11 +78,9 @@ public class TestLob extends TestBase {
testUniqueIndex
();
testConvert
();
testCreateAsSelect
();
testDropAllObjects
();
testDelete
();
testTempFilesDeleted
(
true
);
testTempFilesDeleted
(
false
);
testAddLobRestart
();
testLobServerMemory
();
testUpdatingLobRow
();
if
(
config
.
memory
)
{
...
...
@@ -93,8 +88,6 @@ public class TestLob extends TestBase {
}
testLobCleanupSessionTemporaries
();
testLobUpdateMany
();
testLobDeleteTemp
();
testLobDelete
();
testLobVariable
();
testLobDrop
();
testLobNoClose
();
...
...
@@ -533,39 +526,8 @@ public class TestLob extends TestBase {
conn
.
close
();
}
private
void
testDropAllObjects
()
throws
Exception
{
if
(
SysProperties
.
LOB_IN_DATABASE
||
config
.
memory
)
{
return
;
}
deleteDb
(
"lob"
);
Connection
conn
;
Statement
stat
;
conn
=
getConnection
(
"lob"
);
stat
=
conn
.
createStatement
();
stat
.
execute
(
"create table test(id int primary key, name clob)"
);
stat
.
execute
(
"insert into test values(1, space(10000))"
);
assertEquals
(
1
,
FileUtils
.
newDirectoryStream
(
getBaseDir
()
+
"/lob.lobs.db"
).
size
());
stat
.
execute
(
"drop table test"
);
assertEquals
(
0
,
FileUtils
.
newDirectoryStream
(
getBaseDir
()
+
"/lob.lobs.db"
).
size
());
stat
.
execute
(
"create table test(id int primary key, name clob)"
);
stat
.
execute
(
"insert into test values(1, space(10000))"
);
assertEquals
(
1
,
FileUtils
.
newDirectoryStream
(
getBaseDir
()
+
"/lob.lobs.db"
).
size
());
stat
.
execute
(
"drop all objects"
);
assertEquals
(
0
,
FileUtils
.
newDirectoryStream
(
getBaseDir
()
+
"/lob.lobs.db"
).
size
());
stat
.
execute
(
"create table test(id int primary key, name clob)"
);
stat
.
execute
(
"insert into test values(1, space(10000))"
);
assertEquals
(
1
,
FileUtils
.
newDirectoryStream
(
getBaseDir
()
+
"/lob.lobs.db"
).
size
());
stat
.
execute
(
"truncate table test"
);
assertEquals
(
0
,
FileUtils
.
newDirectoryStream
(
getBaseDir
()
+
"/lob.lobs.db"
).
size
());
conn
.
close
();
}
private
void
testDelete
()
throws
Exception
{
if
(
!
SysProperties
.
LOB_IN_DATABASE
||
config
.
memory
)
{
if
(
config
.
memory
)
{
return
;
}
deleteDb
(
"lob"
);
...
...
@@ -631,27 +593,6 @@ public class TestLob extends TestBase {
assertEquals
(
"Unexpected temp file: "
+
list
,
0
,
list
.
size
());
}
private
static
void
testAddLobRestart
()
throws
SQLException
{
DeleteDbFiles
.
execute
(
"memFS:"
,
"lob"
,
true
);
Connection
conn
=
org
.
h2
.
Driver
.
load
().
connect
(
"jdbc:h2:memFS:lob"
,
null
);
Statement
stat
=
conn
.
createStatement
();
stat
.
execute
(
"create table test(d blob)"
);
stat
.
execute
(
"set MAX_LENGTH_INPLACE_LOB 1"
);
PreparedStatement
prep
=
conn
.
prepareCall
(
"insert into test values('0000')"
);
// long start = System.currentTimeMillis();
for
(
int
i
=
0
;
i
<
2000
;
i
++)
{
// if (i % 1000 == 0) {
// long now = System.currentTimeMillis();
// System.out.println(i + " " + (now - start));
// start = now;
// }
prep
.
execute
();
ValueLob
.
resetDirCounter
();
}
conn
.
close
();
DeleteDbFiles
.
execute
(
"memFS:"
,
"lob"
,
true
);
}
private
void
testLobUpdateMany
()
throws
SQLException
{
deleteDb
(
"lob"
);
Connection
conn
=
getConnection
(
"lob"
);
...
...
@@ -663,24 +604,7 @@ public class TestLob extends TestBase {
conn
.
close
();
}
private
void
testLobDeleteTemp
()
throws
SQLException
{
if
(
SysProperties
.
LOB_IN_DATABASE
)
{
return
;
}
deleteDb
(
"lob"
);
Connection
conn
=
getConnection
(
"lob"
);
Statement
stat
=
conn
.
createStatement
();
stat
.
execute
(
"create table test(data clob) as select space(100000) from dual"
);
assertEquals
(
1
,
FileUtils
.
newDirectoryStream
(
getBaseDir
()
+
"/lob.lobs.db"
).
size
());
stat
.
execute
(
"delete from test"
);
conn
.
close
();
assertEquals
(
0
,
FileUtils
.
newDirectoryStream
(
getBaseDir
()
+
"/lob.lobs.db"
).
size
());
}
private
void
testLobCleanupSessionTemporaries
()
throws
SQLException
{
if
(!
SysProperties
.
LOB_IN_DATABASE
)
{
return
;
}
deleteDb
(
"lob"
);
Connection
conn
=
getConnection
(
"lob"
);
Statement
stat
=
conn
.
createStatement
();
...
...
@@ -716,44 +640,6 @@ public class TestLob extends TestBase {
conn
.
close
();
}
private
void
testLobDelete
()
throws
SQLException
{
if
(
config
.
memory
||
SysProperties
.
LOB_IN_DATABASE
)
{
return
;
}
deleteDb
(
"lob"
);
Connection
conn
=
reconnect
(
null
);
Statement
stat
=
conn
.
createStatement
();
stat
.
execute
(
"CREATE TABLE TEST(ID INT, DATA CLOB)"
);
stat
.
execute
(
"INSERT INTO TEST SELECT X, SPACE(10000) FROM SYSTEM_RANGE(1, 10)"
);
ArrayList
<
String
>
list
=
FileLister
.
getDatabaseFiles
(
getBaseDir
(),
"lob"
,
true
);
stat
.
execute
(
"UPDATE TEST SET DATA = SPACE(5000)"
);
collectAndWait
();
stat
.
execute
(
"CHECKPOINT"
);
ArrayList
<
String
>
list2
=
FileLister
.
getDatabaseFiles
(
getBaseDir
(),
"lob"
,
true
);
if
(
list2
.
size
()
>=
list
.
size
()
+
5
)
{
fail
(
"Expected not many more files, got "
+
list2
.
size
()
+
" was "
+
list
.
size
());
}
stat
.
execute
(
"DELETE FROM TEST"
);
collectAndWait
();
stat
.
execute
(
"CHECKPOINT"
);
ArrayList
<
String
>
list3
=
FileLister
.
getDatabaseFiles
(
getBaseDir
(),
"lob"
,
true
);
if
(
list3
.
size
()
>=
list
.
size
())
{
fail
(
"Expected less files, got "
+
list2
.
size
()
+
" was "
+
list
.
size
());
}
conn
.
close
();
}
private
static
void
collectAndWait
()
{
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
System
.
gc
();
}
try
{
Thread
.
sleep
(
50
);
}
catch
(
InterruptedException
e
)
{
// ignore
}
}
private
void
testLobVariable
()
throws
SQLException
{
deleteDb
(
"lob"
);
Connection
conn
=
reconnect
(
null
);
...
...
@@ -1126,7 +1012,7 @@ public class TestLob extends TestBase {
time
=
System
.
currentTimeMillis
()
-
time
;
trace
(
"time: "
+
time
+
" compress: "
+
compress
);
conn
.
close
();
if
(!
config
.
memory
&&
SysProperties
.
LOB_IN_DATABASE
)
{
if
(!
config
.
memory
)
{
long
length
=
new
File
(
getBaseDir
()
+
"/lob.h2.db"
).
length
();
trace
(
"len: "
+
length
+
" compress: "
+
compress
);
}
...
...
h2/src/test/org/h2/test/jdbc/TestLobApi.java
浏览文件 @
c11011ec
...
...
@@ -40,7 +40,6 @@ public class TestLobApi extends TestBase {
* @param a ignored
*/
public
static
void
main
(
String
...
a
)
throws
Exception
{
// System.setProperty("h2.lobInDatabase", "true");
TestBase
.
createCaller
().
init
().
test
();
}
...
...
h2/src/test/org/h2/test/todo/TestDiskSpaceLeak.java
浏览文件 @
c11011ec
...
...
@@ -27,7 +27,6 @@ public class TestDiskSpaceLeak {
* @param args ignored
*/
public
static
void
main
(
String
...
args
)
throws
Exception
{
System
.
setProperty
(
"h2.lobInDatabase"
,
"true"
);
DeleteDbFiles
.
execute
(
"data"
,
null
,
true
);
Class
.
forName
(
"org.h2.Driver"
);
Connection
conn
;
...
...
h2/src/test/org/h2/test/todo/TestTempTableCrash.java
浏览文件 @
c11011ec
...
...
@@ -34,7 +34,6 @@ public class TestTempTableCrash {
System
.
setProperty
(
"h2.delayWrongPasswordMin"
,
"0"
);
System
.
setProperty
(
"h2.check2"
,
"false"
);
System
.
setProperty
(
"h2.lobInDatabase"
,
"true"
);
FilePathRec
.
register
();
System
.
setProperty
(
"reopenShift"
,
"4"
);
TestReopen
reopen
=
new
TestReopen
();
...
...
h2/src/test/org/h2/test/unit/TestPageStore.java
浏览文件 @
c11011ec
...
...
@@ -44,7 +44,6 @@ public class TestPageStore extends TestBase {
*/
public
static
void
main
(
String
...
a
)
throws
Exception
{
System
.
setProperty
(
"h2.check2"
,
"true"
);
System
.
setProperty
(
"h2.lobInDatabase"
,
"true"
);
TestBase
.
createCaller
().
init
().
test
();
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论