Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
d103edc1
提交
d103edc1
authored
8月 22, 2008
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
7b41b960
显示空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
55 行增加
和
44 行删除
+55
-44
Prepared.java
h2/src/main/org/h2/command/Prepared.java
+1
-31
JdbcArray.java
h2/src/main/org/h2/jdbc/JdbcArray.java
+1
-1
JdbcBlob.java
h2/src/main/org/h2/jdbc/JdbcBlob.java
+1
-1
JdbcClob.java
h2/src/main/org/h2/jdbc/JdbcClob.java
+1
-1
ResultRemote.java
h2/src/main/org/h2/result/ResultRemote.java
+1
-1
Row.java
h2/src/main/org/h2/result/Row.java
+1
-1
SimpleRowValue.java
h2/src/main/org/h2/result/SimpleRowValue.java
+1
-1
Column.java
h2/src/main/org/h2/table/Column.java
+5
-1
Value.java
h2/src/main/org/h2/value/Value.java
+11
-1
ValueArray.java
h2/src/main/org/h2/value/ValueArray.java
+13
-1
ValueLob.java
h2/src/main/org/h2/value/ValueLob.java
+19
-4
没有找到文件。
h2/src/main/org/h2/command/Prepared.java
浏览文件 @
d103edc1
...
...
@@ -17,9 +17,7 @@ import org.h2.expression.Parameter;
import
org.h2.message.Message
;
import
org.h2.result.LocalResult
;
import
org.h2.util.ObjectArray
;
import
org.h2.util.StringUtils
;
import
org.h2.value.Value
;
import
org.h2.value.ValueLob
;
/**
* A prepared statement.
...
...
@@ -320,35 +318,7 @@ public abstract class Prepared {
buff
.
append
(
": "
);
Expression
e
=
(
Expression
)
parameters
.
get
(
i
);
Value
v
=
e
.
getValue
(
session
);
try
{
if
(
v
.
getPrecision
()
>
SysProperties
.
MAX_TRACE_DATA_LENGTH
)
{
if
(
v
.
getType
()
==
Value
.
CLOB
)
{
ValueLob
lob
=
(
ValueLob
)
v
;
buff
.
append
(
"SPACE("
);
buff
.
append
(
lob
.
getPrecision
());
buff
.
append
(
")"
);
buff
.
append
(
"/* "
);
buff
.
append
(
lob
.
getObjectId
());
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
)
{
buff
.
append
(
"? /*"
);
buff
.
append
(
StringUtils
.
quoteJavaString
(
t
.
getMessage
()));
buff
.
append
(
"*/"
);
}
buff
.
append
(
v
.
getTraceSQL
());
}
buff
.
append
(
"}"
);
params
=
buff
.
toString
();
...
...
h2/src/main/org/h2/jdbc/JdbcArray.java
浏览文件 @
d103edc1
...
...
@@ -289,6 +289,6 @@ public class JdbcArray extends TraceObject implements Array {
* INTERNAL
*/
public
String
toString
()
{
return
getTraceObjectName
()
+
": "
+
value
.
getSQL
();
return
getTraceObjectName
()
+
": "
+
value
.
get
Trace
SQL
();
}
}
h2/src/main/org/h2/jdbc/JdbcBlob.java
浏览文件 @
d103edc1
...
...
@@ -292,7 +292,7 @@ public class JdbcBlob extends TraceObject implements Blob {
* INTERNAL
*/
public
String
toString
()
{
return
getTraceObjectName
()
+
": "
+
value
.
getSQL
();
return
getTraceObjectName
()
+
": "
+
value
.
get
Trace
SQL
();
}
}
h2/src/main/org/h2/jdbc/JdbcClob.java
浏览文件 @
d103edc1
...
...
@@ -232,7 +232,7 @@ public class JdbcClob extends TraceObject implements Clob
* INTERNAL
*/
public
String
toString
()
{
return
getTraceObjectName
()
+
": "
+
value
.
getSQL
();
return
getTraceObjectName
()
+
": "
+
value
.
get
Trace
SQL
();
}
}
h2/src/main/org/h2/result/ResultRemote.java
浏览文件 @
d103edc1
...
...
@@ -170,7 +170,7 @@ public class ResultRemote implements ResultInterface {
try
{
v
.
close
();
}
catch
(
SQLException
e
)
{
trace
.
error
(
"delete lob "
+
v
.
getSQL
(),
e
);
trace
.
error
(
"delete lob "
+
v
.
get
Trace
SQL
(),
e
);
}
}
lobValues
=
null
;
...
...
h2/src/main/org/h2/result/Row.java
浏览文件 @
d103edc1
...
...
@@ -100,7 +100,7 @@ public class Row extends Record implements SearchRow {
if
(
i
>
0
)
{
buff
.
append
(
", "
);
}
buff
.
append
(
data
[
i
].
getSQL
());
buff
.
append
(
data
[
i
].
get
Trace
SQL
());
}
buff
.
append
(
')'
);
return
buff
.
toString
();
...
...
h2/src/main/org/h2/result/SimpleRowValue.java
浏览文件 @
d103edc1
...
...
@@ -51,7 +51,7 @@ public class SimpleRowValue implements SearchRow {
}
public
String
toString
()
{
return
"( /* "
+
pos
+
" */ "
+
data
.
getSQL
()
+
" )"
;
return
"( /* "
+
pos
+
" */ "
+
data
.
get
Trace
SQL
()
+
" )"
;
}
}
h2/src/main/org/h2/table/Column.java
浏览文件 @
d103edc1
...
...
@@ -292,7 +292,11 @@ public class Column {
value
=
value
.
convertScale
(
mode
.
convertOnlyToSmallerScale
,
scale
);
if
(
precision
>
0
)
{
if
(!
value
.
checkPrecision
(
precision
))
{
throw
Message
.
getSQLException
(
ErrorCode
.
VALUE_TOO_LONG_2
,
new
String
[]{
name
,
value
.
getSQL
()});
String
s
=
value
.
getTraceSQL
();
if
(
s
.
length
()
>
127
)
{
s
=
s
.
substring
(
0
,
128
)
+
"..."
;
}
throw
Message
.
getSQLException
(
ErrorCode
.
VALUE_TOO_LONG_2
,
new
String
[]{
name
,
s
});
}
}
updateSequenceIfRequired
(
session
,
value
);
...
...
h2/src/main/org/h2/value/Value.java
浏览文件 @
d103edc1
...
...
@@ -968,8 +968,18 @@ public abstract class Value {
return
getPrecision
()
<=
precision
;
}
public
String
toString
()
{
/**
* Get a medium size SQL expression for debugging or tracing. If the precision is
* too large, only a subset of the value is returned.
*
* @return the SQL expression
*/
public
String
getTraceSQL
()
{
return
getSQL
();
}
public
String
toString
()
{
return
getTraceSQL
();
}
}
h2/src/main/org/h2/value/ValueArray.java
浏览文件 @
d103edc1
...
...
@@ -115,6 +115,18 @@ public class ValueArray extends Value {
return
buff
.
toString
();
}
public
String
getTraceSQL
()
{
StringBuffer
buff
=
new
StringBuffer
();
buff
.
append
(
'('
);
for
(
int
i
=
0
;
i
<
values
.
length
;
i
++)
{
if
(
i
>
0
)
{
buff
.
append
(
", "
);
}
buff
.
append
(
values
[
i
].
getTraceSQL
());
}
buff
.
append
(
')'
);
return
buff
.
toString
();
}
public
int
getDisplaySize
()
{
long
size
=
0
;
for
(
int
i
=
0
;
i
<
values
.
length
;
i
++)
{
...
...
h2/src/main/org/h2/value/ValueLob.java
浏览文件 @
d103edc1
...
...
@@ -653,12 +653,27 @@ public class ValueLob extends Value {
}
}
public
String
toString
()
{
if
(
small
==
null
)
{
return
getClass
().
getName
()
+
" file: "
+
fileName
+
" type: "
+
type
+
" precision: "
+
precision
;
}
public
String
getTraceSQL
()
{
if
(
getPrecision
()
<=
SysProperties
.
MAX_TRACE_DATA_LENGTH
)
{
return
getSQL
();
}
StringBuffer
buff
=
new
StringBuffer
();
if
(
type
==
Value
.
CLOB
)
{
buff
.
append
(
"SPACE("
);
buff
.
append
(
getPrecision
());
}
else
{
buff
.
append
(
"CAST(REPEAT('00', "
);
buff
.
append
(
getPrecision
());
buff
.
append
(
") AS BINARY"
);
}
if
(
small
!=
null
)
{
buff
.
append
(
" /* "
);
buff
.
append
(
fileName
);
buff
.
append
(
" */"
);
}
buff
.
append
(
")"
);
return
buff
.
toString
();
}
/**
* Get the data if this a small lob value.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论