Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
2f8b42f4
提交
2f8b42f4
authored
1月 31, 2008
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
373a5600
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
293 行增加
和
38 行删除
+293
-38
source.html
h2/src/docsrc/html/source.html
+12
-11
sourceError.html
h2/src/docsrc/html/sourceError.html
+200
-0
ErrorCode.java
h2/src/main/org/h2/constant/ErrorCode.java
+3
-0
Engine.java
h2/src/main/org/h2/engine/Engine.java
+1
-1
JdbcSQLException.java
h2/src/main/org/h2/jdbc/JdbcSQLException.java
+1
-1
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+10
-5
Doclet.java
h2/src/tools/org/h2/tools/doclet/Doclet.java
+66
-20
没有找到文件。
h2/src/docsrc/html/source.html
浏览文件 @
2f8b42f4
...
...
@@ -2,8 +2,9 @@
Copyright 2004-2008 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<html><script>
<!--
<html>
<script
type=
"text/javascript"
>
//
<!--
var
line
=
0
,
file
=
''
;
var
params
=
location
.
search
.
substring
(
1
).
split
(
'&'
);
var
build
=
'trunk'
;
...
...
@@ -14,28 +15,28 @@ Initial Developer: H2 Group
line
=
value
;
}
else
if
(
key
==
'file'
)
{
file
=
value
;
}
else
if
(
key
==
'build'
)
{
}
else
if
(
key
==
'build'
&&
value
>=
63
)
{
build
=
'tags/version-1.0.'
+
value
;
}
}
-->
//
-->
</script>
<pre>
<table
width=
"100%"
>
<tr>
<td
style=
"width: 50px"
>
<script
>
<!--
<script
type=
"text/javascript"
>
//
<!--
for
(
var
i
=
1
;
i
<=
5000
;
i
++
)
{
if
(
line
==
i
)
{
document
.
write
(
'<b>'
+
i
+
'
></b><br />'
);
document
.
write
(
'<b>'
+
i
+
'></b><br />'
);
}
else
if
(
line
<=
4
||
i
+
4
==
line
)
{
document
.
write
(
i
+
'<a name="here"></a><br />'
);
}
else
{
document
.
write
(
i
+
'<br />'
);
}
}
-->
//
-->
</script>
</td>
<td
width=
"92%"
style=
"vertical-align: top;"
>
...
...
@@ -45,11 +46,11 @@ Initial Developer: H2 Group
</tr>
</table>
<a
href=
"#here"
></a>
<script>
<!--
<script
type=
"text/javascript"
>
//
<!--
var
source
=
document
.
getElementById
(
'source'
);
source
.
src
=
'http://h2database.googlecode.com/svn/'
+
build
+
'/h2/src/main/'
+
file
;
document
.
location
=
'#here'
;
-->
//
-->
</script>
</pre></html>
h2/src/docsrc/html/sourceError.html
0 → 100644
浏览文件 @
2f8b42f4
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Copyright 2004-2008 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<html
xmlns=
"http://www.w3.org/1999/xhtml"
lang=
"en"
xml:lang=
"en"
>
<head><meta
http-equiv=
"Content-Type"
content=
"text/html;charset=utf-8"
/><title>
Error Analytics
</title><link
rel=
"stylesheet"
type=
"text/css"
href=
"stylesheet.css"
/>
<style
type=
"text/css"
>
a
{
text-decoration
:
underline
;
font-weight
:
normal
;
color
:
#0000ff
;
}
a
.selected
{
text-decoration
:
none
;
font-weight
:
bold
;
color
:
#000000
;
}
a
.disabled
{
text-decoration
:
none
;
font-weight
:
normal
;
color
:
lightGray
;
}
</style>
</head><body
style=
"margin:20px"
>
<script
type=
"text/javascript"
>
//
<!--
function
$
(
id
)
{
return
document
.
getElementById
(
id
);
}
function
goDetails
(
code
)
{
code
=
code
.
replace
(
'21S'
,
'210'
);
code
=
code
.
replace
(
'42S'
,
'421'
);
code
=
code
.
replace
(
'HY'
,
'50'
);
code
=
code
.
replace
(
'C'
,
'1'
);
code
=
code
.
replace
(
'T'
,
'2'
);
$
(
'more'
).
src
=
'http://h2database.com/javadoc/org/h2/constant/ErrorCode.html#c'
+
code
;
}
function
go
(
url
,
file
)
{
$
(
'file'
).
innerHTML
=
file
;
$
(
'code'
).
src
=
url
;
}
var
lastError
=
''
;
var
hasData
=
false
;
var
errorCode
=
'0'
;
function
convert
()
{
try
{
var
s
=
$
(
'error'
).
value
;
if
(
lastError
==
s
)
{
return
;
}
lastError
=
s
;
var
result
=
''
;
hasData
=
false
;
var
idx
=
s
.
lastIndexOf
(
"["
);
if
(
idx
>=
0
)
{
$
(
'message'
).
innerHTML
=
s
.
substring
(
0
,
idx
);
var
end
=
s
.
indexOf
(
"]"
,
idx
);
errorCode
=
s
.
substring
(
idx
+
1
,
end
);
hasData
=
true
;
idx
=
errorCode
.
indexOf
(
"-"
);
build
=
errorCode
.
substring
(
idx
+
1
);
$
(
'version'
).
innerHTML
=
'1.0.'
+
build
;
errorCode
=
errorCode
.
substring
(
0
,
idx
);
while
(
errorCode
.
length
>
1
&&
errorCode
.
charAt
(
0
)
==
'0'
)
{
errorCode
=
errorCode
.
substring
(
1
);
}
$
(
'errorCode'
).
innerHTML
=
errorCode
;
goDetails
(
errorCode
);
s
=
s
.
substring
(
end
+
1
);
}
idx
=
0
;
while
(
true
)
{
var
start
=
s
.
indexOf
(
"org.h2."
,
idx
);
if
(
start
<
0
)
{
result
+=
s
.
substring
(
idx
);
break
;
}
if
(
idx
>
0
)
{
result
+=
s
.
substring
(
idx
,
start
);
}
var
end
=
s
.
indexOf
(
')'
,
start
);
if
(
end
<
0
)
{
result
+=
s
.
substring
(
idx
);
break
;
}
var
element
=
s
.
substring
(
start
,
end
+
1
);
var
open
=
element
.
lastIndexOf
(
'('
);
var
dotMethod
=
element
.
lastIndexOf
(
'.'
,
open
-
1
);
var
dotClass
=
element
.
lastIndexOf
(
'.'
,
dotMethod
-
1
);
var
packageName
=
element
.
substring
(
0
,
dotClass
);
var
colon
=
element
.
lastIndexOf
(
':'
);
var
file
=
element
.
substring
(
open
+
1
,
colon
);
var
lineNumber
=
element
.
substring
(
colon
+
1
,
element
.
length
-
1
);
var
fullFileName
=
packageName
.
replace
(
/
\.
/g
,
'/'
)
+
"/"
+
file
;
var
url
=
"http://h2database.com/html/source.html?file="
;
url
+=
fullFileName
;
url
+=
"&line="
;
url
+=
lineNumber
;
url
+=
"&build="
;
url
+=
build
;
result
+=
"<a href='javascript:go(
\"
"
;
result
+=
url
;
result
+=
"
\"
,
\"
"
;
result
+=
fullFileName
;
result
+=
"
\"
)'>"
;
result
+=
element
;
result
+=
"</a>"
;
hasData
=
true
;
idx
=
end
+
1
;
}
result
=
result
.
replace
(
/
[\n\r]
+/g
,
"<br/>"
);
result
=
result
.
replace
(
/ at /g
,
""
);
$
(
'links'
).
innerHTML
=
result
;
select
(
'input'
);
}
catch
(
e
)
{
hasData
=
false
;
alert
(
'Can not parse the stack trace: '
+
e
);
}
}
function
select
(
id
)
{
$
(
'input'
).
style
.
display
=
'none'
;
$
(
'details'
).
style
.
display
=
'none'
;
$
(
'source'
).
style
.
display
=
'none'
;
$
(
'inputTab'
).
className
=
''
;
$
(
'detailsTab'
).
className
=
hasData
?
''
:
'disabled'
;
$
(
'sourceTab'
).
className
=
hasData
?
''
:
'disabled'
;
$
(
id
+
'Tab'
).
className
=
'selected'
;
$
(
id
).
style
.
display
=
''
;
if
(
id
==
'details'
)
{
goDetails
(
errorCode
);
}
}
//-->
</script>
<h1>
Error Analytics
</h1>
<h2>
<a
href=
"javascript:select('input')"
id=
"inputTab"
>
Input
</a>
<a
href=
"javascript:select('details')"
id=
"detailsTab"
>
Details
</a>
<a
href=
"javascript:select('source')"
id=
"sourceTab"
>
Source Code
</a>
</h2>
<hr/>
<div
id=
"input"
>
<p>
Fill in the error message and stack trace and click on 'Details' or 'Source Code':
</p>
<textarea
id=
"error"
cols=
"100"
style=
"width: 100%; overflow: auto;"
rows=
"20"
onChange=
"convert()"
onSelect=
"convert()"
onKeyUp=
"convert()"
onKeyPress=
"convert()"
onFocus=
"convert()"
onBlur=
"convert()"
>
</textarea>
</div>
<div
id=
"details"
>
<p><b>
Error Code:
</b><span
id=
"errorCode"
></span></p>
<p><b>
Product Version:
</b><span
id=
"version"
></span></p>
<p><b>
Message:
</b></p>
<p
id=
"message"
></p>
<p><b>
More Information:
</b></p>
<iframe
id=
"more"
frameborder=
"0"
marginwidth=
"0"
marginheight=
"0"
width=
"100%"
height=
"300px"
src=
""
>
</iframe>
</div>
<div
id=
"source"
>
<table
style=
"border:0px"
width=
"100%"
><tr><td
style=
"border:0px"
width=
"30px"
>
<p><b>
Stack Trace:
</b></p>
<p
id=
"links"
></p>
</td><td
style=
"border:0px"
width=
"90%"
>
<p><b>
Source File:
</b><span
id=
"file"
></span></p>
<iframe
id=
"code"
frameborder=
"0"
marginwidth=
"0"
marginheight=
"0"
width=
"100%"
height=
"300px"
src=
""
>
</iframe>
</td></tr></table>
</div>
<script
type=
"text/javascript"
>
//
<!--
select
(
'input'
);
//-->
</script>
</body></html>
\ No newline at end of file
h2/src/main/org/h2/constant/ErrorCode.java
浏览文件 @
2f8b42f4
...
...
@@ -675,6 +675,9 @@ public class ErrorCode {
* INTERNAL
*/
public
static
String
getState
(
int
errorCode
)
{
// To convert SQLState to error code, replace
// 21S: 210, 42S: 421, HY: 50, C: 1, T: 2
switch
(
errorCode
)
{
// 02: no data
case
NO_DATA_AVAILABLE:
return
"02000"
;
...
...
h2/src/main/org/h2/engine/Engine.java
浏览文件 @
2f8b42f4
...
...
@@ -70,7 +70,7 @@ public class Engine {
if
(
user
==
null
)
{
try
{
database
.
checkFilePasswordHash
(
cipher
,
ci
.
getFilePasswordHash
());
//create the exception here so it is not possible from the stack trace
//
create the exception here so it is not possible from the stack trace
// to see if the user name was wrong or the password
SQLException
wrongUserOrPassword
=
Message
.
getSQLException
(
ErrorCode
.
WRONG_USER_OR_PASSWORD
);
user
=
database
.
getUser
(
ci
.
getUserName
(),
wrongUserOrPassword
);
...
...
h2/src/main/org/h2/jdbc/JdbcSQLException.java
浏览文件 @
2f8b42f4
...
...
@@ -155,7 +155,7 @@ public class JdbcSQLException extends SQLException {
buff
.
append
(
sql
);
}
buff
.
append
(
" ["
);
buff
.
append
(
get
SQLStat
e
());
buff
.
append
(
get
ErrorCod
e
());
buff
.
append
(
'-'
);
buff
.
append
(
Constants
.
BUILD_ID
);
buff
.
append
(
']'
);
...
...
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
2f8b42f4
...
...
@@ -151,6 +151,16 @@ java org.h2.test.TestAll timer
/*
add sourceError as an official link
corruption should be it's own error code(s)
Online Error Analyzer
add a 'kill process while altering tables' test case
1.5 tool: closeSilently(s1, s2,...)
implement max_query_time and use it for TestCrashAPI
document IKVM
...
...
@@ -175,11 +185,6 @@ Roadmap:
Move Maven 2 repository from hsql.sf.net to h2database.sf.net
History:
Primary keys are now considered constraints and can have a constraint name.
H2 Console: stack traces are now links to the source code in the source repository (H2 database only).
CHAR data type equals comparison was case insensitive instead of case sensitive.
The exception 'Value too long for column' now includes the data.
The table name was missing in the documentation of CREATE INDEX.
Test Recovery with MAX_LOG_FILE_SIZE=1; test with various log file sizes
...
...
h2/src/tools/org/h2/tools/doclet/Doclet.java
浏览文件 @
2f8b42f4
...
...
@@ -78,6 +78,7 @@ public class Doclet {
writer
.
println
(
"<h1>"
+
className
+
"</h1>"
);
writer
.
println
(
formatText
(
clazz
.
commentText
())
+
"<br /><br />"
);
// method overview
MethodDoc
[]
methods
=
clazz
.
methods
();
Arrays
.
sort
(
methods
,
new
Comparator
()
{
public
int
compare
(
Object
a
,
Object
b
)
{
...
...
@@ -122,6 +123,8 @@ public class Doclet {
if
(
hasMethods
)
{
writer
.
println
(
"</table>"
);
}
// field overview
FieldDoc
[]
fields
=
clazz
.
fields
();
if
(
clazz
.
interfaces
().
length
>
0
)
{
fields
=
clazz
.
interfaces
()[
0
].
fields
();
...
...
@@ -148,29 +151,14 @@ public class Doclet {
String
type
=
getTypeName
(
true
,
field
.
type
());
writer
.
println
(
"<tr><td class=\"return\">"
+
type
+
"</td><td class=\"method\">"
);
String
constant
=
field
.
constantValueExpression
();
// add a link (a name) if there is a <code> tag
int
linkStart
=
text
.
indexOf
(
"<code>"
);
if
(
linkStart
>=
0
)
{
int
linkEnd
=
text
.
indexOf
(
"</code>"
,
linkStart
);
String
link
=
text
.
substring
(
linkStart
+
"<code>"
.
length
(),
linkEnd
);
if
(
constant
!=
null
&&
!
constant
.
equals
(
link
))
{
throw
new
Error
(
"wrong code tag? "
+
clazz
.
name
()
+
"."
+
name
+
" code: "
+
link
+
" constant: "
+
constant
);
}
if
(
Character
.
isDigit
(
link
.
charAt
(
0
)))
{
link
=
"c"
+
link
;
}
writer
.
println
(
"<a name=\""
+
link
+
"\"></a>"
);
}
String
link
=
getFieldLink
(
text
,
constant
,
clazz
,
name
);
writer
.
print
(
"<a href=\"#"
+
link
+
"\">"
+
name
+
"</a>"
);
if
(
constant
==
null
)
{
writer
.
println
(
name
);
writer
.
println
();
}
else
{
writer
.
println
(
name
+
" = "
+
constant
);
}
if
(
text
!=
null
)
{
writer
.
println
(
"<div class=\"fieldText\">"
+
formatText
(
text
)
+
"</div>"
);
writer
.
println
(
" = "
+
constant
);
}
writer
.
println
(
"</td></tr>"
);
fieldId
++;
...
...
@@ -179,6 +167,7 @@ public class Doclet {
writer
.
println
(
"</table>"
);
}
// message details
for
(
int
i
=
0
;
i
<
methods
.
length
;
i
++)
{
MethodDoc
method
=
methods
[
i
];
String
name
=
method
.
name
();
...
...
@@ -255,11 +244,68 @@ public class Doclet {
}
writer
.
println
(
"<hr />"
);
}
// field details
Arrays
.
sort
(
fields
,
new
Comparator
()
{
public
int
compare
(
Object
a
,
Object
b
)
{
FieldDoc
fa
=
(
FieldDoc
)
a
;
FieldDoc
fb
=
(
FieldDoc
)
b
;
String
ca
=
fa
.
constantValueExpression
();
String
cb
=
fb
.
constantValueExpression
();
if
(
ca
!=
null
&&
cb
!=
null
)
{
return
ca
.
compareTo
(
cb
);
}
return
fa
.
name
().
compareTo
(
fb
.
name
());
}
});
for
(
int
i
=
0
;
i
<
fields
.
length
;
i
++)
{
FieldDoc
field
=
fields
[
i
];
if
(!
field
.
isFinal
()
||
!
field
.
isStatic
()
||
!
field
.
isPublic
())
{
continue
;
}
String
text
=
field
.
commentText
();
if
(
text
.
startsWith
(
"INTERNAL"
))
{
continue
;
}
String
name
=
field
.
name
();
String
constant
=
field
.
constantValueExpression
();
String
link
=
getFieldLink
(
text
,
constant
,
clazz
,
name
);
writer
.
println
(
"<a name=\""
+
link
+
"\"></a>"
);
writer
.
println
(
"<h4><span class=\"methodName\">"
+
name
);
if
(
constant
==
null
)
{
writer
.
println
();
}
else
{
writer
.
println
(
" = "
+
constant
);
}
writer
.
println
(
"</span></h4>"
);
if
(
text
!=
null
)
{
writer
.
println
(
"<div class=\"item\">"
+
formatText
(
text
)
+
"</div>"
);
}
writer
.
println
(
"<hr />"
);
}
writer
.
println
(
"</div></td></tr></table></body></html>"
);
writer
.
close
();
out
.
close
();
}
private
static
String
getFieldLink
(
String
text
,
String
constant
,
ClassDoc
clazz
,
String
name
)
{
String
link
=
constant
!=
null
?
constant
:
name
.
toLowerCase
();
int
linkStart
=
text
.
indexOf
(
"<code>"
);
if
(
linkStart
>=
0
)
{
int
linkEnd
=
text
.
indexOf
(
"</code>"
,
linkStart
);
link
=
text
.
substring
(
linkStart
+
"<code>"
.
length
(),
linkEnd
);
if
(
constant
!=
null
&&
!
constant
.
equals
(
link
))
{
throw
new
Error
(
"wrong code tag? "
+
clazz
.
name
()
+
"."
+
name
+
" code: "
+
link
+
" constant: "
+
constant
);
}
}
if
(
Character
.
isDigit
(
link
.
charAt
(
0
)))
{
link
=
"c"
+
link
;
}
return
link
;
}
private
static
String
formatText
(
String
text
)
{
if
(
text
==
null
)
{
return
text
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论