Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
c5ae92cb
提交
c5ae92cb
authored
3月 31, 2007
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
23cceaf0
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
25 行增加
和
21 行删除
+25
-21
DiskFile.java
h2/src/main/org/h2/store/DiskFile.java
+4
-0
TableView.java
h2/src/main/org/h2/table/TableView.java
+19
-17
Transfer.java
h2/src/main/org/h2/value/Transfer.java
+2
-4
没有找到文件。
h2/src/main/org/h2/store/DiskFile.java
浏览文件 @
c5ae92cb
...
@@ -214,6 +214,10 @@ public class DiskFile implements CacheWriter {
...
@@ -214,6 +214,10 @@ public class DiskFile implements CacheWriter {
try
{
try
{
DataInputStream
in
=
new
DataInputStream
(
new
ByteArrayInputStream
(
summary
));
DataInputStream
in
=
new
DataInputStream
(
new
ByteArrayInputStream
(
summary
));
int
b2
=
in
.
readInt
();
int
b2
=
in
.
readInt
();
if
(
b2
>
fileBlockCount
)
{
database
.
getTrace
(
Trace
.
DATABASE
).
info
(
"unexpected size "
+
b2
+
" when initializing summary for "
+
fileName
+
" expected:"
+
fileBlockCount
);
return
;
}
stage
++;
stage
++;
for
(
int
i
=
0
,
x
=
0
;
i
<
b2
/
8
;
i
++)
{
for
(
int
i
=
0
,
x
=
0
;
i
<
b2
/
8
;
i
++)
{
int
mask
=
in
.
read
();
int
mask
=
in
.
read
();
...
...
h2/src/main/org/h2/table/TableView.java
浏览文件 @
c5ae92cb
...
@@ -25,12 +25,12 @@ public class TableView extends Table {
...
@@ -25,12 +25,12 @@ public class TableView extends Table {
private
String
querySQL
;
private
String
querySQL
;
private
ObjectArray
tables
;
private
ObjectArray
tables
;
private
String
[]
columnNames
;
private
String
[]
columnNames
;
private
boolean
invalid
;
private
Query
viewQuery
;
private
Query
viewQuery
;
private
ViewIndex
index
;
private
ViewIndex
index
;
private
boolean
recursive
;
private
boolean
recursive
;
private
SQLException
createException
;
public
TableView
(
Schema
schema
,
int
id
,
String
name
,
String
querySQL
,
ObjectArray
params
,
String
[]
columnNames
,
Session
session
)
throws
SQLException
{
public
TableView
(
Schema
schema
,
int
id
,
String
name
,
String
querySQL
,
ObjectArray
params
,
String
[]
columnNames
,
Session
session
,
boolean
recursive
)
throws
SQLException
{
super
(
schema
,
id
,
name
,
false
);
super
(
schema
,
id
,
name
,
false
);
this
.
querySQL
=
querySQL
;
this
.
querySQL
=
querySQL
;
this
.
columnNames
=
columnNames
;
this
.
columnNames
=
columnNames
;
...
@@ -68,34 +68,35 @@ public class TableView extends Table {
...
@@ -68,34 +68,35 @@ public class TableView extends Table {
}
}
cols
=
new
Column
[
list
.
size
()];
cols
=
new
Column
[
list
.
size
()];
list
.
toArray
(
cols
);
list
.
toArray
(
cols
);
invalid
=
false
;
createException
=
null
;
if
(
getId
()
!=
0
)
{
if
(
getId
()
!=
0
)
{
addViewToTables
();
addViewToTables
();
}
}
viewQuery
=
query
;
viewQuery
=
query
;
}
catch
(
SQLException
e
)
{
}
catch
(
SQLException
e
)
{
createException
=
e
;
// if it can't be compiled, then it's a 'zero column table'
// if it can't be compiled, then it's a 'zero column table'
// this avoids problems when creating the view when opening the database
// this avoids problems when creating the view when opening the database
tables
=
new
ObjectArray
();
tables
=
new
ObjectArray
();
cols
=
new
Column
[
0
];
cols
=
new
Column
[
0
];
invalid
=
true
;
if
(
columnNames
!=
null
)
{
int
testing
;
cols
=
new
Column
[
columnNames
.
length
];
// if(recursive && columnNames != null) {
for
(
int
i
=
0
;
i
<
columnNames
.
length
;
i
++)
{
// cols = new Column[columnNames.length];
cols
[
i
]
=
new
Column
(
columnNames
[
i
],
Value
.
STRING
,
255
,
0
);
// for(int i=0; i<columnNames.length; i++) {
}
// cols[i] = new Column(columnNames[i], Value.STRING, 255, 0);
invalid
=
false
;
// }
index
.
setRecursive
(
true
);
// index.setRecursive(true);
recursive
=
true
;
// recursive = true;
}
// createException = null;
// }
}
}
setColumns
(
cols
);
setColumns
(
cols
);
}
}
public
boolean
getInvalid
()
{
public
boolean
getInvalid
()
{
return
invalid
;
return
createException
!=
null
;
}
}
public
PlanItem
getBestPlanItem
(
Session
session
,
int
[]
masks
)
throws
SQLException
{
public
PlanItem
getBestPlanItem
(
Session
session
,
int
[]
masks
)
throws
SQLException
{
...
@@ -196,8 +197,9 @@ public class TableView extends Table {
...
@@ -196,8 +197,9 @@ public class TableView extends Table {
}
}
public
Index
getScanIndex
(
Session
session
)
throws
SQLException
{
public
Index
getScanIndex
(
Session
session
)
throws
SQLException
{
if
(
invalid
)
{
if
(
createException
!=
null
)
{
throw
Message
.
getSQLException
(
Message
.
VIEW_IS_INVALID_1
,
getSQL
());
String
msg
=
createException
.
getMessage
();
throw
Message
.
getSQLException
(
Message
.
VIEW_IS_INVALID_2
,
new
String
[]{
getSQL
(),
msg
},
createException
);
}
}
PlanItem
item
=
getBestPlanItem
(
session
,
null
);
PlanItem
item
=
getBestPlanItem
(
session
,
null
);
return
item
.
getIndex
();
return
item
.
getIndex
();
...
@@ -221,7 +223,7 @@ public class TableView extends Table {
...
@@ -221,7 +223,7 @@ public class TableView extends Table {
}
}
public
long
getMaxDataModificationId
()
{
public
long
getMaxDataModificationId
()
{
if
(
invalid
)
{
if
(
createException
!=
null
)
{
throw
Message
.
getInternalError
();
throw
Message
.
getInternalError
();
}
}
if
(
viewQuery
==
null
)
{
if
(
viewQuery
==
null
)
{
...
...
h2/src/main/org/h2/value/Transfer.java
浏览文件 @
c5ae92cb
/*
/*
* Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* */
* Initial Developer: H2 Group
*/
package
org
.
h2
.
value
;
package
org
.
h2
.
value
;
import
java.io.BufferedInputStream
;
import
java.io.BufferedInputStream
;
...
@@ -30,9 +31,6 @@ import org.h2.util.ExactUTF8InputStreamReader;
...
@@ -30,9 +31,6 @@ import org.h2.util.ExactUTF8InputStreamReader;
import
org.h2.util.IOUtils
;
import
org.h2.util.IOUtils
;
import
org.h2.util.StringCache
;
import
org.h2.util.StringCache
;
/**
* @author Thomas
*/
public
class
Transfer
{
public
class
Transfer
{
private
static
final
int
BUFFER_SIZE
=
16
*
1024
;
private
static
final
int
BUFFER_SIZE
=
16
*
1024
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论