Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
4f59a3c8
提交
4f59a3c8
authored
6月 09, 2007
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
013a9c2b
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
166 行增加
和
98 行删除
+166
-98
Parser.java
h2/src/main/org/h2/command/Parser.java
+21
-8
Prepared.java
h2/src/main/org/h2/command/Prepared.java
+2
-2
CreateLinkedTable.java
h2/src/main/org/h2/command/ddl/CreateLinkedTable.java
+6
-1
Delete.java
h2/src/main/org/h2/command/dml/Delete.java
+1
-1
ExplainPlan.java
h2/src/main/org/h2/command/dml/ExplainPlan.java
+1
-1
Insert.java
h2/src/main/org/h2/command/dml/Insert.java
+2
-2
Merge.java
h2/src/main/org/h2/command/dml/Merge.java
+2
-2
Query.java
h2/src/main/org/h2/command/dml/Query.java
+101
-60
ScriptBase.java
h2/src/main/org/h2/command/dml/ScriptBase.java
+2
-2
Select.java
h2/src/main/org/h2/command/dml/Select.java
+20
-12
SelectOrderBy.java
h2/src/main/org/h2/command/dml/SelectOrderBy.java
+1
-1
SelectUnion.java
h2/src/main/org/h2/command/dml/SelectUnion.java
+6
-5
Update.java
h2/src/main/org/h2/command/dml/Update.java
+1
-1
没有找到文件。
h2/src/main/org/h2/command/Parser.java
浏览文件 @
4f59a3c8
...
...
@@ -1130,8 +1130,10 @@ public class Parser {
SelectOrderBy
order
=
new
SelectOrderBy
();
Expression
expr
=
readExpression
();
if
(
canBeNumber
&&
expr
instanceof
ValueExpression
&&
expr
.
getType
()
==
Value
.
INT
)
{
int
i
=
expr
.
getValue
(
null
).
getInt
();
order
.
column
=
i
-
1
;
order
.
columnIndexExpr
=
expr
;
}
else
if
(
expr
instanceof
Parameter
)
{
recompileAlways
=
true
;
order
.
columnIndexExpr
=
expr
;
}
else
{
order
.
expression
=
expr
;
}
...
...
@@ -2706,11 +2708,11 @@ public class Parser {
long
start
=
1
,
increment
=
1
;
if
(
readIf
(
"("
))
{
read
(
"START"
);
read
(
"WITH"
);
read
If
(
"WITH"
);
start
=
readLong
();
readIf
(
","
);
if
(
readIf
(
"INCREMENT"
))
{
read
(
"BY"
);
read
If
(
"BY"
);
increment
=
readLong
();
}
read
(
")"
);
...
...
@@ -2772,6 +2774,10 @@ public class Parser {
if
(
readIf
(
"PRECISION"
))
{
original
+=
" PRECISION"
;
}
}
else
if
(
readIf
(
"CHARACTER"
))
{
if
(
readIf
(
"VARYING"
))
{
original
+=
" VARYING"
;
}
}
else
{
regular
=
true
;
}
...
...
@@ -2874,7 +2880,7 @@ public class Parser {
read
(
"TABLE"
);
return
parseCreateTable
(
false
,
false
,
false
);
}
else
if
(
readIf
(
"LINKED"
))
{
return
parseCreateLinkedTable
();
return
parseCreateLinkedTable
(
force
);
}
else
if
(
readIf
(
"CACHED"
))
{
read
(
"TABLE"
);
return
parseCreateTable
(
false
,
false
,
true
);
...
...
@@ -3038,12 +3044,12 @@ public class Parser {
command
.
setIfNotExists
(
ifNotExists
);
command
.
setSequenceName
(
sequenceName
);
if
(
readIf
(
"START"
))
{
read
(
"WITH"
);
read
If
(
"WITH"
);
long
start
=
readLong
();
command
.
setStartWith
(
start
);
}
if
(
readIf
(
"INCREMENT"
))
{
read
(
"BY"
);
read
If
(
"BY"
);
long
increment
=
readLong
();
command
.
setIncrement
(
increment
);
}
...
...
@@ -3437,6 +3443,12 @@ public class Parser {
}
else
if
(
readIf
(
"DB_CLOSE_ON_EXIT"
))
{
read
();
return
new
NoOperation
(
session
);
}
else
if
(
readIf
(
"WRITE_MODE_LOG"
))
{
read
();
return
new
NoOperation
(
session
);
}
else
if
(
readIf
(
"WRITE_MODE_DATA"
))
{
read
();
return
new
NoOperation
(
session
);
}
else
if
(
readIf
(
"RECOVER"
))
{
read
();
return
new
NoOperation
(
session
);
...
...
@@ -3809,11 +3821,12 @@ public class Parser {
}
}
private
CreateLinkedTable
parseCreateLinkedTable
()
throws
SQLException
{
private
CreateLinkedTable
parseCreateLinkedTable
(
boolean
force
)
throws
SQLException
{
read
(
"TABLE"
);
boolean
ifNotExists
=
readIfNoExists
();
String
tableName
=
readIdentifierWithSchema
();
CreateLinkedTable
command
=
new
CreateLinkedTable
(
session
,
getSchema
());
command
.
setForce
(
force
);
command
.
setIfNotExists
(
ifNotExists
);
command
.
setTableName
(
tableName
);
command
.
setComment
(
readCommentIf
());
...
...
h2/src/main/org/h2/command/Prepared.java
浏览文件 @
4f59a3c8
...
...
@@ -107,8 +107,8 @@ public abstract class Prepared {
objectId
=
0
;
return
id
;
}
public
String
getPlan
()
{
public
String
getPlan
SQL
()
{
return
null
;
}
...
...
h2/src/main/org/h2/command/ddl/CreateLinkedTable.java
浏览文件 @
4f59a3c8
...
...
@@ -24,6 +24,7 @@ public class CreateLinkedTable extends SchemaCommand {
private
boolean
ifNotExists
;
private
String
comment
;
private
boolean
emitUpdates
;
private
boolean
force
;
public
CreateLinkedTable
(
Session
session
,
Schema
schema
)
{
super
(
session
,
schema
);
...
...
@@ -69,7 +70,7 @@ public class CreateLinkedTable extends SchemaCommand {
tableName
);
}
int
id
=
getObjectId
(
false
,
true
);
TableLink
table
=
new
TableLink
(
getSchema
(),
id
,
tableName
,
driver
,
url
,
user
,
password
,
originalTable
,
emitUpdates
);
TableLink
table
=
new
TableLink
(
getSchema
(),
id
,
tableName
,
driver
,
url
,
user
,
password
,
originalTable
,
emitUpdates
,
force
);
table
.
setComment
(
comment
);
db
.
addSchemaObject
(
session
,
table
);
return
0
;
...
...
@@ -83,4 +84,8 @@ public class CreateLinkedTable extends SchemaCommand {
this
.
comment
=
comment
;
}
public
void
setForce
(
boolean
force
)
{
this
.
force
=
force
;
}
}
h2/src/main/org/h2/command/dml/Delete.java
浏览文件 @
4f59a3c8
...
...
@@ -79,7 +79,7 @@ public class Delete extends Prepared {
return
rows
.
size
();
}
public
String
getPlan
()
{
public
String
getPlan
SQL
()
{
StringBuffer
buff
=
new
StringBuffer
();
buff
.
append
(
"DELETE FROM "
);
buff
.
append
(
tableFilter
.
getPlanSQL
(
false
));
...
...
h2/src/main/org/h2/command/dml/ExplainPlan.java
浏览文件 @
4f59a3c8
...
...
@@ -39,7 +39,7 @@ public class ExplainPlan extends Prepared {
ExpressionColumn
expr
=
new
ExpressionColumn
(
session
.
getDatabase
(),
null
,
column
);
expressions
.
add
(
expr
);
result
=
new
LocalResult
(
session
,
expressions
,
1
);
String
plan
=
command
.
getPlan
();
String
plan
=
command
.
getPlan
SQL
();
add
(
plan
);
result
.
done
();
return
result
;
...
...
h2/src/main/org/h2/command/dml/Insert.java
浏览文件 @
4f59a3c8
...
...
@@ -120,7 +120,7 @@ public class Insert extends Prepared {
return
count
;
}
public
String
getPlan
()
{
public
String
getPlan
SQL
()
{
StringBuffer
buff
=
new
StringBuffer
();
buff
.
append
(
"INSERT INTO "
);
buff
.
append
(
table
.
getSQL
());
...
...
@@ -154,7 +154,7 @@ public class Insert extends Prepared {
buff
.
append
(
')'
);
}
}
else
{
buff
.
append
(
query
.
getPlan
());
buff
.
append
(
query
.
getPlan
SQL
());
}
return
buff
.
toString
();
}
...
...
h2/src/main/org/h2/command/dml/Merge.java
浏览文件 @
4f59a3c8
...
...
@@ -174,7 +174,7 @@ public class Merge extends Prepared {
}
}
public
String
getPlan
()
{
public
String
getPlan
SQL
()
{
StringBuffer
buff
=
new
StringBuffer
();
buff
.
append
(
"MERGE INTO "
);
buff
.
append
(
table
.
getSQL
());
...
...
@@ -219,7 +219,7 @@ public class Merge extends Prepared {
buff
.
append
(
')'
);
}
}
else
{
buff
.
append
(
query
.
getPlan
());
buff
.
append
(
query
.
getPlan
SQL
());
}
return
buff
.
toString
();
}
...
...
h2/src/main/org/h2/command/dml/Query.java
浏览文件 @
4f59a3c8
...
...
@@ -14,6 +14,7 @@ import org.h2.expression.Expression;
import
org.h2.expression.ExpressionColumn
;
import
org.h2.expression.ExpressionVisitor
;
import
org.h2.expression.Parameter
;
import
org.h2.expression.ValueExpression
;
import
org.h2.message.Message
;
import
org.h2.result.LocalResult
;
import
org.h2.result.SortOrder
;
...
...
@@ -21,6 +22,8 @@ import org.h2.table.ColumnResolver;
import
org.h2.table.TableFilter
;
import
org.h2.util.ObjectArray
;
import
org.h2.value.Value
;
import
org.h2.value.ValueInt
;
import
org.h2.value.ValueNull
;
public
abstract
class
Query
extends
Prepared
{
...
...
@@ -95,80 +98,118 @@ public abstract class Query extends Prepared {
lastLimit
=
limit
;
return
lastResult
;
}
protected
SortOrder
initOrder
(
ObjectArray
expressions
,
ObjectArray
orderList
,
int
visible
,
boolean
mustBeInResult
)
throws
SQLException
{
int
[]
index
=
new
int
[
orderList
.
size
()];
int
[]
sortType
=
new
int
[
orderList
.
size
()];
int
originalLength
=
expressions
.
size
();
protected
void
initOrder
(
ObjectArray
expressions
,
ObjectArray
expressionSQL
,
ObjectArray
orderList
,
int
visible
,
boolean
mustBeInResult
)
throws
SQLException
{
for
(
int
i
=
0
;
i
<
orderList
.
size
();
i
++)
{
SelectOrderBy
o
=
(
SelectOrderBy
)
orderList
.
get
(
i
);
int
idx
;
if
(
o
.
expression
!
=
null
)
{
Expression
e
=
o
.
expression
;
// special case: SELECT 1 AS A FROM DUAL ORDER BY A
// (oracle supports it, but only in order by, not in group by and not in having):
// SELECT 1 AS A FROM DUAL ORDER BY -A
boolean
isAlias
=
false
;
idx
=
expressions
.
size
()
;
if
(
e
instanceof
ExpressionColumn
)
{
ExpressionColumn
exprCol
=
(
ExpressionColumn
)
e
;
String
alias
=
exprCol
.
getOriginalAliasName
()
;
String
col
=
exprCol
.
getOriginalColumn
Name
();
for
(
int
j
=
0
;
j
<
visible
;
j
++)
{
boolean
found
=
false
;
Expression
ec
=
(
Expression
)
expressions
.
get
(
j
)
;
if
(
ec
instanceof
ExpressionColumn
)
{
ExpressionColumn
c
=
(
ExpressionColumn
)
ec
;
found
=
col
.
equals
(
c
.
getColumnName
())
;
if
(
alias
!=
null
&&
found
)
{
String
ca
=
c
.
getOriginalAliasName
();
if
(
ca
!=
null
)
{
found
=
alias
.
equals
(
ca
);
}
Expression
e
=
o
.
expression
;
if
(
e
=
=
null
)
{
continue
;
}
// special case: SELECT 1 AS A FROM DUAL ORDER BY A
// (oracle supports it, but only in order by, not in group by and not in having):
// SELECT 1 AS A FROM DUAL ORDER BY -A
boolean
isAlias
=
false
;
int
idx
=
expressions
.
size
();
if
(
e
instanceof
ExpressionColumn
)
{
ExpressionColumn
exprCol
=
(
ExpressionColumn
)
e
;
String
alias
=
exprCol
.
getOriginalAlias
Name
();
String
col
=
exprCol
.
getOriginalColumnName
();
for
(
int
j
=
0
;
j
<
visible
;
j
++)
{
boolean
found
=
false
;
Expression
ec
=
(
Expression
)
expressions
.
get
(
j
);
if
(
ec
instanceof
ExpressionColumn
)
{
ExpressionColumn
c
=
(
ExpressionColumn
)
ec
;
found
=
col
.
equals
(
c
.
getColumnName
());
if
(
alias
!=
null
&&
found
)
{
String
ca
=
c
.
getOriginalAliasName
();
if
(
ca
!=
null
)
{
found
=
alias
.
equals
(
ca
);
}
}
else
if
(!(
ec
instanceof
Alias
))
{
continue
;
}
else
if
(
col
.
equals
(
ec
.
getAlias
()))
{
found
=
true
;
}
else
{
Expression
ec2
=
ec
.
getNonAliasExpression
();
if
(
ec2
instanceof
ExpressionColumn
)
{
ExpressionColumn
c2
=
(
ExpressionColumn
)
ec2
;
String
ta
=
exprCol
.
getSQL
();
// exprCol.getTableAlias()
;
String
tb
=
c2
.
getSQL
();
//
getTableAlias();
found
=
col
.
equals
(
c2
.
getColumnName
()
);
if
(
ta
==
null
||
tb
==
null
)
{
if
(
ta
!=
tb
)
{
found
=
false
;
}
}
else
{
if
(!
ta
.
equals
(
tb
))
{
found
=
false
;
}
}
}
else
if
(!(
ec
instanceof
Alias
))
{
continue
;
}
else
if
(
col
.
equals
(
ec
.
getAlias
()))
{
found
=
true
;
}
else
{
Expression
ec2
=
ec
.
getNonAliasExpression
();
if
(
ec2
instanceof
ExpressionColumn
)
{
ExpressionColumn
c2
=
(
ExpressionColumn
)
ec2
;
String
ta
=
exprCol
.
getSQL
();
// exprCol.
getTableAlias();
String
tb
=
c2
.
getSQL
();
// getTableAlias(
);
found
=
col
.
equals
(
c2
.
getColumnName
());
if
(
ta
==
null
||
tb
==
null
)
{
if
(
ta
!=
tb
)
{
found
=
false
;
}
}
else
{
if
(!
ta
.
equals
(
tb
))
{
found
=
false
;
}
}
}
if
(
found
)
{
idx
=
j
;
isAlias
=
true
;
break
;
}
}
if
(
found
)
{
idx
=
j
;
isAlias
=
true
;
break
;
}
}
if
(!
isAlias
)
{
if
(
mustBeInResult
)
{
throw
Message
.
getSQLException
(
Message
.
ORDER_BY_NOT_IN_RESULT
,
e
.
getSQL
());
}
expressions
.
add
(
e
);
}
else
{
String
s
=
e
.
getSQL
();
for
(
int
j
=
0
;
j
<
expressionSQL
.
size
();
j
++)
{
String
s2
=
(
String
)
expressionSQL
.
get
(
j
);
if
(
s2
.
equals
(
s
))
{
idx
=
j
;
isAlias
=
true
;
break
;
}
}
}
if
(!
isAlias
)
{
if
(
mustBeInResult
)
{
throw
Message
.
getSQLException
(
Message
.
ORDER_BY_NOT_IN_RESULT
,
e
.
getSQL
());
}
expressions
.
add
(
e
);
}
o
.
expression
=
null
;
o
.
columnIndexExpr
=
ValueExpression
.
get
(
ValueInt
.
get
(
idx
+
1
));
}
}
public
SortOrder
prepareOrder
(
ObjectArray
expressions
,
ObjectArray
orderList
)
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
;
boolean
reverse
=
false
;
if
(
o
.
expression
!=
null
)
{
throw
Message
.
getInternalError
();
}
Expression
expr
=
o
.
columnIndexExpr
;
Value
v
=
expr
.
getValue
(
null
);
if
(
v
==
ValueNull
.
INSTANCE
)
{
// parameter not yet set - order by first column
idx
=
0
;
}
else
{
idx
=
o
.
column
;
if
(
idx
>=
originalLength
)
{
idx
=
v
.
getInt
();
if
(
idx
<
0
)
{
reverse
=
true
;
idx
=
-
idx
;
}
idx
-=
1
;
if
(
idx
<
0
||
idx
>=
originalLength
)
{
throw
Message
.
getSQLException
(
Message
.
ORDER_BY_NOT_IN_RESULT
,
"index "
+
idx
);
}
}
index
[
i
]
=
idx
;
int
type
=
o
.
descending
?
SortOrder
.
DESCENDING
:
SortOrder
.
ASCENDING
;
boolean
desc
=
o
.
descending
;
if
(
reverse
)
{
desc
=
!
desc
;
}
int
type
=
desc
?
SortOrder
.
DESCENDING
:
SortOrder
.
ASCENDING
;
if
(
o
.
nullsFirst
)
{
type
+=
SortOrder
.
NULLS_FIRST
;
}
else
if
(
o
.
nullsLast
)
{
...
...
h2/src/main/org/h2/command/dml/ScriptBase.java
浏览文件 @
4f59a3c8
...
...
@@ -79,7 +79,7 @@ public class ScriptBase extends Prepared implements DataHandler {
byte
[]
magic
=
Database
.
getMagic
(
true
);
Database
db
=
session
.
getDatabase
();
// script files are always in text format
store
=
FileStore
.
open
(
db
,
fileName
,
magic
,
cipher
,
key
);
store
=
FileStore
.
open
(
db
,
fileName
,
"rw"
,
magic
,
cipher
,
key
);
store
.
setCheckedWriting
(
false
);
store
.
init
();
}
...
...
@@ -153,7 +153,7 @@ public class ScriptBase extends Prepared implements DataHandler {
return
null
;
}
public
FileStore
openFile
(
String
name
,
boolean
mustExist
)
throws
SQLException
{
public
FileStore
openFile
(
String
name
,
String
mode
,
boolean
mustExist
)
throws
SQLException
{
return
null
;
}
...
...
h2/src/main/org/h2/command/dml/Select.java
浏览文件 @
4f59a3c8
...
...
@@ -207,7 +207,7 @@ public class Select extends Query {
for
(
int
i
=
0
;
i
<
indexes
.
length
;
i
++)
{
int
idx
=
indexes
[
i
];
if
(
idx
<
0
||
idx
>=
expressions
.
size
())
{
throw
Message
.
getInvalidValueException
(
"
order by"
,
""
+
idx
);
throw
Message
.
getInvalidValueException
(
"
"
+
(
idx
+
1
),
"ORDER BY"
);
}
Expression
expr
=
(
Expression
)
expressions
.
get
(
idx
);
expr
=
expr
.
getNonAliasExpression
();
...
...
@@ -384,12 +384,22 @@ public class Select extends Query {
checkInit
=
true
;
expandColumnList
();
visibleColumnCount
=
expressions
.
size
();
ObjectArray
expressionSQL
;
if
(
orderList
!=
null
||
group
!=
null
)
{
expressionSQL
=
new
ObjectArray
();
for
(
int
i
=
0
;
i
<
expressions
.
size
();
i
++)
{
Expression
expr
=
(
Expression
)
expressions
.
get
(
i
);
expr
=
expr
.
getNonAliasExpression
();
String
sql
=
expr
.
getSQL
();
expressionSQL
.
add
(
sql
);
}
}
else
{
expressionSQL
=
null
;
}
if
(
orderList
!=
null
)
{
sort
=
initOrder
(
expressions
,
orderList
,
visibleColumnCount
,
distinct
);
orderList
=
null
;
initOrder
(
expressions
,
expressionSQL
,
orderList
,
visibleColumnCount
,
distinct
);
}
distinctColumnCount
=
expressions
.
size
();
if
(
having
!=
null
)
{
expressions
.
add
(
having
);
havingIndex
=
expressions
.
size
()-
1
;
...
...
@@ -401,13 +411,6 @@ public class Select extends Query {
// first visible columns, then order by, then having, and then group by at the end
if
(
group
!=
null
)
{
groupIndex
=
new
int
[
group
.
size
()];
ObjectArray
expressionSQL
=
new
ObjectArray
();
for
(
int
i
=
0
;
i
<
expressions
.
size
();
i
++)
{
Expression
expr
=
(
Expression
)
expressions
.
get
(
i
);
expr
=
expr
.
getNonAliasExpression
();
String
sql
=
expr
.
getSQL
();
expressionSQL
.
add
(
sql
);
}
for
(
int
i
=
0
;
i
<
group
.
size
();
i
++)
{
Expression
expr
=
(
Expression
)
group
.
get
(
i
);
String
sql
=
expr
.
getSQL
();
...
...
@@ -455,6 +458,10 @@ public class Select extends Query {
throw
Message
.
getInternalError
(
"already prepared"
);
}
isPrepared
=
true
;
if
(
orderList
!=
null
)
{
sort
=
prepareOrder
(
expressions
,
orderList
);
orderList
=
null
;
}
for
(
int
i
=
0
;
i
<
expressions
.
size
();
i
++)
{
Expression
e
=
(
Expression
)
expressions
.
get
(
i
);
expressions
.
set
(
i
,
e
.
optimize
(
session
));
...
...
@@ -535,7 +542,7 @@ public class Select extends Query {
return
cost
;
}
public
String
getPlan
()
{
public
String
getPlan
SQL
()
{
if
(
topTableFilter
==
null
)
{
return
sql
;
}
...
...
@@ -663,6 +670,7 @@ public class Select extends Query {
public
void
addGlobalCondition
(
Expression
expr
,
int
columnId
,
int
comparisonType
)
throws
SQLException
{
Expression
col
=
(
Expression
)
expressions
.
get
(
columnId
);
col
=
col
.
getNonAliasExpression
();
Expression
comp
=
new
Comparison
(
session
,
comparisonType
,
col
,
expr
);
comp
=
comp
.
optimize
(
session
);
if
(
isGroupQuery
)
{
...
...
h2/src/main/org/h2/command/dml/SelectOrderBy.java
浏览文件 @
4f59a3c8
...
...
@@ -11,7 +11,7 @@ import org.h2.expression.Expression;
*/
public
class
SelectOrderBy
{
public
Expression
expression
;
public
int
column
;
public
Expression
columnIndexExpr
;
public
boolean
descending
;
public
boolean
nullsFirst
;
public
boolean
nullsLast
;
...
...
h2/src/main/org/h2/command/dml/SelectUnion.java
浏览文件 @
4f59a3c8
...
...
@@ -152,7 +152,7 @@ public class SelectUnion extends Query {
result
.
done
();
return
result
;
}
public
void
init
()
throws
SQLException
{
if
(
Constants
.
CHECK
&&
checkInit
)
{
throw
Message
.
getInternalError
();
...
...
@@ -188,7 +188,8 @@ public class SelectUnion extends Query {
expressions
.
add
(
e
);
}
if
(
orderList
!=
null
)
{
sort
=
initOrder
(
expressions
,
orderList
,
getColumnCount
(),
true
);
initOrder
(
expressions
,
null
,
orderList
,
getColumnCount
(),
true
);
sort
=
prepareOrder
(
expressions
,
orderList
);
orderList
=
null
;
}
}
...
...
@@ -249,10 +250,10 @@ public class SelectUnion extends Query {
}
}
public
String
getPlan
()
{
public
String
getPlan
SQL
()
{
StringBuffer
buff
=
new
StringBuffer
();
buff
.
append
(
'('
);
buff
.
append
(
left
.
getPlan
());
buff
.
append
(
left
.
getPlan
SQL
());
buff
.
append
(
") "
);
switch
(
unionType
)
{
case
UNION_ALL:
...
...
@@ -271,7 +272,7 @@ public class SelectUnion extends Query {
throw
Message
.
getInternalError
(
"type="
+
unionType
);
}
buff
.
append
(
'('
);
buff
.
append
(
right
.
getPlan
());
buff
.
append
(
right
.
getPlan
SQL
());
buff
.
append
(
')'
);
Expression
[]
exprList
=
new
Expression
[
expressions
.
size
()];
expressions
.
toArray
(
exprList
);
...
...
h2/src/main/org/h2/command/dml/Update.java
浏览文件 @
4f59a3c8
...
...
@@ -113,7 +113,7 @@ public class Update extends Prepared {
return
newRows
.
size
();
}
public
String
getPlan
()
{
public
String
getPlan
SQL
()
{
StringBuffer
buff
=
new
StringBuffer
();
buff
.
append
(
"UPDATE "
);
buff
.
append
(
tableFilter
.
getPlanSQL
(
false
));
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论