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
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
56 行增加
和
45 行删除
+56
-45
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
ValueStringBase.java
h2/src/main/org/h2/value/ValueStringBase.java
+1
-1
没有找到文件。
h2/src/main/org/h2/command/Prepared.java
浏览文件 @
d103edc1
...
@@ -17,9 +17,7 @@ import org.h2.expression.Parameter;
...
@@ -17,9 +17,7 @@ import org.h2.expression.Parameter;
import
org.h2.message.Message
;
import
org.h2.message.Message
;
import
org.h2.result.LocalResult
;
import
org.h2.result.LocalResult
;
import
org.h2.util.ObjectArray
;
import
org.h2.util.ObjectArray
;
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,35 +318,7 @@ public abstract class Prepared {
...
@@ -320,35 +318,7 @@ public abstract class Prepared {
buff
.
append
(
": "
);
buff
.
append
(
": "
);
Expression
e
=
(
Expression
)
parameters
.
get
(
i
);
Expression
e
=
(
Expression
)
parameters
.
get
(
i
);
Value
v
=
e
.
getValue
(
session
);
Value
v
=
e
.
getValue
(
session
);
try
{
buff
.
append
(
v
.
getTraceSQL
());
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
(
"}"
);
buff
.
append
(
"}"
);
params
=
buff
.
toString
();
params
=
buff
.
toString
();
...
...
h2/src/main/org/h2/jdbc/JdbcArray.java
浏览文件 @
d103edc1
...
@@ -289,6 +289,6 @@ public class JdbcArray extends TraceObject implements Array {
...
@@ -289,6 +289,6 @@ public class JdbcArray extends TraceObject implements Array {
* INTERNAL
* INTERNAL
*/
*/
public
String
toString
()
{
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 {
...
@@ -292,7 +292,7 @@ public class JdbcBlob extends TraceObject implements Blob {
* INTERNAL
* INTERNAL
*/
*/
public
String
toString
()
{
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
...
@@ -232,7 +232,7 @@ public class JdbcClob extends TraceObject implements Clob
* INTERNAL
* INTERNAL
*/
*/
public
String
toString
()
{
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 {
...
@@ -170,7 +170,7 @@ public class ResultRemote implements ResultInterface {
try
{
try
{
v
.
close
();
v
.
close
();
}
catch
(
SQLException
e
)
{
}
catch
(
SQLException
e
)
{
trace
.
error
(
"delete lob "
+
v
.
getSQL
(),
e
);
trace
.
error
(
"delete lob "
+
v
.
get
Trace
SQL
(),
e
);
}
}
}
}
lobValues
=
null
;
lobValues
=
null
;
...
...
h2/src/main/org/h2/result/Row.java
浏览文件 @
d103edc1
...
@@ -100,7 +100,7 @@ public class Row extends Record implements SearchRow {
...
@@ -100,7 +100,7 @@ public class Row extends Record implements SearchRow {
if
(
i
>
0
)
{
if
(
i
>
0
)
{
buff
.
append
(
", "
);
buff
.
append
(
", "
);
}
}
buff
.
append
(
data
[
i
].
getSQL
());
buff
.
append
(
data
[
i
].
get
Trace
SQL
());
}
}
buff
.
append
(
')'
);
buff
.
append
(
')'
);
return
buff
.
toString
();
return
buff
.
toString
();
...
...
h2/src/main/org/h2/result/SimpleRowValue.java
浏览文件 @
d103edc1
...
@@ -51,7 +51,7 @@ public class SimpleRowValue implements SearchRow {
...
@@ -51,7 +51,7 @@ public class SimpleRowValue implements SearchRow {
}
}
public
String
toString
()
{
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 {
...
@@ -292,7 +292,11 @@ public class Column {
value
=
value
.
convertScale
(
mode
.
convertOnlyToSmallerScale
,
scale
);
value
=
value
.
convertScale
(
mode
.
convertOnlyToSmallerScale
,
scale
);
if
(
precision
>
0
)
{
if
(
precision
>
0
)
{
if
(!
value
.
checkPrecision
(
precision
))
{
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
);
updateSequenceIfRequired
(
session
,
value
);
...
...
h2/src/main/org/h2/value/Value.java
浏览文件 @
d103edc1
...
@@ -967,9 +967,19 @@ public abstract class Value {
...
@@ -967,9 +967,19 @@ public abstract class Value {
public
boolean
checkPrecision
(
long
precision
)
{
public
boolean
checkPrecision
(
long
precision
)
{
return
getPrecision
()
<=
precision
;
return
getPrecision
()
<=
precision
;
}
}
/**
* 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
()
{
public
String
toString
()
{
return
getSQL
();
return
get
Trace
SQL
();
}
}
}
}
h2/src/main/org/h2/value/ValueArray.java
浏览文件 @
d103edc1
...
@@ -114,7 +114,19 @@ public class ValueArray extends Value {
...
@@ -114,7 +114,19 @@ public class ValueArray extends Value {
buff
.
append
(
')'
);
buff
.
append
(
')'
);
return
buff
.
toString
();
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
()
{
public
int
getDisplaySize
()
{
long
size
=
0
;
long
size
=
0
;
for
(
int
i
=
0
;
i
<
values
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
values
.
length
;
i
++)
{
...
...
h2/src/main/org/h2/value/ValueLob.java
浏览文件 @
d103edc1
...
@@ -653,11 +653,26 @@ public class ValueLob extends Value {
...
@@ -653,11 +653,26 @@ public class ValueLob extends Value {
}
}
}
}
public
String
toString
()
{
public
String
getTraceSQL
()
{
if
(
small
==
null
)
{
if
(
getPrecision
()
<=
SysProperties
.
MAX_TRACE_DATA_LENGTH
)
{
return
get
Class
().
getName
()
+
" file: "
+
fileName
+
" type: "
+
type
+
" precision: "
+
precision
;
return
get
SQL
()
;
}
}
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
();
}
}
/**
/**
...
...
h2/src/main/org/h2/value/ValueStringBase.java
浏览文件 @
d103edc1
...
@@ -28,7 +28,7 @@ abstract class ValueStringBase extends Value {
...
@@ -28,7 +28,7 @@ abstract class ValueStringBase extends Value {
public
String
getSQL
()
{
public
String
getSQL
()
{
return
StringUtils
.
quoteStringSQL
(
value
);
return
StringUtils
.
quoteStringSQL
(
value
);
}
}
public
String
getString
()
{
public
String
getString
()
{
return
value
;
return
value
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论