Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
d4891863
Unverified
提交
d4891863
authored
2月 26, 2018
作者:
Noel Grandin
提交者:
GitHub
2月 26, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #908 from grandinj/master
remove dead code
上级
9d28c9f6
23f072e3
显示空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
75 行增加
和
82 行删除
+75
-82
Session.java
h2/src/main/org/h2/engine/Session.java
+1
-1
SysProperties.java
h2/src/main/org/h2/engine/SysProperties.java
+0
-7
JdbcResultSet.java
h2/src/main/org/h2/jdbc/JdbcResultSet.java
+2
-3
MVStore.java
h2/src/main/org/h2/mvstore/MVStore.java
+5
-2
MVTable.java
h2/src/main/org/h2/mvstore/db/MVTable.java
+5
-2
TransactionStore.java
h2/src/main/org/h2/mvstore/db/TransactionStore.java
+1
-1
ResultTempTable.java
h2/src/main/org/h2/result/ResultTempTable.java
+6
-4
UpdatableRow.java
h2/src/main/org/h2/result/UpdatableRow.java
+0
-1
RegularTable.java
h2/src/main/org/h2/table/RegularTable.java
+5
-2
TableBase.java
h2/src/main/org/h2/table/TableBase.java
+4
-2
ToDateTokenizer.java
h2/src/main/org/h2/util/ToDateTokenizer.java
+0
-6
DataType.java
h2/src/main/org/h2/value/DataType.java
+33
-40
TestOptimizations.java
h2/src/test/org/h2/test/db/TestOptimizations.java
+12
-8
TestMVStoreBenchmark.java
h2/src/test/org/h2/test/store/TestMVStoreBenchmark.java
+0
-2
TableDefinition.java
h2/src/tools/org/h2/jaqu/TableDefinition.java
+1
-1
没有找到文件。
h2/src/main/org/h2/engine/Session.java
浏览文件 @
d4891863
...
...
@@ -124,7 +124,7 @@ public class Session extends SessionWithState {
private
long
modificationMetaID
=
-
1
;
private
SubQueryInfo
subQueryInfo
;
private
int
parsingView
;
private
Deque
<
String
>
viewNameStack
=
new
ArrayDeque
<>();
private
final
Deque
<
String
>
viewNameStack
=
new
ArrayDeque
<>();
private
int
preparingQueryExpression
;
private
volatile
SmallLRUCache
<
Object
,
ViewIndex
>
viewIndexCache
;
private
HashMap
<
Object
,
ViewIndex
>
subQueryIndexCache
;
...
...
h2/src/main/org/h2/engine/SysProperties.java
浏览文件 @
d4891863
...
...
@@ -56,13 +56,6 @@ public class SysProperties {
public
static
final
String
FILE_SEPARATOR
=
Utils
.
getProperty
(
"file.separator"
,
"/"
);
/**
* System property <code>java.specification.version</code>.<br />
* It is set by the system. Examples: 0.9 (on Android), 1.7, 1.8, 9, 10.
*/
public
static
final
String
JAVA_SPECIFICATION_VERSION
=
Utils
.
getProperty
(
"java.specification.version"
,
"1.7"
);
/**
* System property <code>line.separator</code> (default: \n).<br />
* It is usually set by the system, and used by the script and trace tools.
...
...
h2/src/main/org/h2/jdbc/JdbcResultSet.java
浏览文件 @
d4891863
...
...
@@ -29,7 +29,6 @@ import java.util.Calendar;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.UUID
;
import
org.h2.api.ErrorCode
;
import
org.h2.api.TimestampWithTimeZone
;
import
org.h2.command.CommandInterface
;
...
...
@@ -91,7 +90,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet, JdbcResultS
private
HashMap
<
String
,
Integer
>
columnLabelMap
;
private
HashMap
<
Integer
,
Value
[]>
patchedRows
;
private
JdbcPreparedStatement
preparedStatement
;
private
CommandInterface
command
;
private
final
CommandInterface
command
;
JdbcResultSet
(
JdbcConnection
conn
,
JdbcStatement
stat
,
CommandInterface
command
,
ResultInterface
result
,
int
id
,
boolean
closeStatement
,
...
...
@@ -101,7 +100,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet, JdbcResultS
this
.
stat
=
stat
;
this
.
command
=
command
;
this
.
result
=
result
;
columnCount
=
result
.
getVisibleColumnCount
();
this
.
columnCount
=
result
.
getVisibleColumnCount
();
this
.
closeStatement
=
closeStatement
;
this
.
scrollable
=
scrollable
;
this
.
updatable
=
updatable
;
...
...
h2/src/main/org/h2/mvstore/MVStore.java
浏览文件 @
d4891863
...
...
@@ -237,7 +237,7 @@ public final class MVStore {
* are counted.
*/
private
int
unsavedMemory
;
private
int
autoCommitMemory
;
private
final
int
autoCommitMemory
;
private
boolean
saveNeeded
;
/**
...
...
@@ -274,7 +274,7 @@ public final class MVStore {
*/
private
int
autoCommitDelay
;
private
int
autoCompactFillRate
;
private
final
int
autoCompactFillRate
;
private
long
autoCompactLastFileOpCount
;
private
final
Object
compactSync
=
new
Object
();
...
...
@@ -376,6 +376,9 @@ public final class MVStore {
// the parameter is different from the old value
int
delay
=
DataUtils
.
getConfigParam
(
config
,
"autoCommitDelay"
,
1000
);
setAutoCommitDelay
(
delay
);
}
else
{
autoCommitMemory
=
0
;
autoCompactFillRate
=
0
;
}
}
...
...
h2/src/main/org/h2/mvstore/db/MVTable.java
浏览文件 @
d4891863
...
...
@@ -118,7 +118,7 @@ public class MVTable extends TableBase {
private
final
Trace
traceLock
;
private
int
changesSinceAnalyze
;
private
int
nextAnalyze
;
private
boolean
containsLargeObject
;
private
final
boolean
containsLargeObject
;
private
Column
rowIdColumn
;
private
final
MVTableEngine
.
Store
store
;
...
...
@@ -130,11 +130,14 @@ public class MVTable extends TableBase {
this
.
store
=
store
;
this
.
transactionStore
=
store
.
getTransactionStore
();
this
.
isHidden
=
data
.
isHidden
;
boolean
b
=
false
;
for
(
Column
col
:
getColumns
())
{
if
(
DataType
.
isLargeObject
(
col
.
getType
()))
{
containsLargeObject
=
true
;
b
=
true
;
break
;
}
}
containsLargeObject
=
b
;
traceLock
=
database
.
getTrace
(
Trace
.
LOCK
);
}
...
...
h2/src/main/org/h2/mvstore/db/TransactionStore.java
浏览文件 @
d4891863
...
...
@@ -468,7 +468,7 @@ public class TransactionStore {
* End this transaction
*
* @param t the transaction
* @param
previo
us status of this transaction
* @param
oldStat
us status of this transaction
*/
synchronized
void
endTransaction
(
Transaction
t
,
int
oldStatus
)
{
if
(
oldStatus
==
Transaction
.
STATUS_PREPARED
)
{
...
...
h2/src/main/org/h2/result/ResultTempTable.java
浏览文件 @
d4891863
...
...
@@ -31,16 +31,16 @@ public class ResultTempTable implements ResultExternal {
private
final
boolean
distinct
;
private
final
SortOrder
sort
;
private
Index
index
;
private
Session
session
;
private
final
Session
session
;
private
Table
table
;
private
Cursor
resultCursor
;
private
int
rowCount
;
private
int
columnCount
;
private
final
int
columnCount
;
private
final
ResultTempTable
parent
;
private
boolean
closed
;
private
int
childCount
;
private
boolean
containsLob
;
private
final
boolean
containsLob
;
ResultTempTable
(
Session
session
,
Expression
[]
expressions
,
boolean
distinct
,
SortOrder
sort
)
{
this
.
session
=
session
;
...
...
@@ -49,15 +49,17 @@ public class ResultTempTable implements ResultExternal {
this
.
columnCount
=
expressions
.
length
;
Schema
schema
=
session
.
getDatabase
().
getSchema
(
Constants
.
SCHEMA_MAIN
);
CreateTableData
data
=
new
CreateTableData
();
boolean
b
=
false
;
for
(
int
i
=
0
;
i
<
expressions
.
length
;
i
++)
{
int
type
=
expressions
[
i
].
getType
();
Column
col
=
new
Column
(
COLUMN_NAME
+
i
,
type
);
if
(
type
==
Value
.
CLOB
||
type
==
Value
.
BLOB
)
{
containsLo
b
=
true
;
b
=
true
;
}
data
.
columns
.
add
(
col
);
}
containsLob
=
b
;
data
.
id
=
session
.
getDatabase
().
allocateObjectId
();
data
.
tableName
=
"TEMP_RESULT_SET_"
+
data
.
id
;
data
.
temporary
=
true
;
...
...
h2/src/main/org/h2/result/UpdatableRow.java
浏览文件 @
d4891863
...
...
@@ -10,7 +10,6 @@ import java.sql.PreparedStatement;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
import
org.h2.api.ErrorCode
;
import
org.h2.jdbc.JdbcConnection
;
import
org.h2.message.DbException
;
...
...
h2/src/main/org/h2/table/RegularTable.java
浏览文件 @
d4891863
...
...
@@ -64,7 +64,7 @@ public class RegularTable extends TableBase {
private
final
Trace
traceLock
;
private
final
ArrayList
<
Index
>
indexes
=
New
.
arrayList
();
private
long
lastModificationId
;
private
boolean
containsLargeObject
;
private
final
boolean
containsLargeObject
;
private
final
PageDataIndex
mainIndex
;
private
int
changesSinceAnalyze
;
private
int
nextAnalyze
;
...
...
@@ -74,11 +74,14 @@ public class RegularTable extends TableBase {
super
(
data
);
nextAnalyze
=
database
.
getSettings
().
analyzeAuto
;
this
.
isHidden
=
data
.
isHidden
;
boolean
b
=
false
;
for
(
Column
col
:
getColumns
())
{
if
(
DataType
.
isLargeObject
(
col
.
getType
()))
{
containsLargeObject
=
true
;
b
=
true
;
break
;
}
}
containsLargeObject
=
b
;
if
(
data
.
persistData
&&
database
.
isPersistent
())
{
mainIndex
=
new
PageDataIndex
(
this
,
data
.
id
,
IndexColumn
.
wrap
(
getColumns
()),
...
...
h2/src/main/org/h2/table/TableBase.java
浏览文件 @
d4891863
...
...
@@ -5,7 +5,7 @@
*/
package
org
.
h2
.
table
;
import
java.util.
ArrayList
;
import
java.util.
Collections
;
import
java.util.List
;
import
org.h2.command.ddl.CreateTableData
;
import
org.h2.engine.Database
;
...
...
@@ -27,7 +27,7 @@ public abstract class TableBase extends Table {
*/
private
final
String
tableEngine
;
/** Provided table parameters */
private
List
<
String
>
tableEngineParams
=
new
ArrayList
<>()
;
private
final
List
<
String
>
tableEngineParams
;
private
final
boolean
globalTemporary
;
...
...
@@ -38,6 +38,8 @@ public abstract class TableBase extends Table {
this
.
globalTemporary
=
data
.
globalTemporary
;
if
(
data
.
tableEngineParams
!=
null
)
{
this
.
tableEngineParams
=
data
.
tableEngineParams
;
}
else
{
this
.
tableEngineParams
=
Collections
.
EMPTY_LIST
;
}
setTemporary
(
data
.
temporary
);
Column
[]
cols
=
data
.
columns
.
toArray
(
new
Column
[
0
]);
...
...
h2/src/main/org/h2/util/ToDateTokenizer.java
浏览文件 @
d4891863
...
...
@@ -6,7 +6,6 @@
package
org
.
h2
.
util
;
import
static
java
.
lang
.
String
.
format
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
...
...
@@ -113,11 +112,6 @@ class ToDateTokenizer {
*/
static
final
InlineParslet
PARSLET_INLINE
=
new
InlineParslet
();
/**
* The number of milliseconds in a day.
*/
static
final
int
MILLIS_IN_HOUR
=
60
*
60
*
1000
;
/**
* Interface of the classes that can parse a specialized small bit of the
* TO_DATE format-string.
...
...
h2/src/main/org/h2/value/DataType.java
浏览文件 @
d4891863
...
...
@@ -37,7 +37,6 @@ import org.h2.message.DbException;
import
org.h2.tools.SimpleResultSet
;
import
org.h2.util.JdbcUtils
;
import
org.h2.util.LocalDateTimeUtils
;
import
org.h2.util.New
;
import
org.h2.util.Utils
;
/**
...
...
@@ -85,11 +84,6 @@ public class DataType {
*/
public
int
sqlType
;
/**
* The Java class name.
*/
public
String
jdbc
;
/**
* How closely the data type maps to the corresponding JDBC SQL type (low is
* best).
...
...
@@ -188,75 +182,75 @@ public class DataType {
}
static
{
add
(
Value
.
NULL
,
Types
.
NULL
,
"Null"
,
add
(
Value
.
NULL
,
Types
.
NULL
,
new
DataType
(),
new
String
[]{
"NULL"
},
// the value is always in the cache
0
);
add
(
Value
.
STRING
,
Types
.
VARCHAR
,
"String"
,
add
(
Value
.
STRING
,
Types
.
VARCHAR
,
createString
(
true
),
new
String
[]{
"VARCHAR"
,
"VARCHAR2"
,
"NVARCHAR"
,
"NVARCHAR2"
,
"VARCHAR_CASESENSITIVE"
,
"CHARACTER VARYING"
,
"TID"
},
// 24 for ValueString, 24 for String
48
);
add
(
Value
.
STRING
,
Types
.
LONGVARCHAR
,
"String"
,
add
(
Value
.
STRING
,
Types
.
LONGVARCHAR
,
createString
(
true
),
new
String
[]{
"LONGVARCHAR"
,
"LONGNVARCHAR"
},
48
);
add
(
Value
.
STRING_FIXED
,
Types
.
CHAR
,
"String"
,
add
(
Value
.
STRING_FIXED
,
Types
.
CHAR
,
createString
(
true
),
new
String
[]{
"CHAR"
,
"CHARACTER"
,
"NCHAR"
},
48
);
add
(
Value
.
STRING_IGNORECASE
,
Types
.
VARCHAR
,
"String"
,
add
(
Value
.
STRING_IGNORECASE
,
Types
.
VARCHAR
,
createString
(
false
),
new
String
[]{
"VARCHAR_IGNORECASE"
},
48
);
add
(
Value
.
BOOLEAN
,
Types
.
BOOLEAN
,
"Boolean"
,
add
(
Value
.
BOOLEAN
,
Types
.
BOOLEAN
,
createDecimal
(
ValueBoolean
.
PRECISION
,
ValueBoolean
.
PRECISION
,
0
,
ValueBoolean
.
DISPLAY_SIZE
,
false
,
false
),
new
String
[]{
"BOOLEAN"
,
"BIT"
,
"BOOL"
},
// the value is always in the cache
0
);
add
(
Value
.
BYTE
,
Types
.
TINYINT
,
"Byte"
,
add
(
Value
.
BYTE
,
Types
.
TINYINT
,
createDecimal
(
ValueByte
.
PRECISION
,
ValueByte
.
PRECISION
,
0
,
ValueByte
.
DISPLAY_SIZE
,
false
,
false
),
new
String
[]{
"TINYINT"
},
// the value is almost always in the cache
1
);
add
(
Value
.
SHORT
,
Types
.
SMALLINT
,
"Short"
,
add
(
Value
.
SHORT
,
Types
.
SMALLINT
,
createDecimal
(
ValueShort
.
PRECISION
,
ValueShort
.
PRECISION
,
0
,
ValueShort
.
DISPLAY_SIZE
,
false
,
false
),
new
String
[]{
"SMALLINT"
,
"YEAR"
,
"INT2"
},
// in many cases the value is in the cache
20
);
add
(
Value
.
INT
,
Types
.
INTEGER
,
"Int"
,
add
(
Value
.
INT
,
Types
.
INTEGER
,
createDecimal
(
ValueInt
.
PRECISION
,
ValueInt
.
PRECISION
,
0
,
ValueInt
.
DISPLAY_SIZE
,
false
,
false
),
new
String
[]{
"INTEGER"
,
"INT"
,
"MEDIUMINT"
,
"INT4"
,
"SIGNED"
},
// in many cases the value is in the cache
20
);
add
(
Value
.
INT
,
Types
.
INTEGER
,
"Int"
,
add
(
Value
.
INT
,
Types
.
INTEGER
,
createDecimal
(
ValueInt
.
PRECISION
,
ValueInt
.
PRECISION
,
0
,
ValueInt
.
DISPLAY_SIZE
,
false
,
true
),
new
String
[]{
"SERIAL"
},
20
);
add
(
Value
.
LONG
,
Types
.
BIGINT
,
"Long"
,
add
(
Value
.
LONG
,
Types
.
BIGINT
,
createDecimal
(
ValueLong
.
PRECISION
,
ValueLong
.
PRECISION
,
0
,
ValueLong
.
DISPLAY_SIZE
,
false
,
false
),
new
String
[]{
"BIGINT"
,
"INT8"
,
"LONG"
},
24
);
add
(
Value
.
LONG
,
Types
.
BIGINT
,
"Long"
,
add
(
Value
.
LONG
,
Types
.
BIGINT
,
createDecimal
(
ValueLong
.
PRECISION
,
ValueLong
.
PRECISION
,
0
,
ValueLong
.
DISPLAY_SIZE
,
false
,
true
),
new
String
[]{
"IDENTITY"
,
"BIGSERIAL"
},
...
...
@@ -269,37 +263,37 @@ public class DataType {
addNumeric
();
addDecimal
();
}
add
(
Value
.
FLOAT
,
Types
.
REAL
,
"Float"
,
add
(
Value
.
FLOAT
,
Types
.
REAL
,
createDecimal
(
ValueFloat
.
PRECISION
,
ValueFloat
.
PRECISION
,
0
,
ValueFloat
.
DISPLAY_SIZE
,
false
,
false
),
new
String
[]
{
"REAL"
,
"FLOAT4"
},
24
);
add
(
Value
.
DOUBLE
,
Types
.
DOUBLE
,
"Double"
,
add
(
Value
.
DOUBLE
,
Types
.
DOUBLE
,
createDecimal
(
ValueDouble
.
PRECISION
,
ValueDouble
.
PRECISION
,
0
,
ValueDouble
.
DISPLAY_SIZE
,
false
,
false
),
new
String
[]
{
"DOUBLE"
,
"DOUBLE PRECISION"
},
24
);
add
(
Value
.
DOUBLE
,
Types
.
FLOAT
,
"Double"
,
add
(
Value
.
DOUBLE
,
Types
.
FLOAT
,
createDecimal
(
ValueDouble
.
PRECISION
,
ValueDouble
.
PRECISION
,
0
,
ValueDouble
.
DISPLAY_SIZE
,
false
,
false
),
new
String
[]
{
"FLOAT"
,
"FLOAT8"
},
24
);
add
(
Value
.
TIME
,
Types
.
TIME
,
"Time"
,
add
(
Value
.
TIME
,
Types
.
TIME
,
createDate
(
ValueTime
.
PRECISION
,
"TIME"
,
0
,
ValueTime
.
DISPLAY_SIZE
),
new
String
[]{
"TIME"
,
"TIME WITHOUT TIME ZONE"
},
// 24 for ValueTime, 32 for java.sql.Time
56
);
add
(
Value
.
DATE
,
Types
.
DATE
,
"Date"
,
add
(
Value
.
DATE
,
Types
.
DATE
,
createDate
(
ValueDate
.
PRECISION
,
"DATE"
,
0
,
ValueDate
.
DISPLAY_SIZE
),
new
String
[]{
"DATE"
},
// 24 for ValueDate, 32 for java.sql.Data
56
);
add
(
Value
.
TIMESTAMP
,
Types
.
TIMESTAMP
,
"Timestamp"
,
add
(
Value
.
TIMESTAMP
,
Types
.
TIMESTAMP
,
createDate
(
ValueTimestamp
.
PRECISION
,
"TIMESTAMP"
,
ValueTimestamp
.
DEFAULT_SCALE
,
ValueTimestamp
.
DISPLAY_SIZE
),
new
String
[]{
"TIMESTAMP"
,
"TIMESTAMP WITHOUT TIME ZONE"
,
...
...
@@ -311,54 +305,54 @@ public class DataType {
// use the value instead of the reference because the code has to
// compile (on Java 1.7). Can be replaced with
// Types.TIMESTAMP_WITH_TIMEZONE once Java 1.8 is required.
add
(
Value
.
TIMESTAMP_TZ
,
2014
,
"TimestampTimeZone"
,
add
(
Value
.
TIMESTAMP_TZ
,
2014
,
createDate
(
ValueTimestampTimeZone
.
PRECISION
,
"TIMESTAMP_TZ"
,
ValueTimestampTimeZone
.
DEFAULT_SCALE
,
ValueTimestampTimeZone
.
DISPLAY_SIZE
),
new
String
[]{
"TIMESTAMP WITH TIME ZONE"
},
// 26 for ValueTimestampUtc, 32 for java.sql.Timestamp
58
);
add
(
Value
.
BYTES
,
Types
.
VARBINARY
,
"Bytes"
,
add
(
Value
.
BYTES
,
Types
.
VARBINARY
,
createString
(
false
),
new
String
[]{
"VARBINARY"
},
32
);
add
(
Value
.
BYTES
,
Types
.
BINARY
,
"Bytes"
,
add
(
Value
.
BYTES
,
Types
.
BINARY
,
createString
(
false
),
new
String
[]{
"BINARY"
,
"RAW"
,
"BYTEA"
,
"LONG RAW"
},
32
);
add
(
Value
.
BYTES
,
Types
.
LONGVARBINARY
,
"Bytes"
,
add
(
Value
.
BYTES
,
Types
.
LONGVARBINARY
,
createString
(
false
),
new
String
[]{
"LONGVARBINARY"
},
32
);
add
(
Value
.
UUID
,
Types
.
BINARY
,
"Bytes"
,
add
(
Value
.
UUID
,
Types
.
BINARY
,
createString
(
false
),
// UNIQUEIDENTIFIER is the MSSQL mode equivalent
new
String
[]{
"UUID"
,
"UNIQUEIDENTIFIER"
},
32
);
add
(
Value
.
JAVA_OBJECT
,
Types
.
OTHER
,
"Object"
,
add
(
Value
.
JAVA_OBJECT
,
Types
.
OTHER
,
createString
(
false
),
new
String
[]{
"OTHER"
,
"OBJECT"
,
"JAVA_OBJECT"
},
24
);
add
(
Value
.
BLOB
,
Types
.
BLOB
,
"Blob"
,
add
(
Value
.
BLOB
,
Types
.
BLOB
,
createLob
(),
new
String
[]{
"BLOB"
,
"TINYBLOB"
,
"MEDIUMBLOB"
,
"LONGBLOB"
,
"IMAGE"
,
"OID"
},
// 80 for ValueLob, 24 for String
104
);
add
(
Value
.
CLOB
,
Types
.
CLOB
,
"Clob"
,
add
(
Value
.
CLOB
,
Types
.
CLOB
,
createLob
(),
new
String
[]{
"CLOB"
,
"TINYTEXT"
,
"TEXT"
,
"MEDIUMTEXT"
,
"LONGTEXT"
,
"NTEXT"
,
"NCLOB"
},
// 80 for ValueLob, 24 for String
104
);
add
(
Value
.
GEOMETRY
,
Types
.
OTHER
,
"Geometry"
,
add
(
Value
.
GEOMETRY
,
Types
.
OTHER
,
createString
(
false
),
new
String
[]{
"GEOMETRY"
},
32
...
...
@@ -366,13 +360,13 @@ public class DataType {
DataType
dataType
=
new
DataType
();
dataType
.
prefix
=
"("
;
dataType
.
suffix
=
"')"
;
add
(
Value
.
ARRAY
,
Types
.
ARRAY
,
"Array"
,
add
(
Value
.
ARRAY
,
Types
.
ARRAY
,
dataType
,
new
String
[]{
"ARRAY"
},
32
);
dataType
=
new
DataType
();
add
(
Value
.
RESULT_SET
,
DataType
.
TYPE_RESULT_SET
,
"ResultSet"
,
add
(
Value
.
RESULT_SET
,
DataType
.
TYPE_RESULT_SET
,
dataType
,
new
String
[]{
"RESULT_SET"
},
400
...
...
@@ -380,7 +374,7 @@ public class DataType {
dataType
=
createString
(
false
);
dataType
.
supportsPrecision
=
false
;
dataType
.
supportsScale
=
false
;
add
(
Value
.
ENUM
,
Types
.
OTHER
,
"Enum"
,
add
(
Value
.
ENUM
,
Types
.
OTHER
,
dataType
,
new
String
[]{
"ENUM"
},
48
...
...
@@ -391,7 +385,7 @@ public class DataType {
}
private
static
void
addDecimal
()
{
add
(
Value
.
DECIMAL
,
Types
.
DECIMAL
,
"BigDecimal"
,
add
(
Value
.
DECIMAL
,
Types
.
DECIMAL
,
createDecimal
(
Integer
.
MAX_VALUE
,
ValueDecimal
.
DEFAULT_PRECISION
,
ValueDecimal
.
DEFAULT_SCALE
,
...
...
@@ -403,7 +397,7 @@ public class DataType {
}
private
static
void
addNumeric
()
{
add
(
Value
.
DECIMAL
,
Types
.
NUMERIC
,
"BigDecimal"
,
add
(
Value
.
DECIMAL
,
Types
.
NUMERIC
,
createDecimal
(
Integer
.
MAX_VALUE
,
ValueDecimal
.
DEFAULT_PRECISION
,
ValueDecimal
.
DEFAULT_SCALE
,
...
...
@@ -413,13 +407,12 @@ public class DataType {
);
}
private
static
void
add
(
int
type
,
int
sqlType
,
String
jdbc
,
private
static
void
add
(
int
type
,
int
sqlType
,
DataType
dataType
,
String
[]
names
,
int
memory
)
{
for
(
int
i
=
0
;
i
<
names
.
length
;
i
++)
{
DataType
dt
=
new
DataType
();
dt
.
type
=
type
;
dt
.
sqlType
=
sqlType
;
dt
.
jdbc
=
jdbc
;
dt
.
name
=
names
[
i
];
dt
.
autoIncrement
=
dataType
.
autoIncrement
;
dt
.
decimal
=
dataType
.
decimal
;
...
...
h2/src/test/org/h2/test/db/TestOptimizations.java
浏览文件 @
d4891863
...
...
@@ -5,18 +5,22 @@
*/
package
org
.
h2
.
test
.
db
;
import
org.h2.api.ErrorCode
;
import
org.h2.test.TestBase
;
import
org.h2.tools.SimpleResultSet
;
import
org.h2.util.StringUtils
;
import
org.h2.util.Task
;
import
java.sql.*
;
import
java.sql.Connection
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.sql.Types
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Random
;
import
java.util.TreeSet
;
import
java.util.concurrent.TimeUnit
;
import
org.h2.api.ErrorCode
;
import
org.h2.test.TestBase
;
import
org.h2.tools.SimpleResultSet
;
import
org.h2.util.StringUtils
;
import
org.h2.util.Task
;
/**
* Test various optimizations (query cache, optimization for MIN(..), and
...
...
@@ -818,7 +822,7 @@ public class TestOptimizations extends TestBase {
}
}
private
long
measureQuerySpeed
(
Statement
stat
,
String
sql
,
boolean
optimized
)
throws
SQLException
{
private
static
long
measureQuerySpeed
(
Statement
stat
,
String
sql
,
boolean
optimized
)
throws
SQLException
{
stat
.
execute
(
"set OPTIMIZE_REUSE_RESULTS "
+
(
optimized
?
"1"
:
"0"
));
stat
.
execute
(
sql
);
long
time
=
System
.
nanoTime
();
...
...
h2/src/test/org/h2/test/store/TestMVStoreBenchmark.java
浏览文件 @
d4891863
...
...
@@ -8,12 +8,10 @@ package org.h2.test.store;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.TreeMap
;
import
java.util.concurrent.TimeUnit
;
import
org.h2.mvstore.MVStore
;
import
org.h2.test.TestBase
;
import
org.h2.util.New
;
...
...
h2/src/tools/org/h2/jaqu/TableDefinition.java
浏览文件 @
d4891863
...
...
@@ -19,8 +19,8 @@ import org.h2.jaqu.Table.JQColumn;
import
org.h2.jaqu.Table.JQIndex
;
import
org.h2.jaqu.Table.JQSchema
;
import
org.h2.jaqu.Table.JQTable
;
import
org.h2.jaqu.util.StatementLogger
;
import
org.h2.jaqu.util.ClassUtils
;
import
org.h2.jaqu.util.StatementLogger
;
import
org.h2.util.New
;
import
org.h2.util.StatementBuilder
;
import
org.h2.util.StringUtils
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论