Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
88a516d1
提交
88a516d1
authored
7月 15, 2017
作者:
Niklas Mehner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix "build doc" target (long line / missing copyright / words missing from dictionary)
上级
3049b1ed
隐藏空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
88 行增加
和
50 行删除
+88
-50
Parser.java
h2/src/main/org/h2/command/Parser.java
+1
-1
Database.java
h2/src/main/org/h2/engine/Database.java
+1
-1
Mode.java
h2/src/main/org/h2/engine/Mode.java
+1
-1
Comparison.java
h2/src/main/org/h2/expression/Comparison.java
+2
-1
TableSynonym.java
h2/src/main/org/h2/table/TableSynonym.java
+7
-2
CharsetCollator.java
h2/src/main/org/h2/value/CharsetCollator.java
+5
-0
CompareMode.java
h2/src/main/org/h2/value/CompareMode.java
+2
-2
Value.java
h2/src/main/org/h2/value/Value.java
+1
-1
ValueStringFixed.java
h2/src/main/org/h2/value/ValueStringFixed.java
+10
-8
ValueTimestamp.java
h2/src/main/org/h2/value/ValueTimestamp.java
+2
-1
TestCompatibility.java
h2/src/test/org/h2/test/db/TestCompatibility.java
+6
-3
TestQueryCache.java
h2/src/test/org/h2/test/db/TestQueryCache.java
+2
-1
TestRecursiveQueries.java
h2/src/test/org/h2/test/db/TestRecursiveQueries.java
+3
-3
TestSetCollation.java
h2/src/test/org/h2/test/db/TestSetCollation.java
+25
-16
TestSpatial.java
h2/src/test/org/h2/test/db/TestSpatial.java
+1
-1
TestSynonymForTable.java
h2/src/test/org/h2/test/db/TestSynonymForTable.java
+2
-1
TestStatement.java
h2/src/test/org/h2/test/jdbc/TestStatement.java
+8
-7
TestCharsetCollator.java
h2/src/test/org/h2/test/unit/TestCharsetCollator.java
+5
-0
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+4
-0
没有找到文件。
h2/src/main/org/h2/command/Parser.java
浏览文件 @
88a516d1
...
@@ -4031,7 +4031,7 @@ public class Parser {
...
@@ -4031,7 +4031,7 @@ public class Parser {
// Check if any of them are disallowed in the current Mode
// Check if any of them are disallowed in the current Mode
if
(
isIdentity
&&
session
.
getDatabase
().
getMode
().
if
(
isIdentity
&&
session
.
getDatabase
().
getMode
().
disallowedTypes
.
contains
(
"IDENTITY"
))
{
disallowedTypes
.
contains
(
"IDENTITY"
))
{
throw
DbException
.
get
(
ErrorCode
.
UNKNOWN_DATA_TYPE_1
,
throw
DbException
.
get
(
ErrorCode
.
UNKNOWN_DATA_TYPE_1
,
currentToken
);
currentToken
);
}
}
column
=
new
Column
(
columnName
,
Value
.
LONG
);
column
=
new
Column
(
columnName
,
Value
.
LONG
);
...
...
h2/src/main/org/h2/engine/Database.java
浏览文件 @
88a516d1
...
@@ -293,7 +293,7 @@ public class Database implements DataHandler {
...
@@ -293,7 +293,7 @@ public class Database implements DataHandler {
e
.
fillInStackTrace
();
e
.
fillInStackTrace
();
}
}
boolean
alreadyOpen
=
e
instanceof
DbException
boolean
alreadyOpen
=
e
instanceof
DbException
&&
((
DbException
)
e
).
getErrorCode
()
==
ErrorCode
.
DATABASE_ALREADY_OPEN_1
;
&&
((
DbException
)
e
).
getErrorCode
()
==
ErrorCode
.
DATABASE_ALREADY_OPEN_1
;
if
(
alreadyOpen
)
{
if
(
alreadyOpen
)
{
stopServer
();
stopServer
();
}
}
...
...
h2/src/main/org/h2/engine/Mode.java
浏览文件 @
88a516d1
...
@@ -174,7 +174,7 @@ public class Mode {
...
@@ -174,7 +174,7 @@ public class Mode {
/**
/**
* An optional Set of hidden/disallowed column types.
* An optional Set of hidden/disallowed column types.
* Certain DBMSs don't support all column types provided by H2, such as
* Certain DBMSs don't support all column types provided by H2, such as
* "NUMBER" when using PostgreSQL mode.
* "NUMBER" when using PostgreSQL mode.
*/
*/
public
Set
<
String
>
disallowedTypes
=
Collections
.
emptySet
();
public
Set
<
String
>
disallowedTypes
=
Collections
.
emptySet
();
...
...
h2/src/main/org/h2/expression/Comparison.java
浏览文件 @
88a516d1
...
@@ -202,7 +202,8 @@ public class Comparison extends Condition {
...
@@ -202,7 +202,8 @@ public class Comparison extends Condition {
// to constant type, but vise versa, then let's do this here
// to constant type, but vise versa, then let's do this here
// once.
// once.
if
(
constType
!=
resType
)
{
if
(
constType
!=
resType
)
{
right
=
ValueExpression
.
get
(
r
.
convertTo
(
resType
,
MathUtils
.
convertLongToInt
(
left
.
getPrecision
()),
session
.
getDatabase
().
getMode
()));
right
=
ValueExpression
.
get
(
r
.
convertTo
(
resType
,
MathUtils
.
convertLongToInt
(
left
.
getPrecision
()),
session
.
getDatabase
().
getMode
()));
}
}
}
else
if
(
right
instanceof
Parameter
)
{
}
else
if
(
right
instanceof
Parameter
)
{
((
Parameter
)
right
).
setColumn
(
((
Parameter
)
right
).
setColumn
(
...
...
h2/src/main/org/h2/table/TableSynonym.java
浏览文件 @
88a516d1
/*
* Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
* and the EPL 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package
org
.
h2
.
table
;
package
org
.
h2
.
table
;
import
org.h2.command.ddl.CreateSynonymData
;
import
org.h2.command.ddl.CreateSynonymData
;
...
@@ -7,8 +12,8 @@ import org.h2.message.Trace;
...
@@ -7,8 +12,8 @@ import org.h2.message.Trace;
import
org.h2.schema.SchemaObjectBase
;
import
org.h2.schema.SchemaObjectBase
;
/**
/**
* Synonym for an existing table or view. All DML requests are forwarded to the backing table.
Adding indices
* Synonym for an existing table or view. All DML requests are forwarded to the backing table.
* to a synonym or altering the table is not supported.
*
Adding indices
to a synonym or altering the table is not supported.
*/
*/
public
class
TableSynonym
extends
SchemaObjectBase
{
public
class
TableSynonym
extends
SchemaObjectBase
{
...
...
h2/src/main/org/h2/value/CharsetCollator.java
浏览文件 @
88a516d1
/*
* Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
* and the EPL 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package
org
.
h2
.
value
;
package
org
.
h2
.
value
;
import
java.nio.charset.Charset
;
import
java.nio.charset.Charset
;
...
...
h2/src/main/org/h2/value/CompareMode.java
浏览文件 @
88a516d1
...
@@ -37,8 +37,8 @@ public class CompareMode {
...
@@ -37,8 +37,8 @@ public class CompareMode {
public
static
final
String
ICU4J
=
"ICU4J_"
;
public
static
final
String
ICU4J
=
"ICU4J_"
;
/**
/**
* This constant means the charset specified should be used.
This will fail if the specified charset does
* This constant means the charset specified should be used.
* not exist.
*
This will fail if the specified charset does
not exist.
*/
*/
public
static
final
String
CHARSET
=
"CHARSET_"
;
public
static
final
String
CHARSET
=
"CHARSET_"
;
...
...
h2/src/main/org/h2/value/Value.java
浏览文件 @
88a516d1
...
@@ -542,7 +542,7 @@ public abstract class Value {
...
@@ -542,7 +542,7 @@ public abstract class Value {
* @return the converted value
* @return the converted value
*/
*/
public
Value
convertTo
(
int
targetType
)
{
public
Value
convertTo
(
int
targetType
)
{
// Use -1 to indicate "default behaviour" where value conversion should not
// Use -1 to indicate "default behaviour" where value conversion should not
// depend on any datatype precision.
// depend on any datatype precision.
return
convertTo
(
targetType
,
-
1
,
null
);
return
convertTo
(
targetType
,
-
1
,
null
);
}
}
...
...
h2/src/main/org/h2/value/ValueStringFixed.java
浏览文件 @
88a516d1
...
@@ -23,8 +23,8 @@ public class ValueStringFixed extends ValueString {
...
@@ -23,8 +23,8 @@ public class ValueStringFixed extends ValueString {
public
static
final
int
PRECISION_DO_NOT_TRIM
=
Integer
.
MIN_VALUE
;
public
static
final
int
PRECISION_DO_NOT_TRIM
=
Integer
.
MIN_VALUE
;
/**
/**
* Special value for the precision in {@link #get(String, int, Mode)} to indicate
that the default
* Special value for the precision in {@link #get(String, int, Mode)} to indicate
* behaviour should of trimming the value should apply.
*
that the default
behaviour should of trimming the value should apply.
*/
*/
public
static
final
int
PRECISION_TRIM
=
-
1
;
public
static
final
int
PRECISION_TRIM
=
-
1
;
...
@@ -79,14 +79,16 @@ public class ValueStringFixed extends ValueString {
...
@@ -79,14 +79,16 @@ public class ValueStringFixed extends ValueString {
/**
/**
* Get or create a fixed length string value for the given string.
* Get or create a fixed length string value for the given string.
* <p>
* <p>
* This method will use a {@link Mode}-specific conversion when <code>mode</code> is not <code>null</code>.
* This method will use a {@link Mode}-specific conversion when <code>mode</code> is not
* Otherwise it will use the default H2 behaviour of trimming the given string if <code>precision</code>
* <code>null</code>.
* is not {@link #PRECISION_DO_NOT_TRIM}.
* Otherwise it will use the default H2 behaviour of trimming the given string if
* <code>precision</code> is not {@link #PRECISION_DO_NOT_TRIM}.
*
*
* @param s the string
* @param s the string
* @param precision if the {@link Mode#padFixedLengthStrings} indicates that strings should be padded, this
* @param precision if the {@link Mode#padFixedLengthStrings} indicates that strings should
* defines the overall length of the (potentially padded) string.
* be padded, this defines the overall length of the (potentially padded) string.
* If the special constant {@link #PRECISION_DO_NOT_TRIM} is used the value will not be trimmed.
* If the special constant {@link #PRECISION_DO_NOT_TRIM} is used the value will
* not be trimmed.
* @return the value
* @return the value
*/
*/
public
static
ValueStringFixed
get
(
String
s
,
int
precision
,
Mode
mode
)
{
public
static
ValueStringFixed
get
(
String
s
,
int
precision
,
Mode
mode
)
{
...
...
h2/src/main/org/h2/value/ValueTimestamp.java
浏览文件 @
88a516d1
...
@@ -139,7 +139,8 @@ public class ValueTimestamp extends Value {
...
@@ -139,7 +139,8 @@ public class ValueTimestamp extends Value {
}
}
/**
/**
* See: https://stackoverflow.com/questions/3976616/how-to-find-nth-occurrence-of-character-in-a-string#answer-3976656
* See:
* https://stackoverflow.com/questions/3976616/how-to-find-nth-occurrence-of-character-in-a-string#answer-3976656
*/
*/
private
static
int
findNthIndexOf
(
String
str
,
char
chr
,
int
n
)
{
private
static
int
findNthIndexOf
(
String
str
,
char
chr
,
int
n
)
{
int
pos
=
str
.
indexOf
(
chr
);
int
pos
=
str
.
indexOf
(
chr
);
...
...
h2/src/test/org/h2/test/db/TestCompatibility.java
浏览文件 @
88a516d1
...
@@ -517,9 +517,12 @@ public class TestCompatibility extends TestBase {
...
@@ -517,9 +517,12 @@ public class TestCompatibility extends TestBase {
stat
.
execute
(
"drop table test if exists"
);
stat
.
execute
(
"drop table test if exists"
);
stat
.
execute
(
"create table test(date TIMESTAMP)"
);
stat
.
execute
(
"create table test(date TIMESTAMP)"
);
stat
.
executeUpdate
(
"insert into test (date) values ('2014-04-05-09.48.28.020005')"
);
stat
.
executeUpdate
(
"insert into test (date) values ('2014-04-05-09.48.28.020005')"
);
assertResult
(
"2014-04-05 09:48:28.020005"
,
stat
,
"select date from test"
);
// <- result is always H2 format timestamp!
assertResult
(
"2014-04-05 09:48:28.020005"
,
stat
,
assertResult
(
"2014-04-05 09:48:28.020005"
,
stat
,
"select date from test where date = '2014-04-05-09.48.28.020005'"
);
"select date from test"
);
// <- result is always H2 format timestamp!
assertResult
(
"2014-04-05 09:48:28.020005"
,
stat
,
"select date from test where date = '2014-04-05 09:48:28.020005'"
);
assertResult
(
"2014-04-05 09:48:28.020005"
,
stat
,
"select date from test where date = '2014-04-05-09.48.28.020005'"
);
assertResult
(
"2014-04-05 09:48:28.020005"
,
stat
,
"select date from test where date = '2014-04-05 09:48:28.020005'"
);
}
}
private
void
testDerby
()
throws
SQLException
{
private
void
testDerby
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestQueryCache.java
浏览文件 @
88a516d1
...
@@ -72,7 +72,8 @@ public class TestQueryCache extends TestBase {
...
@@ -72,7 +72,8 @@ public class TestQueryCache extends TestBase {
assertEquals
(
0
,
c
);
assertEquals
(
0
,
c
);
time
=
System
.
nanoTime
()
-
time
;
time
=
System
.
nanoTime
()
-
time
;
if
(
i
==
1000
)
{
if
(
i
==
1000
)
{
// take from cache and do not close, so that next iteration will have a cache miss
// take from cache and do not close,
// so that next iteration will have a cache miss
prep
=
conn
.
prepareStatement
(
query
);
prep
=
conn
.
prepareStatement
(
query
);
}
else
if
(
i
==
1001
)
{
}
else
if
(
i
==
1001
)
{
first
=
time
;
first
=
time
;
...
...
h2/src/test/org/h2/test/db/TestRecursiveQueries.java
浏览文件 @
88a516d1
...
@@ -156,7 +156,7 @@ public class TestRecursiveQueries extends TestBase {
...
@@ -156,7 +156,7 @@ public class TestRecursiveQueries extends TestBase {
conn
.
close
();
conn
.
close
();
deleteDb
(
"recursiveQueries"
);
deleteDb
(
"recursiveQueries"
);
}
}
private
void
testSimpleUnion
()
throws
Exception
{
private
void
testSimpleUnion
()
throws
Exception
{
deleteDb
(
"recursiveQueries"
);
deleteDb
(
"recursiveQueries"
);
Connection
conn
=
getConnection
(
"recursiveQueries"
);
Connection
conn
=
getConnection
(
"recursiveQueries"
);
...
@@ -174,9 +174,9 @@ public class TestRecursiveQueries extends TestBase {
...
@@ -174,9 +174,9 @@ public class TestRecursiveQueries extends TestBase {
assertTrue
(
rs
.
next
());
assertTrue
(
rs
.
next
());
assertEquals
(
3
,
rs
.
getInt
(
1
));
assertEquals
(
3
,
rs
.
getInt
(
1
));
assertFalse
(
rs
.
next
());
assertFalse
(
rs
.
next
());
conn
.
close
();
conn
.
close
();
deleteDb
(
"recursiveQueries"
);
deleteDb
(
"recursiveQueries"
);
}
}
}
}
h2/src/test/org/h2/test/db/TestSetCollation.java
浏览文件 @
88a516d1
/*
* Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
* and the EPL 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package
org
.
h2
.
test
.
db
;
package
org
.
h2
.
test
.
db
;
...
@@ -13,10 +18,9 @@ import org.h2.jdbc.JdbcSQLException;
...
@@ -13,10 +18,9 @@ import org.h2.jdbc.JdbcSQLException;
import
org.h2.test.TestBase
;
import
org.h2.test.TestBase
;
public
class
TestSetCollation
extends
TestBase
{
public
class
TestSetCollation
extends
TestBase
{
private
static
final
String
[]
TEST_STRINGS
=
new
String
[]{
"A"
,
"Ä"
,
"AA"
,
"B"
,
"$"
,
"1A"
,
null
};
private
static
final
String
[]
TEST_STRINGS
=
new
String
[]{
"A"
,
"\u00c4"
,
"AA"
,
"B"
,
"$"
,
"1A"
,
null
};
public
static
final
String
DB_NAME
=
"collator"
;
private
static
final
String
DB_NAME
=
"collator"
;
/**
/**
* Run just this test.
* Run just this test.
...
@@ -41,25 +45,26 @@ public class TestSetCollation extends TestBase {
...
@@ -41,25 +45,26 @@ public class TestSetCollation extends TestBase {
private
void
testDefaultCollator
()
throws
Exception
{
private
void
testDefaultCollator
()
throws
Exception
{
assertEquals
(
Arrays
.
asList
(
null
,
"$"
,
"1A"
,
"A"
,
"AA"
,
"B"
,
"
Ä
"
),
orderedWithCollator
(
null
));
assertEquals
(
Arrays
.
asList
(
null
,
"$"
,
"1A"
,
"A"
,
"AA"
,
"B"
,
"
\u00c4
"
),
orderedWithCollator
(
null
));
}
}
private
void
testDeCollator
()
throws
Exception
{
private
void
testDeCollator
()
throws
Exception
{
assertEquals
(
Arrays
.
asList
(
null
,
"$"
,
"1A"
,
"A"
,
"
Ä
"
,
"AA"
,
"B"
),
orderedWithCollator
(
"DE"
));
assertEquals
(
Arrays
.
asList
(
null
,
"$"
,
"1A"
,
"A"
,
"
\u00c4
"
,
"AA"
,
"B"
),
orderedWithCollator
(
"DE"
));
assertEquals
(
Arrays
.
asList
(
null
,
"$"
,
"1A"
,
"A"
,
"
Ä
"
,
"AA"
,
"B"
),
orderedWithCollator
(
"DEFAULT_DE"
));
assertEquals
(
Arrays
.
asList
(
null
,
"$"
,
"1A"
,
"A"
,
"
\u00c4
"
,
"AA"
,
"B"
),
orderedWithCollator
(
"DEFAULT_DE"
));
}
}
private
void
testCp500Collator
()
throws
Exception
{
private
void
testCp500Collator
()
throws
Exception
{
// IBM z/OS codepage
// IBM z/OS codepage
assertEquals
(
Arrays
.
asList
(
null
,
"A"
,
"AA"
,
"B"
,
"1A"
,
"$"
,
"
Ä
"
),
assertEquals
(
Arrays
.
asList
(
null
,
"A"
,
"AA"
,
"B"
,
"1A"
,
"$"
,
"
\u00c4
"
),
orderedWithCollator
(
"CHARSET_CP500"
));
orderedWithCollator
(
"CHARSET_CP500"
));
}
}
private
void
testUrlParameter
()
throws
Exception
{
private
void
testUrlParameter
()
throws
Exception
{
// Specifying the collator in the JDBC Url should have the same effect as setting it with a set statement
// Specifying the collator in the JDBC Url should have the same effect
// as setting it with a set statement
config
.
collation
=
"CHARSET_CP500"
;
config
.
collation
=
"CHARSET_CP500"
;
try
{
try
{
assertEquals
(
Arrays
.
asList
(
null
,
"A"
,
"AA"
,
"B"
,
"1A"
,
"$"
,
"
Ä
"
),
orderedWithCollator
(
null
));
assertEquals
(
Arrays
.
asList
(
null
,
"A"
,
"AA"
,
"B"
,
"1A"
,
"$"
,
"
\u00c4
"
),
orderedWithCollator
(
null
));
}
finally
{
}
finally
{
config
.
collation
=
null
;
config
.
collation
=
null
;
}
}
...
@@ -69,9 +74,10 @@ public class TestSetCollation extends TestBase {
...
@@ -69,9 +74,10 @@ public class TestSetCollation extends TestBase {
orderedWithCollator
(
"DE"
);
orderedWithCollator
(
"DE"
);
try
(
Connection
con
=
getConnection
(
DB_NAME
))
{
try
(
Connection
con
=
getConnection
(
DB_NAME
))
{
insertValues
(
con
,
new
String
[]{
"A"
,
"
Ä
"
},
100
);
insertValues
(
con
,
new
String
[]{
"A"
,
"
\u00c4
"
},
100
);
assertEquals
(
Arrays
.
asList
(
null
,
"$"
,
"1A"
,
"A"
,
"A"
,
"Ä"
,
"Ä"
,
"AA"
,
"B"
),
loadTableValues
(
con
));
assertEquals
(
Arrays
.
asList
(
null
,
"$"
,
"1A"
,
"A"
,
"A"
,
"\u00c4"
,
"\u00c4"
,
"AA"
,
"B"
),
loadTableValues
(
con
));
}
}
}
}
...
@@ -83,11 +89,13 @@ public class TestSetCollation extends TestBase {
...
@@ -83,11 +89,13 @@ public class TestSetCollation extends TestBase {
config
.
collation
=
null
;
config
.
collation
=
null
;
}
}
// reopen the database without specifying a collation in the url. This should keep the initial collation.
// reopen the database without specifying a collation in the url.
// This should keep the initial collation.
try
(
Connection
con
=
getConnection
(
DB_NAME
))
{
try
(
Connection
con
=
getConnection
(
DB_NAME
))
{
insertValues
(
con
,
new
String
[]{
"A"
,
"
Ä
"
},
100
);
insertValues
(
con
,
new
String
[]{
"A"
,
"
\u00c4
"
},
100
);
assertEquals
(
Arrays
.
asList
(
null
,
"$"
,
"1A"
,
"A"
,
"A"
,
"Ä"
,
"Ä"
,
"AA"
,
"B"
),
loadTableValues
(
con
));
assertEquals
(
Arrays
.
asList
(
null
,
"$"
,
"1A"
,
"A"
,
"A"
,
"\u00c4"
,
"\u00c4"
,
"AA"
,
"B"
),
loadTableValues
(
con
));
}
}
}
}
...
@@ -121,9 +129,10 @@ public class TestSetCollation extends TestBase {
...
@@ -121,9 +129,10 @@ public class TestSetCollation extends TestBase {
config
.
collation
=
"DE"
;
config
.
collation
=
"DE"
;
try
(
Connection
con
=
getConnection
(
DB_NAME
))
{
try
(
Connection
con
=
getConnection
(
DB_NAME
))
{
insertValues
(
con
,
new
String
[]{
"A"
,
"
Ä
"
},
100
);
insertValues
(
con
,
new
String
[]{
"A"
,
"
\u00c4
"
},
100
);
assertEquals
(
Arrays
.
asList
(
null
,
"$"
,
"1A"
,
"A"
,
"A"
,
"Ä"
,
"Ä"
,
"AA"
,
"B"
),
loadTableValues
(
con
));
assertEquals
(
Arrays
.
asList
(
null
,
"$"
,
"1A"
,
"A"
,
"A"
,
"\u00c4"
,
"\u00c4"
,
"AA"
,
"B"
),
loadTableValues
(
con
));
}
finally
{
}
finally
{
config
.
collation
=
null
;
config
.
collation
=
null
;
}
}
...
...
h2/src/test/org/h2/test/db/TestSpatial.java
浏览文件 @
88a516d1
...
@@ -1146,7 +1146,7 @@ public class TestSpatial extends TestBase {
...
@@ -1146,7 +1146,7 @@ public class TestSpatial extends TestBase {
try
(
Connection
conn
=
getConnection
(
URL
))
{
try
(
Connection
conn
=
getConnection
(
URL
))
{
Statement
stat
=
conn
.
createStatement
();
Statement
stat
=
conn
.
createStatement
();
stat
.
execute
(
"DROP TABLE IF EXISTS BUILDINGS;"
+
stat
.
execute
(
"DROP TABLE IF EXISTS BUILDINGS;"
+
"CREATE TABLE BUILDINGS (PK serial, THE_GEOM geometry);"
+
"CREATE TABLE BUILDINGS (PK serial, THE_GEOM geometry);"
+
"insert into buildings(the_geom) SELECT 'POINT(1 1)"
+
"insert into buildings(the_geom) SELECT 'POINT(1 1)"
+
"'::geometry from SYSTEM_RANGE(1,10000);\n"
+
"'::geometry from SYSTEM_RANGE(1,10000);\n"
+
"CREATE SPATIAL INDEX ON PUBLIC.BUILDINGS(THE_GEOM);\n"
);
"CREATE SPATIAL INDEX ON PUBLIC.BUILDINGS(THE_GEOM);\n"
);
...
...
h2/src/test/org/h2/test/db/TestSynonymForTable.java
浏览文件 @
88a516d1
...
@@ -85,7 +85,8 @@ public class TestSynonymForTable extends TestBase {
...
@@ -85,7 +85,8 @@ public class TestSynonymForTable extends TestBase {
assertThrows
(
JdbcSQLException
.
class
,
stat
).
execute
(
"SELECT id FROM testsynonym"
);
assertThrows
(
JdbcSQLException
.
class
,
stat
).
execute
(
"SELECT id FROM testsynonym"
);
// Synonym should be dropped as well
// Synonym should be dropped as well
ResultSet
synonyms
=
conn
.
createStatement
().
executeQuery
(
"SELECT * FROM INFORMATION_SCHEMA.SYNONYMS WHERE SYNONYM_NAME='TESTSYNONYM'"
);
ResultSet
synonyms
=
conn
.
createStatement
().
executeQuery
(
"SELECT * FROM INFORMATION_SCHEMA.SYNONYMS WHERE SYNONYM_NAME='TESTSYNONYM'"
);
assertFalse
(
synonyms
.
next
());
assertFalse
(
synonyms
.
next
());
conn
.
close
();
conn
.
close
();
...
...
h2/src/test/org/h2/test/jdbc/TestStatement.java
浏览文件 @
88a516d1
...
@@ -397,23 +397,24 @@ public class TestStatement extends TestBase {
...
@@ -397,23 +397,24 @@ public class TestStatement extends TestBase {
stat
.
execute
(
"DROP TABLE TEST"
);
stat
.
execute
(
"DROP TABLE TEST"
);
stat
.
execute
(
"DROP TABLE TEST2"
);
stat
.
execute
(
"DROP TABLE TEST2"
);
}
}
private
void
testPreparedStatement
()
throws
SQLException
{
private
void
testPreparedStatement
()
throws
SQLException
{
Statement
stat
=
conn
.
createStatement
();
Statement
stat
=
conn
.
createStatement
();
stat
.
execute
(
"create table test(id int primary key, name varchar(255))"
);
stat
.
execute
(
"create table test(id int primary key, name varchar(255))"
);
stat
.
execute
(
"insert into test values(1, 'Hello')"
);
stat
.
execute
(
"insert into test values(1, 'Hello')"
);
stat
.
execute
(
"insert into test values(2, 'World')"
);
stat
.
execute
(
"insert into test values(2, 'World')"
);
PreparedStatement
ps
=
conn
.
prepareStatement
(
"select name from test where id in (select id from test where name REGEXP ?)"
);
PreparedStatement
ps
=
conn
.
prepareStatement
(
"select name from test where id in (select id from test where name REGEXP ?)"
);
ps
.
setString
(
1
,
"Hello"
);
ps
.
setString
(
1
,
"Hello"
);
ResultSet
rs
=
ps
.
executeQuery
();
ResultSet
rs
=
ps
.
executeQuery
();
assertTrue
(
rs
.
next
());
assertTrue
(
rs
.
next
());
assertEquals
(
"Hello"
,
rs
.
getString
(
"name"
));
assertEquals
(
"Hello"
,
rs
.
getString
(
"name"
));
assertFalse
(
rs
.
next
());
assertFalse
(
rs
.
next
());
ps
.
setString
(
1
,
"World"
);
ps
.
setString
(
1
,
"World"
);
rs
=
ps
.
executeQuery
();
rs
=
ps
.
executeQuery
();
assertTrue
(
rs
.
next
());
assertTrue
(
rs
.
next
());
assertEquals
(
"World"
,
rs
.
getString
(
"name"
));
assertEquals
(
"World"
,
rs
.
getString
(
"name"
));
assertFalse
(
rs
.
next
());
assertFalse
(
rs
.
next
());
//Changes the table structure
//Changes the table structure
stat
.
execute
(
"create index t_id on test(name)"
);
stat
.
execute
(
"create index t_id on test(name)"
);
//Test the prepared statement again to check if the internal cache attributes were reset
//Test the prepared statement again to check if the internal cache attributes were reset
...
@@ -421,13 +422,13 @@ public class TestStatement extends TestBase {
...
@@ -421,13 +422,13 @@ public class TestStatement extends TestBase {
rs
=
ps
.
executeQuery
();
rs
=
ps
.
executeQuery
();
assertTrue
(
rs
.
next
());
assertTrue
(
rs
.
next
());
assertEquals
(
"Hello"
,
rs
.
getString
(
"name"
));
assertEquals
(
"Hello"
,
rs
.
getString
(
"name"
));
assertFalse
(
rs
.
next
());
assertFalse
(
rs
.
next
());
ps
.
setString
(
1
,
"World"
);
ps
.
setString
(
1
,
"World"
);
rs
=
ps
.
executeQuery
();
rs
=
ps
.
executeQuery
();
assertTrue
(
rs
.
next
());
assertTrue
(
rs
.
next
());
assertEquals
(
"World"
,
rs
.
getString
(
"name"
));
assertEquals
(
"World"
,
rs
.
getString
(
"name"
));
assertFalse
(
rs
.
next
());
assertFalse
(
rs
.
next
());
stat
.
execute
(
"drop table test"
);
stat
.
execute
(
"drop table test"
);
}
}
}
}
h2/src/test/org/h2/test/unit/TestCharsetCollator.java
浏览文件 @
88a516d1
/*
* Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0,
* and the EPL 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package
org
.
h2
.
test
.
unit
;
package
org
.
h2
.
test
.
unit
;
import
java.nio.charset.Charset
;
import
java.nio.charset.Charset
;
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
88a516d1
...
@@ -737,3 +737,7 @@ choosing optimise arte preparator katzyn bla jenkins tot artes pgserver npe
...
@@ -737,3 +737,7 @@ choosing optimise arte preparator katzyn bla jenkins tot artes pgserver npe
suffers closeablem mni significance vise identiy vitalus aka ilike uppercasing reentrant
suffers closeablem mni significance vise identiy vitalus aka ilike uppercasing reentrant
aff ignite warm upstream producing sfu jit smtm affinity stashed tbl
aff ignite warm upstream producing sfu jit smtm affinity stashed tbl
stumc numbered
stumc numbered
reopening cloudera hive clustername whomooz unittest anymore snowflakecomputing unpadded endpoint redshift backingtable
trimming hadoop azure resolves snowflake testsynonym plays charsettable synonyms nonexisting impala codepage recognize
dbm forwarded amazon stmnt excessive testvalue
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论