Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
66c2dc5b
提交
66c2dc5b
authored
3月 23, 2008
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
2cdc5f9a
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
29 行增加
和
7 行删除
+29
-7
Database.java
h2/src/main/org/h2/engine/Database.java
+1
-0
LogFile.java
h2/src/main/org/h2/log/LogFile.java
+1
-1
LogSystem.java
h2/src/main/org/h2/log/LogSystem.java
+4
-0
FileSystemDatabase.java
h2/src/main/org/h2/store/fs/FileSystemDatabase.java
+1
-1
FileSystemMemory.java
h2/src/main/org/h2/store/fs/FileSystemMemory.java
+8
-2
TableLink.java
h2/src/main/org/h2/table/TableLink.java
+5
-0
Recover.java
h2/src/main/org/h2/tools/Recover.java
+6
-2
JdbcDriverUtils.java
h2/src/main/org/h2/util/JdbcDriverUtils.java
+1
-0
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+2
-1
没有找到文件。
h2/src/main/org/h2/engine/Database.java
浏览文件 @
66c2dc5b
...
@@ -898,6 +898,7 @@ public class Database implements DataHandler {
...
@@ -898,6 +898,7 @@ public class Database implements DataHandler {
sequence
.
close
();
sequence
.
close
();
}
}
meta
.
close
(
systemSession
);
meta
.
close
(
systemSession
);
systemSession
.
commit
(
true
);
indexSummaryValid
=
true
;
indexSummaryValid
=
true
;
}
}
}
catch
(
SQLException
e
)
{
}
catch
(
SQLException
e
)
{
...
...
h2/src/main/org/h2/log/LogFile.java
浏览文件 @
66c2dc5b
...
@@ -212,7 +212,7 @@ public class LogFile {
...
@@ -212,7 +212,7 @@ public class LogFile {
int
blocks
=
in
.
readInt
();
int
blocks
=
in
.
readInt
();
if
(
blocks
<
0
)
{
if
(
blocks
<
0
)
{
return
true
;
return
true
;
}
else
if
(
blocks
==
0
)
{
}
else
if
(
blocks
==
0
&&
!
database
.
getReadOnly
()
)
{
truncate
(
pos
);
truncate
(
pos
);
return
false
;
return
false
;
}
}
...
...
h2/src/main/org/h2/log/LogSystem.java
浏览文件 @
66c2dc5b
...
@@ -82,6 +82,10 @@ public class LogSystem {
...
@@ -82,6 +82,10 @@ public class LogSystem {
return
;
return
;
}
}
file
.
flush
();
file
.
flush
();
if
(
database
.
getLogIndexChanges
())
{
file
=
database
.
getIndexFile
();
file
.
flush
();
}
if
(
containsInDoubtTransactions
())
{
if
(
containsInDoubtTransactions
())
{
// if there are any in-doubt transactions
// if there are any in-doubt transactions
// (even if they are resolved), can't update or delete the log files
// (even if they are resolved), can't update or delete the log files
...
...
h2/src/main/org/h2/store/fs/FileSystemDatabase.java
浏览文件 @
66c2dc5b
...
@@ -170,7 +170,7 @@ public class FileSystemDatabase extends FileSystem {
...
@@ -170,7 +170,7 @@ public class FileSystemDatabase extends FileSystem {
if
(
log
)
{
if
(
log
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
return
new
RuntimeException
(
e
.
toString
());
return
new
RuntimeException
(
e
.
toString
()
,
e
);
}
}
public
boolean
canWrite
(
String
fileName
)
{
public
boolean
canWrite
(
String
fileName
)
{
...
...
h2/src/main/org/h2/store/fs/FileSystemMemory.java
浏览文件 @
66c2dc5b
...
@@ -13,6 +13,7 @@ import java.util.HashMap;
...
@@ -13,6 +13,7 @@ import java.util.HashMap;
import
org.h2.message.Message
;
import
org.h2.message.Message
;
import
org.h2.util.IOUtils
;
import
org.h2.util.IOUtils
;
import
org.h2.util.RandomUtils
;
/**
/**
* This file system keeps files fully in memory.
* This file system keeps files fully in memory.
...
@@ -74,7 +75,12 @@ public class FileSystemMemory extends FileSystem {
...
@@ -74,7 +75,12 @@ public class FileSystemMemory extends FileSystem {
public
String
createTempFile
(
String
name
,
String
suffix
,
boolean
deleteOnExit
,
boolean
inTempDir
)
throws
IOException
{
public
String
createTempFile
(
String
name
,
String
suffix
,
boolean
deleteOnExit
,
boolean
inTempDir
)
throws
IOException
{
name
+=
"."
;
name
+=
"."
;
for
(
int
i
=
0
;;
i
++)
{
for
(
int
i
=
0
;;
i
++)
{
String
n
=
name
+
i
+
suffix
;
int
test
;
String
n
=
name
+
RandomUtils
.
getSecureLong
()
+
suffix
;
// String n = name + i + suffix;
if
(!
exists
(
n
))
{
if
(!
exists
(
n
))
{
// creates the file (not thread safe)
// creates the file (not thread safe)
getMemoryFile
(
n
);
getMemoryFile
(
n
);
...
...
h2/src/main/org/h2/table/TableLink.java
浏览文件 @
66c2dc5b
...
@@ -72,6 +72,8 @@ public class TableLink extends Table {
...
@@ -72,6 +72,8 @@ public class TableLink extends Table {
conn
=
JdbcUtils
.
getConnection
(
driver
,
url
,
user
,
password
);
conn
=
JdbcUtils
.
getConnection
(
driver
,
url
,
user
,
password
);
DatabaseMetaData
meta
=
conn
.
getMetaData
();
DatabaseMetaData
meta
=
conn
.
getMetaData
();
boolean
storesLowerCase
=
meta
.
storesLowerCaseIdentifiers
();
boolean
storesLowerCase
=
meta
.
storesLowerCaseIdentifiers
();
boolean
storesMixedCase
=
meta
.
storesMixedCaseIdentifiers
();
boolean
supportsMixedCaseIdentifiers
=
meta
.
supportsMixedCaseIdentifiers
();
ResultSet
rs
=
meta
.
getColumns
(
null
,
null
,
originalTable
,
null
);
ResultSet
rs
=
meta
.
getColumns
(
null
,
null
,
originalTable
,
null
);
int
i
=
0
;
int
i
=
0
;
ObjectArray
columnList
=
new
ObjectArray
();
ObjectArray
columnList
=
new
ObjectArray
();
...
@@ -96,6 +98,9 @@ public class TableLink extends Table {
...
@@ -96,6 +98,9 @@ public class TableLink extends Table {
String
n
=
rs
.
getString
(
"COLUMN_NAME"
);
String
n
=
rs
.
getString
(
"COLUMN_NAME"
);
if
(
storesLowerCase
&&
n
.
equals
(
StringUtils
.
toLowerEnglish
(
n
)))
{
if
(
storesLowerCase
&&
n
.
equals
(
StringUtils
.
toLowerEnglish
(
n
)))
{
n
=
StringUtils
.
toUpperEnglish
(
n
);
n
=
StringUtils
.
toUpperEnglish
(
n
);
}
else
if
(
storesMixedCase
&&
!
supportsMixedCaseIdentifiers
)
{
// TeraData
n
=
StringUtils
.
toUpperEnglish
(
n
);
}
}
int
sqlType
=
rs
.
getInt
(
"DATA_TYPE"
);
int
sqlType
=
rs
.
getInt
(
"DATA_TYPE"
);
long
precision
=
rs
.
getInt
(
"COLUMN_SIZE"
);
long
precision
=
rs
.
getInt
(
"COLUMN_SIZE"
);
...
...
h2/src/main/org/h2/tools/Recover.java
浏览文件 @
66c2dc5b
...
@@ -537,11 +537,15 @@ public class Recover implements DataHandler {
...
@@ -537,11 +537,15 @@ public class Recover implements DataHandler {
break
;
break
;
case
'I'
:
case
'I'
:
writer
.
println
(
"// insert session:"
+
sessionId
+
" storage:"
+
storageId
+
" pos:"
+
recId
+
" blockCount:"
+
blockCount
);
writer
.
println
(
"// insert session:"
+
sessionId
+
" storage:"
+
storageId
+
" pos:"
+
recId
+
" blockCount:"
+
blockCount
);
if
(
storageId
>=
0
)
{
writeLogRecord
(
writer
,
s
);
writeLogRecord
(
writer
,
s
);
}
break
;
break
;
case
'D'
:
case
'D'
:
writer
.
println
(
"// delete session:"
+
sessionId
+
" storage:"
+
storageId
+
" pos:"
+
recId
+
" blockCount:"
+
blockCount
);
writer
.
println
(
"// delete session:"
+
sessionId
+
" storage:"
+
storageId
+
" pos:"
+
recId
+
" blockCount:"
+
blockCount
);
if
(
storageId
>=
0
)
{
writeLogRecord
(
writer
,
s
);
writeLogRecord
(
writer
,
s
);
}
break
;
break
;
default
:
default
:
writer
.
println
(
"// type?:"
+
type
+
" session:"
+
sessionId
+
" storage:"
+
storageId
+
" pos:"
+
recId
+
" blockCount:"
+
blockCount
);
writer
.
println
(
"// type?:"
+
type
+
" session:"
+
sessionId
+
" storage:"
+
storageId
+
" pos:"
+
recId
+
" blockCount:"
+
blockCount
);
...
...
h2/src/main/org/h2/util/JdbcDriverUtils.java
浏览文件 @
66c2dc5b
...
@@ -36,6 +36,7 @@ public class JdbcDriverUtils {
...
@@ -36,6 +36,7 @@ public class JdbcDriverUtils {
"jdbc:postgresql:"
,
"org.postgresql.Driver"
,
"jdbc:postgresql:"
,
"org.postgresql.Driver"
,
"jdbc:sybase:"
,
"com.sybase.jdbc3.jdbc.SybDriver"
,
"jdbc:sybase:"
,
"com.sybase.jdbc3.jdbc.SybDriver"
,
"jdbc:sqlserver:"
,
"com.microsoft.sqlserver.jdbc.SQLServerDriver"
,
"jdbc:sqlserver:"
,
"com.microsoft.sqlserver.jdbc.SQLServerDriver"
,
"jdbc:teradata:"
,
"com.ncr.teradata.TeraDriver"
,
};
};
public
static
String
getDriver
(
String
url
)
{
public
static
String
getDriver
(
String
url
)
{
...
...
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
66c2dc5b
...
@@ -163,6 +163,8 @@ java org.h2.test.TestAll timer
...
@@ -163,6 +163,8 @@ java org.h2.test.TestAll timer
should write (log) to system table before adding to internal data structures
should write (log) to system table before adding to internal data structures
//new TestCrashAPI().init(test).testCase(2046453618);
//new TestCrashAPI().init(test).testCase(2046453618);
temp file delete should be per-database and should stop deleting once the database is closed
--------------
--------------
scheduler: what if invoke takes more than...
scheduler: what if invoke takes more than...
...
@@ -449,7 +451,6 @@ Use a default delay of 1 second before closing a database.
...
@@ -449,7 +451,6 @@ Use a default delay of 1 second before closing a database.
beforeTest
();
beforeTest
();
// db
// db
new
TestScriptSimple
().
runTest
(
this
);
new
TestScriptSimple
().
runTest
(
this
);
new
TestScript
().
runTest
(
this
);
new
TestScript
().
runTest
(
this
);
new
TestAutoRecompile
().
runTest
(
this
);
new
TestAutoRecompile
().
runTest
(
this
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论