Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
ff25a9ff
提交
ff25a9ff
authored
8月 15, 2008
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
c0354f2a
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
68 行增加
和
34 行删除
+68
-34
changelog.html
h2/src/docsrc/html/changelog.html
+2
-1
Prepared.java
h2/src/main/org/h2/command/Prepared.java
+24
-9
SysProperties.java
h2/src/main/org/h2/constant/SysProperties.java
+6
-0
SessionRemote.java
h2/src/main/org/h2/engine/SessionRemote.java
+0
-2
ValueLob.java
h2/src/main/org/h2/value/ValueLob.java
+0
-1
TestBase.java
h2/src/test/org/h2/test/TestBase.java
+23
-21
TestLob.java
h2/src/test/org/h2/test/db/TestLob.java
+13
-0
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
ff25a9ff
...
@@ -16,7 +16,8 @@ Change Log
...
@@ -16,7 +16,8 @@ Change Log
<h1>
Change Log
</h1>
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
Timestamp columns such as TIMESTAMP(6) were not compatible to other database.
<ul><li>
When using remote in-memory databases, large LOB objects did not work.
</li><li>
Timestamp columns such as TIMESTAMP(6) were not compatible to other database.
</li><li>
Opening a large database was slow if there was a problem opening the previous time.
</li><li>
Opening a large database was slow if there was a problem opening the previous time.
</li><li>
NOT IN(SELECT ...) was incorrect if the subquery returns no rows.
</li><li>
NOT IN(SELECT ...) was incorrect if the subquery returns no rows.
</li><li>
CREATE TABLE AS SELECT did not work correctly in the multi-version concurrency mode.
</li><li>
CREATE TABLE AS SELECT did not work correctly in the multi-version concurrency mode.
...
...
h2/src/main/org/h2/command/Prepared.java
浏览文件 @
ff25a9ff
...
@@ -19,6 +19,7 @@ import org.h2.result.LocalResult;
...
@@ -19,6 +19,7 @@ import org.h2.result.LocalResult;
import
org.h2.util.ObjectArray
;
import
org.h2.util.ObjectArray
;
import
org.h2.util.StringUtils
;
import
org.h2.util.StringUtils
;
import
org.h2.value.Value
;
import
org.h2.value.Value
;
import
org.h2.value.ValueLob
;
/**
/**
* A prepared statement.
* A prepared statement.
...
@@ -320,15 +321,29 @@ public abstract class Prepared {
...
@@ -320,15 +321,29 @@ public abstract class Prepared {
Expression
e
=
(
Expression
)
parameters
.
get
(
i
);
Expression
e
=
(
Expression
)
parameters
.
get
(
i
);
Value
v
=
e
.
getValue
(
session
);
Value
v
=
e
.
getValue
(
session
);
try
{
try
{
// if (v.getPrecision() > SysProperties.MAX_TRACE_DATA_LENGTH) {
if
(
v
.
getPrecision
()
>
SysProperties
.
MAX_TRACE_DATA_LENGTH
)
{
//
if
(
v
.
getType
()
==
Value
.
CLOB
)
{
// }
ValueLob
lob
=
(
ValueLob
)
v
;
String
s
=
v
.
getSQL
();
buff
.
append
(
"SPACE("
);
int
test
;
buff
.
append
(
lob
.
getPrecision
());
// if (s.length() > SysProperties.MAX_TRACE_DATA_LENGTH) {
buff
.
append
(
")"
);
// s = s.substring(0, SysProperties.MAX_TRACE_DATA_LENGTH) + " /* len: " + s.length() + " */";
buff
.
append
(
"/* "
);
// }
buff
.
append
(
lob
.
getObjectId
());
buff
.
append
(
s
);
buff
.
append
(
"*/"
);
}
else
if
(
v
.
getType
()
==
Value
.
BLOB
)
{
ValueLob
lob
=
(
ValueLob
)
v
;
buff
.
append
(
"CAST(REPEAT('00', "
);
buff
.
append
(
lob
.
getPrecision
());
buff
.
append
(
") AS BINARY)"
);
buff
.
append
(
"/* "
);
buff
.
append
(
lob
.
getObjectId
());
buff
.
append
(
"*/"
);
}
else
{
buff
.
append
(
v
.
getSQL
());
}
}
else
{
buff
.
append
(
v
.
getSQL
());
}
}
catch
(
Exception
t
)
{
}
catch
(
Exception
t
)
{
buff
.
append
(
"? /*"
);
buff
.
append
(
"? /*"
);
buff
.
append
(
StringUtils
.
quoteJavaString
(
t
.
getMessage
()));
buff
.
append
(
StringUtils
.
quoteJavaString
(
t
.
getMessage
()));
...
...
h2/src/main/org/h2/constant/SysProperties.java
浏览文件 @
ff25a9ff
...
@@ -259,6 +259,12 @@ public class SysProperties {
...
@@ -259,6 +259,12 @@ public class SysProperties {
*/
*/
public
static
final
int
MAX_QUERY_TIMEOUT
=
getIntSetting
(
H2_MAX_QUERY_TIMEOUT
,
0
);
public
static
final
int
MAX_QUERY_TIMEOUT
=
getIntSetting
(
H2_MAX_QUERY_TIMEOUT
,
0
);
/**
* System property <code>h2.maxTraceDataLength</code> (default: 65535).<br />
* The maximum size of a LOB value that is written as data to the trace system.
*/
public
static
final
long
MAX_TRACE_DATA_LENGTH
=
getIntSetting
(
"h2.maxTraceDataLength"
,
65535
);
/**
/**
* System property <code>h2.minColumnNameMap</code> (default: 3).<br />
* System property <code>h2.minColumnNameMap</code> (default: 3).<br />
* The minimum number of columns where a hash table is created when result set
* The minimum number of columns where a hash table is created when result set
...
...
h2/src/main/org/h2/engine/SessionRemote.java
浏览文件 @
ff25a9ff
...
@@ -454,8 +454,6 @@ public class SessionRemote implements SessionInterface, DataHandler {
...
@@ -454,8 +454,6 @@ public class SessionRemote implements SessionInterface, DataHandler {
public
String
createTempFile
()
throws
SQLException
{
public
String
createTempFile
()
throws
SQLException
{
try
{
try
{
String
prefix
=
getFilePrefix
(
System
.
getProperty
(
"java.io.tmpdir"
));
String
prefix
=
getFilePrefix
(
System
.
getProperty
(
"java.io.tmpdir"
));
int
test
;
// return FileUtils.createTempFile(databaseName, Constants.SUFFIX_TEMP_FILE, true, false);
return
FileUtils
.
createTempFile
(
prefix
,
Constants
.
SUFFIX_TEMP_FILE
,
true
,
false
);
return
FileUtils
.
createTempFile
(
prefix
,
Constants
.
SUFFIX_TEMP_FILE
,
true
,
false
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
Message
.
convertIOException
(
e
,
databaseName
);
throw
Message
.
convertIOException
(
e
,
databaseName
);
...
...
h2/src/main/org/h2/value/ValueLob.java
浏览文件 @
ff25a9ff
...
@@ -654,7 +654,6 @@ public class ValueLob extends Value {
...
@@ -654,7 +654,6 @@ public class ValueLob extends Value {
}
}
public
String
toString
()
{
public
String
toString
()
{
int
tst
;
if
(
small
==
null
)
{
if
(
small
==
null
)
{
return
getClass
().
getName
()
+
" file: "
+
fileName
+
" type: "
+
type
+
" precision: "
+
precision
;
return
getClass
().
getName
()
+
" file: "
+
fileName
+
" type: "
+
type
+
" precision: "
+
precision
;
}
}
...
...
h2/src/test/org/h2/test/TestBase.java
浏览文件 @
ff25a9ff
...
@@ -154,7 +154,7 @@ public abstract class TestBase {
...
@@ -154,7 +154,7 @@ public abstract class TestBase {
return
name
;
return
name
;
}
}
if
(
config
.
memory
)
{
if
(
config
.
memory
)
{
url
=
"mem:"
+
name
;
name
=
"mem:"
+
name
;
}
else
{
}
else
{
if
(!
name
.
startsWith
(
"memFS:"
)
&&
!
name
.
startsWith
(
baseDir
+
"/"
))
{
if
(!
name
.
startsWith
(
"memFS:"
)
&&
!
name
.
startsWith
(
baseDir
+
"/"
))
{
name
=
baseDir
+
"/"
+
name
;
name
=
baseDir
+
"/"
+
name
;
...
@@ -162,37 +162,39 @@ public abstract class TestBase {
...
@@ -162,37 +162,39 @@ public abstract class TestBase {
if
(
config
.
deleteIndex
)
{
if
(
config
.
deleteIndex
)
{
deleteIndexFiles
(
name
);
deleteIndexFiles
(
name
);
}
}
if
(
config
.
networked
)
{
}
if
(
config
.
ssl
)
{
if
(
config
.
networked
)
{
url
=
"ssl://localhost:9192/"
+
name
;
if
(
config
.
ssl
)
{
}
else
{
url
=
"ssl://localhost:9192/"
+
name
;
url
=
"tcp://localhost:9192/"
+
name
;
}
}
else
{
}
else
{
url
=
name
;
url
=
"tcp://localhost:9192/"
+
name
;
}
}
else
{
url
=
name
;
}
if
(!
config
.
memory
)
{
if
(
config
.
textStorage
)
{
url
+=
";STORAGE=TEXT"
;
}
}
if
(
config
.
traceSystemOut
)
{
if
(
admin
)
{
url
+=
";
TRACE_LEVEL_SYSTEM_OUT=2"
;
url
+=
";
LOG="
+
config
.
logMode
;
}
}
if
(
config
.
traceLevelFile
>
0
&&
admin
)
{
if
(
config
.
smallLog
&&
admin
)
{
url
+=
";
TRACE_LEVEL_FILE="
+
config
.
traceLevelFile
;
url
+=
";
MAX_LOG_SIZE=1"
;
}
}
}
}
if
(
config
.
traceSystemOut
)
{
url
+=
";TRACE_LEVEL_SYSTEM_OUT=2"
;
}
if
(
config
.
traceLevelFile
>
0
&&
admin
)
{
url
+=
";TRACE_LEVEL_FILE="
+
config
.
traceLevelFile
;
}
if
(
config
.
throttle
>
0
)
{
if
(
config
.
throttle
>
0
)
{
url
+=
";THROTTLE="
+
config
.
throttle
;
url
+=
";THROTTLE="
+
config
.
throttle
;
}
}
if
(
config
.
textStorage
)
{
url
+=
";STORAGE=TEXT"
;
}
if
(
url
.
indexOf
(
"LOCK_TIMEOUT="
)
<
0
)
{
if
(
url
.
indexOf
(
"LOCK_TIMEOUT="
)
<
0
)
{
url
+=
";LOCK_TIMEOUT=50"
;
url
+=
";LOCK_TIMEOUT=50"
;
}
}
if
(
admin
)
{
url
+=
";LOG="
+
config
.
logMode
;
}
if
(
config
.
smallLog
&&
admin
)
{
url
+=
";MAX_LOG_SIZE=1"
;
}
if
(
config
.
diskUndo
&&
admin
)
{
if
(
config
.
diskUndo
&&
admin
)
{
url
+=
";MAX_MEMORY_UNDO=3"
;
url
+=
";MAX_MEMORY_UNDO=3"
;
}
}
...
...
h2/src/test/org/h2/test/db/TestLob.java
浏览文件 @
ff25a9ff
...
@@ -35,6 +35,7 @@ import org.h2.util.StringUtils;
...
@@ -35,6 +35,7 @@ import org.h2.util.StringUtils;
public
class
TestLob
extends
TestBase
{
public
class
TestLob
extends
TestBase
{
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
testLobServerMemory
();
if
(
config
.
memory
)
{
if
(
config
.
memory
)
{
return
;
return
;
}
}
...
@@ -60,6 +61,18 @@ public class TestLob extends TestBase {
...
@@ -60,6 +61,18 @@ public class TestLob extends TestBase {
testJavaObject
();
testJavaObject
();
}
}
private
void
testLobServerMemory
()
throws
Exception
{
deleteDb
(
"lob"
);
Connection
conn
=
getConnection
(
"lob;TRACE_LEVEL_FILE=3"
);
Statement
stat
=
conn
.
createStatement
();
stat
.
execute
(
"CREATE TABLE TEST(ID INT, DATA CLOB)"
);
PreparedStatement
prep
=
conn
.
prepareStatement
(
"INSERT INTO TEST VALUES(1, ?)"
);
StringReader
reader
=
new
StringReader
(
new
String
(
new
char
[
100000
]));
prep
.
setClob
(
1
,
reader
);
prep
.
execute
();
conn
.
close
();
}
private
void
testLobDelete
()
throws
Exception
{
private
void
testLobDelete
()
throws
Exception
{
if
(
config
.
memory
)
{
if
(
config
.
memory
)
{
return
;
return
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论