Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
e9bd9c7d
提交
e9bd9c7d
authored
4月 22, 2007
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
b9e6c06e
显示空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
59 行增加
和
23 行删除
+59
-23
Constraint.java
h2/src/main/org/h2/constraint/Constraint.java
+4
-0
Comment.java
h2/src/main/org/h2/engine/Comment.java
+4
-0
Constants.java
h2/src/main/org/h2/engine/Constants.java
+4
-3
Database.java
h2/src/main/org/h2/engine/Database.java
+8
-9
DbObject.java
h2/src/main/org/h2/engine/DbObject.java
+2
-0
FunctionAlias.java
h2/src/main/org/h2/engine/FunctionAlias.java
+4
-0
Right.java
h2/src/main/org/h2/engine/Right.java
+4
-0
Role.java
h2/src/main/org/h2/engine/Role.java
+4
-0
Session.java
h2/src/main/org/h2/engine/Session.java
+10
-9
SessionRemote.java
h2/src/main/org/h2/engine/SessionRemote.java
+3
-2
Setting.java
h2/src/main/org/h2/engine/Setting.java
+4
-0
User.java
h2/src/main/org/h2/engine/User.java
+4
-0
UserDataType.java
h2/src/main/org/h2/engine/UserDataType.java
+4
-0
没有找到文件。
h2/src/main/org/h2/constraint/Constraint.java
浏览文件 @
e9bd9c7d
...
...
@@ -54,4 +54,8 @@ public abstract class Constraint extends SchemaObject {
return
table
;
}
public
String
getDropSQL
()
{
return
null
;
}
}
h2/src/main/org/h2/engine/Comment.java
浏览文件 @
e9bd9c7d
...
...
@@ -57,6 +57,10 @@ public class Comment extends DbObject {
}
}
public
String
getDropSQL
()
{
return
null
;
}
public
String
getCreateSQL
()
{
StringBuffer
buff
=
new
StringBuffer
();
buff
.
append
(
"COMMENT ON "
);
...
...
h2/src/main/org/h2/engine/Constants.java
浏览文件 @
e9bd9c7d
...
...
@@ -27,7 +27,7 @@ package org.h2.engine;
* ant codeswitch_jdk14
*
* - Change FAQ (next release planned, known bugs)
* - Check version, change build number in Constants.java and
build.xml
* - Check version, change build number in Constants.java and
ant-build.properties
* - Check code coverage
* - No " Message.getInternalError" (must be "throw Message.getInternalError")
* - No TODO in the docs
...
...
@@ -66,8 +66,8 @@ package org.h2.engine;
*/
public
class
Constants
{
public
static
final
int
BUILD_ID
=
4
4
;
private
static
final
String
BUILD
=
"2007-03-
04
"
;
public
static
final
int
BUILD_ID
=
4
5
;
private
static
final
String
BUILD
=
"2007-03-
20
"
;
public
static
final
int
VERSION_MAJOR
=
1
;
public
static
final
int
VERSION_MINOR
=
0
;
...
...
@@ -106,6 +106,7 @@ public class Constants {
public
static
final
int
DEFAULT_CACHE_SIZE_LINEAR_INDEX
=
1
<<
8
;
public
static
final
String
SUFFIX_DB_FILE
=
".db"
;
public
static
final
String
SUFFIX_DATA_FILE
=
".data.db"
;
public
static
final
String
SUFFIX_LOG_FILE
=
".log.db"
;
public
static
final
String
SUFFIX_INDEX_FILE
=
".index.db"
;
...
...
h2/src/main/org/h2/engine/Database.java
浏览文件 @
e9bd9c7d
...
...
@@ -45,6 +45,7 @@ import org.h2.tools.DeleteDbFiles;
import
org.h2.util.BitField
;
import
org.h2.util.ByteUtils
;
import
org.h2.util.CacheLRU
;
import
org.h2.util.ClassUtils
;
import
org.h2.util.FileUtils
;
import
org.h2.util.IOUtils
;
import
org.h2.util.MemoryFile
;
...
...
@@ -291,16 +292,10 @@ public class Database implements DataHandler {
}
public
FileStore
openFile
(
String
name
,
boolean
mustExist
)
throws
SQLException
{
return
openFile
(
name
,
false
,
mustExist
);
}
public
FileStore
openFile
(
String
name
,
boolean
notEncrypted
,
boolean
mustExist
)
throws
SQLException
{
String
c
=
notEncrypted
?
null
:
cipher
;
byte
[]
h
=
notEncrypted
?
null
:
filePasswordHash
;
if
(
mustExist
&&
!
FileUtils
.
exists
(
name
))
{
throw
Message
.
getSQLException
(
Message
.
FILE_CORRUPTED_1
,
name
);
}
FileStore
store
=
FileStore
.
open
(
this
,
name
,
getMagic
(),
c
,
h
);
FileStore
store
=
FileStore
.
open
(
this
,
name
,
getMagic
(),
c
ipher
,
filePasswordHas
h
);
try
{
store
.
init
();
}
catch
(
SQLException
e
)
{
...
...
@@ -417,6 +412,9 @@ public class Database implements DataHandler {
}
else
{
traceSystem
=
new
TraceSystem
(
databaseName
+
Constants
.
SUFFIX_TRACE_FILE
);
}
if
(
cipher
!=
null
)
{
traceSystem
.
setManualEnabling
(
false
);
}
traceSystem
.
setLevelFile
(
traceLevelFile
);
traceSystem
.
setLevelSystemOut
(
traceLevelSystemOut
);
traceSystem
.
getTrace
(
Trace
.
DATABASE
).
info
(
"opening "
+
databaseName
+
" (build "
+
Constants
.
BUILD_ID
+
")"
);
...
...
@@ -1007,7 +1005,8 @@ public class Database implements DataHandler {
public
String
createTempFile
()
throws
SQLException
{
try
{
return
FileUtils
.
createTempFile
(
databaseName
,
Constants
.
SUFFIX_TEMP_FILE
,
true
);
boolean
inTempDir
=
readOnly
;
return
FileUtils
.
createTempFile
(
databaseName
,
Constants
.
SUFFIX_TEMP_FILE
,
true
,
inTempDir
);
}
catch
(
IOException
e
)
{
throw
Message
.
convert
(
e
);
}
...
...
@@ -1220,7 +1219,7 @@ public class Database implements DataHandler {
}
public
Class
loadClass
(
String
className
)
throws
ClassNotFoundException
{
return
Class
.
forName
(
className
);
return
Class
Utils
.
loadClass
(
className
);
}
public
void
setEventListener
(
String
className
)
throws
SQLException
{
...
...
h2/src/main/org/h2/engine/DbObject.java
浏览文件 @
e9bd9c7d
...
...
@@ -108,6 +108,8 @@ public abstract class DbObject {
public
abstract
String
getCreateSQLForCopy
(
Table
table
,
String
quotedName
);
public
abstract
String
getCreateSQL
();
public
abstract
String
getDropSQL
();
public
abstract
int
getType
();
public
abstract
void
removeChildrenAndResources
(
Session
session
)
throws
SQLException
;
public
abstract
void
checkRename
()
throws
SQLException
;
...
...
h2/src/main/org/h2/engine/FunctionAlias.java
浏览文件 @
e9bd9c7d
...
...
@@ -105,6 +105,10 @@ public class FunctionAlias extends DbObject {
throw
Message
.
getInternalError
();
}
public
String
getDropSQL
()
{
return
"DROP ALIAS IF EXISTS "
+
getSQL
();
}
public
String
getCreateSQL
()
{
StringBuffer
buff
=
new
StringBuffer
();
buff
.
append
(
"CREATE ALIAS "
);
...
...
h2/src/main/org/h2/engine/Right.java
浏览文件 @
e9bd9c7d
...
...
@@ -69,6 +69,10 @@ public class Right extends DbObject {
return
grantee
;
}
public
String
getDropSQL
()
{
return
null
;
}
public
String
getCreateSQLForCopy
(
Table
table
,
String
quotedName
)
{
StringBuffer
buff
=
new
StringBuffer
();
buff
.
append
(
"GRANT "
);
...
...
h2/src/main/org/h2/engine/Role.java
浏览文件 @
e9bd9c7d
...
...
@@ -24,6 +24,10 @@ public class Role extends RightOwner {
throw
Message
.
getInternalError
();
}
public
String
getDropSQL
()
{
return
null
;
}
public
String
getCreateSQL
()
{
if
(
system
)
{
return
null
;
...
...
h2/src/main/org/h2/engine/Session.java
浏览文件 @
e9bd9c7d
...
...
@@ -26,7 +26,6 @@ import org.h2.store.LogSystem;
import
org.h2.store.UndoLog
;
import
org.h2.store.UndoLogRecord
;
import
org.h2.table.Table
;
import
org.h2.table.TableData
;
import
org.h2.util.ObjectArray
;
import
org.h2.value.Value
;
import
org.h2.value.ValueLong
;
...
...
@@ -88,8 +87,8 @@ public class Session implements SessionInterface {
}
}
public
void
addLocalTempTable
(
Table
Data
table
)
throws
SQLException
{
cleanTempTables
();
public
void
addLocalTempTable
(
Table
table
)
throws
SQLException
{
cleanTempTables
(
false
);
if
(
localTempTables
==
null
)
{
localTempTables
=
new
HashMap
();
}
...
...
@@ -195,7 +194,8 @@ public class Session implements SessionInterface {
}
if
(
undoLog
.
size
()
>
0
)
{
undoLog
.
clear
();
cleanTempTables
();
// do not clean the temp tables if the last command was a create/drop
cleanTempTables
(
false
);
}
if
(
unlinkSet
!=
null
&&
unlinkSet
.
size
()
>
0
)
{
// need to flush the log file, because we can't unlink lobs if the commit record is not written
...
...
@@ -219,7 +219,7 @@ public class Session implements SessionInterface {
if
(
locks
.
size
()
>
0
||
needCommit
)
{
logSystem
.
commit
(
this
);
}
cleanTempTables
();
cleanTempTables
(
false
);
unlockAll
();
}
...
...
@@ -252,6 +252,7 @@ public class Session implements SessionInterface {
public
void
close
()
throws
SQLException
{
if
(
database
!=
null
)
{
try
{
cleanTempTables
(
true
);
database
.
removeSession
(
this
);
}
finally
{
database
=
null
;
...
...
@@ -296,12 +297,12 @@ public class Session implements SessionInterface {
savepoints
=
null
;
}
private
void
cleanTempTables
()
throws
SQLException
{
private
void
cleanTempTables
(
boolean
closeSession
)
throws
SQLException
{
if
(
localTempTables
!=
null
&&
localTempTables
.
size
()>
0
)
{
ObjectArray
list
=
new
ObjectArray
(
localTempTables
.
values
());
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
Table
Data
table
=
(
TableData
)
list
.
get
(
i
);
if
(
table
.
isOnCommitDrop
())
{
Table
table
=
(
Table
)
list
.
get
(
i
);
if
(
closeSession
||
table
.
isOnCommitDrop
())
{
table
.
setModified
();
localTempTables
.
remove
(
table
.
getName
());
table
.
removeChildrenAndResources
(
this
);
...
...
h2/src/main/org/h2/engine/SessionRemote.java
浏览文件 @
e9bd9c7d
...
...
@@ -178,7 +178,7 @@ public class SessionRemote implements SessionInterface, DataHandler {
if
(
traceLevelFile
!=
null
)
{
int
level
=
Integer
.
parseInt
(
traceLevelFile
);
String
prefix
=
getTraceFilePrefix
(
databaseName
);
String
file
=
FileUtils
.
createTempFile
(
prefix
,
Constants
.
SUFFIX_TRACE_FILE
,
false
);
String
file
=
FileUtils
.
createTempFile
(
prefix
,
Constants
.
SUFFIX_TRACE_FILE
,
false
,
false
);
traceSystem
.
setFileName
(
file
);
traceSystem
.
setLevelFile
(
level
);
}
...
...
@@ -323,7 +323,7 @@ public class SessionRemote implements SessionInterface, DataHandler {
public
String
createTempFile
()
throws
SQLException
{
try
{
return
FileUtils
.
createTempFile
(
databaseName
,
Constants
.
SUFFIX_TEMP_FILE
,
true
);
return
FileUtils
.
createTempFile
(
databaseName
,
Constants
.
SUFFIX_TEMP_FILE
,
true
,
false
);
}
catch
(
IOException
e
)
{
throw
Message
.
convert
(
e
);
}
...
...
@@ -367,6 +367,7 @@ public class SessionRemote implements SessionInterface, DataHandler {
}
else
{
store
=
FileStore
.
open
(
this
,
name
,
magic
,
cipher
,
fileEncryptionKey
,
0
);
}
store
.
setCheckedWriting
(
false
);
try
{
store
.
init
();
}
catch
(
SQLException
e
)
{
...
...
h2/src/main/org/h2/engine/Setting.java
浏览文件 @
e9bd9c7d
...
...
@@ -38,6 +38,10 @@ public class Setting extends DbObject {
throw
Message
.
getInternalError
();
}
public
String
getDropSQL
()
{
return
null
;
}
public
String
getCreateSQL
()
{
StringBuffer
buff
=
new
StringBuffer
();
buff
.
append
(
"SET "
);
...
...
h2/src/main/org/h2/engine/User.java
浏览文件 @
e9bd9c7d
...
...
@@ -58,6 +58,10 @@ public class User extends RightOwner {
return
getCreateSQL
(
true
,
false
);
}
public
String
getDropSQL
()
{
return
null
;
}
public
void
checkRight
(
Table
table
,
int
rightMask
)
throws
SQLException
{
if
(
rightMask
!=
Right
.
SELECT
&&
!
systemUser
)
{
database
.
checkWritingAllowed
();
...
...
h2/src/main/org/h2/engine/UserDataType.java
浏览文件 @
e9bd9c7d
...
...
@@ -23,6 +23,10 @@ public class UserDataType extends DbObject {
throw
Message
.
getInternalError
();
}
public
String
getDropSQL
()
{
return
"DROP DOMAIN IF EXISTS "
+
getSQL
();
}
public
String
getCreateSQL
()
{
StringBuffer
buff
=
new
StringBuffer
();
buff
.
append
(
"CREATE DOMAIN "
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论