Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
2dd76e97
提交
2dd76e97
authored
5月 09, 2008
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
003d1ab8
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
697 行增加
和
179 行删除
+697
-179
roadmap.html
h2/src/docsrc/html/roadmap.html
+3
-1
CommandRemote.java
h2/src/main/org/h2/command/CommandRemote.java
+1
-1
Parser.java
h2/src/main/org/h2/command/Parser.java
+4
-2
BackupCommand.java
h2/src/main/org/h2/command/dml/BackupCommand.java
+1
-1
Comment.java
h2/src/main/org/h2/engine/Comment.java
+12
-0
ConnectionInfo.java
h2/src/main/org/h2/engine/ConnectionInfo.java
+183
-40
Constants.java
h2/src/main/org/h2/engine/Constants.java
+407
-107
Engine.java
h2/src/main/org/h2/engine/Engine.java
+2
-2
Operation.java
h2/src/main/org/h2/expression/Operation.java
+31
-1
ParameterRemote.java
h2/src/main/org/h2/expression/ParameterRemote.java
+13
-2
SequenceValue.java
h2/src/main/org/h2/expression/SequenceValue.java
+0
-4
TableFunction.java
h2/src/main/org/h2/expression/TableFunction.java
+6
-0
ValueExpression.java
h2/src/main/org/h2/expression/ValueExpression.java
+18
-3
BtreeIndex.java
h2/src/main/org/h2/index/BtreeIndex.java
+9
-7
TcpServerThread.java
h2/src/main/org/h2/server/TcpServerThread.java
+1
-1
PgServerThread.java
h2/src/main/org/h2/server/pg/PgServerThread.java
+1
-1
FileLister.java
h2/src/main/org/h2/store/FileLister.java
+0
-2
Shell.java
h2/src/main/org/h2/tools/Shell.java
+2
-2
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+2
-1
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+1
-1
没有找到文件。
h2/src/docsrc/html/roadmap.html
浏览文件 @
2dd76e97
...
...
@@ -323,7 +323,6 @@ Roadmap
</li><li>
Translated .pdf
</li><li>
Cluster: hot deploy (adding a node on runtime)
</li><li>
Test with PostgreSQL Version 8.2
</li><li>
Submit again to http://www.docjar.com/
</li><li>
Website: Don't use frames.
</li><li>
Try again with Lobo browser (pure Java)
</li><li>
Recovery tool: bad blocks should be converted to INSERT INTO SYSTEM_ERRORS(...), and things should go into the .trace.db file
...
...
@@ -356,6 +355,9 @@ Roadmap
</li><li>
Support flashback queries as in Oracle.
</li><li>
Import / Export of fixed with text files.
</li><li>
Support for OUT parameters in user-defined procedures.
</li><li>
Support getGeneratedKeys to return multiple rows when used with batch updates.
This is supported by MySQL, but not Derby. Both PostgreSQL and HSQLDB don't support getGeneratedKeys.
Also support it when using INSERT ... SELECT.
</li></ul>
<h2>
Not Planned
</h2>
...
...
h2/src/main/org/h2/command/CommandRemote.java
浏览文件 @
2dd76e97
...
...
@@ -74,7 +74,7 @@ public class CommandRemote implements CommandInterface {
for
(
int
j
=
0
;
j
<
paramCount
;
j
++)
{
if
(
readParams
)
{
ParameterRemote
p
=
new
ParameterRemote
(
j
);
p
.
read
(
transfer
);
p
.
read
MetaData
(
transfer
);
parameters
.
add
(
p
);
}
else
{
parameters
.
add
(
new
ParameterRemote
(
j
));
...
...
h2/src/main/org/h2/command/Parser.java
浏览文件 @
2dd76e97
...
...
@@ -3072,8 +3072,10 @@ public class Parser {
Expression
defaultExpression
=
readExpression
();
column
.
setDefaultExpression
(
session
,
defaultExpression
);
}
else
if
(
readIf
(
"GENERATED"
))
{
read
(
"BY"
);
read
(
"DEFAULT"
);
if
(!
readIf
(
"ALWAYS"
))
{
read
(
"BY"
);
read
(
"DEFAULT"
);
}
read
(
"AS"
);
read
(
"IDENTITY"
);
long
start
=
1
,
increment
=
1
;
...
...
h2/src/main/org/h2/command/dml/BackupCommand.java
浏览文件 @
2dd76e97
...
...
@@ -89,7 +89,7 @@ public class BackupCommand extends Prepared {
ArrayList
fileList
=
FileLister
.
getDatabaseFiles
(
dir
,
name
,
true
);
for
(
int
i
=
0
;
i
<
fileList
.
size
();
i
++)
{
fn
=
(
String
)
fileList
.
get
(
i
);
if
(
fn
.
endsWith
(
Constants
.
SUFFIX_
HASH_FILE
)
||
fn
.
endsWith
(
Constants
.
SUFFIX_
LOB_FILE
))
{
if
(
fn
.
endsWith
(
Constants
.
SUFFIX_LOB_FILE
))
{
backupFile
(
out
,
base
,
fn
);
}
}
...
...
h2/src/main/org/h2/engine/Comment.java
浏览文件 @
2dd76e97
...
...
@@ -93,10 +93,22 @@ public class Comment extends DbObjectBase {
throw
Message
.
getInternalError
();
}
/**
* Get the comment key name for the given database object. This key name is
* used internally to associate the comment to the object.
*
* @param obj the object
* @return the key name
*/
public
static
String
getKey
(
DbObject
obj
)
{
return
getTypeName
(
obj
.
getType
())
+
" "
+
obj
.
getSQL
();
}
/**
* Set the comment text.
*
* @param comment the text
*/
public
void
setCommentText
(
String
comment
)
{
this
.
commentText
=
comment
;
}
...
...
h2/src/main/org/h2/engine/ConnectionInfo.java
浏览文件 @
2dd76e97
差异被折叠。
点击展开。
h2/src/main/org/h2/engine/Constants.java
浏览文件 @
2dd76e97
差异被折叠。
点击展开。
h2/src/main/org/h2/engine/Engine.java
浏览文件 @
2dd76e97
...
...
@@ -44,7 +44,7 @@ public class Engine {
// if it is required to call it twice
String
name
=
ci
.
getName
();
Database
database
;
if
(
ci
.
isUnnamed
())
{
if
(
ci
.
isUnnamed
InMemory
())
{
database
=
null
;
}
else
{
database
=
(
Database
)
databases
.
get
(
name
);
...
...
@@ -65,7 +65,7 @@ public class Engine {
user
.
setUserPasswordHash
(
ci
.
getUserPasswordHash
());
database
.
setMasterUser
(
user
);
}
if
(!
ci
.
isUnnamed
())
{
if
(!
ci
.
isUnnamed
InMemory
())
{
databases
.
put
(
name
,
database
);
}
database
.
opened
();
...
...
h2/src/main/org/h2/expression/Operation.java
浏览文件 @
2dd76e97
...
...
@@ -22,7 +22,37 @@ import org.h2.value.ValueString;
* A mathematical expression, or string concatenation.
*/
public
class
Operation
extends
Expression
{
public
static
final
int
CONCAT
=
0
,
PLUS
=
1
,
MINUS
=
2
,
MULTIPLY
=
3
,
DIVIDE
=
4
,
NEGATE
=
5
;
/**
* This operation represents a string concatenation as in 'Hello' || 'World'.
*/
public
static
final
int
CONCAT
=
0
;
/**
* This operation represents an addition as in 1 + 2.
*/
public
static
final
int
PLUS
=
1
;
/**
* This operation represents a subtraction as in 2 - 1.
*/
public
static
final
int
MINUS
=
2
;
/**
* This operation represents a multiplication as in 2 * 3.
*/
public
static
final
int
MULTIPLY
=
3
;
/**
* This operation represents a division as in 4 * 2.
*/
public
static
final
int
DIVIDE
=
4
;
/**
* This operation represents a negation as in - ID.
*/
public
static
final
int
NEGATE
=
5
;
private
int
opType
;
private
Expression
left
,
right
;
private
int
dataType
;
...
...
h2/src/main/org/h2/expression/ParameterRemote.java
浏览文件 @
2dd76e97
...
...
@@ -64,14 +64,25 @@ public class ParameterRemote implements ParameterInterface {
return
nullable
;
}
public
void
read
(
Transfer
transfer
)
throws
IOException
{
/**
* Write the parameter meta data from the transfer object.
*
* @param transfer the transfer object
*/
public
void
readMetaData
(
Transfer
transfer
)
throws
IOException
{
dataType
=
transfer
.
readInt
();
precision
=
transfer
.
readLong
();
scale
=
transfer
.
readInt
();
nullable
=
transfer
.
readInt
();
}
public
static
void
write
(
Transfer
transfer
,
ParameterInterface
p
)
throws
IOException
{
/**
* Write the parameter meta data to the transfer object.
*
* @param transfer the transfer object
* @param p the parameter
*/
public
static
void
writeMetaData
(
Transfer
transfer
,
ParameterInterface
p
)
throws
IOException
{
transfer
.
writeInt
(
p
.
getType
());
transfer
.
writeLong
(
p
.
getPrecision
());
transfer
.
writeInt
(
p
.
getScale
());
...
...
h2/src/main/org/h2/expression/SequenceValue.java
浏览文件 @
2dd76e97
...
...
@@ -42,10 +42,6 @@ public class SequenceValue extends Expression {
// nothing to do
}
public
void
checkMapped
()
{
// nothing to do
}
public
Expression
optimize
(
Session
session
)
{
return
this
;
}
...
...
h2/src/main/org/h2/expression/TableFunction.java
浏览文件 @
2dd76e97
...
...
@@ -68,6 +68,12 @@ public class TableFunction extends Function implements FunctionCall {
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
;
...
...
h2/src/main/org/h2/expression/ValueExpression.java
浏览文件 @
2dd76e97
...
...
@@ -23,14 +23,29 @@ import org.h2.value.ValueNull;
public
class
ValueExpression
extends
Expression
{
private
Value
value
;
/**
* The expression represents ValueNull.INSTANCE.
*/
public
static
final
ValueExpression
NULL
=
new
ValueExpression
(
ValueNull
.
INSTANCE
);
/**
* This special expression represents the default value. It is used for
* UPDATE statements of the form SET COLUMN = DEFAULT. The value is
* ValueNull.INSTANCE, but should never be accessed.
*/
public
static
final
ValueExpression
DEFAULT
=
new
ValueExpression
(
ValueNull
.
INSTANCE
);
public
static
ValueExpression
get
(
Value
v
)
{
if
(
v
==
ValueNull
.
INSTANCE
)
{
/**
* Create a new expression with the given value.
*
* @param value the value
* @return the expression
*/
public
static
ValueExpression
get
(
Value
value
)
{
if
(
value
==
ValueNull
.
INSTANCE
)
{
return
ValueExpression
.
NULL
;
}
return
new
ValueExpression
(
v
);
return
new
ValueExpression
(
v
alue
);
}
private
ValueExpression
(
Value
value
)
{
...
...
h2/src/main/org/h2/index/BtreeIndex.java
浏览文件 @
2dd76e97
...
...
@@ -146,14 +146,16 @@ public class BtreeIndex extends BaseIndex implements RecordReader {
lastChange
=
0
;
if
(
storage
!=
null
)
{
storage
.
flushFile
();
deletePage
(
session
,
head
);
// if we log index changes now, then the index is consistent
// if we don't log index changes, then the index is only consistent
// if there are no in doubt transactions
if
(
database
.
getLogIndexChanges
()
||
!
database
.
getLog
().
containsInDoubtTransactions
())
{
head
.
setConsistent
(
true
);
if
(!
database
.
getReadOnly
())
{
deletePage
(
session
,
head
);
// if we log index changes now, then the index is consistent
// if we don't log index changes, then the index is only consistent
// if there are no in doubt transactions
if
(
database
.
getLogIndexChanges
()
||
!
database
.
getLog
().
containsInDoubtTransactions
())
{
head
.
setConsistent
(
true
);
}
flushHead
(
session
);
}
flushHead
(
session
);
}
}
...
...
h2/src/main/org/h2/server/TcpServerThread.java
浏览文件 @
2dd76e97
...
...
@@ -215,7 +215,7 @@ public class TcpServerThread implements Runnable {
if
(
operation
==
SessionRemote
.
SESSION_PREPARE_READ_PARAMS
)
{
for
(
int
i
=
0
;
i
<
paramCount
;
i
++)
{
Parameter
p
=
(
Parameter
)
params
.
get
(
i
);
ParameterRemote
.
write
(
transfer
,
p
);
ParameterRemote
.
write
MetaData
(
transfer
,
p
);
}
}
transfer
.
flush
();
...
...
h2/src/main/org/h2/server/pg/PgServerThread.java
浏览文件 @
2dd76e97
...
...
@@ -197,7 +197,7 @@ public class PgServerThread implements Runnable {
ci
.
setOriginalURL
(
"jdbc:h2:"
+
databaseName
+
";MODE=PostgreSQL"
);
ci
.
setUserName
(
userName
);
ci
.
setProperty
(
"PASSWORD"
,
password
);
ci
.
read
Passwords
();
ci
.
convert
Passwords
();
conn
=
new
JdbcConnection
(
ci
,
false
);
// can not do this because when called inside
// DriverManager.getConnection, a deadlock occurs
...
...
h2/src/main/org/h2/store/FileLister.java
浏览文件 @
2dd76e97
...
...
@@ -58,8 +58,6 @@ public class FileLister {
ok
=
true
;
}
else
if
(
f
.
endsWith
(
Constants
.
SUFFIX_LOG_FILE
))
{
ok
=
true
;
}
else
if
(
f
.
endsWith
(
Constants
.
SUFFIX_HASH_FILE
))
{
ok
=
true
;
}
else
if
(
f
.
endsWith
(
Constants
.
SUFFIX_LOBS_DIRECTORY
))
{
files
.
addAll
(
getDatabaseFiles
(
f
,
null
,
all
));
ok
=
true
;
...
...
h2/src/main/org/h2/tools/Shell.java
浏览文件 @
2dd76e97
...
...
@@ -294,10 +294,10 @@ public class Shell {
private
String
readPassword
()
throws
IOException
{
try
{
Method
getConsole
=
System
.
class
.
getMethod
(
"console"
,
new
Class
[
0
]);
Object
console
=
getConsole
.
invoke
(
null
,
null
);
Object
console
=
getConsole
.
invoke
(
null
,
(
Object
[])
null
);
Method
readPassword
=
console
.
getClass
().
getMethod
(
"readPassword"
,
new
Class
[
0
]);
System
.
out
.
print
(
"Password "
);
char
[]
password
=
(
char
[])
readPassword
.
invoke
(
console
,
null
);
char
[]
password
=
(
char
[])
readPassword
.
invoke
(
console
,
(
Object
[])
null
);
return
password
==
null
?
null
:
new
String
(
password
);
}
catch
(
Throwable
t
)
{
// ignore, use the default solution
...
...
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
2dd76e97
...
...
@@ -160,7 +160,6 @@ java org.h2.test.TestAll timer
/*
improve javadocs
upload jazoon
...
...
@@ -222,6 +221,8 @@ History:
(when using remote connections).
The Shell tool now uses java.io.Console to read the password
when using JDK 1.6
When using read-only databases and setting LOG=2, an exception
was written to the trace file when closing the database. Fixed.
Roadmap:
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
2dd76e97
...
...
@@ -509,4 +509,4 @@ worldwide everyone additions expense lawsuit checksums jazoon flashback
dieguez dfile mvn dversion dgroup dpackaging dartifact durl dpom pom
subpackages slowed deactivate throttled noindex expired arizona export
intentional knowing jcl plug facade deployment logback confusion visited
pickle
pickle
associate subtraction negation multiplication
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论