Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
5acc65e8
提交
5acc65e8
authored
7 年前
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Do not concatenate non-constant expressions inside calls to StringBuilder
上级
bfc27535
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
127 行增加
和
113 行删除
+127
-113
Parser.java
h2/src/main/org/h2/command/Parser.java
+4
-4
ScriptCommand.java
h2/src/main/org/h2/command/dml/ScriptCommand.java
+6
-5
FreeSpaceBitSet.java
h2/src/main/org/h2/mvstore/FreeSpaceBitSet.java
+3
-3
Page.java
h2/src/main/org/h2/mvstore/Page.java
+4
-4
RowImpl.java
h2/src/main/org/h2/result/RowImpl.java
+1
-1
SimpleRow.java
h2/src/main/org/h2/result/SimpleRow.java
+1
-1
WebApp.java
h2/src/main/org/h2/server/web/WebApp.java
+89
-79
TableLink.java
h2/src/main/org/h2/table/TableLink.java
+1
-1
Recover.java
h2/src/main/org/h2/tools/Recover.java
+1
-1
AbbaLockingDetector.java
h2/src/main/org/h2/util/AbbaLockingDetector.java
+17
-14
没有找到文件。
h2/src/main/org/h2/command/Parser.java
浏览文件 @
5acc65e8
...
...
@@ -1154,10 +1154,10 @@ public class Parser {
TableFilter
sourceTableFilter
=
readSimpleTableFilterWithAliasExcludes
(
0
,
excludeIdentifiers
);
command
.
setSourceTableFilter
(
sourceTableFilter
);
StringBuilder
buff
=
new
StringBuilder
(
"SELECT * FROM "
+
sourceTableFilter
.
getTable
().
getName
());
StringBuilder
buff
=
new
StringBuilder
(
"SELECT * FROM "
)
.
append
(
sourceTableFilter
.
getTable
().
getName
());
if
(
sourceTableFilter
.
getTableAlias
()
!=
null
)
{
buff
.
append
(
" AS "
+
sourceTableFilter
.
getTableAlias
());
buff
.
append
(
" AS "
).
append
(
sourceTableFilter
.
getTableAlias
());
}
Prepared
preparedQuery
=
prepare
(
session
,
buff
.
toString
(),
null
/*paramValues*/
);
command
.
setQuery
((
Select
)
preparedQuery
);
...
...
@@ -1208,7 +1208,7 @@ public class Parser {
" AS "
+
command
.
getTargetTableFilter
().
getTableAlias
());
}
targetMatchQuerySQL
.
append
(
" WHERE "
+
command
.
getOnCondition
().
getSQL
());
.
append
(
" WHERE "
).
append
(
command
.
getOnCondition
().
getSQL
());
command
.
setTargetMatchQuery
(
(
Select
)
parse
(
targetMatchQuerySQL
.
toString
()));
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/command/dml/ScriptCommand.java
浏览文件 @
5acc65e8
...
...
@@ -423,10 +423,10 @@ public class ScriptCommand extends ScriptBase {
int
id
;
if
(
v
.
getType
()
==
Value
.
CLOB
)
{
id
=
writeLobStream
(
v
);
buff
.
append
(
"SYSTEM_COMBINE_CLOB("
+
id
+
")"
);
buff
.
append
(
"SYSTEM_COMBINE_CLOB("
).
append
(
id
).
append
(
')'
);
}
else
if
(
v
.
getType
()
==
Value
.
BLOB
)
{
id
=
writeLobStream
(
v
);
buff
.
append
(
"SYSTEM_COMBINE_BLOB("
+
id
+
")"
);
buff
.
append
(
"SYSTEM_COMBINE_BLOB("
).
append
(
id
).
append
(
')'
);
}
else
{
buff
.
append
(
v
.
getSQL
());
}
...
...
@@ -471,8 +471,8 @@ public class ScriptCommand extends ScriptBase {
try
(
InputStream
input
=
v
.
getInputStream
())
{
for
(
int
i
=
0
;;
i
++)
{
StringBuilder
buff
=
new
StringBuilder
(
lobBlockSize
*
2
);
buff
.
append
(
"INSERT INTO SYSTEM_LOB_STREAM VALUES("
+
id
+
", "
+
i
+
", NULL, '"
);
buff
.
append
(
"INSERT INTO SYSTEM_LOB_STREAM VALUES("
).
append
(
id
)
.
append
(
", "
).
append
(
i
).
append
(
", NULL, '"
);
int
len
=
IOUtils
.
readFully
(
input
,
bytes
,
lobBlockSize
);
if
(
len
<=
0
)
{
break
;
...
...
@@ -490,7 +490,8 @@ public class ScriptCommand extends ScriptBase {
try
(
Reader
reader
=
v
.
getReader
())
{
for
(
int
i
=
0
;;
i
++)
{
StringBuilder
buff
=
new
StringBuilder
(
lobBlockSize
*
2
);
buff
.
append
(
"INSERT INTO SYSTEM_LOB_STREAM VALUES("
+
id
+
", "
+
i
+
", "
);
buff
.
append
(
"INSERT INTO SYSTEM_LOB_STREAM VALUES("
).
append
(
id
).
append
(
", "
).
append
(
i
)
.
append
(
", "
);
int
len
=
IOUtils
.
readFully
(
reader
,
chars
,
lobBlockSize
);
if
(
len
==
0
)
{
break
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/mvstore/FreeSpaceBitSet.java
浏览文件 @
5acc65e8
...
...
@@ -197,9 +197,9 @@ public class FreeSpaceBitSet {
on
=
0
;
}
}
buff
.
append
(
"\n"
);
buff
.
append
(
" on "
+
onCount
+
" off "
+
offCount
);
buff
.
append
(
" "
+
100
*
onCount
/
(
onCount
+
offCount
)
+
"% used "
);
buff
.
append
(
'\n'
)
.
append
(
" on "
).
append
(
onCount
).
append
(
" off "
).
append
(
offCount
)
.
append
(
' '
).
append
(
100
*
onCount
/
(
onCount
+
offCount
)).
append
(
"% used "
);
}
buff
.
append
(
'['
);
for
(
int
i
=
0
;;)
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/mvstore/Page.java
浏览文件 @
5acc65e8
...
...
@@ -259,18 +259,18 @@ public class Page {
public
String
toString
()
{
StringBuilder
buff
=
new
StringBuilder
();
buff
.
append
(
"id: "
).
append
(
System
.
identityHashCode
(
this
)).
append
(
'\n'
);
buff
.
append
(
"version: "
).
append
(
Long
.
toHexString
(
version
)).
append
(
"\n"
);
buff
.
append
(
"pos: "
).
append
(
Long
.
toHexString
(
pos
)).
append
(
"\n"
);
buff
.
append
(
"version: "
).
append
(
Long
.
toHexString
(
version
)).
append
(
'\n'
);
buff
.
append
(
"pos: "
).
append
(
Long
.
toHexString
(
pos
)).
append
(
'\n'
);
if
(
pos
!=
0
)
{
int
chunkId
=
DataUtils
.
getPageChunkId
(
pos
);
buff
.
append
(
"chunk: "
).
append
(
Long
.
toHexString
(
chunkId
)).
append
(
"\n"
);
buff
.
append
(
"chunk: "
).
append
(
Long
.
toHexString
(
chunkId
)).
append
(
'\n'
);
}
for
(
int
i
=
0
;
i
<=
keys
.
length
;
i
++)
{
if
(
i
>
0
)
{
buff
.
append
(
" "
);
}
if
(
children
!=
null
)
{
buff
.
append
(
"["
+
Long
.
toHexString
(
children
[
i
].
pos
)
+
"] "
);
buff
.
append
(
'['
).
append
(
Long
.
toHexString
(
children
[
i
].
pos
)).
append
(
"] "
);
}
if
(
i
<
keys
.
length
)
{
buff
.
append
(
keys
[
i
]);
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/result/RowImpl.java
浏览文件 @
5acc65e8
...
...
@@ -134,7 +134,7 @@ public class RowImpl implements Row {
StatementBuilder
buff
=
new
StatementBuilder
(
"( /* key:"
);
buff
.
append
(
getKey
());
if
(
version
!=
0
)
{
buff
.
append
(
" v:"
+
version
);
buff
.
append
(
" v:"
).
append
(
version
);
}
if
(
isDeleted
())
{
buff
.
append
(
" deleted"
);
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/result/SimpleRow.java
浏览文件 @
5acc65e8
...
...
@@ -64,7 +64,7 @@ public class SimpleRow implements SearchRow {
StatementBuilder
buff
=
new
StatementBuilder
(
"( /* key:"
);
buff
.
append
(
getKey
());
if
(
version
!=
0
)
{
buff
.
append
(
" v:"
+
version
);
buff
.
append
(
" v:"
).
append
(
version
);
}
buff
.
append
(
" */ "
);
for
(
Value
v
:
data
)
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/server/web/WebApp.java
浏览文件 @
5acc65e8
...
...
@@ -490,14 +490,16 @@ public class WebApp {
columnsBuffer
.
append
(
column
.
getName
());
String
col
=
escapeIdentifier
(
column
.
getName
());
String
level
=
mainSchema
?
", 1, 1"
:
", 2, 2"
;
buff
.
append
(
"setNode("
+
treeIndex
+
level
+
", 'column', '"
+
PageParser
.
escapeJavaScript
(
column
.
getName
())
+
"', 'javascript:ins(\\'"
+
col
+
"\\')');\n"
);
buff
.
append
(
"setNode("
).
append
(
treeIndex
).
append
(
level
)
.
append
(
", 'column', '"
)
.
append
(
PageParser
.
escapeJavaScript
(
column
.
getName
()))
.
append
(
"', 'javascript:ins(\\'"
).
append
(
col
).
append
(
"\\')');\n"
);
treeIndex
++;
if
(
mainSchema
&&
showColumnTypes
)
{
buff
.
append
(
"setNode("
+
treeIndex
+
", 2, 2, 'type', '"
+
PageParser
.
escapeJavaScript
(
column
.
getDataType
())
+
"', null);\n"
);
buff
.
append
(
"setNode("
).
append
(
treeIndex
)
.
append
(
", 2, 2, 'type', '"
)
.
append
(
PageParser
.
escapeJavaScript
(
column
.
getDataType
()))
.
append
(
"', null);\n"
);
treeIndex
++;
}
}
...
...
@@ -574,21 +576,22 @@ public class WebApp {
String
level
=
mainSchema
?
", 1, 1"
:
", 2, 1"
;
String
levelIndex
=
mainSchema
?
", 2, 1"
:
", 3, 1"
;
String
levelColumnType
=
mainSchema
?
", 3, 2"
:
", 4, 2"
;
buff
.
append
(
"setNode("
+
treeIndex
+
level
+
", 'index_az', '${text.tree.indexes}', null);\n"
);
buff
.
append
(
"setNode("
).
append
(
treeIndex
).
append
(
level
)
.
append
(
", 'index_az', '${text.tree.indexes}', null);\n"
);
treeIndex
++;
for
(
IndexInfo
info
:
indexMap
.
values
())
{
buff
.
append
(
"setNode("
+
treeIndex
+
levelIndex
+
", 'index', '"
+
PageParser
.
escapeJavaScript
(
info
.
name
)
+
"', null);\n"
);
buff
.
append
(
"setNode("
).
append
(
treeIndex
).
append
(
levelIndex
)
.
append
(
", 'index', '"
)
.
append
(
PageParser
.
escapeJavaScript
(
info
.
name
))
.
append
(
"', null);\n"
);
treeIndex
++;
buff
.
append
(
"setNode("
+
treeIndex
+
levelColumnType
+
", 'type', '"
+
info
.
type
+
"', null);\n"
);
buff
.
append
(
"setNode("
).
append
(
treeIndex
).
append
(
levelColumnType
)
.
append
(
", 'type', '"
).
append
(
info
.
type
).
append
(
"', null);\n"
);
treeIndex
++;
buff
.
append
(
"setNode("
+
treeIndex
+
levelColumnType
+
", 'type', '"
+
PageParser
.
escapeJavaScript
(
info
.
columns
)
+
"', null);\n"
);
buff
.
append
(
"setNode("
).
append
(
treeIndex
).
append
(
levelColumnType
)
.
append
(
", 'type', '"
)
.
append
(
PageParser
.
escapeJavaScript
(
info
.
columns
))
.
append
(
"', null);\n"
);
treeIndex
++;
}
}
...
...
@@ -622,9 +625,10 @@ public class WebApp {
tab
=
schema
.
quotedName
+
"."
+
tab
;
}
tab
=
escapeIdentifier
(
tab
);
buff
.
append
(
"setNode("
+
treeIndex
+
indentation
+
" 'table', '"
+
PageParser
.
escapeJavaScript
(
table
.
getName
())
+
"', 'javascript:ins(\\'"
+
tab
+
"\\',true)');\n"
);
buff
.
append
(
"setNode("
).
append
(
treeIndex
).
append
(
indentation
)
.
append
(
" 'table', '"
)
.
append
(
PageParser
.
escapeJavaScript
(
table
.
getName
()))
.
append
(
"', 'javascript:ins(\\'"
).
append
(
tab
).
append
(
"\\',true)');\n"
);
treeIndex
++;
if
(
mainSchema
||
showColumns
)
{
StringBuilder
columnsBuffer
=
new
StringBuilder
();
...
...
@@ -634,10 +638,10 @@ public class WebApp {
treeIndex
=
addIndexes
(
mainSchema
,
meta
,
table
.
getName
(),
schema
.
name
,
buff
,
treeIndex
);
}
buff
.
append
(
"addTable('"
+
PageParser
.
escapeJavaScript
(
table
.
getName
())
+
"', '"
+
PageParser
.
escapeJavaScript
(
columnsBuffer
.
toString
())
+
"', "
+
tableId
+
");\n"
);
buff
.
append
(
"addTable('"
)
.
append
(
PageParser
.
escapeJavaScript
(
table
.
getName
())).
append
(
"', '"
)
.
append
(
PageParser
.
escapeJavaScript
(
columnsBuffer
.
toString
())).
append
(
"', "
)
.
append
(
tableId
).
append
(
");\n"
);
}
}
tables
=
schema
.
getTables
();
...
...
@@ -651,9 +655,10 @@ public class WebApp {
tab
=
view
.
getSchema
().
quotedName
+
"."
+
tab
;
}
tab
=
escapeIdentifier
(
tab
);
buff
.
append
(
"setNode("
+
treeIndex
+
indentation
+
" 'view', '"
+
PageParser
.
escapeJavaScript
(
view
.
getName
())
+
"', 'javascript:ins(\\'"
+
tab
+
"\\',true)');\n"
);
buff
.
append
(
"setNode("
).
append
(
treeIndex
).
append
(
indentation
)
.
append
(
" 'view', '"
)
.
append
(
PageParser
.
escapeJavaScript
(
view
.
getName
()))
.
append
(
"', 'javascript:ins(\\'"
).
append
(
tab
).
append
(
"\\',true)');\n"
);
treeIndex
++;
if
(
mainSchema
)
{
StringBuilder
columnsBuffer
=
new
StringBuilder
();
...
...
@@ -667,19 +672,20 @@ public class WebApp {
ResultSet
rs
=
prep
.
executeQuery
();
if
(
rs
.
next
())
{
String
sql
=
rs
.
getString
(
"SQL"
);
buff
.
append
(
"setNode("
+
treeIndex
+
indentNode
+
" 'type', '"
+
PageParser
.
escapeJavaScript
(
sql
)
+
"', null);\n"
);
buff
.
append
(
"setNode("
).
append
(
treeIndex
)
.
append
(
indentNode
)
.
append
(
" 'type', '"
)
.
append
(
PageParser
.
escapeJavaScript
(
sql
))
.
append
(
"', null);\n"
);
treeIndex
++;
}
rs
.
close
();
}
}
buff
.
append
(
"addTable('"
+
PageParser
.
escapeJavaScript
(
view
.
getName
())
+
"', '"
+
PageParser
.
escapeJavaScript
(
columnsBuffer
.
toString
())
+
"', "
+
tableId
+
");\n"
);
buff
.
append
(
"addTable('"
)
.
append
(
PageParser
.
escapeJavaScript
(
view
.
getName
())).
append
(
"', '"
)
.
append
(
PageParser
.
escapeJavaScript
(
columnsBuffer
.
toString
())).
append
(
"', "
)
.
append
(
tableId
).
append
(
");\n"
);
}
}
return
treeIndex
;
...
...
@@ -695,9 +701,10 @@ public class WebApp {
session
.
loadBnf
();
isH2
=
contents
.
isH2
();
StringBuilder
buff
=
new
StringBuilder
();
buff
.
append
(
"setNode(0, 0, 0, 'database', '"
+
PageParser
.
escapeJavaScript
(
url
)
+
"', null);\n"
);
StringBuilder
buff
=
new
StringBuilder
()
.
append
(
"setNode(0, 0, 0, 'database', '"
)
.
append
(
PageParser
.
escapeJavaScript
(
url
))
.
append
(
"', null);\n"
);
int
treeIndex
=
1
;
DbSchema
defaultSchema
=
contents
.
getDefaultSchema
();
...
...
@@ -707,9 +714,9 @@ public class WebApp {
if
(
schema
==
defaultSchema
||
schema
==
null
)
{
continue
;
}
buff
.
append
(
"setNode("
+
treeIndex
+
", 0, 1, 'folder', '"
+
PageParser
.
escapeJavaScript
(
schema
.
name
)
+
"', null);\n"
);
buff
.
append
(
"setNode("
).
append
(
treeIndex
).
append
(
", 0, 1, 'folder', '"
)
.
append
(
PageParser
.
escapeJavaScript
(
schema
.
name
))
.
append
(
"', null);\n"
);
treeIndex
++;
treeIndex
=
addTablesAndViews
(
schema
,
false
,
buff
,
treeIndex
);
}
...
...
@@ -719,29 +726,28 @@ public class WebApp {
"INFORMATION_SCHEMA.SEQUENCES ORDER BY SEQUENCE_NAME"
);
for
(
int
i
=
0
;
rs
.
next
();
i
++)
{
if
(
i
==
0
)
{
buff
.
append
(
"setNode("
+
treeIndex
+
", 0, 1, 'sequences', '${text.tree.sequences}', null);\n"
);
buff
.
append
(
"setNode("
).
append
(
treeIndex
)
.
append
(
", 0, 1, 'sequences', '${text.tree.sequences}', null);\n"
);
treeIndex
++;
}
String
name
=
rs
.
getString
(
"SEQUENCE_NAME"
);
String
current
=
rs
.
getString
(
"CURRENT_VALUE"
);
String
increment
=
rs
.
getString
(
"INCREMENT"
);
buff
.
append
(
"setNode("
+
treeIndex
+
", 1, 1, 'sequence', '"
+
PageParser
.
escapeJavaScript
(
name
)
+
"', null);\n"
);
buff
.
append
(
"setNode("
).
append
(
treeIndex
)
.
append
(
", 1, 1, 'sequence', '"
)
.
append
(
PageParser
.
escapeJavaScript
(
name
))
.
append
(
"', null);\n"
);
treeIndex
++;
buff
.
append
(
"setNode("
+
treeIndex
+
", 2, 2, 'type', '${text.tree.current}: "
+
PageParser
.
escapeJavaScript
(
current
)
+
"', null);\n"
);
buff
.
append
(
"setNode("
).
append
(
treeIndex
)
.
append
(
", 2, 2, 'type', '${text.tree.current}: "
)
.
append
(
PageParser
.
escapeJavaScript
(
current
))
.
append
(
"', null);\n"
);
treeIndex
++;
if
(!
"1"
.
equals
(
increment
))
{
buff
.
append
(
"setNode("
+
treeIndex
+
", 2, 2, 'type', '${text.tree.increment}: "
+
PageParser
.
escapeJavaScript
(
increment
)
+
"', null);\n"
);
buff
.
append
(
"setNode("
).
append
(
treeIndex
)
.
append
(
", 2, 2, 'type', '${text.tree.increment}: "
)
.
append
(
PageParser
.
escapeJavaScript
(
increment
))
.
append
(
"', null);\n"
);
treeIndex
++;
}
}
...
...
@@ -750,20 +756,20 @@ public class WebApp {
"INFORMATION_SCHEMA.USERS ORDER BY NAME"
);
for
(
int
i
=
0
;
rs
.
next
();
i
++)
{
if
(
i
==
0
)
{
buff
.
append
(
"setNode("
+
treeIndex
+
", 0, 1, 'users', '${text.tree.users}', null);\n"
);
buff
.
append
(
"setNode("
).
append
(
treeIndex
)
.
append
(
", 0, 1, 'users', '${text.tree.users}', null);\n"
);
treeIndex
++;
}
String
name
=
rs
.
getString
(
"NAME"
);
String
admin
=
rs
.
getString
(
"ADMIN"
);
buff
.
append
(
"setNode("
+
treeIndex
+
", 1, 1, 'user', '"
+
PageParser
.
escapeJavaScript
(
name
)
+
"', null);\n"
);
buff
.
append
(
"setNode("
).
append
(
treeIndex
)
.
append
(
", 1, 1, 'user', '"
)
.
append
(
PageParser
.
escapeJavaScript
(
name
))
.
append
(
"', null);\n"
);
treeIndex
++;
if
(
admin
.
equalsIgnoreCase
(
"TRUE"
))
{
buff
.
append
(
"setNode("
+
treeIndex
+
", 2, 2, 'type', '${text.tree.admin}', null);\n"
);
buff
.
append
(
"setNode("
).
append
(
treeIndex
)
.
append
(
", 2, 2, 'type', '${text.tree.admin}', null);\n"
);
treeIndex
++;
}
}
...
...
@@ -773,9 +779,11 @@ public class WebApp {
DatabaseMetaData
meta
=
session
.
getMetaData
();
String
version
=
meta
.
getDatabaseProductName
()
+
" "
+
meta
.
getDatabaseProductVersion
();
buff
.
append
(
"setNode("
+
treeIndex
+
", 0, 0, 'info', '"
+
PageParser
.
escapeJavaScript
(
version
)
+
"', null);\n"
);
buff
.
append
(
"refreshQueryTables();"
);
buff
.
append
(
"setNode("
).
append
(
treeIndex
)
.
append
(
", 0, 0, 'info', '"
)
.
append
(
PageParser
.
escapeJavaScript
(
version
))
.
append
(
"', null);\n"
)
.
append
(
"refreshQueryTables();"
);
session
.
put
(
"tree"
,
buff
.
toString
());
}
catch
(
Exception
e
)
{
session
.
put
(
"tree"
,
""
);
...
...
@@ -1357,21 +1365,22 @@ public class WebApp {
int
level
=
Integer
.
parseInt
(
s
);
conn
.
setTransactionIsolation
(
level
);
}
buff
.
append
(
"Transaction Isolation: "
+
conn
.
getTransactionIsolation
()
+
"<br />"
);
buff
.
append
(
Connection
.
TRANSACTION_READ_UNCOMMITTED
+
": read_uncommitted<br />"
);
buff
.
append
(
Connection
.
TRANSACTION_READ_COMMITTED
+
": read_committed<br />"
);
buff
.
append
(
Connection
.
TRANSACTION_REPEATABLE_READ
+
": repeatable_read<br />"
);
buff
.
append
(
Connection
.
TRANSACTION_SERIALIZABLE
+
": serializable"
);
buff
.
append
(
"Transaction Isolation: "
)
.
append
(
conn
.
getTransactionIsolation
())
.
append
(
"<br />"
);
buff
.
append
(
Connection
.
TRANSACTION_READ_UNCOMMITTED
)
.
append
(
": read_uncommitted<br />"
);
buff
.
append
(
Connection
.
TRANSACTION_READ_COMMITTED
)
.
append
(
": read_committed<br />"
);
buff
.
append
(
Connection
.
TRANSACTION_REPEATABLE_READ
)
.
append
(
": repeatable_read<br />"
);
buff
.
append
(
Connection
.
TRANSACTION_SERIALIZABLE
)
.
append
(
": serializable"
);
}
if
(
sql
.
startsWith
(
"@"
))
{
rs
=
getMetaResultSet
(
conn
,
sql
);
if
(
rs
==
null
)
{
buff
.
append
(
"?: "
+
sql
);
buff
.
append
(
"?: "
).
append
(
sql
);
return
buff
.
toString
();
}
}
else
{
...
...
@@ -1385,7 +1394,8 @@ public class WebApp {
rs
=
stat
.
getGeneratedKeys
();
}
else
{
if
(!
isResultSet
)
{
buff
.
append
(
"${text.result.updateCount}: "
+
stat
.
getUpdateCount
());
buff
.
append
(
"${text.result.updateCount}: "
)
.
append
(
stat
.
getUpdateCount
());
time
=
System
.
currentTimeMillis
()
-
time
;
buff
.
append
(
"<br />("
).
append
(
time
).
append
(
" ms)"
);
stat
.
close
();
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/table/TableLink.java
浏览文件 @
5acc65e8
...
...
@@ -387,7 +387,7 @@ public class TableLink extends Table {
if
(
readOnly
)
{
buff
.
append
(
" READONLY"
);
}
buff
.
append
(
" /*"
+
JdbcSQLException
.
HIDE_SQL
+
"*/"
);
buff
.
append
(
" /*"
).
append
(
JdbcSQLException
.
HIDE_SQL
).
append
(
"*/"
);
return
buff
.
toString
();
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/tools/Recover.java
浏览文件 @
5acc65e8
...
...
@@ -1477,7 +1477,7 @@ public class Recover extends Tool implements DataHandler {
private
void
writeRow
(
PrintWriter
writer
,
Data
s
,
Value
[]
data
)
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
"INSERT INTO "
+
storageName
+
" VALUES("
);
sb
.
append
(
"INSERT INTO "
).
append
(
storageName
).
append
(
" VALUES("
);
for
(
valueId
=
0
;
valueId
<
recordLength
;
valueId
++)
{
try
{
Value
v
=
s
.
readValue
();
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/util/AbbaLockingDetector.java
浏览文件 @
5acc65e8
...
...
@@ -184,15 +184,15 @@ public class AbbaLockingDetector implements Runnable {
* stack frames)
*/
private
static
String
getStackTraceForThread
(
ThreadInfo
info
)
{
StringBuilder
sb
=
new
StringBuilder
(
"\""
+
info
.
getThreadName
()
+
"\""
+
" Id="
+
info
.
getThreadId
()
+
" "
+
info
.
getThreadState
());
StringBuilder
sb
=
new
StringBuilder
(
).
append
(
'"'
)
.
append
(
info
.
getThreadName
()).
append
(
"\""
+
" Id="
)
.
append
(
info
.
getThreadId
()).
append
(
' '
).
append
(
info
.
getThreadState
());
if
(
info
.
getLockName
()
!=
null
)
{
sb
.
append
(
" on "
+
info
.
getLockName
());
sb
.
append
(
" on "
).
append
(
info
.
getLockName
());
}
if
(
info
.
getLockOwnerName
()
!=
null
)
{
sb
.
append
(
" owned by \""
+
info
.
getLockOwnerName
()
+
"\" Id="
+
info
.
getLockOwnerId
());
sb
.
append
(
" owned by \""
).
append
(
info
.
getLockOwnerName
())
.
append
(
"\" Id="
).
append
(
info
.
getLockOwnerId
());
}
if
(
info
.
isSuspended
())
{
sb
.
append
(
" (suspended)"
);
...
...
@@ -229,22 +229,25 @@ public class AbbaLockingDetector implements Runnable {
private
static
void
dumpStackTraceElement
(
ThreadInfo
info
,
StringBuilder
sb
,
int
i
,
StackTraceElement
e
)
{
sb
.
append
(
'\t'
).
append
(
"at "
).
append
(
e
.
toString
());
sb
.
append
(
'\n'
);
sb
.
append
(
'\t'
).
append
(
"at "
).
append
(
e
)
.
append
(
'\n'
);
if
(
i
==
0
&&
info
.
getLockInfo
()
!=
null
)
{
Thread
.
State
ts
=
info
.
getThreadState
();
switch
(
ts
)
{
case
BLOCKED:
sb
.
append
(
"\t- blocked on "
+
info
.
getLockInfo
());
sb
.
append
(
'\n'
);
sb
.
append
(
"\t- blocked on "
)
.
append
(
info
.
getLockInfo
())
.
append
(
'\n'
);
break
;
case
WAITING:
sb
.
append
(
"\t- waiting on "
+
info
.
getLockInfo
());
sb
.
append
(
'\n'
);
sb
.
append
(
"\t- waiting on "
)
.
append
(
info
.
getLockInfo
())
.
append
(
'\n'
);
break
;
case
TIMED_WAITING:
sb
.
append
(
"\t- waiting on "
+
info
.
getLockInfo
());
sb
.
append
(
'\n'
);
sb
.
append
(
"\t- waiting on "
)
.
append
(
info
.
getLockInfo
())
.
append
(
'\n'
);
break
;
default
:
}
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论