Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
d32a566b
提交
d32a566b
authored
7 年前
作者:
Jacek Ławrynowicz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
formatting - add braces to control statements
上级
b81fe715
master
version-1.4.198
version-1.4.197
无相关合并请求
显示空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
50 行增加
和
28 行删除
+50
-28
DbSchema.java
h2/src/main/org/h2/bnf/context/DbSchema.java
+2
-1
Parser.java
h2/src/main/org/h2/command/Parser.java
+4
-2
DropTable.java
h2/src/main/org/h2/command/ddl/DropTable.java
+3
-2
AggregateDataMedian.java
h2/src/main/org/h2/expression/AggregateDataMedian.java
+2
-1
Function.java
h2/src/main/org/h2/expression/Function.java
+2
-1
MVStore.java
h2/src/main/org/h2/mvstore/MVStore.java
+2
-1
PgServerThread.java
h2/src/main/org/h2/server/pg/PgServerThread.java
+2
-1
RangeInputStream.java
h2/src/main/org/h2/store/RangeInputStream.java
+2
-1
RangeReader.java
h2/src/main/org/h2/store/RangeReader.java
+2
-1
Server.java
h2/src/main/org/h2/tools/Server.java
+3
-2
DateTimeUtils.java
h2/src/main/org/h2/util/DateTimeUtils.java
+2
-1
MergedResultSet.java
h2/src/main/org/h2/util/MergedResultSet.java
+4
-2
SourceCompiler.java
h2/src/main/org/h2/util/SourceCompiler.java
+4
-3
DataType.java
h2/src/main/org/h2/value/DataType.java
+5
-3
ValueEnum.java
h2/src/main/org/h2/value/ValueEnum.java
+5
-2
ValueLob.java
h2/src/main/org/h2/value/ValueLob.java
+6
-4
没有找到文件。
h2/src/main/org/h2/bnf/context/DbSchema.java
浏览文件 @
d32a566b
...
...
@@ -71,9 +71,10 @@ public class DbSchema {
}
else
if
(
contents
.
isPostgreSQL
()
&&
StringUtils
.
toUpperEnglish
(
name
).
startsWith
(
"PG_"
))
{
isSystem
=
true
;
}
else
}
else
{
isSystem
=
contents
.
isDerby
()
&&
name
.
startsWith
(
"SYS"
);
}
}
/**
* @return The database content container.
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/command/Parser.java
浏览文件 @
d32a566b
...
...
@@ -3569,18 +3569,20 @@ public class Parser {
return
b
==
null
;
}
else
if
(
a
.
equals
(
b
))
{
return
true
;
}
else
}
else
{
return
!
identifiersToUpper
&&
a
.
equalsIgnoreCase
(
b
);
}
}
private
static
boolean
equalsTokenIgnoreCase
(
String
a
,
String
b
)
{
if
(
a
==
null
)
{
return
b
==
null
;
}
else
if
(
a
.
equals
(
b
))
{
return
true
;
}
else
}
else
{
return
a
.
equalsIgnoreCase
(
b
);
}
}
private
boolean
isTokenInList
(
Collection
<
String
>
upperCaseTokenList
)
{
String
upperCaseCurrentToken
=
currentToken
.
toUpperCase
();
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/command/ddl/DropTable.java
浏览文件 @
d32a566b
...
...
@@ -95,8 +95,9 @@ public class DropTable extends SchemaCommand {
}
}
}
if
(
buff
.
length
()
>
0
)
if
(
buff
.
length
()
>
0
)
{
throw
DbException
.
get
(
ErrorCode
.
CANNOT_DROP_2
,
tableName
,
buff
.
toString
());
}
}
table
.
lock
(
session
,
true
,
true
);
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/expression/AggregateDataMedian.java
浏览文件 @
d32a566b
...
...
@@ -119,9 +119,10 @@ class AggregateDataMedian extends AggregateData {
count
--;
cursor
.
next
();
hasNulls
=
true
;
}
else
}
else
{
break
;
}
}
if
(
count
==
0
)
{
return
ValueNull
.
INSTANCE
;
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/expression/Function.java
浏览文件 @
d32a566b
...
...
@@ -1648,8 +1648,9 @@ public class Function extends Expression implements FunctionCall {
break
;
case
SIGNAL:
{
String
sqlState
=
v0
.
getString
();
if
(
sqlState
.
startsWith
(
"00"
)
||
!
SIGNAL_PATTERN
.
matcher
(
sqlState
).
matches
())
if
(
sqlState
.
startsWith
(
"00"
)
||
!
SIGNAL_PATTERN
.
matcher
(
sqlState
).
matches
())
{
throw
DbException
.
getInvalidValueException
(
"SQLSTATE"
,
sqlState
);
}
String
msgText
=
v1
.
getString
();
throw
DbException
.
fromUser
(
sqlState
,
msgText
);
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/mvstore/MVStore.java
浏览文件 @
d32a566b
...
...
@@ -567,8 +567,9 @@ public final class MVStore {
// the following can fail for various reasons
try
{
HashMap
<
String
,
String
>
m
=
DataUtils
.
parseChecksummedMap
(
buff
);
if
(
m
==
null
)
if
(
m
==
null
)
{
continue
;
}
int
blockSize
=
DataUtils
.
readHexInt
(
m
,
"blockSize"
,
BLOCK_SIZE
);
if
(
blockSize
!=
BLOCK_SIZE
)
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/server/pg/PgServerThread.java
浏览文件 @
d32a566b
...
...
@@ -653,8 +653,9 @@ public class PgServerThread implements Runnable {
case
PgServer
.
PG_TYPE_TIME
:
{
// Strip timezone offset
int
idx
=
str
.
indexOf
(
'+'
);
if
(
idx
<=
0
)
if
(
idx
<=
0
)
{
idx
=
str
.
indexOf
(
'-'
);
}
if
(
idx
>
0
)
{
str
=
str
.
substring
(
0
,
idx
);
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/store/RangeInputStream.java
浏览文件 @
d32a566b
...
...
@@ -49,8 +49,9 @@ public final class RangeInputStream extends FilterInputStream {
@Override
public
int
read
(
byte
b
[],
int
off
,
int
len
)
throws
IOException
{
if
(
limit
<=
0
)
if
(
limit
<=
0
)
{
return
-
1
;
}
if
(
len
>
limit
)
{
len
=
(
int
)
limit
;
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/store/RangeReader.java
浏览文件 @
d32a566b
...
...
@@ -50,8 +50,9 @@ public final class RangeReader extends Reader {
@Override
public
int
read
(
char
cbuf
[],
int
off
,
int
len
)
throws
IOException
{
if
(
limit
<=
0
)
if
(
limit
<=
0
)
{
return
-
1
;
}
if
(
len
>
limit
)
{
len
=
(
int
)
limit
;
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/tools/Server.java
浏览文件 @
d32a566b
...
...
@@ -720,10 +720,11 @@ public class Server extends Tool implements Runnable, ShutdownHandler {
public
static
void
startWebServer
(
Connection
conn
,
boolean
ignoreProperties
)
throws
SQLException
{
WebServer
webServer
=
new
WebServer
();
String
[]
args
;
if
(
ignoreProperties
)
if
(
ignoreProperties
)
{
args
=
new
String
[]
{
"-webPort"
,
"0"
,
"-properties"
,
"null"
};
else
}
else
{
args
=
new
String
[]
{
"-webPort"
,
"0"
};
}
Server
web
=
new
Server
(
webServer
,
args
);
web
.
start
();
Server
server
=
new
Server
();
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/util/DateTimeUtils.java
浏览文件 @
d32a566b
...
...
@@ -422,8 +422,9 @@ public class DateTimeUtils {
*/
private
static
int
findNthIndexOf
(
String
str
,
char
chr
,
int
n
)
{
int
pos
=
str
.
indexOf
(
chr
);
while
(--
n
>
0
&&
pos
!=
-
1
)
while
(--
n
>
0
&&
pos
!=
-
1
)
{
pos
=
str
.
indexOf
(
chr
,
pos
+
1
);
}
return
pos
;
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/util/MergedResultSet.java
浏览文件 @
d32a566b
...
...
@@ -57,10 +57,12 @@ public final class MergedResultSet {
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
obj
)
if
(
this
==
obj
)
{
return
true
;
if
(
obj
==
null
||
getClass
()
!=
obj
.
getClass
())
}
if
(
obj
==
null
||
getClass
()
!=
obj
.
getClass
())
{
return
false
;
}
ColumnInfo
other
=
(
ColumnInfo
)
obj
;
return
name
.
equals
(
other
.
name
);
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/util/SourceCompiler.java
浏览文件 @
d32a566b
...
...
@@ -209,12 +209,13 @@ public class SourceCompiler {
if
(
compiledScript
==
null
)
{
String
source
=
sources
.
get
(
packageAndClassName
);
final
String
lang
;
if
(
isJavascriptSource
(
source
))
if
(
isJavascriptSource
(
source
))
{
lang
=
"javascript"
;
else
if
(
isRubySource
(
source
))
}
else
if
(
isRubySource
(
source
))
{
lang
=
"ruby"
;
else
}
else
{
throw
new
IllegalStateException
(
"Unknown language for "
+
source
);
}
final
Compilable
jsEngine
=
(
Compilable
)
new
ScriptEngineManager
().
getEngineByName
(
lang
);
compiledScript
=
jsEngine
.
compile
(
source
);
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/value/DataType.java
浏览文件 @
d32a566b
...
...
@@ -534,18 +534,20 @@ public class DataType {
v
=
ValueBytes
.
getNoCopy
((
byte
[])
o
);
}
else
if
(
o
!=
null
)
{
v
=
ValueUuid
.
get
((
UUID
)
o
);
}
else
}
else
{
v
=
ValueNull
.
INSTANCE
;
}
break
;
}
case
Value
.
UUID
:
{
Object
o
=
rs
.
getObject
(
columnIndex
);
if
(
o
instanceof
UUID
)
{
v
=
ValueUuid
.
get
((
UUID
)
o
);
}
else
if
(
o
!=
null
)
}
else
if
(
o
!=
null
)
{
v
=
ValueUuid
.
get
((
byte
[])
o
);
else
}
else
{
v
=
ValueNull
.
INSTANCE
;
}
break
;
}
case
Value
.
BOOLEAN
:
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/value/ValueEnum.java
浏览文件 @
d32a566b
...
...
@@ -78,9 +78,10 @@ public class ValueEnum extends ValueEnumBase {
final
String
cleanLabel
=
sanitize
(
value
);
for
(
int
i
=
0
;
i
<
enumerators
.
length
;
i
++)
{
if
(
cleanLabel
.
equals
(
sanitize
(
enumerators
[
i
])))
if
(
cleanLabel
.
equals
(
sanitize
(
enumerators
[
i
])))
{
return
new
ValueEnum
(
enumerators
,
i
);
}
}
throw
DbException
.
get
(
ErrorCode
.
GENERAL_ERROR_1
,
"Unexpected error"
);
}
...
...
@@ -106,7 +107,9 @@ public class ValueEnum extends ValueEnumBase {
}
private
static
String
[]
sanitize
(
final
String
[]
enumerators
)
{
if
(
enumerators
==
null
||
enumerators
.
length
==
0
)
return
null
;
if
(
enumerators
==
null
||
enumerators
.
length
==
0
)
{
return
null
;
}
final
String
[]
clean
=
new
String
[
enumerators
.
length
];
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/value/ValueLob.java
浏览文件 @
d32a566b
...
...
@@ -69,10 +69,11 @@ public class ValueLob extends Value {
* @return the smaller input stream
*/
static
InputStream
rangeInputStream
(
InputStream
inputStream
,
long
oneBasedOffset
,
long
length
,
long
dataSize
)
{
if
(
dataSize
>
0
)
if
(
dataSize
>
0
)
{
rangeCheck
(
oneBasedOffset
-
1
,
length
,
dataSize
);
else
}
else
{
rangeCheckUnknown
(
oneBasedOffset
-
1
,
length
);
}
try
{
return
new
RangeInputStream
(
inputStream
,
oneBasedOffset
-
1
,
length
);
}
catch
(
IOException
e
)
{
...
...
@@ -90,10 +91,11 @@ public class ValueLob extends Value {
* @return the smaller input stream
*/
static
Reader
rangeReader
(
Reader
reader
,
long
oneBasedOffset
,
long
length
,
long
dataSize
)
{
if
(
dataSize
>
0
)
if
(
dataSize
>
0
)
{
rangeCheck
(
oneBasedOffset
-
1
,
length
,
dataSize
);
else
}
else
{
rangeCheckUnknown
(
oneBasedOffset
-
1
,
length
);
}
try
{
return
new
RangeReader
(
reader
,
oneBasedOffset
-
1
,
length
);
}
catch
(
IOException
e
)
{
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论