Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
dd54730f
提交
dd54730f
authored
3月 07, 2008
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
b3f0513a
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
54 行增加
和
11 行删除
+54
-11
AlterTableSet.java
h2/src/main/org/h2/command/dml/AlterTableSet.java
+10
-3
BackupCommand.java
h2/src/main/org/h2/command/dml/BackupCommand.java
+6
-0
ExecuteProcedure.java
h2/src/main/org/h2/command/dml/ExecuteProcedure.java
+6
-0
Query.java
h2/src/main/org/h2/command/dml/Query.java
+17
-4
Select.java
h2/src/main/org/h2/command/dml/Select.java
+12
-1
SelectUnion.java
h2/src/main/org/h2/command/dml/SelectUnion.java
+2
-2
LZFInputStream.java
h2/src/main/org/h2/compress/LZFInputStream.java
+1
-1
没有找到文件。
h2/src/main/org/h2/command/dml/AlterTableSet.java
浏览文件 @
dd54730f
...
...
@@ -20,13 +20,20 @@ import org.h2.table.Table;
*/
public
class
AlterTableSet
extends
SchemaCommand
{
/**
* Enable the referential integrity.
*/
public
static
final
int
REFERENTIAL_INTEGRITY_TRUE
=
0
;
/**
* Disable the referential integrity.
*/
public
static
final
int
REFERENTIAL_INTEGRITY_FALSE
=
1
;
private
String
tableName
;
private
final
int
type
;
private
boolean
checkExisting
;
public
static
final
int
REFERENTIAL_INTEGRITY_TRUE
=
4
;
public
static
final
int
REFERENTIAL_INTEGRITY_FALSE
=
5
;
public
AlterTableSet
(
Session
session
,
Schema
schema
,
int
type
)
{
super
(
session
,
schema
);
this
.
type
=
type
;
...
...
h2/src/main/org/h2/command/dml/BackupCommand.java
浏览文件 @
dd54730f
...
...
@@ -135,6 +135,12 @@ public class BackupCommand extends Prepared {
return
true
;
}
/**
* Fix the file name, replacing backslash with slash.
*
* @param f the file name
* @return the corrected file name
*/
public
static
String
correctFileName
(
String
f
)
{
f
=
f
.
replace
(
'\\'
,
'/'
);
if
(
f
.
startsWith
(
"/"
))
{
...
...
h2/src/main/org/h2/command/dml/ExecuteProcedure.java
浏览文件 @
dd54730f
...
...
@@ -32,6 +32,12 @@ public class ExecuteProcedure extends Prepared {
this
.
procedure
=
procedure
;
}
/**
* Set the expression at the given index.
*
* @param index the index (0 based)
* @param expr the expression
*/
public
void
setExpression
(
int
index
,
Expression
expr
)
throws
SQLException
{
expressions
.
add
(
index
,
expr
);
}
...
...
h2/src/main/org/h2/command/dml/Query.java
浏览文件 @
dd54730f
...
...
@@ -181,7 +181,7 @@ public abstract class Query extends Prepared {
return
true
;
}
p
ublic
final
boolean
sameResultAsLast
(
Session
session
,
Value
[]
params
,
Value
[]
lastParams
,
long
lastEvaluated
)
p
rivate
boolean
sameResultAsLast
(
Session
session
,
Value
[]
params
,
Value
[]
lastParams
,
long
lastEvaluated
)
throws
SQLException
{
Database
db
=
session
.
getDatabase
();
for
(
int
i
=
0
;
i
<
params
.
length
;
i
++)
{
...
...
@@ -320,10 +320,17 @@ public abstract class Query extends Prepared {
}
}
public
SortOrder
prepareOrder
(
ObjectArray
expressions
,
ObjectArray
orderList
)
throws
SQLException
{
/**
* Create a {@link SortOrder} object given the list of {@link SelectOrderBy} objects.
* The expression list is extended if necessary.
*
* @param orderList a list of {@link SelectOrderBy} elements
* @param expressionCount the number of columns in the query
* @return the {@link SortOrder} object
*/
public
SortOrder
prepareOrder
(
ObjectArray
orderList
,
int
expressionCount
)
throws
SQLException
{
int
[]
index
=
new
int
[
orderList
.
size
()];
int
[]
sortType
=
new
int
[
orderList
.
size
()];
int
originalLength
=
expressions
.
size
();
for
(
int
i
=
0
;
i
<
orderList
.
size
();
i
++)
{
SelectOrderBy
o
=
(
SelectOrderBy
)
orderList
.
get
(
i
);
int
idx
;
...
...
@@ -343,7 +350,7 @@ public abstract class Query extends Prepared {
idx
=
-
idx
;
}
idx
-=
1
;
if
(
idx
<
0
||
idx
>=
originalLength
)
{
if
(
idx
<
0
||
idx
>=
expressionCount
)
{
throw
Message
.
getSQLException
(
ErrorCode
.
ORDER_BY_NOT_IN_RESULT
,
""
+
(
idx
+
1
));
}
}
...
...
@@ -388,6 +395,12 @@ public abstract class Query extends Prepared {
return
visitor
.
getMaxDataModificationId
();
}
/**
* Visit all expressions and subqueries in this query using the visitor pattern.
*
* @param expressionVisitorType the visitor type
* @return true if no component returned false
*/
public
final
boolean
isEverything
(
int
expressionVisitorType
)
{
ExpressionVisitor
visitor
=
ExpressionVisitor
.
get
(
expressionVisitorType
);
return
isEverything
(
visitor
);
...
...
h2/src/main/org/h2/command/dml/Select.java
浏览文件 @
dd54730f
...
...
@@ -80,6 +80,12 @@ public class Select extends Query {
super
(
session
);
}
/**
* Add a table to the query.
*
* @param filter the table to add
* @param isTop if the table can be the first table in the query plan
*/
public
void
addTableFilter
(
TableFilter
filter
,
boolean
isTop
)
{
// TODO compatibility: it seems oracle doesn't check on
// duplicate aliases; do other databases check it?
...
...
@@ -119,6 +125,11 @@ public class Select extends Query {
orderList
=
order
;
}
/**
* Add a condition to the list of conditions.
*
* @param cond the condition to add
*/
public
void
addCondition
(
Expression
cond
)
{
if
(
condition
==
null
)
{
condition
=
cond
;
...
...
@@ -658,7 +669,7 @@ public class Select extends Query {
throw
Message
.
getInternalError
(
"not initialized"
);
}
if
(
orderList
!=
null
)
{
sort
=
prepareOrder
(
expressions
,
orderList
);
sort
=
prepareOrder
(
orderList
,
expressions
.
size
()
);
orderList
=
null
;
}
for
(
int
i
=
0
;
i
<
expressions
.
size
();
i
++)
{
...
...
h2/src/main/org/h2/command/dml/SelectUnion.java
浏览文件 @
dd54730f
...
...
@@ -216,11 +216,11 @@ public class SelectUnion extends Query {
}
if
(
orderList
!=
null
)
{
initOrder
(
expressions
,
null
,
orderList
,
getColumnCount
(),
true
);
sort
=
prepareOrder
(
expressions
,
orderList
);
sort
=
prepareOrder
(
orderList
,
expressions
.
size
()
);
orderList
=
null
;
}
}
public
double
getCost
()
{
return
left
.
getCost
()
+
right
.
getCost
();
}
...
...
h2/src/main/org/h2/compress/LZFInputStream.java
浏览文件 @
dd54730f
...
...
@@ -105,7 +105,7 @@ public class LZFInputStream extends InputStream {
return
read
==
0
?
-
1
:
read
;
}
p
ublic
int
readBlock
(
byte
[]
b
,
int
off
,
int
len
)
throws
IOException
{
p
rivate
int
readBlock
(
byte
[]
b
,
int
off
,
int
len
)
throws
IOException
{
fillBuffer
();
if
(
pos
>=
bufferLength
)
{
return
-
1
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论