Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
c0c3cc9e
提交
c0c3cc9e
authored
5月 13, 2008
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove unused methods and fields;
small documentation improvements
上级
9f46d4ef
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
65 个修改的文件
包含
1722 行增加
和
1167 行删除
+1722
-1167
advanced.html
h2/src/docsrc/html/advanced.html
+10
-1
links.html
h2/src/docsrc/html/links.html
+4
-0
tutorial.html
h2/src/docsrc/html/tutorial.html
+0
-10
index.html
h2/src/docsrc/javadoc/index.html
+1
-1
_docs_en.utf8.txt
h2/src/docsrc/text/_docs_en.utf8.txt
+384
-378
_docs_ja.utf8.txt
h2/src/docsrc/text/_docs_ja.utf8.txt
+945
-378
Parser.java
h2/src/main/org/h2/command/Parser.java
+2
-5
AlterTableAddConstraint.java
h2/src/main/org/h2/command/ddl/AlterTableAddConstraint.java
+0
-4
CreateIndex.java
h2/src/main/org/h2/command/ddl/CreateIndex.java
+0
-12
Select.java
h2/src/main/org/h2/command/dml/Select.java
+4
-4
Constraint.java
h2/src/main/org/h2/constraint/Constraint.java
+0
-8
ConstraintReferential.java
h2/src/main/org/h2/constraint/ConstraintReferential.java
+7
-0
ConstraintUnique.java
h2/src/main/org/h2/constraint/ConstraintUnique.java
+0
-16
Database.java
h2/src/main/org/h2/engine/Database.java
+0
-10
MetaRecord.java
h2/src/main/org/h2/engine/MetaRecord.java
+8
-28
Session.java
h2/src/main/org/h2/engine/Session.java
+1
-11
Aggregate.java
h2/src/main/org/h2/expression/Aggregate.java
+2
-6
Comparison.java
h2/src/main/org/h2/expression/Comparison.java
+56
-7
ConditionAndOr.java
h2/src/main/org/h2/expression/ConditionAndOr.java
+16
-1
ConditionIn.java
h2/src/main/org/h2/expression/ConditionIn.java
+1
-1
ExpressionColumn.java
h2/src/main/org/h2/expression/ExpressionColumn.java
+4
-4
ExpressionVisitor.java
h2/src/main/org/h2/expression/ExpressionVisitor.java
+104
-19
Function.java
h2/src/main/org/h2/expression/Function.java
+27
-2
JavaAggregate.java
h2/src/main/org/h2/expression/JavaAggregate.java
+1
-1
JavaFunction.java
h2/src/main/org/h2/expression/JavaFunction.java
+1
-5
Parameter.java
h2/src/main/org/h2/expression/Parameter.java
+2
-2
Rownum.java
h2/src/main/org/h2/expression/Rownum.java
+2
-2
SequenceValue.java
h2/src/main/org/h2/expression/SequenceValue.java
+2
-2
TableFunction.java
h2/src/main/org/h2/expression/TableFunction.java
+0
-23
ValueExpression.java
h2/src/main/org/h2/expression/ValueExpression.java
+2
-2
Variable.java
h2/src/main/org/h2/expression/Variable.java
+2
-2
Wildcard.java
h2/src/main/org/h2/expression/Wildcard.java
+0
-4
BaseIndex.java
h2/src/main/org/h2/index/BaseIndex.java
+0
-1
BtreeIndex.java
h2/src/main/org/h2/index/BtreeIndex.java
+0
-9
IndexCondition.java
h2/src/main/org/h2/index/IndexCondition.java
+0
-4
LinkedIndex.java
h2/src/main/org/h2/index/LinkedIndex.java
+0
-9
MultiVersionIndex.java
h2/src/main/org/h2/index/MultiVersionIndex.java
+0
-6
TreeIndex.java
h2/src/main/org/h2/index/TreeIndex.java
+0
-9
JdbcResultSet.java
h2/src/main/org/h2/jdbc/JdbcResultSet.java
+0
-24
JdbcXAConnection.java
h2/src/main/org/h2/jdbcx/JdbcXAConnection.java
+3
-13
InDoubtTransaction.java
h2/src/main/org/h2/log/InDoubtTransaction.java
+0
-8
TraceObject.java
h2/src/main/org/h2/message/TraceObject.java
+0
-4
help.csv
h2/src/main/org/h2/res/help.csv
+14
-10
LocalResult.java
h2/src/main/org/h2/result/LocalResult.java
+15
-29
ResultInterface.java
h2/src/main/org/h2/result/ResultInterface.java
+0
-13
ResultRemote.java
h2/src/main/org/h2/result/ResultRemote.java
+0
-8
Row.java
h2/src/main/org/h2/result/Row.java
+0
-5
SimpleRowValue.java
h2/src/main/org/h2/result/SimpleRowValue.java
+0
-4
TcpServer.java
h2/src/main/org/h2/server/TcpServer.java
+8
-14
PgServer.java
h2/src/main/org/h2/server/pg/PgServer.java
+58
-0
WebServer.java
h2/src/main/org/h2/server/web/WebServer.java
+0
-5
FileStore.java
h2/src/main/org/h2/store/FileStore.java
+0
-5
Column.java
h2/src/main/org/h2/table/Column.java
+1
-1
FunctionTable.java
h2/src/main/org/h2/table/FunctionTable.java
+1
-1
MetaTable.java
h2/src/main/org/h2/table/MetaTable.java
+0
-4
Table.java
h2/src/main/org/h2/table/Table.java
+0
-8
TableView.java
h2/src/main/org/h2/table/TableView.java
+0
-8
IOUtils.java
h2/src/main/org/h2/util/IOUtils.java
+0
-4
DataType.java
h2/src/main/org/h2/value/DataType.java
+0
-7
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+13
-0
TestReader.java
h2/src/test/org/h2/test/unit/TestReader.java
+2
-1
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+2
-2
Base64.java
h2/src/tools/org/h2/dev/util/Base64.java
+1
-1
ReaderInputStream.java
h2/src/tools/org/h2/dev/util/ReaderInputStream.java
+1
-1
package.html
h2/src/tools/org/h2/dev/util/package.html
+15
-0
没有找到文件。
h2/src/docsrc/html/advanced.html
浏览文件 @
c0c3cc9e
...
@@ -487,8 +487,17 @@ Therefore the ODBC driver should not be used where security is important.
...
@@ -487,8 +487,17 @@ Therefore the ODBC driver should not be used where security is important.
<br
/><a
name=
"microsoft_dot_net"
></a>
<br
/><a
name=
"microsoft_dot_net"
></a>
<h2>
Using H2 in Microsoft .NET
</h2>
<h2>
Using H2 in Microsoft .NET
</h2>
<p>
<p>
The database can be used from Microsoft .NET even without using Java, by using IKVM.NET:
The database can be used from Microsoft .NET even without using Java, by using IKVM.NET.
You can access a H2 database on .NET using the JDBC API, or using the ADO.NET interface.
</p>
</p>
<h3>
Using the ADO.NET API on .NET
</h3>
<p>
An implementation of the ADO.NET interface is available in the open source project
<a
href=
"http://code.google.com/p/h2sharp"
>
H2Sharp
</a>
.
</p>
<h3>
Using the JDBC API on .NET
</h3>
<ul><li>
Install the .NET Framework from
<a
href=
"http://www.microsoft.com"
>
Microsoft
</a>
.
<ul><li>
Install the .NET Framework from
<a
href=
"http://www.microsoft.com"
>
Microsoft
</a>
.
Mono has not yet been tested.
Mono has not yet been tested.
</li><li>
Install
<a
href=
"http://www.ikvm.net"
>
IKVM.NET
</a>
.
</li><li>
Install
<a
href=
"http://www.ikvm.net"
>
IKVM.NET
</a>
.
...
...
h2/src/docsrc/html/links.html
浏览文件 @
c0c3cc9e
...
@@ -24,6 +24,10 @@ If you want to add a link, please send it to the support email address or post i
...
@@ -24,6 +24,10 @@ If you want to add a link, please send it to the support email address or post i
Seam In Action
</a>
Seam In Action
</a>
<h2>
Extensions
</h2>
<h2>
Extensions
</h2>
<p><a
href=
"http://code.google.com/p/h2sharp"
>
H2Sharp
</a><br
/>
ADO.NET interface for the H2 database engine.
</p>
<a
href=
"http://geosysin.iict.ch/irstv-trac/wiki/H2spatial/Download"
>
<a
href=
"http://geosysin.iict.ch/irstv-trac/wiki/H2spatial/Download"
>
Spatial capabilities
</a>
Spatial capabilities
</a>
...
...
h2/src/docsrc/html/tutorial.html
浏览文件 @
c0c3cc9e
...
@@ -334,16 +334,6 @@ to avoid recovery when the databases are opened the next time.
...
@@ -334,16 +334,6 @@ to avoid recovery when the databases are opened the next time.
To stop remote server, remote connections must be enabled on the server.
To stop remote server, remote connections must be enabled on the server.
</p>
</p>
<h3>
Limitations of the Server
</h3>
<p>
There currently are a few limitations when using the server or cluster mode:
</p>
<ul>
<li>
Statement.cancel() is only supported in embedded mode.
A connection can only execute one operation at a time in server or cluster mode,
and is blocked until this operation is finished.
</li></ul>
<br
/><a
name=
"using_hibernate"
></a>
<br
/><a
name=
"using_hibernate"
></a>
<h2>
Using Hibernate
</h2>
<h2>
Using Hibernate
</h2>
<p>
<p>
...
...
h2/src/docsrc/javadoc/index.html
浏览文件 @
c0c3cc9e
...
@@ -11,7 +11,7 @@ Initial Developer: H2 Group
...
@@ -11,7 +11,7 @@ Initial Developer: H2 Group
<title>
H2 Documentation
</title>
<title>
H2 Documentation
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"stylesheet.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"stylesheet.css"
/>
</head>
</head>
<frameset
cols=
"1
88
,*"
rows=
"*"
frameborder=
"2"
framespacing=
"4"
border=
"4"
>
<frameset
cols=
"1
90
,*"
rows=
"*"
frameborder=
"2"
framespacing=
"4"
border=
"4"
>
<frame
frameborder=
"0"
marginheight=
"0"
marginwidth=
"0"
src=
"classes.html"
name=
"classes"
/>
<frame
frameborder=
"0"
marginheight=
"0"
marginwidth=
"0"
src=
"classes.html"
name=
"classes"
/>
<frame
frameborder=
"0"
marginheight=
"0"
marginwidth=
"0"
src=
"overview.html"
name=
"javadoc"
/>
<frame
frameborder=
"0"
marginheight=
"0"
marginwidth=
"0"
src=
"overview.html"
name=
"javadoc"
/>
</frameset>
</frameset>
...
...
h2/src/docsrc/text/_docs_en.utf8.txt
浏览文件 @
c0c3cc9e
差异被折叠。
点击展开。
h2/src/docsrc/text/_docs_ja.utf8.txt
浏览文件 @
c0c3cc9e
This source diff could not be displayed because it is too large. You can
view the blob
instead.
h2/src/main/org/h2/command/Parser.java
浏览文件 @
c0c3cc9e
...
@@ -170,7 +170,8 @@ public class Parser {
...
@@ -170,7 +170,8 @@ public class Parser {
private
String
currentToken
;
private
String
currentToken
;
private
boolean
currentTokenQuoted
;
private
boolean
currentTokenQuoted
;
private
Value
currentValue
;
private
Value
currentValue
;
private
String
sqlCommand
,
originalSQL
;
private
String
sqlCommand
;
private
String
originalSQL
;
private
char
[]
sqlCommandChars
;
private
char
[]
sqlCommandChars
;
private
int
lastParseIndex
;
private
int
lastParseIndex
;
private
int
parseIndex
;
private
int
parseIndex
;
...
@@ -2650,10 +2651,6 @@ public class Parser {
...
@@ -2650,10 +2651,6 @@ public class Parser {
currentTokenType
=
VALUE
;
currentTokenType
=
VALUE
;
}
}
public
String
getOriginalSQL
()
{
return
originalSQL
;
}
public
Session
getSession
()
{
public
Session
getSession
()
{
return
session
;
return
session
;
}
}
...
...
h2/src/main/org/h2/command/ddl/AlterTableAddConstraint.java
浏览文件 @
c0c3cc9e
...
@@ -410,8 +410,4 @@ public class AlterTableAddConstraint extends SchemaCommand {
...
@@ -410,8 +410,4 @@ public class AlterTableAddConstraint extends SchemaCommand {
this
.
primaryKeyHash
=
b
;
this
.
primaryKeyHash
=
b
;
}
}
public
boolean
getPrimaryKeyHash
()
{
return
primaryKeyHash
;
}
}
}
h2/src/main/org/h2/command/ddl/CreateIndex.java
浏览文件 @
c0c3cc9e
...
@@ -52,14 +52,6 @@ public class CreateIndex extends SchemaCommand {
...
@@ -52,14 +52,6 @@ public class CreateIndex extends SchemaCommand {
this
.
indexColumns
=
columns
;
this
.
indexColumns
=
columns
;
}
}
public
boolean
getPrimaryKey
()
{
return
primaryKey
;
}
public
IndexColumn
[]
getIndexColumns
()
{
return
indexColumns
;
}
public
int
update
()
throws
SQLException
{
public
int
update
()
throws
SQLException
{
// TODO cancel: may support for index creation
// TODO cancel: may support for index creation
session
.
commit
(
true
);
session
.
commit
(
true
);
...
@@ -111,10 +103,6 @@ public class CreateIndex extends SchemaCommand {
...
@@ -111,10 +103,6 @@ public class CreateIndex extends SchemaCommand {
this
.
hash
=
b
;
this
.
hash
=
b
;
}
}
public
boolean
getHash
()
{
return
hash
;
}
public
void
setComment
(
String
comment
)
{
public
void
setComment
(
String
comment
)
{
this
.
comment
=
comment
;
this
.
comment
=
comment
;
}
}
...
...
h2/src/main/org/h2/command/dml/Select.java
浏览文件 @
c0c3cc9e
...
@@ -693,7 +693,7 @@ public class Select extends Query {
...
@@ -693,7 +693,7 @@ public class Select extends Query {
if
(
isGroupQuery
&&
groupIndex
==
null
&&
havingIndex
<
0
&&
filters
.
size
()
==
1
)
{
if
(
isGroupQuery
&&
groupIndex
==
null
&&
havingIndex
<
0
&&
filters
.
size
()
==
1
)
{
if
(
condition
==
null
)
{
if
(
condition
==
null
)
{
ExpressionVisitor
optimizable
=
ExpressionVisitor
.
get
(
ExpressionVisitor
.
OPTIMIZABLE_MIN_MAX_COUNT_ALL
);
ExpressionVisitor
optimizable
=
ExpressionVisitor
.
get
(
ExpressionVisitor
.
OPTIMIZABLE_MIN_MAX_COUNT_ALL
);
optimizable
.
table
=
((
TableFilter
)
filters
.
get
(
0
)).
getTable
(
);
optimizable
.
setTable
(((
TableFilter
)
filters
.
get
(
0
)).
getTable
()
);
isQuickAggregateQuery
=
isEverything
(
optimizable
);
isQuickAggregateQuery
=
isEverything
(
optimizable
);
}
}
}
}
...
@@ -995,7 +995,7 @@ public class Select extends Query {
...
@@ -995,7 +995,7 @@ public class Select extends Query {
}
}
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
switch
(
visitor
.
type
)
{
switch
(
visitor
.
getType
()
)
{
case
ExpressionVisitor
.
SET_MAX_DATA_MODIFICATION_ID
:
{
case
ExpressionVisitor
.
SET_MAX_DATA_MODIFICATION_ID
:
{
for
(
int
i
=
0
;
i
<
filters
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
filters
.
size
();
i
++)
{
TableFilter
f
=
(
TableFilter
)
filters
.
get
(
i
);
TableFilter
f
=
(
TableFilter
)
filters
.
get
(
i
);
...
@@ -1020,7 +1020,7 @@ public class Select extends Query {
...
@@ -1020,7 +1020,7 @@ public class Select extends Query {
break
;
break
;
}
}
}
}
visitor
.
q
ueryLevel
(
1
);
visitor
.
incrementQ
ueryLevel
(
1
);
boolean
result
=
true
;
boolean
result
=
true
;
for
(
int
i
=
0
;
i
<
expressions
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
expressions
.
size
();
i
++)
{
Expression
e
=
(
Expression
)
expressions
.
get
(
i
);
Expression
e
=
(
Expression
)
expressions
.
get
(
i
);
...
@@ -1035,7 +1035,7 @@ public class Select extends Query {
...
@@ -1035,7 +1035,7 @@ public class Select extends Query {
if
(
result
&&
having
!=
null
&&
!
having
.
isEverything
(
visitor
))
{
if
(
result
&&
having
!=
null
&&
!
having
.
isEverything
(
visitor
))
{
result
=
false
;
result
=
false
;
}
}
visitor
.
q
ueryLevel
(-
1
);
visitor
.
incrementQ
ueryLevel
(-
1
);
return
result
;
return
result
;
}
}
...
...
h2/src/main/org/h2/constraint/Constraint.java
浏览文件 @
c0c3cc9e
...
@@ -104,14 +104,6 @@ public abstract class Constraint extends SchemaObjectBase implements Comparable
...
@@ -104,14 +104,6 @@ public abstract class Constraint extends SchemaObjectBase implements Comparable
*/
*/
public
abstract
boolean
isBefore
();
public
abstract
boolean
isBefore
();
/**
* Get a short description of the constraint. This includes the constraint
* name (if set), and the constraint expression.
*
* @return the description
*/
public
abstract
String
getShortDescription
();
/**
/**
* Check the existing data. This method is called if the constraint is added
* Check the existing data. This method is called if the constraint is added
* after data has been inserted into the table.
* after data has been inserted into the table.
...
...
h2/src/main/org/h2/constraint/ConstraintReferential.java
浏览文件 @
c0c3cc9e
...
@@ -168,6 +168,13 @@ public class ConstraintReferential extends Constraint {
...
@@ -168,6 +168,13 @@ public class ConstraintReferential extends Constraint {
return
buff
.
toString
();
return
buff
.
toString
();
}
}
/**
* Get a short description of the constraint. This includes the constraint
* name (if set), and the constraint expression.
*
* @return the description
*/
public
String
getShortDescription
()
{
public
String
getShortDescription
()
{
StringBuffer
buff
=
new
StringBuffer
();
StringBuffer
buff
=
new
StringBuffer
();
buff
.
append
(
getName
());
buff
.
append
(
getName
());
...
...
h2/src/main/org/h2/constraint/ConstraintUnique.java
浏览文件 @
c0c3cc9e
...
@@ -76,22 +76,6 @@ public class ConstraintUnique extends Constraint {
...
@@ -76,22 +76,6 @@ public class ConstraintUnique extends Constraint {
}
}
}
}
public
String
getShortDescription
()
{
StringBuffer
buff
=
new
StringBuffer
();
buff
.
append
(
getName
());
buff
.
append
(
": "
);
buff
.
append
(
getTypeName
());
buff
.
append
(
'('
);
for
(
int
i
=
0
;
i
<
columns
.
length
;
i
++)
{
if
(
i
>
0
)
{
buff
.
append
(
", "
);
}
buff
.
append
(
Parser
.
quoteIdentifier
(
columns
[
i
].
column
.
getName
()));
}
buff
.
append
(
")"
);
return
buff
.
toString
();
}
public
String
getCreateSQLWithoutIndexes
()
{
public
String
getCreateSQLWithoutIndexes
()
{
return
getCreateSQLForCopy
(
table
,
getSQL
(),
false
);
return
getCreateSQLForCopy
(
table
,
getSQL
(),
false
);
}
}
...
...
h2/src/main/org/h2/engine/Database.java
浏览文件 @
c0c3cc9e
...
@@ -128,7 +128,6 @@ public class Database implements DataHandler {
...
@@ -128,7 +128,6 @@ public class Database implements DataHandler {
private
int
lockMode
=
SysProperties
.
DEFAULT_LOCK_MODE
;
private
int
lockMode
=
SysProperties
.
DEFAULT_LOCK_MODE
;
private
boolean
logIndexChanges
;
private
boolean
logIndexChanges
;
private
int
logLevel
=
1
;
private
int
logLevel
=
1
;
private
int
cacheSize
;
private
int
maxLengthInplaceLob
=
Constants
.
DEFAULT_MAX_LENGTH_INPLACE_LOB
;
private
int
maxLengthInplaceLob
=
Constants
.
DEFAULT_MAX_LENGTH_INPLACE_LOB
;
private
long
biggestFileSize
;
private
long
biggestFileSize
;
private
int
allowLiterals
=
Constants
.
DEFAULT_ALLOW_LITERALS
;
private
int
allowLiterals
=
Constants
.
DEFAULT_ALLOW_LITERALS
;
...
@@ -1244,10 +1243,6 @@ public class Database implements DataHandler {
...
@@ -1244,10 +1243,6 @@ public class Database implements DataHandler {
return
new
ObjectArray
(
users
.
values
());
return
new
ObjectArray
(
users
.
values
());
}
}
public
int
getCacheSize
()
{
return
cacheSize
;
}
public
String
getCacheType
()
{
public
String
getCacheType
()
{
return
cacheType
;
return
cacheType
;
}
}
...
@@ -1576,7 +1571,6 @@ public class Database implements DataHandler {
...
@@ -1576,7 +1571,6 @@ public class Database implements DataHandler {
fileData
.
getCache
().
setMaxSize
(
kb
);
fileData
.
getCache
().
setMaxSize
(
kb
);
int
valueIndex
=
kb
<=
32
?
kb
:
(
kb
>>>
SysProperties
.
CACHE_SIZE_INDEX_SHIFT
);
int
valueIndex
=
kb
<=
32
?
kb
:
(
kb
>>>
SysProperties
.
CACHE_SIZE_INDEX_SHIFT
);
fileIndex
.
getCache
().
setMaxSize
(
valueIndex
);
fileIndex
.
getCache
().
setMaxSize
(
valueIndex
);
cacheSize
=
kb
;
}
}
}
}
...
@@ -1833,10 +1827,6 @@ public class Database implements DataHandler {
...
@@ -1833,10 +1827,6 @@ public class Database implements DataHandler {
return
closing
;
return
closing
;
}
}
public
int
getWriteDelay
()
{
return
writeDelay
;
}
public
void
setMaxLengthInplaceLob
(
int
value
)
{
public
void
setMaxLengthInplaceLob
(
int
value
)
{
this
.
maxLengthInplaceLob
=
value
;
this
.
maxLengthInplaceLob
=
value
;
}
}
...
...
h2/src/main/org/h2/engine/MetaRecord.java
浏览文件 @
c0c3cc9e
...
@@ -35,6 +35,13 @@ public class MetaRecord {
...
@@ -35,6 +35,13 @@ public class MetaRecord {
objectType
=
r
.
getValue
(
2
).
getInt
();
objectType
=
r
.
getValue
(
2
).
getInt
();
sql
=
r
.
getValue
(
3
).
getString
();
sql
=
r
.
getValue
(
3
).
getString
();
}
}
MetaRecord
(
DbObject
obj
)
{
id
=
obj
.
getId
();
objectType
=
obj
.
getType
();
headPos
=
obj
.
getHeadPos
();
sql
=
obj
.
getCreateSQL
();
}
/**
/**
* Sort the list of meta records by 'create order'.
* Sort the list of meta records by 'create order'.
...
@@ -56,20 +63,13 @@ public class MetaRecord {
...
@@ -56,20 +63,13 @@ public class MetaRecord {
});
});
}
}
public
void
setRecord
(
SearchRow
r
)
{
void
setRecord
(
SearchRow
r
)
{
r
.
setValue
(
0
,
ValueInt
.
get
(
id
));
r
.
setValue
(
0
,
ValueInt
.
get
(
id
));
r
.
setValue
(
1
,
ValueInt
.
get
(
headPos
));
r
.
setValue
(
1
,
ValueInt
.
get
(
headPos
));
r
.
setValue
(
2
,
ValueInt
.
get
(
objectType
));
r
.
setValue
(
2
,
ValueInt
.
get
(
objectType
));
r
.
setValue
(
3
,
ValueString
.
get
(
sql
));
r
.
setValue
(
3
,
ValueString
.
get
(
sql
));
}
}
public
MetaRecord
(
DbObject
obj
)
{
id
=
obj
.
getId
();
objectType
=
obj
.
getType
();
headPos
=
obj
.
getHeadPos
();
sql
=
obj
.
getCreateSQL
();
}
void
execute
(
Database
db
,
Session
systemSession
,
DatabaseEventListener
listener
)
throws
SQLException
{
void
execute
(
Database
db
,
Session
systemSession
,
DatabaseEventListener
listener
)
throws
SQLException
{
try
{
try
{
Prepared
command
=
systemSession
.
prepare
(
sql
);
Prepared
command
=
systemSession
.
prepare
(
sql
);
...
@@ -88,36 +88,16 @@ public class MetaRecord {
...
@@ -88,36 +88,16 @@ public class MetaRecord {
}
}
}
}
public
int
getHeadPos
()
{
return
headPos
;
}
public
void
setHeadPos
(
int
headPos
)
{
this
.
headPos
=
headPos
;
}
public
int
getId
()
{
public
int
getId
()
{
return
id
;
return
id
;
}
}
public
void
setId
(
int
id
)
{
this
.
id
=
id
;
}
public
int
getObjectType
()
{
public
int
getObjectType
()
{
return
objectType
;
return
objectType
;
}
}
public
void
setObjectType
(
int
objectType
)
{
this
.
objectType
=
objectType
;
}
public
String
getSQL
()
{
public
String
getSQL
()
{
return
sql
;
return
sql
;
}
}
public
void
setSql
(
String
sql
)
{
this
.
sql
=
sql
;
}
}
}
h2/src/main/org/h2/engine/Session.java
浏览文件 @
c0c3cc9e
...
@@ -79,7 +79,6 @@ public class Session implements SessionInterface {
...
@@ -79,7 +79,6 @@ public class Session implements SessionInterface {
private
String
currentTransactionName
;
private
String
currentTransactionName
;
private
volatile
long
cancelAt
;
private
volatile
long
cancelAt
;
private
boolean
closed
;
private
boolean
closed
;
private
boolean
rollbackMode
;
private
long
sessionStart
=
System
.
currentTimeMillis
();
private
long
sessionStart
=
System
.
currentTimeMillis
();
private
long
currentCommandStart
;
private
long
currentCommandStart
;
private
HashMap
variables
;
private
HashMap
variables
;
...
@@ -395,12 +394,7 @@ public class Session implements SessionInterface {
...
@@ -395,12 +394,7 @@ public class Session implements SessionInterface {
public
void
rollbackTo
(
int
index
)
throws
SQLException
{
public
void
rollbackTo
(
int
index
)
throws
SQLException
{
while
(
undoLog
.
size
()
>
index
)
{
while
(
undoLog
.
size
()
>
index
)
{
UndoLogRecord
entry
=
undoLog
.
getAndRemoveLast
();
UndoLogRecord
entry
=
undoLog
.
getAndRemoveLast
();
rollbackMode
=
true
;
entry
.
undo
(
this
);
try
{
entry
.
undo
(
this
);
}
finally
{
rollbackMode
=
false
;
}
}
}
if
(
savepoints
!=
null
)
{
if
(
savepoints
!=
null
)
{
String
[]
names
=
new
String
[
savepoints
.
size
()];
String
[]
names
=
new
String
[
savepoints
.
size
()];
...
@@ -868,10 +862,6 @@ public class Session implements SessionInterface {
...
@@ -868,10 +862,6 @@ public class Session implements SessionInterface {
autoCommit
=
false
;
autoCommit
=
false
;
}
}
public
boolean
getRollbackMode
()
{
return
rollbackMode
;
}
public
long
getSessionStart
()
{
public
long
getSessionStart
()
{
return
sessionStart
;
return
sessionStart
;
}
}
...
...
h2/src/main/org/h2/expression/Aggregate.java
浏览文件 @
c0c3cc9e
...
@@ -427,10 +427,6 @@ public class Aggregate extends Expression {
...
@@ -427,10 +427,6 @@ public class Aggregate extends Expression {
}
}
}
}
public
int
getAggregateType
()
{
return
type
;
}
private
Index
getColumnIndex
(
boolean
first
)
{
private
Index
getColumnIndex
(
boolean
first
)
{
if
(
on
instanceof
ExpressionColumn
)
{
if
(
on
instanceof
ExpressionColumn
)
{
ExpressionColumn
col
=
(
ExpressionColumn
)
on
;
ExpressionColumn
col
=
(
ExpressionColumn
)
on
;
...
@@ -446,10 +442,10 @@ public class Aggregate extends Expression {
...
@@ -446,10 +442,10 @@ public class Aggregate extends Expression {
}
}
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
if
(
visitor
.
type
==
ExpressionVisitor
.
OPTIMIZABLE_MIN_MAX_COUNT_ALL
)
{
if
(
visitor
.
getType
()
==
ExpressionVisitor
.
OPTIMIZABLE_MIN_MAX_COUNT_ALL
)
{
switch
(
type
)
{
switch
(
type
)
{
case
COUNT_ALL:
case
COUNT_ALL:
return
visitor
.
table
.
canGetRowCount
();
return
visitor
.
getTable
()
.
canGetRowCount
();
case
MIN:
case
MIN:
case
MAX:
case
MAX:
if
(!
SysProperties
.
OPTIMIZE_MIN_MAX
)
{
if
(!
SysProperties
.
OPTIMIZE_MIN_MAX
)
{
...
...
h2/src/main/org/h2/expression/Comparison.java
浏览文件 @
c0c3cc9e
...
@@ -25,12 +25,50 @@ import org.h2.value.ValueNull;
...
@@ -25,12 +25,50 @@ import org.h2.value.ValueNull;
*/
*/
public
class
Comparison
extends
Condition
{
public
class
Comparison
extends
Condition
{
public
static
final
int
EQUAL
=
0
,
BIGGER_EQUAL
=
1
,
BIGGER
=
2
,
SMALLER_EQUAL
=
3
,
SMALLER
=
4
,
NOT_EQUAL
=
5
,
/**
IS_NULL
=
6
,
IS_NOT_NULL
=
7
;
* The comparison type meaning = as in ID=1.
*/
public
static
final
int
EQUAL
=
0
;
/**
* The comparison type meaning >= as in ID>=1.
*/
public
static
final
int
BIGGER_EQUAL
=
1
;
/**
* The comparison type meaning > as in ID>1.
*/
public
static
final
int
BIGGER
=
2
;
// TODO refactor: comparison: a comparison is never 'false'; the constant is
/**
// used only for index conditions
* The comparison type meaning <= as in ID<=1.
*/
public
static
final
int
SMALLER_EQUAL
=
3
;
/**
* The comparison type meaning < as in ID<1.
*/
public
static
final
int
SMALLER
=
4
;
/**
* The comparison type meaning <> as in ID<>1.
*/
public
static
final
int
NOT_EQUAL
=
5
;
/**
* The comparison type meaning IS NULL as in NAME IS NULL.
*/
public
static
final
int
IS_NULL
=
6
;
/**
* The comparison type meaning IS NOT NULL as in NAME IS NOT NULL.
*/
public
static
final
int
IS_NOT_NULL
=
7
;
/**
* This is a pseudo comparison type that is only used for index conditions.
* It means the comparison will always yield FALSE. Example: 1=0.
*/
public
static
final
int
FALSE
=
8
;
public
static
final
int
FALSE
=
8
;
private
final
Database
database
;
private
final
Database
database
;
...
@@ -277,11 +315,15 @@ public class Comparison extends Condition {
...
@@ -277,11 +315,15 @@ public class Comparison extends Condition {
return
;
return
;
}
}
if
(
l
==
null
)
{
if
(
l
==
null
)
{
if
(!
left
.
isEverything
(
ExpressionVisitor
.
getNotFromResolver
(
filter
)))
{
ExpressionVisitor
visitor
=
ExpressionVisitor
.
get
(
ExpressionVisitor
.
NOT_FROM_RESOLVER
);
visitor
.
setResolver
(
filter
);
if
(!
left
.
isEverything
(
visitor
))
{
return
;
return
;
}
}
}
else
if
(
r
==
null
)
{
}
else
if
(
r
==
null
)
{
if
(!
right
.
isEverything
(
ExpressionVisitor
.
getNotFromResolver
(
filter
)))
{
ExpressionVisitor
visitor
=
ExpressionVisitor
.
get
(
ExpressionVisitor
.
NOT_FROM_RESOLVER
);
visitor
.
setResolver
(
filter
);
if
(!
right
.
isEverything
(
visitor
))
{
return
;
return
;
}
}
}
else
{
}
else
{
...
@@ -355,7 +397,7 @@ public class Comparison extends Condition {
...
@@ -355,7 +397,7 @@ public class Comparison extends Condition {
return
left
.
getCost
()
+
(
right
==
null
?
0
:
right
.
getCost
())
+
1
;
return
left
.
getCost
()
+
(
right
==
null
?
0
:
right
.
getCost
())
+
1
;
}
}
public
Comparison
getAdditional
(
Session
session
,
Comparison
other
)
{
Comparison
getAdditional
(
Session
session
,
Comparison
other
)
{
if
(
compareType
==
other
.
compareType
&&
compareType
==
EQUAL
)
{
if
(
compareType
==
other
.
compareType
&&
compareType
==
EQUAL
)
{
boolean
lc
=
left
.
isConstant
(),
rc
=
right
.
isConstant
();
boolean
lc
=
left
.
isConstant
(),
rc
=
right
.
isConstant
();
boolean
l2c
=
other
.
left
.
isConstant
(),
r2c
=
other
.
right
.
isConstant
();
boolean
l2c
=
other
.
left
.
isConstant
(),
r2c
=
other
.
right
.
isConstant
();
...
@@ -377,6 +419,13 @@ public class Comparison extends Condition {
...
@@ -377,6 +419,13 @@ public class Comparison extends Condition {
return
null
;
return
null
;
}
}
/**
* Get the left or the right sub-expression of this condition.
*
* @param left true to get the left sub-expression, false to get the right
* sub-expression.
* @return the sub-expression
*/
public
Expression
getExpression
(
boolean
left
)
{
public
Expression
getExpression
(
boolean
left
)
{
return
left
?
this
.
left
:
right
;
return
left
?
this
.
left
:
right
;
}
}
...
...
h2/src/main/org/h2/expression/ConditionAndOr.java
浏览文件 @
c0c3cc9e
...
@@ -23,7 +23,15 @@ import org.h2.value.ValueNull;
...
@@ -23,7 +23,15 @@ import org.h2.value.ValueNull;
*/
*/
public
class
ConditionAndOr
extends
Condition
{
public
class
ConditionAndOr
extends
Condition
{
public
static
final
int
AND
=
0
,
OR
=
1
;
/**
* The AND condition type as in ID=1 AND NAME='Hello'.
*/
public
static
final
int
AND
=
0
;
/**
* The OR condition type as in ID=1 OR NAME='Hello'.
*/
public
static
final
int
OR
=
1
;
private
final
int
andOrType
;
private
final
int
andOrType
;
private
Expression
left
,
right
;
private
Expression
left
,
right
;
...
@@ -241,6 +249,13 @@ public class ConditionAndOr extends Condition {
...
@@ -241,6 +249,13 @@ public class ConditionAndOr extends Condition {
return
this
;
return
this
;
}
}
/**
* Get the left or the right sub-expression of this condition.
*
* @param left true to get the left sub-expression, false to get the right
* sub-expression.
* @return the sub-expression
*/
public
Expression
getExpression
(
boolean
left
)
{
public
Expression
getExpression
(
boolean
left
)
{
return
left
?
this
.
left
:
right
;
return
left
?
this
.
left
:
right
;
}
}
...
...
h2/src/main/org/h2/expression/ConditionIn.java
浏览文件 @
c0c3cc9e
...
@@ -104,7 +104,7 @@ public class ConditionIn extends Condition {
...
@@ -104,7 +104,7 @@ public class ConditionIn extends Condition {
if
(
SysProperties
.
OPTIMIZE_IN
)
{
if
(
SysProperties
.
OPTIMIZE_IN
)
{
int
dataType
=
left
.
getType
();
int
dataType
=
left
.
getType
();
ExpressionVisitor
independent
=
ExpressionVisitor
.
get
(
ExpressionVisitor
.
INDEPENDENT
);
ExpressionVisitor
independent
=
ExpressionVisitor
.
get
(
ExpressionVisitor
.
INDEPENDENT
);
independent
.
queryLevel
=
queryLevel
;
independent
.
setQueryLevel
(
queryLevel
)
;
if
(
areAllValues
(
independent
))
{
if
(
areAllValues
(
independent
))
{
if
(
left
instanceof
ExpressionColumn
)
{
if
(
left
instanceof
ExpressionColumn
)
{
Column
column
=
((
ExpressionColumn
)
left
).
getColumn
();
Column
column
=
((
ExpressionColumn
)
left
).
getColumn
();
...
...
h2/src/main/org/h2/expression/ExpressionColumn.java
浏览文件 @
c0c3cc9e
...
@@ -230,19 +230,19 @@ public class ExpressionColumn extends Expression {
...
@@ -230,19 +230,19 @@ public class ExpressionColumn extends Expression {
}
}
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
switch
(
visitor
.
type
)
{
switch
(
visitor
.
getType
()
)
{
case
ExpressionVisitor
.
OPTIMIZABLE_MIN_MAX_COUNT_ALL
:
case
ExpressionVisitor
.
OPTIMIZABLE_MIN_MAX_COUNT_ALL
:
return
false
;
return
false
;
case
ExpressionVisitor
.
READONLY
:
case
ExpressionVisitor
.
READONLY
:
case
ExpressionVisitor
.
DETERMINISTIC
:
case
ExpressionVisitor
.
DETERMINISTIC
:
return
true
;
return
true
;
case
ExpressionVisitor
.
INDEPENDENT
:
case
ExpressionVisitor
.
INDEPENDENT
:
return
this
.
queryLevel
<
visitor
.
queryLevel
;
return
this
.
queryLevel
<
visitor
.
getQueryLevel
()
;
case
ExpressionVisitor
.
EVALUATABLE
:
case
ExpressionVisitor
.
EVALUATABLE
:
// if the current value is known (evaluatable set)
// if the current value is known (evaluatable set)
// or if this columns belongs to a 'higher level' query and is
// or if this columns belongs to a 'higher level' query and is
// therefore just a parameter
// therefore just a parameter
return
evaluatable
||
visitor
.
queryLevel
<
this
.
queryLevel
;
return
evaluatable
||
visitor
.
getQueryLevel
()
<
this
.
queryLevel
;
case
ExpressionVisitor
.
SET_MAX_DATA_MODIFICATION_ID
:
case
ExpressionVisitor
.
SET_MAX_DATA_MODIFICATION_ID
:
visitor
.
addDataModificationId
(
column
.
getTable
().
getMaxDataModificationId
());
visitor
.
addDataModificationId
(
column
.
getTable
().
getMaxDataModificationId
());
return
true
;
return
true
;
...
@@ -252,7 +252,7 @@ public class ExpressionColumn extends Expression {
...
@@ -252,7 +252,7 @@ public class ExpressionColumn extends Expression {
visitor
.
addDependency
(
column
.
getTable
());
visitor
.
addDependency
(
column
.
getTable
());
return
true
;
return
true
;
default
:
default
:
throw
Message
.
getInternalError
(
"type="
+
visitor
.
type
);
throw
Message
.
getInternalError
(
"type="
+
visitor
.
getType
()
);
}
}
}
}
...
...
h2/src/main/org/h2/expression/ExpressionVisitor.java
浏览文件 @
c0c3cc9e
...
@@ -26,7 +26,8 @@ public class ExpressionVisitor {
...
@@ -26,7 +26,8 @@ public class ExpressionVisitor {
public
static
final
int
INDEPENDENT
=
0
;
public
static
final
int
INDEPENDENT
=
0
;
/**
/**
* Are all aggregates MIN(column), MAX(column), or COUNT(*)?
* Are all aggregates MIN(column), MAX(column), or COUNT(*) for the given
* table (getTable)?
*/
*/
public
static
final
int
OPTIMIZABLE_MIN_MAX_COUNT_ALL
=
1
;
public
static
final
int
OPTIMIZABLE_MIN_MAX_COUNT_ALL
=
1
;
...
@@ -52,7 +53,8 @@ public class ExpressionVisitor {
...
@@ -52,7 +53,8 @@ public class ExpressionVisitor {
public
static
final
int
READONLY
=
5
;
public
static
final
int
READONLY
=
5
;
/**
/**
* Does an expression have no relation to the given table filter?
* Does an expression have no relation to the given table filter
* (getResolver)?
*/
*/
public
static
final
int
NOT_FROM_RESOLVER
=
6
;
public
static
final
int
NOT_FROM_RESOLVER
=
6
;
...
@@ -61,9 +63,9 @@ public class ExpressionVisitor {
...
@@ -61,9 +63,9 @@ public class ExpressionVisitor {
*/
*/
public
static
final
int
GET_DEPENDENCIES
=
7
;
public
static
final
int
GET_DEPENDENCIES
=
7
;
int
queryLevel
;
private
int
queryLevel
;
p
ublic
Table
table
;
p
rivate
Table
table
;
p
ublic
int
type
;
p
rivate
int
type
;
private
long
maxDataModificationId
;
private
long
maxDataModificationId
;
private
ColumnResolver
resolver
;
private
ColumnResolver
resolver
;
private
HashSet
dependencies
;
private
HashSet
dependencies
;
...
@@ -71,43 +73,126 @@ public class ExpressionVisitor {
...
@@ -71,43 +73,126 @@ public class ExpressionVisitor {
public
static
ExpressionVisitor
get
(
int
type
)
{
public
static
ExpressionVisitor
get
(
int
type
)
{
return
new
ExpressionVisitor
(
type
);
return
new
ExpressionVisitor
(
type
);
}
}
p
ublic
long
getMaxDataModificationId
(
)
{
p
rivate
ExpressionVisitor
(
int
type
)
{
return
maxDataModificationId
;
this
.
type
=
type
;
}
}
/**
* Add a new dependency to the set of dependencies.
* This is used for GET_DEPENDENCIES visitors.
*
* @param obj the additional dependency.
*/
public
void
addDependency
(
DbObject
obj
)
{
public
void
addDependency
(
DbObject
obj
)
{
dependencies
.
add
(
obj
);
dependencies
.
add
(
obj
);
}
}
/**
* Get the dependency set.
* This is used for GET_DEPENDENCIES visitors.
*
* @return the set
*/
public
HashSet
getDependencies
()
{
public
HashSet
getDependencies
()
{
return
dependencies
;
return
dependencies
;
}
}
/**
* Set all dependencies.
* This is used for GET_DEPENDENCIES visitors.
*
* @param dependencies the dependency set
*/
public
void
setDependencies
(
HashSet
dependencies
)
{
public
void
setDependencies
(
HashSet
dependencies
)
{
this
.
dependencies
=
dependencies
;
this
.
dependencies
=
dependencies
;
}
}
private
ExpressionVisitor
(
int
type
)
{
/**
this
.
type
=
type
;
* Increment or decrement the query level.
}
*
* @param offset 1 to increment, -1 to decrement
public
void
queryLevel
(
int
offset
)
{
*/
public
void
incrementQueryLevel
(
int
offset
)
{
queryLevel
+=
offset
;
queryLevel
+=
offset
;
}
}
/**
* Get the column resolver.
* This is used for NOT_FROM_RESOLVER visitors.
*
* @return the column resolver
*/
public
ColumnResolver
getResolver
()
{
public
ColumnResolver
getResolver
()
{
return
resolver
;
return
resolver
;
}
}
/**
* Set the column resolver.
* This is used for NOT_FROM_RESOLVER visitors.
*
* @param resolver
*/
public
void
setResolver
(
ColumnResolver
resolver
)
{
this
.
resolver
=
resolver
;
}
/**
* Update the field maxDataModificationId if this value is higher
* than the current value.
* This is used for SET_MAX_DATA_MODIFICATION_ID visitors.
*
* @param value the data modification id
*/
public
void
addDataModificationId
(
long
value
)
{
maxDataModificationId
=
Math
.
max
(
maxDataModificationId
,
value
);
}
/**
* Get the last data modification.
* This is used for SET_MAX_DATA_MODIFICATION_ID visitors.
*
* @return the maximum modification id
*/
public
long
getMaxDataModificationId
()
{
return
maxDataModificationId
;
}
public
void
addDataModificationId
(
long
v
)
{
int
getQueryLevel
(
)
{
maxDataModificationId
=
Math
.
max
(
maxDataModificationId
,
v
)
;
return
queryLevel
;
}
}
public
static
ExpressionVisitor
getNotFromResolver
(
ColumnResolver
resolver
)
{
void
setQueryLevel
(
int
queryLevel
)
{
ExpressionVisitor
v
=
new
ExpressionVisitor
(
NOT_FROM_RESOLVER
);
this
.
queryLevel
=
queryLevel
;
v
.
resolver
=
resolver
;
}
return
v
;
/**
* Set the table.
* This is used for OPTIMIZABLE_MIN_MAX_COUNT_ALL visitors.
*
* @param table the table
*/
public
void
setTable
(
Table
table
)
{
this
.
table
=
table
;
}
/**
* Get the table.
* This is used for OPTIMIZABLE_MIN_MAX_COUNT_ALL visitors.
*
* @return the table
*/
public
Table
getTable
()
{
return
table
;
}
/**
* Get the visitor type.
*
* @return the type
*/
public
int
getType
()
{
return
type
;
}
}
}
}
h2/src/main/org/h2/expression/Function.java
浏览文件 @
c0c3cc9e
...
@@ -323,10 +323,23 @@ public class Function extends Expression implements FunctionCall {
...
@@ -323,10 +323,23 @@ public class Function extends Expression implements FunctionCall {
addFunction
(
name
,
type
,
parameterCount
,
dataType
,
false
,
true
);
addFunction
(
name
,
type
,
parameterCount
,
dataType
,
false
,
true
);
}
}
/**
* Get the function info object for this function, or null if there is no
* such function.
*
* @param name the function name
*/
public
static
FunctionInfo
getFunctionInfo
(
String
name
)
{
public
static
FunctionInfo
getFunctionInfo
(
String
name
)
{
return
(
FunctionInfo
)
FUNCTIONS
.
get
(
name
);
return
(
FunctionInfo
)
FUNCTIONS
.
get
(
name
);
}
}
/**
* Get an instance of the given function for this database.
*
* @param database the database
* @param name the function name
* @return the function object
*/
public
static
Function
getFunction
(
Database
database
,
String
name
)
throws
SQLException
{
public
static
Function
getFunction
(
Database
database
,
String
name
)
throws
SQLException
{
FunctionInfo
info
=
getFunctionInfo
(
name
);
FunctionInfo
info
=
getFunctionInfo
(
name
);
if
(
info
==
null
)
{
if
(
info
==
null
)
{
...
@@ -351,6 +364,12 @@ public class Function extends Expression implements FunctionCall {
...
@@ -351,6 +364,12 @@ public class Function extends Expression implements FunctionCall {
}
}
}
}
/**
* Set the parameter expression at the given index.
*
* @param index the index (0, 1,...)
* @param param the expression
*/
public
void
setParameter
(
int
index
,
Expression
param
)
throws
SQLException
{
public
void
setParameter
(
int
index
,
Expression
param
)
throws
SQLException
{
if
(
varArgs
!=
null
)
{
if
(
varArgs
!=
null
)
{
varArgs
.
add
(
param
);
varArgs
.
add
(
param
);
...
@@ -786,7 +805,7 @@ public class Function extends Expression implements FunctionCall {
...
@@ -786,7 +805,7 @@ public class Function extends Expression implements FunctionCall {
return
false
;
return
false
;
}
}
p
ublic
Value
getValueWithArgs
(
Session
session
,
Expression
[]
args
)
throws
SQLException
{
p
rivate
Value
getValueWithArgs
(
Session
session
,
Expression
[]
args
)
throws
SQLException
{
if
(
info
.
nullIfParameterIsNull
)
{
if
(
info
.
nullIfParameterIsNull
)
{
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++)
{
if
(
getNullOrValue
(
session
,
args
,
i
)
==
ValueNull
.
INSTANCE
)
{
if
(
getNullOrValue
(
session
,
args
,
i
)
==
ValueNull
.
INSTANCE
)
{
...
@@ -1490,6 +1509,12 @@ public class Function extends Expression implements FunctionCall {
...
@@ -1490,6 +1509,12 @@ public class Function extends Expression implements FunctionCall {
}
}
}
}
/**
* This method is called after all the parameters have been set.
* It checks if the parameter count is correct.
*
* @throws SQLException if the parameter count is incorrect.
*/
public
void
doneWithParameters
()
throws
SQLException
{
public
void
doneWithParameters
()
throws
SQLException
{
if
(
info
.
parameterCount
==
VAR_ARGS
)
{
if
(
info
.
parameterCount
==
VAR_ARGS
)
{
int
len
=
varArgs
.
size
();
int
len
=
varArgs
.
size
();
...
@@ -1837,7 +1862,7 @@ public class Function extends Expression implements FunctionCall {
...
@@ -1837,7 +1862,7 @@ public class Function extends Expression implements FunctionCall {
}
}
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
if
(
visitor
.
type
==
ExpressionVisitor
.
DETERMINISTIC
&&
!
info
.
isDeterministic
)
{
if
(
visitor
.
getType
()
==
ExpressionVisitor
.
DETERMINISTIC
&&
!
info
.
isDeterministic
)
{
return
false
;
return
false
;
}
}
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++)
{
...
...
h2/src/main/org/h2/expression/JavaAggregate.java
浏览文件 @
c0c3cc9e
...
@@ -82,7 +82,7 @@ public class JavaAggregate extends Expression {
...
@@ -82,7 +82,7 @@ public class JavaAggregate extends Expression {
}
}
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
switch
(
visitor
.
type
)
{
switch
(
visitor
.
getType
()
)
{
case
ExpressionVisitor
.
DETERMINISTIC
:
case
ExpressionVisitor
.
DETERMINISTIC
:
// TODO optimization: some functions are deterministic, but we don't
// TODO optimization: some functions are deterministic, but we don't
// know (no setting for that)
// know (no setting for that)
...
...
h2/src/main/org/h2/expression/JavaFunction.java
浏览文件 @
c0c3cc9e
...
@@ -97,10 +97,6 @@ public class JavaFunction extends Expression implements FunctionCall {
...
@@ -97,10 +97,6 @@ public class JavaFunction extends Expression implements FunctionCall {
}
}
}
}
public
FunctionAlias
getFunctionAlias
()
{
return
functionAlias
;
}
public
String
getName
()
{
public
String
getName
()
{
return
functionAlias
.
getName
();
return
functionAlias
.
getName
();
}
}
...
@@ -119,7 +115,7 @@ public class JavaFunction extends Expression implements FunctionCall {
...
@@ -119,7 +115,7 @@ public class JavaFunction extends Expression implements FunctionCall {
}
}
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
switch
(
visitor
.
type
)
{
switch
(
visitor
.
getType
()
)
{
case
ExpressionVisitor
.
DETERMINISTIC
:
case
ExpressionVisitor
.
DETERMINISTIC
:
// TODO optimization: some functions are deterministic, but we don't
// TODO optimization: some functions are deterministic, but we don't
// know (no setting for that)
// know (no setting for that)
...
...
h2/src/main/org/h2/expression/Parameter.java
浏览文件 @
c0c3cc9e
...
@@ -128,7 +128,7 @@ public class Parameter extends Expression implements ParameterInterface {
...
@@ -128,7 +128,7 @@ public class Parameter extends Expression implements ParameterInterface {
}
}
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
switch
(
visitor
.
type
)
{
switch
(
visitor
.
getType
()
)
{
case
ExpressionVisitor
.
OPTIMIZABLE_MIN_MAX_COUNT_ALL
:
case
ExpressionVisitor
.
OPTIMIZABLE_MIN_MAX_COUNT_ALL
:
return
true
;
return
true
;
case
ExpressionVisitor
.
DETERMINISTIC
:
case
ExpressionVisitor
.
DETERMINISTIC
:
...
@@ -147,7 +147,7 @@ public class Parameter extends Expression implements ParameterInterface {
...
@@ -147,7 +147,7 @@ public class Parameter extends Expression implements ParameterInterface {
case
ExpressionVisitor
.
GET_DEPENDENCIES
:
case
ExpressionVisitor
.
GET_DEPENDENCIES
:
return
true
;
return
true
;
default
:
default
:
throw
Message
.
getInternalError
(
"type="
+
visitor
.
type
);
throw
Message
.
getInternalError
(
"type="
+
visitor
.
getType
()
);
}
}
}
}
...
...
h2/src/main/org/h2/expression/Rownum.java
浏览文件 @
c0c3cc9e
...
@@ -65,7 +65,7 @@ public class Rownum extends Expression {
...
@@ -65,7 +65,7 @@ public class Rownum extends Expression {
}
}
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
switch
(
visitor
.
type
)
{
switch
(
visitor
.
getType
()
)
{
case
ExpressionVisitor
.
OPTIMIZABLE_MIN_MAX_COUNT_ALL
:
case
ExpressionVisitor
.
OPTIMIZABLE_MIN_MAX_COUNT_ALL
:
return
false
;
return
false
;
case
ExpressionVisitor
.
DETERMINISTIC
:
case
ExpressionVisitor
.
DETERMINISTIC
:
...
@@ -84,7 +84,7 @@ public class Rownum extends Expression {
...
@@ -84,7 +84,7 @@ public class Rownum extends Expression {
case
ExpressionVisitor
.
GET_DEPENDENCIES
:
case
ExpressionVisitor
.
GET_DEPENDENCIES
:
return
true
;
return
true
;
default
:
default
:
throw
Message
.
getInternalError
(
"type="
+
visitor
.
type
);
throw
Message
.
getInternalError
(
"type="
+
visitor
.
getType
()
);
}
}
}
}
...
...
h2/src/main/org/h2/expression/SequenceValue.java
浏览文件 @
c0c3cc9e
...
@@ -71,7 +71,7 @@ public class SequenceValue extends Expression {
...
@@ -71,7 +71,7 @@ public class SequenceValue extends Expression {
}
}
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
switch
(
visitor
.
type
)
{
switch
(
visitor
.
getType
()
)
{
case
ExpressionVisitor
.
OPTIMIZABLE_MIN_MAX_COUNT_ALL
:
case
ExpressionVisitor
.
OPTIMIZABLE_MIN_MAX_COUNT_ALL
:
return
true
;
return
true
;
case
ExpressionVisitor
.
DETERMINISTIC
:
case
ExpressionVisitor
.
DETERMINISTIC
:
...
@@ -90,7 +90,7 @@ public class SequenceValue extends Expression {
...
@@ -90,7 +90,7 @@ public class SequenceValue extends Expression {
visitor
.
addDependency
(
sequence
);
visitor
.
addDependency
(
sequence
);
return
true
;
return
true
;
default
:
default
:
throw
Message
.
getInternalError
(
"type="
+
visitor
.
type
);
throw
Message
.
getInternalError
(
"type="
+
visitor
.
getType
()
);
}
}
}
}
...
...
h2/src/main/org/h2/expression/TableFunction.java
浏览文件 @
c0c3cc9e
...
@@ -68,29 +68,6 @@ public class TableFunction extends Function implements FunctionCall {
...
@@ -68,29 +68,6 @@ public class TableFunction extends Function implements FunctionCall {
return
distinct
?
"TABLE_DISTINCT"
:
"TABLE"
;
return
distinct
?
"TABLE_DISTINCT"
:
"TABLE"
;
}
}
/**
* Get the row count of the table.
*
* @param session the session
* @return the row count
*/
public
int
getRowCount
(
Session
session
)
throws
SQLException
{
int
len
=
columnList
.
length
;
int
rowCount
=
0
;
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
Expression
expr
=
args
[
i
];
if
(
expr
.
isConstant
())
{
Value
v
=
expr
.
getValue
(
session
);
if
(
v
!=
ValueNull
.
INSTANCE
)
{
ValueArray
array
=
(
ValueArray
)
v
.
convertTo
(
Value
.
ARRAY
);
Value
[]
l
=
array
.
getList
();
rowCount
=
Math
.
max
(
rowCount
,
l
.
length
);
}
}
}
return
rowCount
;
}
public
ValueResultSet
getValueForColumnList
(
Session
session
,
Expression
[]
nullArgs
)
throws
SQLException
{
public
ValueResultSet
getValueForColumnList
(
Session
session
,
Expression
[]
nullArgs
)
throws
SQLException
{
return
getTable
(
session
,
args
,
true
,
false
);
return
getTable
(
session
,
args
,
true
,
false
);
}
}
...
...
h2/src/main/org/h2/expression/ValueExpression.java
浏览文件 @
c0c3cc9e
...
@@ -115,7 +115,7 @@ public class ValueExpression extends Expression {
...
@@ -115,7 +115,7 @@ public class ValueExpression extends Expression {
}
}
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
switch
(
visitor
.
type
)
{
switch
(
visitor
.
getType
()
)
{
case
ExpressionVisitor
.
OPTIMIZABLE_MIN_MAX_COUNT_ALL
:
case
ExpressionVisitor
.
OPTIMIZABLE_MIN_MAX_COUNT_ALL
:
return
true
;
return
true
;
case
ExpressionVisitor
.
DETERMINISTIC
:
case
ExpressionVisitor
.
DETERMINISTIC
:
...
@@ -132,7 +132,7 @@ public class ValueExpression extends Expression {
...
@@ -132,7 +132,7 @@ public class ValueExpression extends Expression {
case
ExpressionVisitor
.
GET_DEPENDENCIES
:
case
ExpressionVisitor
.
GET_DEPENDENCIES
:
return
true
;
return
true
;
default
:
default
:
throw
Message
.
getInternalError
(
"type="
+
visitor
.
type
);
throw
Message
.
getInternalError
(
"type="
+
visitor
.
getType
()
);
}
}
}
}
...
...
h2/src/main/org/h2/expression/Variable.java
浏览文件 @
c0c3cc9e
...
@@ -58,7 +58,7 @@ public class Variable extends Expression {
...
@@ -58,7 +58,7 @@ public class Variable extends Expression {
}
}
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
switch
(
visitor
.
type
)
{
switch
(
visitor
.
getType
()
)
{
case
ExpressionVisitor
.
OPTIMIZABLE_MIN_MAX_COUNT_ALL
:
case
ExpressionVisitor
.
OPTIMIZABLE_MIN_MAX_COUNT_ALL
:
return
true
;
return
true
;
case
ExpressionVisitor
.
DETERMINISTIC
:
case
ExpressionVisitor
.
DETERMINISTIC
:
...
@@ -78,7 +78,7 @@ public class Variable extends Expression {
...
@@ -78,7 +78,7 @@ public class Variable extends Expression {
case
ExpressionVisitor
.
GET_DEPENDENCIES
:
case
ExpressionVisitor
.
GET_DEPENDENCIES
:
return
true
;
return
true
;
default
:
default
:
throw
Message
.
getInternalError
(
"type="
+
visitor
.
type
);
throw
Message
.
getInternalError
(
"type="
+
visitor
.
getType
()
);
}
}
}
}
...
...
h2/src/main/org/h2/expression/Wildcard.java
浏览文件 @
c0c3cc9e
...
@@ -66,10 +66,6 @@ public class Wildcard extends Expression {
...
@@ -66,10 +66,6 @@ public class Wildcard extends Expression {
throw
Message
.
getInternalError
();
throw
Message
.
getInternalError
();
}
}
public
String
getSchema
()
{
return
schema
;
}
public
String
getTableAlias
()
{
public
String
getTableAlias
()
{
return
table
;
return
table
;
}
}
...
...
h2/src/main/org/h2/index/BaseIndex.java
浏览文件 @
c0c3cc9e
...
@@ -33,7 +33,6 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index {
...
@@ -33,7 +33,6 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index {
protected
IndexColumn
[]
indexColumns
;
protected
IndexColumn
[]
indexColumns
;
protected
Column
[]
columns
;
protected
Column
[]
columns
;
protected
int
[]
columnIds
;
protected
int
[]
columnIds
;
protected
boolean
[]
descending
;
protected
Table
table
;
protected
Table
table
;
protected
IndexType
indexType
;
protected
IndexType
indexType
;
protected
long
rowCount
;
protected
long
rowCount
;
...
...
h2/src/main/org/h2/index/BtreeIndex.java
浏览文件 @
c0c3cc9e
...
@@ -242,15 +242,6 @@ public class BtreeIndex extends BaseIndex implements RecordReader {
...
@@ -242,15 +242,6 @@ public class BtreeIndex extends BaseIndex implements RecordReader {
}
}
}
}
public
int
getLookupCost
(
int
rowCount
)
{
for
(
int
i
=
0
,
j
=
1
;;
i
++)
{
j
*=
BtreePage
.
BLOCKS_PER_PAGE
;
if
(
j
>
rowCount
)
{
return
(
i
+
1
);
}
}
}
public
double
getCost
(
Session
session
,
int
[]
masks
)
throws
SQLException
{
public
double
getCost
(
Session
session
,
int
[]
masks
)
throws
SQLException
{
return
10
*
getCostRangeIndex
(
masks
,
tableData
.
getRowCount
(
session
));
return
10
*
getCostRangeIndex
(
masks
,
tableData
.
getRowCount
(
session
));
}
}
...
...
h2/src/main/org/h2/index/IndexCondition.java
浏览文件 @
c0c3cc9e
...
@@ -142,9 +142,5 @@ public class IndexCondition {
...
@@ -142,9 +142,5 @@ public class IndexCondition {
public
boolean
isEvaluatable
()
{
public
boolean
isEvaluatable
()
{
return
expression
.
isEverything
(
ExpressionVisitor
.
EVALUATABLE
);
return
expression
.
isEverything
(
ExpressionVisitor
.
EVALUATABLE
);
}
}
public
Expression
getExpression
()
{
return
expression
;
}
}
}
h2/src/main/org/h2/index/LinkedIndex.java
浏览文件 @
c0c3cc9e
...
@@ -132,15 +132,6 @@ public class LinkedIndex extends BaseIndex {
...
@@ -132,15 +132,6 @@ public class LinkedIndex extends BaseIndex {
}
}
}
}
public
int
getLookupCost
(
int
rowCount
)
{
for
(
int
i
=
0
,
j
=
1
;;
i
++)
{
j
*=
10
;
if
(
j
>
rowCount
)
{
return
i
+
1
;
}
}
}
public
double
getCost
(
Session
session
,
int
[]
masks
)
throws
SQLException
{
public
double
getCost
(
Session
session
,
int
[]
masks
)
throws
SQLException
{
return
100
+
getCostRangeIndex
(
masks
,
rowCount
+
Constants
.
COST_ROW_OFFSET
);
return
100
+
getCostRangeIndex
(
masks
,
rowCount
+
Constants
.
COST_ROW_OFFSET
);
}
}
...
...
h2/src/main/org/h2/index/MultiVersionIndex.java
浏览文件 @
c0c3cc9e
...
@@ -309,10 +309,4 @@ public class MultiVersionIndex implements Index {
...
@@ -309,10 +309,4 @@ public class MultiVersionIndex implements Index {
base
.
setTemporary
(
temporary
);
base
.
setTemporary
(
temporary
);
}
}
void
debug
(
String
s
,
Session
session
,
SearchRow
row
)
throws
SQLException
{
// System.out.println(this + " " + s + " session:" +
// (session == null ? -1: session.getId()) + " " +
// (row == null ? "" : row.getValue(0).getString()));
}
}
}
h2/src/main/org/h2/index/TreeIndex.java
浏览文件 @
c0c3cc9e
...
@@ -293,15 +293,6 @@ public class TreeIndex extends BaseIndex {
...
@@ -293,15 +293,6 @@ public class TreeIndex extends BaseIndex {
}
}
}
}
public
int
getLookupCost
(
int
rowCount
)
{
for
(
int
i
=
0
,
j
=
1
;;
i
++)
{
j
+=
j
;
if
(
j
>=
rowCount
)
{
return
i
;
}
}
}
public
double
getCost
(
Session
session
,
int
[]
masks
)
throws
SQLException
{
public
double
getCost
(
Session
session
,
int
[]
masks
)
throws
SQLException
{
return
getCostRangeIndex
(
masks
,
tableData
.
getRowCount
(
session
));
return
getCostRangeIndex
(
masks
,
tableData
.
getRowCount
(
session
));
}
}
...
...
h2/src/main/org/h2/jdbc/JdbcResultSet.java
浏览文件 @
c0c3cc9e
...
@@ -3384,18 +3384,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
...
@@ -3384,18 +3384,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
}
}
}
}
/**
* Updates a column in the current or insert row.
*
* @param columnIndex (1,2,...)
* @param x the value
* @param length the number of characters
* @throws SQLException if the result set is closed
*/
public
void
updateNCharacterStream
(
int
columnIndex
,
Reader
x
,
int
length
)
throws
SQLException
{
updateNCharacterStream
(
columnIndex
,
x
,
(
long
)
length
);
}
/**
/**
* Updates a column in the current or insert row.
* Updates a column in the current or insert row.
*
*
...
@@ -3428,18 +3416,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
...
@@ -3428,18 +3416,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
}
}
}
}
/**
* Updates a column in the current or insert row.
*
* @param columnName the name of the column label
* @param x the value
* @param length the number of characters
* @throws SQLException if the result set is closed
*/
public
void
updateNCharacterStream
(
String
columnName
,
Reader
x
,
int
length
)
throws
SQLException
{
updateNCharacterStream
(
columnName
,
x
,
(
long
)
length
);
}
/**
/**
* Updates a column in the current or insert row.
* Updates a column in the current or insert row.
*
*
...
...
h2/src/main/org/h2/jdbcx/JdbcXAConnection.java
浏览文件 @
c0c3cc9e
...
@@ -237,7 +237,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
...
@@ -237,7 +237,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
list
.
toArray
(
result
);
list
.
toArray
(
result
);
return
result
;
return
result
;
}
catch
(
SQLException
e
)
{
}
catch
(
SQLException
e
)
{
getTrace
().
debug
(
"throw XAException.XAER_RMERR"
,
e
);
throw
new
XAException
(
XAException
.
XAER_RMERR
);
throw
new
XAException
(
XAException
.
XAER_RMERR
);
}
finally
{
}
finally
{
JdbcUtils
.
closeSilently
(
stat
);
JdbcUtils
.
closeSilently
(
stat
);
...
@@ -257,7 +256,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
...
@@ -257,7 +256,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
}
}
checkOpen
();
checkOpen
();
if
(!
currentTransaction
.
equals
(
xid
))
{
if
(!
currentTransaction
.
equals
(
xid
))
{
getTrace
().
debug
(
"throw XAException.XAER_INVAL"
);
throw
new
XAException
(
XAException
.
XAER_INVAL
);
throw
new
XAException
(
XAException
.
XAER_INVAL
);
}
}
Statement
stat
=
null
;
Statement
stat
=
null
;
...
@@ -270,7 +268,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
...
@@ -270,7 +268,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
}
finally
{
}
finally
{
JdbcUtils
.
closeSilently
(
stat
);
JdbcUtils
.
closeSilently
(
stat
);
}
}
getTrace
().
debug
(
"return XA_OK"
);
return
XA_OK
;
return
XA_OK
;
}
}
//## Java 1.4 end ##
//## Java 1.4 end ##
...
@@ -304,7 +301,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
...
@@ -304,7 +301,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
}
catch
(
SQLException
e
)
{
}
catch
(
SQLException
e
)
{
throw
convertException
(
e
);
throw
convertException
(
e
);
}
}
getTrace
().
debug
(
"rolled back"
);
currentTransaction
=
null
;
currentTransaction
=
null
;
}
}
//## Java 1.4 end ##
//## Java 1.4 end ##
...
@@ -325,7 +321,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
...
@@ -325,7 +321,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
return
;
return
;
}
}
if
(!
currentTransaction
.
equals
(
xid
))
{
if
(!
currentTransaction
.
equals
(
xid
))
{
getTrace
().
debug
(
"throw XAException.XAER_OUTSIDE"
);
throw
new
XAException
(
XAException
.
XAER_OUTSIDE
);
throw
new
XAException
(
XAException
.
XAER_OUTSIDE
);
}
}
}
}
...
@@ -346,7 +341,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
...
@@ -346,7 +341,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
return
;
return
;
}
}
if
(
currentTransaction
!=
null
)
{
if
(
currentTransaction
!=
null
)
{
getTrace
().
debug
(
"throw XAException.XAER_NOTA"
);
throw
new
XAException
(
XAException
.
XAER_NOTA
);
throw
new
XAException
(
XAException
.
XAER_NOTA
);
}
}
try
{
try
{
...
@@ -354,7 +348,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
...
@@ -354,7 +348,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
}
catch
(
SQLException
e
)
{
}
catch
(
SQLException
e
)
{
throw
convertException
(
e
);
throw
convertException
(
e
);
}
}
getTrace
().
debug
(
"currentTransaction=xid"
);
currentTransaction
=
xid
;
currentTransaction
=
xid
;
}
}
//## Java 1.4 end ##
//## Java 1.4 end ##
...
@@ -383,7 +376,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
...
@@ -383,7 +376,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
}
finally
{
}
finally
{
JdbcUtils
.
closeSilently
(
stat
);
JdbcUtils
.
closeSilently
(
stat
);
}
}
getTrace
().
debug
(
"committed"
);
currentTransaction
=
null
;
currentTransaction
=
null
;
}
}
//## Java 1.4 end ##
//## Java 1.4 end ##
...
@@ -437,10 +429,9 @@ implements XAConnection, XAResource, JdbcConnectionListener
...
@@ -437,10 +429,9 @@ implements XAConnection, XAResource, JdbcConnectionListener
}
}
private
XAException
convertException
(
SQLException
e
)
{
private
XAException
convertException
(
SQLException
e
)
{
if
(
isDebugEnabled
())
{
XAException
xa
=
new
XAException
(
e
.
getMessage
());
getTrace
().
debug
(
"throw XAException("
+
e
.
getMessage
()+
");"
);
xa
.
initCause
(
e
);
}
return
xa
;
return
new
XAException
(
e
.
getMessage
());
}
}
private
String
quoteXid
(
Xid
xid
)
{
private
String
quoteXid
(
Xid
xid
)
{
...
@@ -494,7 +485,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
...
@@ -494,7 +485,6 @@ implements XAConnection, XAResource, JdbcConnectionListener
private
void
checkOpen
()
throws
XAException
{
private
void
checkOpen
()
throws
XAException
{
if
(
conn
==
null
)
{
if
(
conn
==
null
)
{
getTrace
().
debug
(
"conn==null"
);
throw
new
XAException
(
XAException
.
XAER_RMERR
);
throw
new
XAException
(
XAException
.
XAER_RMERR
);
}
}
}
}
...
...
h2/src/main/org/h2/log/InDoubtTransaction.java
浏览文件 @
c0c3cc9e
...
@@ -62,14 +62,6 @@ public class InDoubtTransaction {
...
@@ -62,14 +62,6 @@ public class InDoubtTransaction {
}
}
}
}
public
int
getPos
()
{
return
pos
;
}
public
int
getSessionId
()
{
return
sessionId
;
}
public
String
getTransaction
()
{
public
String
getTransaction
()
{
return
transaction
;
return
transaction
;
}
}
...
...
h2/src/main/org/h2/message/TraceObject.java
浏览文件 @
c0c3cc9e
...
@@ -68,10 +68,6 @@ public class TraceObject {
...
@@ -68,10 +68,6 @@ public class TraceObject {
return
trace
.
isInfoEnabled
();
return
trace
.
isInfoEnabled
();
}
}
protected
Trace
getTrace
()
{
return
trace
;
}
protected
void
debugCodeAssign
(
String
className
,
int
type
,
int
id
,
String
value
)
{
protected
void
debugCodeAssign
(
String
className
,
int
type
,
int
id
,
String
value
)
{
if
(
trace
.
isDebugEnabled
())
{
if
(
trace
.
isDebugEnabled
())
{
trace
.
debugCode
(
className
+
" "
+
PREFIX
[
type
]
+
id
+
" = "
+
getTraceObjectName
()
+
"."
+
value
+
";"
);
trace
.
debugCode
(
className
+
" "
+
PREFIX
[
type
]
+
id
+
" = "
+
getTraceObjectName
()
+
"."
+
value
+
";"
);
...
...
h2/src/main/org/h2/res/help.csv
浏览文件 @
c0c3cc9e
...
@@ -2696,7 +2696,7 @@ CSVREAD(fileNameString [, columnNamesString [, charsetString [, fieldSeparatorSt
...
@@ -2696,7 +2696,7 @@ CSVREAD(fileNameString [, columnNamesString [, charsetString [, fieldSeparatorSt
[, escapeCharacterString [, nullString]]]]]]): resultSet
[, escapeCharacterString [, nullString]]]]]]): resultSet
","
","
Returns the result set of reading the CSV (comma separated values) file.
Returns the result set of reading the CSV (comma separated values) file.
If the column names are specified (a
comma separated list of column names
),
If the column names are specified (a
list of column names separated with the fieldSeparator
),
those are used they are read from the file, otherwise (or if they are set to NULL) the first line
those are used they are read from the file, otherwise (or if they are set to NULL) the first line
of the file is interpreted as the column names.
of the file is interpreted as the column names.
The default charset is the default value for this system, and the default field separator is a comma.
The default charset is the default value for this system, and the default field separator is a comma.
...
@@ -2705,7 +2705,9 @@ This function can be used like a table: SELECT * FROM CSVREAD(...).
...
@@ -2705,7 +2705,9 @@ This function can be used like a table: SELECT * FROM CSVREAD(...).
Instead of a file, an URL may be used, for example jar:file:///c:/temp/example.zip!/org/example/nested.zip.
Instead of a file, an URL may be used, for example jar:file:///c:/temp/example.zip!/org/example/nested.zip.
Admin rights are required to execute this command.
Admin rights are required to execute this command.
","
","
CALL CSVREAD('test.csv')
CALL CSVREAD('test.csv');
-- Read a file containing the columns ID, NAME with UTF-8 encoding and the pipe (|) as field separator
CALL CSVREAD('test2.csv', 'ID|NAME', 'UTF-8', '|');
"
"
"Functions (System)","CSVWRITE","
"Functions (System)","CSVWRITE","
...
@@ -2720,7 +2722,9 @@ The default line separator is the default value for this system ('line.separator
...
@@ -2720,7 +2722,9 @@ The default line separator is the default value for this system ('line.separator
The returned value is the number or rows written.
The returned value is the number or rows written.
Admin rights are required to execute this command.
Admin rights are required to execute this command.
","
","
CALL CSVWRITE('test.csv', 'SELECT * FROM TEST')
CALL CSVWRITE('test.csv', 'SELECT * FROM TEST');
-- Write a file with UTF-8 encoding and the pipe (|) as field separator
CALL CSVWRITE('test2.csv', 'SELECT * FROM TEST', 'UTF-8', '|');
"
"
"Functions (System)","DATABASE","
"Functions (System)","DATABASE","
...
@@ -2728,7 +2732,7 @@ DATABASE(): string
...
@@ -2728,7 +2732,7 @@ DATABASE(): string
","
","
Returns the name of the database.
Returns the name of the database.
","
","
DATABASE()
CALL DATABASE();
"
"
"Functions (System)","DATABASE_PATH","
"Functions (System)","DATABASE_PATH","
...
@@ -2737,7 +2741,7 @@ DATABASE_PATH(): string
...
@@ -2737,7 +2741,7 @@ DATABASE_PATH(): string
Returns the directory of the database files and the database name, if it is file based.
Returns the directory of the database files and the database name, if it is file based.
Returns NULL otherwise.
Returns NULL otherwise.
","
","
DATABASE_PATH()
CALL DATABASE_PATH();
"
"
"Functions (System)","FILE_READ","
"Functions (System)","FILE_READ","
...
@@ -2759,7 +2763,7 @@ GREATEST(aValue, bValue [,...]): value
...
@@ -2759,7 +2763,7 @@ GREATEST(aValue, bValue [,...]): value
","
","
Returns the largest value that is not NULL, or NULL if all values are NULL.
Returns the largest value that is not NULL, or NULL if all values are NULL.
","
","
GREATEST(A, B, C)
CALL GREATEST(1, 2, 3);
"
"
"Functions (System)","IDENTITY","
"Functions (System)","IDENTITY","
...
@@ -2767,7 +2771,7 @@ IDENTITY(): long
...
@@ -2767,7 +2771,7 @@ IDENTITY(): long
","
","
Returns the last inserted identity value for this session.
Returns the last inserted identity value for this session.
","
","
IDENTITY()
CALL IDENTITY();
"
"
"Functions (System)","IFNULL","
"Functions (System)","IFNULL","
...
@@ -2775,7 +2779,7 @@ IFNULL(aValue, bValue): value
...
@@ -2775,7 +2779,7 @@ IFNULL(aValue, bValue): value
","
","
Returns the value of 'a' if it is not null, otherwise 'b'.
Returns the value of 'a' if it is not null, otherwise 'b'.
","
","
IFNULL(A, B)
CALL IFNULL(NULL, '');
"
"
"Functions (System)","LEAST","
"Functions (System)","LEAST","
...
@@ -2783,7 +2787,7 @@ LEAST(aValue, bValue [,...]): value
...
@@ -2783,7 +2787,7 @@ LEAST(aValue, bValue [,...]): value
","
","
Returns the smallest value that is not NULL, or NULL if all values are NULL.
Returns the smallest value that is not NULL, or NULL if all values are NULL.
","
","
LEAST(A, B, C)
CALL LEAST(1, 2, 3);
"
"
"Functions (System)","LOCK_MODE","
"Functions (System)","LOCK_MODE","
...
@@ -2791,7 +2795,7 @@ LOCK_MODE(): int
...
@@ -2791,7 +2795,7 @@ LOCK_MODE(): int
","
","
Returns the current lock mode. See SET LOCK_MODE.
Returns the current lock mode. See SET LOCK_MODE.
","
","
LOCK_MODE()
CALL LOCK_MODE();
"
"
"Functions (System)","LOCK_TIMEOUT","
"Functions (System)","LOCK_TIMEOUT","
...
...
h2/src/main/org/h2/result/LocalResult.java
浏览文件 @
c0c3cc9e
...
@@ -43,8 +43,6 @@ public class LocalResult implements ResultInterface {
...
@@ -43,8 +43,6 @@ public class LocalResult implements ResultInterface {
private
int
offset
,
limit
;
private
int
offset
,
limit
;
private
ResultExternal
disk
;
private
ResultExternal
disk
;
private
int
diskOffset
;
private
int
diskOffset
;
private
boolean
isUpdateCount
;
private
int
updateCount
;
private
boolean
distinct
;
private
boolean
distinct
;
private
boolean
closed
;
private
boolean
closed
;
...
@@ -82,16 +80,27 @@ public class LocalResult implements ResultInterface {
...
@@ -82,16 +80,27 @@ public class LocalResult implements ResultInterface {
return
cols
;
return
cols
;
}
}
public
LocalResult
(
int
updateCount
)
{
public
LocalResult
()
{
this
.
isUpdateCount
=
true
;
}
this
.
updateCount
=
updateCount
;
public
LocalResult
(
Session
session
,
Expression
[]
expressions
,
int
visibleColumnCount
)
{
this
.
session
=
session
;
if
(
session
==
null
)
{
this
.
maxMemoryRows
=
Integer
.
MAX_VALUE
;
}
else
{
this
.
maxMemoryRows
=
session
.
getDatabase
().
getMaxMemoryRows
();
}
rows
=
new
ObjectArray
();
this
.
visibleColumnCount
=
visibleColumnCount
;
rowId
=
-
1
;
this
.
expressions
=
expressions
;
}
}
public
LocalResult
createShallowCopy
(
Session
session
)
{
public
LocalResult
createShallowCopy
(
Session
session
)
{
if
(
disk
==
null
&&
(
rows
==
null
||
rows
.
size
()
<
rowCount
))
{
if
(
disk
==
null
&&
(
rows
==
null
||
rows
.
size
()
<
rowCount
))
{
return
null
;
return
null
;
}
}
LocalResult
copy
=
new
LocalResult
(
0
);
LocalResult
copy
=
new
LocalResult
();
copy
.
maxMemoryRows
=
this
.
maxMemoryRows
;
copy
.
maxMemoryRows
=
this
.
maxMemoryRows
;
copy
.
session
=
session
;
copy
.
session
=
session
;
copy
.
visibleColumnCount
=
this
.
visibleColumnCount
;
copy
.
visibleColumnCount
=
this
.
visibleColumnCount
;
...
@@ -107,19 +116,9 @@ public class LocalResult implements ResultInterface {
...
@@ -107,19 +116,9 @@ public class LocalResult implements ResultInterface {
copy
.
limit
=
0
;
copy
.
limit
=
0
;
copy
.
disk
=
this
.
disk
;
copy
.
disk
=
this
.
disk
;
copy
.
diskOffset
=
this
.
diskOffset
;
copy
.
diskOffset
=
this
.
diskOffset
;
copy
.
isUpdateCount
=
this
.
isUpdateCount
;
copy
.
updateCount
=
this
.
updateCount
;
return
copy
;
return
copy
;
}
}
public
boolean
isUpdateCount
()
{
return
isUpdateCount
;
}
public
int
getUpdateCount
()
{
return
updateCount
;
}
public
LocalResult
(
Session
session
,
ObjectArray
expressionList
,
int
visibleColumnCount
)
{
public
LocalResult
(
Session
session
,
ObjectArray
expressionList
,
int
visibleColumnCount
)
{
this
(
session
,
getList
(
expressionList
),
visibleColumnCount
);
this
(
session
,
getList
(
expressionList
),
visibleColumnCount
);
}
}
...
@@ -130,19 +129,6 @@ public class LocalResult implements ResultInterface {
...
@@ -130,19 +129,6 @@ public class LocalResult implements ResultInterface {
return
expressions
;
return
expressions
;
}
}
public
LocalResult
(
Session
session
,
Expression
[]
expressions
,
int
visibleColumnCount
)
{
this
.
session
=
session
;
if
(
session
==
null
)
{
this
.
maxMemoryRows
=
Integer
.
MAX_VALUE
;
}
else
{
this
.
maxMemoryRows
=
session
.
getDatabase
().
getMaxMemoryRows
();
}
rows
=
new
ObjectArray
();
this
.
visibleColumnCount
=
visibleColumnCount
;
rowId
=
-
1
;
this
.
expressions
=
expressions
;
}
public
void
setSortOrder
(
SortOrder
sort
)
{
public
void
setSortOrder
(
SortOrder
sort
)
{
this
.
sort
=
sort
;
this
.
sort
=
sort
;
}
}
...
...
h2/src/main/org/h2/result/ResultInterface.java
浏览文件 @
c0c3cc9e
...
@@ -144,17 +144,4 @@ public interface ResultInterface {
...
@@ -144,17 +144,4 @@ public interface ResultInterface {
*/
*/
int
getNullable
(
int
i
);
int
getNullable
(
int
i
);
/**
* Check if this result is in fact an update count.
*
* @return if it is an update count
*/
boolean
isUpdateCount
();
/**
* Get the update count for this result.
*
* @return the update count
*/
int
getUpdateCount
();
}
}
h2/src/main/org/h2/result/ResultRemote.java
浏览文件 @
c0c3cc9e
...
@@ -34,14 +34,6 @@ public class ResultRemote implements ResultInterface {
...
@@ -34,14 +34,6 @@ public class ResultRemote implements ResultInterface {
private
ObjectArray
result
;
private
ObjectArray
result
;
private
ObjectArray
lobValues
;
private
ObjectArray
lobValues
;
public
boolean
isUpdateCount
()
{
return
false
;
}
public
int
getUpdateCount
()
{
return
0
;
}
public
ResultRemote
(
SessionRemote
session
,
Transfer
transfer
,
int
id
,
int
columnCount
,
int
fetchSize
)
public
ResultRemote
(
SessionRemote
session
,
Transfer
transfer
,
int
id
,
int
columnCount
,
int
fetchSize
)
throws
IOException
,
SQLException
{
throws
IOException
,
SQLException
{
this
.
session
=
session
;
this
.
session
=
session
;
...
...
h2/src/main/org/h2/result/Row.java
浏览文件 @
c0c3cc9e
...
@@ -40,11 +40,6 @@ public class Row extends Record implements SearchRow {
...
@@ -40,11 +40,6 @@ public class Row extends Record implements SearchRow {
this
.
version
=
version
;
this
.
version
=
version
;
}
}
public
Row
(
Row
old
)
{
this
.
data
=
old
.
data
;
this
.
memory
=
old
.
memory
;
}
public
Value
getValue
(
int
i
)
{
public
Value
getValue
(
int
i
)
{
return
data
[
i
];
return
data
[
i
];
}
}
...
...
h2/src/main/org/h2/result/SimpleRowValue.java
浏览文件 @
c0c3cc9e
...
@@ -32,10 +32,6 @@ public class SimpleRowValue implements SearchRow {
...
@@ -32,10 +32,6 @@ public class SimpleRowValue implements SearchRow {
return
version
;
return
version
;
}
}
public
void
setVersion
(
int
version
)
{
this
.
version
=
version
;
}
public
int
getColumnCount
()
{
public
int
getColumnCount
()
{
return
virtualColumnCount
;
return
virtualColumnCount
;
}
}
...
...
h2/src/main/org/h2/server/TcpServer.java
浏览文件 @
c0c3cc9e
...
@@ -100,20 +100,6 @@ public class TcpServer implements Service {
...
@@ -100,20 +100,6 @@ public class TcpServer implements Service {
SERVERS
.
put
(
""
+
port
,
this
);
SERVERS
.
put
(
""
+
port
,
this
);
}
}
/**
* Get the list of ports of all running TCP server.
*
* @return the list of ports
*/
public
static
int
[]
getAllServerPorts
()
{
Object
[]
servers
=
SERVERS
.
keySet
().
toArray
();
int
[]
ports
=
new
int
[
servers
.
length
];
for
(
int
i
=
0
;
i
<
servers
.
length
;
i
++)
{
ports
[
i
]
=
Integer
.
parseInt
(
servers
[
i
].
toString
());
}
return
ports
;
}
synchronized
void
addConnection
(
int
id
,
String
url
,
String
user
)
{
synchronized
void
addConnection
(
int
id
,
String
url
,
String
user
)
{
try
{
try
{
managementDbAdd
.
setInt
(
1
,
id
);
managementDbAdd
.
setInt
(
1
,
id
);
...
@@ -280,6 +266,14 @@ public class TcpServer implements Service {
...
@@ -280,6 +266,14 @@ public class TcpServer implements Service {
}
}
}
}
/**
* Stop a running server. This method is called via reflection from the
* STOP_SERVER function.
*
* @param port the port where the server runs
* @param password the password
* @param shutdownMode the shutdown mode, SHUTDOWN_NORMAL or SHUTDOWN_FORCE.
*/
public
static
void
stopServer
(
int
port
,
String
password
,
int
shutdownMode
)
{
public
static
void
stopServer
(
int
port
,
String
password
,
int
shutdownMode
)
{
TcpServer
server
=
(
TcpServer
)
SERVERS
.
get
(
""
+
port
);
TcpServer
server
=
(
TcpServer
)
SERVERS
.
get
(
""
+
port
);
if
(
server
==
null
)
{
if
(
server
==
null
)
{
...
...
h2/src/main/org/h2/server/pg/PgServer.java
浏览文件 @
c0c3cc9e
...
@@ -243,12 +243,26 @@ public class PgServer implements Service {
...
@@ -243,12 +243,26 @@ public class PgServer implements Service {
}
}
}
}
/**
* Get the name of the current schema.
* This method is called by the database.
*
* @param conn the connection
* @return the schema name
*/
public
static
String
getCurrentSchema
(
Connection
conn
)
throws
SQLException
{
public
static
String
getCurrentSchema
(
Connection
conn
)
throws
SQLException
{
ResultSet
rs
=
conn
.
createStatement
().
executeQuery
(
"call schema()"
);
ResultSet
rs
=
conn
.
createStatement
().
executeQuery
(
"call schema()"
);
rs
.
next
();
rs
.
next
();
return
rs
.
getString
(
1
);
return
rs
.
getString
(
1
);
}
}
/**
* Get the name of this encoding code.
* This method is called by the database.
*
* @param code the encoding code
* @return the encoding name
*/
public
static
String
getEncodingName
(
int
code
)
throws
SQLException
{
public
static
String
getEncodingName
(
int
code
)
throws
SQLException
{
switch
(
code
)
{
switch
(
code
)
{
case
0
:
case
0
:
...
@@ -262,14 +276,34 @@ public class PgServer implements Service {
...
@@ -262,14 +276,34 @@ public class PgServer implements Service {
}
}
}
}
/**
* Get the version. This method must return PostgreSQL to keep some clients
* happy. This method is called by the database.
*
* @return the server name and version
*/
public
static
String
getVersion
()
{
public
static
String
getVersion
()
{
return
"PostgreSQL 8.1.4 server protocol using H2 "
+
Constants
.
getFullVersion
();
return
"PostgreSQL 8.1.4 server protocol using H2 "
+
Constants
.
getFullVersion
();
}
}
/**
* Get the current system time.
* This method is called by the database.
*
* @return the current system time
*/
public
static
Timestamp
getStartTime
()
{
public
static
Timestamp
getStartTime
()
{
return
new
Timestamp
(
System
.
currentTimeMillis
());
return
new
Timestamp
(
System
.
currentTimeMillis
());
}
}
/**
* Get the user name for this id.
* This method is called by the database.
*
* @param conn the connection
* @param id the user id
* @return the user name
*/
public
static
String
getUserById
(
Connection
conn
,
int
id
)
throws
SQLException
{
public
static
String
getUserById
(
Connection
conn
,
int
id
)
throws
SQLException
{
PreparedStatement
prep
=
conn
.
prepareStatement
(
"SELECT NAME FROM INFORMATION_SCHEMA.USERS WHERE ID=?"
);
PreparedStatement
prep
=
conn
.
prepareStatement
(
"SELECT NAME FROM INFORMATION_SCHEMA.USERS WHERE ID=?"
);
prep
.
setInt
(
1
,
id
);
prep
.
setInt
(
1
,
id
);
...
@@ -280,14 +314,38 @@ public class PgServer implements Service {
...
@@ -280,14 +314,38 @@ public class PgServer implements Service {
return
null
;
return
null
;
}
}
/**
* Check if the this session has the given database privilege.
* This method is called by the database.
*
* @param id the session id
* @param privilege the privilege to check
* @return true
*/
public
static
boolean
hasDatabasePrivilege
(
int
id
,
String
privilege
)
{
public
static
boolean
hasDatabasePrivilege
(
int
id
,
String
privilege
)
{
return
true
;
return
true
;
}
}
/**
* Check if the current session has access to this table.
* This method is called by the database.
*
* @param table the table name
* @param privilege the privilege to check
* @return true
*/
public
static
boolean
hasTablePrivilege
(
String
table
,
String
privilege
)
{
public
static
boolean
hasTablePrivilege
(
String
table
,
String
privilege
)
{
return
true
;
return
true
;
}
}
/**
* Get the current transaction id.
* This method is called by the database.
*
* @param table the table name
* @param id the id
* @return 1
*/
public
static
int
getCurrentTid
(
String
table
,
String
id
)
{
public
static
int
getCurrentTid
(
String
table
,
String
id
)
{
return
1
;
return
1
;
}
}
...
...
h2/src/main/org/h2/server/web/WebServer.java
浏览文件 @
c0c3cc9e
...
@@ -133,11 +133,6 @@ public class WebServer implements Service {
...
@@ -133,11 +133,6 @@ public class WebServer implements Service {
return
data
;
return
data
;
}
}
String
getTextFile
(
String
file
)
throws
IOException
{
byte
[]
bytes
=
getFile
(
file
);
return
new
String
(
bytes
);
}
synchronized
void
remove
(
WebThread
t
)
{
synchronized
void
remove
(
WebThread
t
)
{
running
.
remove
(
t
);
running
.
remove
(
t
);
}
}
...
...
h2/src/main/org/h2/store/FileStore.java
浏览文件 @
c0c3cc9e
...
@@ -114,11 +114,6 @@ public class FileStore {
...
@@ -114,11 +114,6 @@ public class FileStore {
}
}
}
}
protected
FileStore
(
DataHandler
handler
,
byte
[]
magic
)
{
this
.
handler
=
handler
;
this
.
magic
=
magic
;
}
protected
byte
[]
generateSalt
()
{
protected
byte
[]
generateSalt
()
{
return
magic
;
return
magic
;
}
}
...
...
h2/src/main/org/h2/table/Column.java
浏览文件 @
c0c3cc9e
...
@@ -524,7 +524,7 @@ public class Column {
...
@@ -524,7 +524,7 @@ public class Column {
}
}
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
if
(
visitor
.
type
==
ExpressionVisitor
.
GET_DEPENDENCIES
)
{
if
(
visitor
.
getType
()
==
ExpressionVisitor
.
GET_DEPENDENCIES
)
{
if
(
sequence
!=
null
)
{
if
(
sequence
!=
null
)
{
visitor
.
getDependencies
().
add
(
sequence
);
visitor
.
getDependencies
().
add
(
sequence
);
}
}
...
...
h2/src/main/org/h2/table/FunctionTable.java
浏览文件 @
c0c3cc9e
...
@@ -138,7 +138,7 @@ public class FunctionTable extends Table {
...
@@ -138,7 +138,7 @@ public class FunctionTable extends Table {
function
.
optimize
(
session
);
function
.
optimize
(
session
);
Value
v
=
function
.
getValue
(
session
);
Value
v
=
function
.
getValue
(
session
);
if
(
v
==
ValueNull
.
INSTANCE
)
{
if
(
v
==
ValueNull
.
INSTANCE
)
{
return
new
LocalResult
(
0
);
return
new
LocalResult
();
}
else
{
}
else
{
ValueResultSet
value
=
(
ValueResultSet
)
v
;
ValueResultSet
value
=
(
ValueResultSet
)
v
;
ResultSet
rs
=
value
.
getResultSet
();
ResultSet
rs
=
value
.
getResultSet
();
...
...
h2/src/main/org/h2/table/MetaTable.java
浏览文件 @
c0c3cc9e
...
@@ -1279,10 +1279,6 @@ public class MetaTable extends Table {
...
@@ -1279,10 +1279,6 @@ public class MetaTable extends Table {
throw
Message
.
getUnsupportedException
();
throw
Message
.
getUnsupportedException
();
}
}
public
void
removeIndex
(
String
indexName
)
throws
SQLException
{
throw
Message
.
getUnsupportedException
();
}
public
void
removeChildrenAndResources
(
Session
session
)
throws
SQLException
{
public
void
removeChildrenAndResources
(
Session
session
)
throws
SQLException
{
throw
Message
.
getUnsupportedException
();
throw
Message
.
getUnsupportedException
();
}
}
...
...
h2/src/main/org/h2/table/Table.java
浏览文件 @
c0c3cc9e
...
@@ -607,14 +607,6 @@ public abstract class Table extends SchemaObjectBase {
...
@@ -607,14 +607,6 @@ public abstract class Table extends SchemaObjectBase {
}
}
}
}
public
Column
[]
getColumns
(
String
[]
columnNames
)
throws
SQLException
{
Column
[]
cols
=
new
Column
[
columnNames
.
length
];
for
(
int
i
=
0
;
i
<
cols
.
length
;
i
++)
{
cols
[
i
]
=
getColumn
(
columnNames
[
i
]);
}
return
cols
;
}
public
boolean
getGlobalTemporary
()
{
public
boolean
getGlobalTemporary
()
{
return
false
;
return
false
;
}
}
...
...
h2/src/main/org/h2/table/TableView.java
浏览文件 @
c0c3cc9e
...
@@ -177,10 +177,6 @@ public class TableView extends Table {
...
@@ -177,10 +177,6 @@ public class TableView extends Table {
return
false
;
return
false
;
}
}
public
void
removeIndex
(
String
indexName
)
throws
SQLException
{
throw
Message
.
getUnsupportedException
();
}
public
Index
addIndex
(
Session
session
,
String
indexName
,
int
indexId
,
IndexColumn
[]
cols
,
IndexType
indexType
,
public
Index
addIndex
(
Session
session
,
String
indexName
,
int
indexId
,
IndexColumn
[]
cols
,
IndexType
indexType
,
int
headPos
,
String
comment
)
throws
SQLException
{
int
headPos
,
String
comment
)
throws
SQLException
{
throw
Message
.
getUnsupportedException
();
throw
Message
.
getUnsupportedException
();
...
@@ -253,10 +249,6 @@ public class TableView extends Table {
...
@@ -253,10 +249,6 @@ public class TableView extends Table {
return
null
;
return
null
;
}
}
public
ObjectArray
getTables
()
{
return
tables
;
}
public
void
recompile
(
Session
session
)
throws
SQLException
{
public
void
recompile
(
Session
session
)
throws
SQLException
{
for
(
int
i
=
0
;
i
<
tables
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
tables
.
size
();
i
++)
{
Table
t
=
(
Table
)
tables
.
get
(
i
);
Table
t
=
(
Table
)
tables
.
get
(
i
);
...
...
h2/src/main/org/h2/util/IOUtils.java
浏览文件 @
c0c3cc9e
...
@@ -250,10 +250,6 @@ public class IOUtils {
...
@@ -250,10 +250,6 @@ public class IOUtils {
return
new
ByteArrayInputStream
(
StringUtils
.
utf8Encode
(
s
));
return
new
ByteArrayInputStream
(
StringUtils
.
utf8Encode
(
s
));
}
}
public
static
InputStream
getInputStream
(
Reader
x
)
throws
SQLException
{
return
x
==
null
?
null
:
new
ReaderInputStream
(
x
);
}
public
static
Reader
getReader
(
String
s
)
{
public
static
Reader
getReader
(
String
s
)
{
return
s
==
null
?
null
:
new
StringReader
(
s
);
return
s
==
null
?
null
:
new
StringReader
(
s
);
}
}
...
...
h2/src/main/org/h2/value/DataType.java
浏览文件 @
c0c3cc9e
...
@@ -62,9 +62,6 @@ public class DataType {
...
@@ -62,9 +62,6 @@ public class DataType {
public
boolean
hidden
;
public
boolean
hidden
;
public
int
memory
;
public
int
memory
;
// for operations that include different types, convert both to the higher order
public
int
order
;
// JDK 1.3 compatibility: Types.BOOLEAN
// JDK 1.3 compatibility: Types.BOOLEAN
public
static
final
int
TYPE_BOOLEAN
=
16
;
public
static
final
int
TYPE_BOOLEAN
=
16
;
...
@@ -276,10 +273,6 @@ public class DataType {
...
@@ -276,10 +273,6 @@ public class DataType {
}
}
}
}
public
static
String
getJdbcString
(
int
type
)
{
return
typesByValueType
[
type
].
jdbc
;
}
private
static
DataType
createDecimal
(
int
maxPrecision
,
int
defaultPrecision
,
int
defaultScale
,
int
defaultDisplaySize
,
boolean
needsPrecisionAndScale
,
boolean
autoInc
)
{
private
static
DataType
createDecimal
(
int
maxPrecision
,
int
defaultPrecision
,
int
defaultScale
,
int
defaultDisplaySize
,
boolean
needsPrecisionAndScale
,
boolean
autoInc
)
{
DataType
dataType
=
new
DataType
();
DataType
dataType
=
new
DataType
();
dataType
.
maxPrecision
=
maxPrecision
;
dataType
.
maxPrecision
=
maxPrecision
;
...
...
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
c0c3cc9e
...
@@ -160,6 +160,19 @@ java org.h2.test.TestAll timer
...
@@ -160,6 +160,19 @@ java org.h2.test.TestAll timer
/*
/*
-- Wildcard schema bug:
create schema a;
create table a.x(ax int);
create schema b;
create table b.x(bx int);
select * from a.x, b.x;
in help.csv, use complete examples for functions; add a test case
upload and test javadoc/index.html
Test Bnf.COMBINE_KEYWORDS
improve javadocs
improve javadocs
write complete page right after checkpoint
write complete page right after checkpoint
...
...
h2/src/test/org/h2/test/unit/TestReader.java
浏览文件 @
c0c3cc9e
...
@@ -11,6 +11,7 @@ import java.io.InputStream;
...
@@ -11,6 +11,7 @@ import java.io.InputStream;
import
java.io.Reader
;
import
java.io.Reader
;
import
java.io.StringReader
;
import
java.io.StringReader
;
import
org.h2.dev.util.ReaderInputStream
;
import
org.h2.test.TestBase
;
import
org.h2.test.TestBase
;
import
org.h2.util.IOUtils
;
import
org.h2.util.IOUtils
;
...
@@ -22,7 +23,7 @@ public class TestReader extends TestBase {
...
@@ -22,7 +23,7 @@ public class TestReader extends TestBase {
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
String
s
=
"\u00ef\u00f6\u00fc"
;
String
s
=
"\u00ef\u00f6\u00fc"
;
StringReader
r
=
new
StringReader
(
s
);
StringReader
r
=
new
StringReader
(
s
);
InputStream
in
=
IOUtils
.
get
InputStream
(
r
);
InputStream
in
=
new
Reader
InputStream
(
r
);
byte
[]
buff
=
IOUtils
.
readBytesAndClose
(
in
,
0
);
byte
[]
buff
=
IOUtils
.
readBytesAndClose
(
in
,
0
);
InputStream
in2
=
new
ByteArrayInputStream
(
buff
);
InputStream
in2
=
new
ByteArrayInputStream
(
buff
);
Reader
r2
=
IOUtils
.
getReader
(
in2
);
Reader
r2
=
IOUtils
.
getReader
(
in2
);
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
c0c3cc9e
...
@@ -509,5 +509,5 @@ worldwide everyone additions expense lawsuit checksums jazoon flashback
...
@@ -509,5 +509,5 @@ worldwide everyone additions expense lawsuit checksums jazoon flashback
dieguez dfile mvn dversion dgroup dpackaging dartifact durl dpom pom
dieguez dfile mvn dversion dgroup dpackaging dartifact durl dpom pom
subpackages slowed deactivate throttled noindex expired arizona export
subpackages slowed deactivate throttled noindex expired arizona export
intentional knowing jcl plug facade deployment logback confusion visited
intentional knowing jcl plug facade deployment logback confusion visited
pickle associate subtraction negation multiplication
connector derbynet
pickle associate subtraction negation multiplication
visitors sharp connector
derbyclient
derby
net ado happy derby
client
h2/src/tools/org/h2/dev/
net
/Base64.java
→
h2/src/tools/org/h2/dev/
util
/Base64.java
浏览文件 @
c0c3cc9e
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
*/
*/
package
org
.
h2
.
dev
.
net
;
package
org
.
h2
.
dev
.
util
;
import
java.util.Random
;
import
java.util.Random
;
...
...
h2/src/
main/org/h2
/util/ReaderInputStream.java
→
h2/src/
tools/org/h2/dev
/util/ReaderInputStream.java
浏览文件 @
c0c3cc9e
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
* (http://h2database.com/html/license.html).
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
* Initial Developer: H2 Group
*/
*/
package
org
.
h2
.
util
;
package
org
.
h2
.
dev
.
util
;
import
java.io.BufferedWriter
;
import
java.io.BufferedWriter
;
import
java.io.ByteArrayOutputStream
;
import
java.io.ByteArrayOutputStream
;
...
...
h2/src/tools/org/h2/dev/util/package.html
0 → 100644
浏览文件 @
c0c3cc9e
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Copyright 2004-2008 H2 Group. Multiple-Licensed under the H2 License, Version 1.0,,
and under the Eclipse Public License, Version 1.0
(http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<html
xmlns=
"http://www.w3.org/1999/xhtml"
lang=
"en"
xml:lang=
"en"
>
<head><meta
http-equiv=
"Content-Type"
content=
"text/html;charset=utf-8"
/><title>
Javadoc package documentation
</title></head><body
style=
"font: 9pt/130% Tahoma, Arial, Helvetica, sans-serif; font-weight: normal;"
>
Utility classes that are currently not used in the database engine.
</body></html>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论