Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
e51e48dc
提交
e51e48dc
authored
15 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
New experimental LOB storage.
上级
1df42bbd
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
69 行增加
和
15 行删除
+69
-15
DropDatabase.java
h2/src/main/org/h2/command/ddl/DropDatabase.java
+4
-1
Constraint.java
h2/src/main/org/h2/constraint/Constraint.java
+4
-0
Database.java
h2/src/main/org/h2/engine/Database.java
+2
-1
BaseIndex.java
h2/src/main/org/h2/index/BaseIndex.java
+4
-0
MultiVersionIndex.java
h2/src/main/org/h2/index/MultiVersionIndex.java
+4
-0
SchemaObject.java
h2/src/main/org/h2/schema/SchemaObject.java
+9
-0
SchemaObjectBase.java
h2/src/main/org/h2/schema/SchemaObjectBase.java
+4
-0
LobStorage.java
h2/src/main/org/h2/store/LobStorage.java
+25
-2
Table.java
h2/src/main/org/h2/table/Table.java
+0
-6
ValueLob2.java
h2/src/main/org/h2/value/ValueLob2.java
+13
-5
没有找到文件。
h2/src/main/org/h2/command/ddl/DropDatabase.java
浏览文件 @
e51e48dc
...
...
@@ -62,7 +62,7 @@ public class DropDatabase extends DefineCommand {
}
}
for
(
Table
t
:
tables
)
{
if
(
t
.
getName
()
!=
null
&&
Table
.
TABLE
.
equals
(
t
.
getTableType
()))
{
if
(
t
.
getName
()
!=
null
&&
Table
.
TABLE
.
equals
(
t
.
getTableType
())
&&
!
t
.
isHidden
()
)
{
db
.
removeSchemaObject
(
session
,
t
);
}
}
...
...
@@ -75,6 +75,9 @@ public class DropDatabase extends DefineCommand {
list
.
addAll
(
db
.
getAllSchemaObjects
(
DbObject
.
TRIGGER
));
list
.
addAll
(
db
.
getAllSchemaObjects
(
DbObject
.
CONSTANT
));
for
(
SchemaObject
obj
:
list
)
{
if
(
obj
.
isHidden
())
{
continue
;
}
db
.
removeSchemaObject
(
session
,
obj
);
}
for
(
User
user
:
db
.
getAllUsers
())
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/constraint/Constraint.java
浏览文件 @
e51e48dc
...
...
@@ -174,4 +174,8 @@ public abstract class Constraint extends SchemaObjectBase implements Comparable<
return
thisType
-
otherType
;
}
public
boolean
isHidden
()
{
return
table
.
isHidden
();
}
}
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/Database.java
浏览文件 @
e51e48dc
...
...
@@ -2034,7 +2034,8 @@ public class Database implements DataHandler {
public
Table
getFirstUserTable
()
{
for
(
Table
table
:
getAllTablesAndViews
(
false
))
{
if
(
table
.
getCreateSQL
()
!=
null
)
{
if
(
SysProperties
.
LOB_IN_DATABASE
&&
table
.
getSchema
()
==
infoSchema
)
{
if
(
table
.
isHidden
())
{
// LOB tables
continue
;
}
return
table
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/BaseIndex.java
浏览文件 @
e51e48dc
...
...
@@ -371,4 +371,8 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index {
throw
DbException
.
getUnsupportedException
(
toString
());
}
public
boolean
isHidden
()
{
return
table
.
isHidden
();
}
}
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/MultiVersionIndex.java
浏览文件 @
e51e48dc
...
...
@@ -320,4 +320,8 @@ public class MultiVersionIndex implements Index {
return
base
.
getRow
(
session
,
key
);
}
public
boolean
isHidden
()
{
return
base
.
isHidden
();
}
}
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/schema/SchemaObject.java
浏览文件 @
e51e48dc
...
...
@@ -19,4 +19,13 @@ public interface SchemaObject extends DbObject {
* @return the schema
*/
Schema
getSchema
();
/**
* Check whether this is a hidden object that doesn't appear in the meta
* data and in the script, and is not dropped on DROP ALL OBJECTS.
*
* @return true if it is hidden
*/
boolean
isHidden
();
}
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/schema/SchemaObjectBase.java
浏览文件 @
e51e48dc
...
...
@@ -36,4 +36,8 @@ public abstract class SchemaObjectBase extends DbObjectBase implements SchemaObj
return
schema
.
getSQL
()
+
"."
+
super
.
getSQL
();
}
public
boolean
isHidden
()
{
return
false
;
}
}
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/store/LobStorage.java
浏览文件 @
e51e48dc
...
...
@@ -69,7 +69,6 @@ public class LobStorage {
if
(
conn
==
null
)
{
return
;
}
int
todoDatabaseGetFirstUserTable
;
try
{
Statement
stat
=
conn
.
createStatement
();
// stat.execute("SET UNDO_LOG 0");
...
...
@@ -101,8 +100,18 @@ public class LobStorage {
public
void
removeAllForTable
(
int
tableId
)
{
if
(
SysProperties
.
LOB_IN_DATABASE
)
{
init
();
int
todo
;
try
{
PreparedStatement
prep
=
prepare
(
"SELECT ID FROM "
+
LOBS
+
" WHERE TABLE=?"
);
prep
.
setInt
(
1
,
tableId
);
ResultSet
rs
=
prep
.
executeQuery
();
while
(
rs
.
next
())
{
deleteLob
(
rs
.
getLong
(
1
));
}
}
catch
(
SQLException
e
)
{
throw
DbException
.
convert
(
e
);
}
// remove both lobs in the database as well as in the file system
// (compatibility)
}
ValueLob
.
removeAllForTable
(
handler
,
tableId
);
}
...
...
@@ -455,4 +464,18 @@ public class LobStorage {
return
ValueLob
.
createClob
(
reader
,
maxLength
,
handler
);
}
public
void
setTable
(
long
lobId
,
int
table
)
{
try
{
PreparedStatement
prep
=
prepare
(
"UPDATE "
+
LOBS
+
" SET TABLE = ? WHERE ID = ?"
);
prep
.
setInt
(
1
,
table
);
prep
.
setLong
(
2
,
lobId
);
int
updateCount
=
prep
.
executeUpdate
();
if
(
updateCount
!=
1
)
{
throw
DbException
.
throwInternalError
(
"count: "
+
updateCount
);
}
}
catch
(
SQLException
e
)
{
throw
DbException
.
convert
(
e
);
}
}
}
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/table/Table.java
浏览文件 @
e51e48dc
...
...
@@ -972,12 +972,6 @@ public abstract class Table extends SchemaObjectBase {
return
column
.
convert
(
v
);
}
/**
* Check whether this is a hidden table that doesn't appear in the meta
* data and in the script.
*
* @return true if it is hidden
*/
public
boolean
isHidden
()
{
return
isHidden
;
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/value/ValueLob2.java
浏览文件 @
e51e48dc
...
...
@@ -137,17 +137,25 @@ public class ValueLob2 extends Value {
}
public
void
unlink
()
{
if
(
small
==
null
&&
tableId
!=
LobStorage
.
TABLE_ID_SESSION_VARIABLE
)
{
lobStorage
.
setTable
(
lobId
,
LobStorage
.
TABLE_ID_SESSION_VARIABLE
);
tableId
=
LobStorage
.
TABLE_ID_SESSION_VARIABLE
;
}
}
public
Value
link
(
DataHandler
h
,
int
tabId
)
{
int
todo
;
if
(
small
==
null
)
{
if
(
tabId
!=
tableId
)
{
if
(
tableId
!=
LobStorage
.
TABLE_ID_SESSION_VARIABLE
)
{
throw
DbException
.
throwInternalError
();
}
lobStorage
.
setTable
(
lobId
,
tabId
);
this
.
tableId
=
tabId
;
}
}
return
this
;
}
private
int
getNewObjectId
(
DataHandler
h
)
{
return
0
;
}
/**
* Get the current table id of this lob.
*
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论