Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
814fb93c
提交
814fb93c
authored
1月 30, 2008
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
73c1cc8c
显示空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
135 行增加
和
44 行删除
+135
-44
source.html
h2/src/docsrc/html/source.html
+55
-0
AlterTableAddConstraint.java
h2/src/main/org/h2/command/ddl/AlterTableAddConstraint.java
+4
-4
ErrorCode.java
h2/src/main/org/h2/constant/ErrorCode.java
+1
-1
_messages_de.properties
h2/src/main/org/h2/res/_messages_de.properties
+1
-1
_messages_en.properties
h2/src/main/org/h2/res/_messages_en.properties
+1
-1
_messages_ja.properties
h2/src/main/org/h2/res/_messages_ja.properties
+1
-1
_messages_pl.properties
h2/src/main/org/h2/res/_messages_pl.properties
+1
-1
_messages_pt_br.properties
h2/src/main/org/h2/res/_messages_pt_br.properties
+1
-1
help.csv
h2/src/main/org/h2/res/help.csv
+1
-1
Column.java
h2/src/main/org/h2/table/Column.java
+1
-1
Console.java
h2/src/main/org/h2/tools/Console.java
+8
-1
ValueString.java
h2/src/main/org/h2/value/ValueString.java
+9
-0
ValueStringBase.java
h2/src/main/org/h2/value/ValueStringBase.java
+3
-10
ValueStringFixed.java
h2/src/main/org/h2/value/ValueStringFixed.java
+9
-4
ValueStringIgnoreCase.java
h2/src/main/org/h2/value/ValueStringIgnoreCase.java
+9
-0
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+5
-16
test.in.txt
h2/src/test/org/h2/test/test.in.txt
+16
-0
TestValueMemory.java
h2/src/test/org/h2/test/unit/TestValueMemory.java
+8
-0
dictionary.txt
h2/src/tools/org/h2/tools/doc/dictionary.txt
+1
-1
没有找到文件。
h2/src/docsrc/html/source.html
0 → 100644
浏览文件 @
814fb93c
<!--
Copyright 2004-2008 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<html><script>
<!--
var
line
=
0
,
file
=
''
;
var
params
=
location
.
search
.
substring
(
1
).
split
(
'&'
);
var
build
=
'trunk'
;
for
(
var
i
=
0
;
i
<
params
.
length
;
i
++
)
{
var
k
=
params
[
i
].
split
(
'='
);
var
key
=
k
[
0
],
value
=
k
[
1
];
if
(
key
==
'line'
)
{
line
=
value
;
}
else
if
(
key
==
'file'
)
{
file
=
value
;
}
else
if
(
key
==
'build'
)
{
build
=
'tags/version-1.0.'
+
value
;
}
}
-->
</script>
<pre>
<table
width=
"100%"
>
<tr>
<td
style=
"width: 50px"
>
<script>
<!--
for
(
var
i
=
1
;
i
<=
5000
;
i
++
)
{
if
(
line
==
i
)
{
document
.
write
(
'<b>'
+
i
+
' ></b><br />'
);
}
else
if
(
line
<=
4
||
i
+
4
==
line
)
{
document
.
write
(
i
+
'<a name="here"></a><br />'
);
}
else
{
document
.
write
(
i
+
'<br />'
);
}
}
-->
</script>
</td>
<td
width=
"92%"
style=
"vertical-align: top;"
>
<iframe
id=
"source"
frameborder=
"0"
marginwidth=
"0"
marginheight=
"0"
width=
"100%"
height=
"80000px"
scrolling=
"no"
src=
""
>
</iframe>
</td>
</tr>
</table>
<a
href=
"#here"
></a>
<script>
<!--
var
source
=
document
.
getElementById
(
'source'
);
source
.
src
=
'http://h2database.googlecode.com/svn/'
+
build
+
'/h2/src/main/'
+
file
;
document
.
location
=
'#here'
;
-->
</script>
</pre></html>
h2/src/main/org/h2/command/ddl/AlterTableAddConstraint.java
浏览文件 @
814fb93c
...
...
@@ -48,7 +48,7 @@ public class AlterTableAddConstraint extends SchemaCommand {
private
Index
index
,
refIndex
;
private
String
comment
;
private
boolean
checkExisting
;
private
boolean
primaryKey
K
ash
;
private
boolean
primaryKey
H
ash
;
public
AlterTableAddConstraint
(
Session
session
,
Schema
schema
)
{
super
(
session
,
schema
);
...
...
@@ -104,7 +104,7 @@ public class AlterTableAddConstraint extends SchemaCommand {
}
}
if
(
index
==
null
)
{
IndexType
indexType
=
IndexType
.
createPrimaryKey
(
table
.
isPersistent
(),
primaryKey
K
ash
);
IndexType
indexType
=
IndexType
.
createPrimaryKey
(
table
.
isPersistent
(),
primaryKey
H
ash
);
String
indexName
=
getSchema
().
getUniqueIndexName
(
table
,
Constants
.
PREFIX_PRIMARY_KEY
);
int
id
=
getObjectId
(
true
,
false
);
try
{
...
...
@@ -385,11 +385,11 @@ public class AlterTableAddConstraint extends SchemaCommand {
}
public
void
setPrimaryKeyHash
(
boolean
b
)
{
this
.
primaryKey
K
ash
=
b
;
this
.
primaryKey
H
ash
=
b
;
}
public
boolean
getPrimaryKeyHash
()
{
return
primaryKey
K
ash
;
return
primaryKey
H
ash
;
}
}
h2/src/main/org/h2/constant/ErrorCode.java
浏览文件 @
814fb93c
...
...
@@ -356,7 +356,7 @@ public class ErrorCode {
* INSERT INTO TEST VALUES(1, 'Hello');
* </pre>
*/
public
static
final
int
VALUE_TOO_LONG_
1
=
90005
;
public
static
final
int
VALUE_TOO_LONG_
2
=
90005
;
/**
* The error with code <code>90006</code> is thrown when
...
...
h2/src/main/org/h2/res/_messages_de.properties
浏览文件 @
814fb93c
...
...
@@ -25,7 +25,7 @@
90002
=
Methode nur zul
\u
00E4ssig for eine Abfrage. Erlaubt sind execute oder executeUpdate, nicht jedoch executeQuery
90003
=
Hexadezimal Zahl mit einer ungeraden Anzahl Zeichen
\:
{0}
90004
=
Hexadezimal Zahl enth
\u
00E4lt unerlaubtes Zeichen
\:
{0}
90005
=
Wert zu gross / lang f
\u
00FCr Feld {0}
90005
=
Wert zu gross / lang f
\u
00FCr Feld {0}
\:
{1}
90006
=
NULL nicht zul
\u
00E4ssig f
\u
00FCr Feld {0}
90007
=
Das Objekt wurde bereits geschlossen
90008
=
Unerlaubter Wert {0} f
\u
00FCr Parameter {1}
...
...
h2/src/main/org/h2/res/_messages_en.properties
浏览文件 @
814fb93c
...
...
@@ -25,7 +25,7 @@
90002
=
Method is only allowed for a query. Use execute or executeUpdate instead of executeQuery
90003
=
Hexadecimal string with odd number of characters
\:
{0}
90004
=
Hexadecimal string contains non-hex character
\:
{0}
90005
=
Value too long for column {0}
90005
=
Value too long for column {0}
\:
{1}
90006
=
NULL not allowed for column {0}
90007
=
The object is already closed
90008
=
Invalid value {0} for parameter {1}
...
...
h2/src/main/org/h2/res/_messages_ja.properties
浏览文件 @
814fb93c
...
...
@@ -25,7 +25,7 @@
90002
=
\u
30E1
\u
30BD
\u
30C3
\u
30C9
\u
306F
\u
30AF
\u
30A8
\u
30EA
\u3057\u
304B
\u
30B5
\u
30DD
\u
30FC
\u
30C8
\u3057\u3066\u3044\u
307E
\u
305B
\u3093\u3002
executeQuery
\u
306E
\u
304B
\u
308F
\u
308A
\u
306B
\u3001
excecute
\u3001\u
307E
\u
305F
\u
306FexecuteUpdate
\u3092\u
4F7F
\u7528\u3057\u3066\u
304F
\u3060\u3055\u3044
90003
=
\u6587\u
5B57
\u6570\u
304C
\u5947\u6570\u
306E16
\u9032\u6587\u
5B57
\u5217\u3067\u3059\:
{0}
90004
=
16
\u9032\u6587\u
5B57
\u5217\u
306B
\u
4E0D
\u
6B63
\u
306A
\u6587\u
5B57
\u
304C
\u
542B
\u
307E
\u
308C
\u3066\u3044\u
307E
\u3059\:
{0}
90005
=
\u5217
{0}
\u
306E
\u5024\u
304C
\u9577\u
904E
\u
304E
\u
307E
\u3059
90005
=
\u5217
{0}
\u
306E
\u5024\u
304C
\u9577\u
904E
\u
304E
\u
307E
\u3059
\:
{1}
90006
=
\u5217
{0}
\u
306B
\u
306Fnull
\u5024\u
304C
\u
8A31
\u3055\u
308C
\u3066\u3044\u
307E
\u
305B
\u3093
90007
=
\u
30AA
\u
30D6
\u
30B8
\u
30A7
\u
30AF
\u
30C8
\u
306F
\u3059\u3067\u
306B
\u9589\u3058\u3089\u
308C
\u3066\u3044\u
307E
\u3059
90008
=
\u
30D1
\u
30E9
\u
30E1
\u
30FC
\u
30BF {1}
\u
306B
\u
5BFE
\u3059\u
308B
\u5024
{0}
\u
304C
\u
4E0D
\u
6B63
\u3067\u3059
...
...
h2/src/main/org/h2/res/_messages_pl.properties
浏览文件 @
814fb93c
...
...
@@ -25,7 +25,7 @@
90002
=
Metoda jest dozwolona tylko w kwerendzie
90003
=
Hexadecimal string with odd number of characters
\:
{0}
90004
=
Hexadecimal string contains non hex character
\:
{0}
90005
=
Wartosc za dluga dla kolumny {0}
90005
=
Wartosc za dluga dla kolumny {0}
\:
{1}
90006
=
Pole nie moze byc puste {0}
90007
=
Objekt jest zamkniety
90008
=
Nieprawidlowa wartosc {0} parametru {1}
...
...
h2/src/main/org/h2/res/_messages_pt_br.properties
浏览文件 @
814fb93c
...
...
@@ -25,7 +25,7 @@
90002
=
O m
\u
00E9todo
\u
00E9 apenas para consulta. Use o execute ou o executeUpdate em vez de executeQuery
90003
=
Sequ
\u
00EAncia Hexadecimal com n
\u
00FAmero
\u
00EDmpar de caracteres
\:
{0}
90004
=
Sequ
\u
00EAncia Hexadecimal cont
\u
00EAm caracteres inv
\u
00E1lidos
\:
{0}
90005
=
Valor muito longo para a coluna {0}
90005
=
Valor muito longo para a coluna {0}
\:
{1}
90006
=
NULL n
\u
00E3o
\u
00E9 permitido para a coluna {0}
90007
=
O objeto est
\u
00E1 fechado
90008
=
Valor inv
\u
00E1lido {0} para o par
\u
00E2metro {1}
...
...
h2/src/main/org/h2/res/help.csv
浏览文件 @
814fb93c
...
...
@@ -378,7 +378,7 @@ CREATE DOMAIN EMAIL AS VARCHAR(255) CHECK (POSITION('@', VALUE) > 1)
"Commands (DDL)","CREATE INDEX","
CREATE {[UNIQUE [HASH]] INDEX [[IF NOT EXISTS] newIndexName]
| PRIMARY KEY [HASH]} ON (columnName [,...])
| PRIMARY KEY [HASH]} ON
tableName
(columnName [,...])
","
Creates a new index.
","
...
...
h2/src/main/org/h2/table/Column.java
浏览文件 @
814fb93c
...
...
@@ -224,7 +224,7 @@ public class Column {
value
=
value
.
convertScale
(
mode
.
convertOnlyToSmallerScale
,
scale
);
if
(
precision
>
0
)
{
if
(!
value
.
checkPrecision
(
precision
))
{
throw
Message
.
getSQLException
(
ErrorCode
.
VALUE_TOO_LONG_
1
,
name
);
throw
Message
.
getSQLException
(
ErrorCode
.
VALUE_TOO_LONG_
2
,
new
String
[]{
name
,
value
.
getSQL
()}
);
}
}
updateSequenceIfRequired
(
session
,
value
);
...
...
h2/src/main/org/h2/tools/Console.java
浏览文件 @
814fb93c
...
...
@@ -273,7 +273,14 @@ ShutdownHandler {
frame
.
setSize
(
width
,
height
);
Dimension
screenSize
=
Toolkit
.
getDefaultToolkit
().
getScreenSize
();
frame
.
setLocation
((
screenSize
.
width
-
width
)
/
2
,
(
screenSize
.
height
-
height
)
/
2
);
try
{
frame
.
setVisible
(
true
);
}
catch
(
Throwable
t
)
{
// some systems don't support this method, for example IKVM
// however it still works
// ignore
System
.
out
.
println
(
"URL: "
+
web
.
getURL
());
}
}
private
void
startBrowser
()
{
...
...
h2/src/main/org/h2/value/ValueString.java
浏览文件 @
814fb93c
...
...
@@ -5,6 +5,7 @@
package
org
.
h2
.
value
;
import
org.h2.constant.SysProperties
;
import
org.h2.util.MathUtils
;
import
org.h2.util.StringCache
;
/**
...
...
@@ -56,6 +57,14 @@ public class ValueString extends ValueStringBase {
}
public
Value
convertPrecision
(
long
precision
)
{
if
(
precision
==
0
||
value
.
length
()
<=
precision
)
{
return
this
;
}
int
p
=
MathUtils
.
convertLongToInt
(
precision
);
return
ValueString
.
get
(
value
.
substring
(
0
,
p
));
}
public
static
ValueString
get
(
String
s
)
{
if
(
s
.
length
()
==
0
)
{
return
EMPTY
;
...
...
h2/src/main/org/h2/value/ValueStringBase.java
浏览文件 @
814fb93c
...
...
@@ -7,7 +7,6 @@ package org.h2.value;
import
java.sql.PreparedStatement
;
import
java.sql.SQLException
;
import
org.h2.util.MathUtils
;
import
org.h2.util.StringUtils
;
/**
...
...
@@ -44,22 +43,16 @@ abstract class ValueStringBase extends Value {
prep
.
setString
(
parameterIndex
,
value
);
}
public
Value
convertPrecision
(
long
precision
)
{
if
(
precision
==
0
||
value
.
length
()
<=
precision
)
{
return
this
;
}
int
p
=
MathUtils
.
convertLongToInt
(
precision
);
return
ValueString
.
get
(
value
.
substring
(
0
,
p
));
}
public
int
getDisplaySize
()
{
return
value
.
length
();
}
protected
boolean
isEqual
(
Value
v
)
{
return
v
instanceof
ValueString
&&
value
.
equals
(((
ValueString
)
v
).
value
);
return
v
instanceof
ValueString
Base
&&
value
.
equals
(((
ValueStringBase
)
v
).
value
);
}
public
abstract
Value
convertPrecision
(
long
precision
);
public
int
getMemory
()
{
return
value
.
length
()
*
2
+
30
;
}
...
...
h2/src/main/org/h2/value/ValueStringFixed.java
浏览文件 @
814fb93c
...
...
@@ -7,6 +7,7 @@ package org.h2.value;
import
java.sql.SQLException
;
import
org.h2.constant.SysProperties
;
import
org.h2.util.MathUtils
;
import
org.h2.util.StringCache
;
/**
...
...
@@ -36,10 +37,6 @@ public class ValueStringFixed extends ValueStringBase {
return
s
;
}
protected
boolean
isEqual
(
Value
v
)
{
return
v
instanceof
ValueStringBase
&&
value
.
equalsIgnoreCase
(((
ValueStringBase
)
v
).
value
);
}
public
int
hashCode
()
{
// TODO hash performance: could build a quicker hash by hashing the size and a few characters
return
value
.
hashCode
();
...
...
@@ -61,4 +58,12 @@ public class ValueStringFixed extends ValueStringBase {
return
(
ValueStringFixed
)
Value
.
cache
(
obj
);
}
public
Value
convertPrecision
(
long
precision
)
{
if
(
precision
==
0
||
value
.
length
()
<=
precision
)
{
return
this
;
}
int
p
=
MathUtils
.
convertLongToInt
(
precision
);
return
ValueStringFixed
.
get
(
value
.
substring
(
0
,
p
));
}
}
h2/src/main/org/h2/value/ValueStringIgnoreCase.java
浏览文件 @
814fb93c
...
...
@@ -5,6 +5,7 @@
package
org
.
h2
.
value
;
import
org.h2.constant.SysProperties
;
import
org.h2.util.MathUtils
;
import
org.h2.util.StringCache
;
import
org.h2.util.StringUtils
;
...
...
@@ -62,4 +63,12 @@ public class ValueStringIgnoreCase extends ValueStringBase {
}
}
public
Value
convertPrecision
(
long
precision
)
{
if
(
precision
==
0
||
value
.
length
()
<=
precision
)
{
return
this
;
}
int
p
=
MathUtils
.
convertLongToInt
(
precision
);
return
ValueStringIgnoreCase
.
get
(
value
.
substring
(
0
,
p
));
}
}
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
814fb93c
...
...
@@ -153,20 +153,7 @@ java org.h2.test.TestAll timer
implement max_query_time and use it for TestCrashAPI
Value too long for column DESC. But which value?
org.h2.jdbc.JdbcSQLException: Value too long for column DESC
[90005-64]
at org.h2.message.Message.getSQLException(Message.java:89)
at org.h2.message.Message.getSQLException(Message.java:93)
at org.h2.message.Message.getSQLException(Message.java:71)
at org.h2.table.Column.validateConvertUpdateSequence(Column.java:226)
at org.h2.table.Table.validateConvertUpdateSequence(Table.java:331)
at org.h2.command.dml.Insert.update(Insert.java:111)
at org.h2.command.CommandContainer.update(CommandContainer.java:68)
CREATE {[UNIQUE [HASH]] INDEX [[IF NOT EXISTS] newIndexName]
| PRIMARY KEY [HASH]} ON (columnName [,...])
There is missing name of table
document IKVM
adjust cache memory usage
...
...
@@ -189,8 +176,10 @@ Move Maven 2 repository from hsql.sf.net to h2database.sf.net
History:
Primary keys are now considered constraints and can have a constraint name.
H2 Console: stack traces are now links to the source code in the source repository (H2 database only)
H2 Console: stack traces are now links to the source code in the source repository (H2 database only).
CHAR data type equals comparison was case insensitive instead of case sensitive.
The exception 'Value too long for column' now includes the data.
The table name was missing in the documentation of CREATE INDEX.
Test Recovery with MAX_LOG_FILE_SIZE=1; test with various log file sizes
...
...
h2/src/test/org/h2/test/test.in.txt
浏览文件 @
814fb93c
--- special grammar and test cases ---------------------------------------------------------------------------------------------
CREATE TABLE TEST(ID INT PRIMARY KEY, LABEL CHAR(20), LOOKUP CHAR(30));
> ok
INSERT INTO TEST VALUES (1, 'Mouse', 'MOUSE'), (2, 'MOUSE', 'Mouse');
> update count: 2
SELECT * FROM TEST;
> ID LABEL LOOKUP
> -- ----- ------
> 1 Mouse MOUSE
> 2 MOUSE Mouse
> rows: 2
DROP TABLE TEST;
> ok
call 'a' regexp '\Ho.*';
> exception
...
...
h2/src/test/org/h2/test/unit/TestValueMemory.java
浏览文件 @
814fb93c
/*
* Copyright 2004-2008 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package
org
.
h2
.
test
.
unit
;
import
java.io.ByteArrayInputStream
;
...
...
@@ -33,6 +37,10 @@ import org.h2.value.ValueTime;
import
org.h2.value.ValueTimestamp
;
import
org.h2.value.ValueUuid
;
/**
* Tests the memory consumption of values. Values can estimate how much memory they occupy,
* and this tests if this estimation is correct.
*/
public
class
TestValueMemory
extends
TestBase
implements
DataHandler
{
private
Random
random
=
new
Random
(
1
);
...
...
h2/src/tools/org/h2/tools/doc/dictionary.txt
浏览文件 @
814fb93c
...
...
@@ -523,4 +523,4 @@ thousands ridvan incremented slots debugging inherit agar fulvio invisible biond
turkish fulfils iapi filesync
compares packets destroying echo homed hosts clock countries validated catches turning staging kills distance morning performs internationalization simulator constructed nicer
echo callablestatement procid homed getstart staging prices meantime qujd qujdra qui divided quaere restrictions hudson scoped design inverting newlines
violate verysmallint eremainder iee
violate verysmallint eremainder iee
cgi adjust estimation consumption occupy ikvm
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论