Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
c87d9ab6
提交
c87d9ab6
authored
5月 25, 2016
作者:
Thomas Mueller Graf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Formatting / Javadocs
上级
d7f16c93
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
52 行增加
和
48 行删除
+52
-48
changelog.html
h2/src/docsrc/html/changelog.html
+1
-1
Parser.java
h2/src/main/org/h2/command/Parser.java
+14
-8
CompareLike.java
h2/src/main/org/h2/expression/CompareLike.java
+1
-1
CipherFactory.java
h2/src/main/org/h2/security/CipherFactory.java
+13
-13
testScript.sql
h2/src/test/org/h2/test/testScript.sql
+9
-9
TestSecurity.java
h2/src/test/org/h2/test/unit/TestSecurity.java
+12
-12
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+2
-4
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
c87d9ab6
...
...
@@ -54,7 +54,7 @@ table with an LOB column.
</li>
<li>
Add support for ALTER VIEW [ IF EXISTS ]
</li>
<li>
Add support for ALTER INDE [ IF EXISTS ]
<li>
Add support for ALTER INDE
X
[ IF EXISTS ]
</li>
<li>
Add support for ALTER SEQUENCE [ IF EXISTS ]
</li>
...
...
h2/src/main/org/h2/command/Parser.java
浏览文件 @
c87d9ab6
...
...
@@ -5615,7 +5615,8 @@ public class Parser {
return
command
;
}
else
if
(
readIf
(
"TYPE"
))
{
// PostgreSQL compatibility
return
parseAlterTableAlterColumnType
(
schema
,
tableName
,
columnName
,
ifTableExists
);
return
parseAlterTableAlterColumnType
(
schema
,
tableName
,
columnName
,
ifTableExists
);
}
else
if
(
readIf
(
"SET"
))
{
if
(
readIf
(
"DATA"
))
{
// Derby compatibility
...
...
@@ -5658,7 +5659,8 @@ public class Parser {
command
.
setSelectivity
(
readExpression
());
return
command
;
}
else
{
return
parseAlterTableAlterColumnType
(
schema
,
tableName
,
columnName
,
ifTableExists
);
return
parseAlterTableAlterColumnType
(
schema
,
tableName
,
columnName
,
ifTableExists
);
}
}
throw
getSyntaxError
();
...
...
@@ -5672,21 +5674,24 @@ public class Parser {
return
table
;
}
private
Column
columnIfTableExists
(
Schema
schema
,
String
tableName
,
String
columnName
,
boolean
ifTableExists
)
{
private
Column
columnIfTableExists
(
Schema
schema
,
String
tableName
,
String
columnName
,
boolean
ifTableExists
)
{
Table
table
=
tableIfTableExists
(
schema
,
tableName
,
ifTableExists
);
return
table
==
null
?
null
:
table
.
getColumn
(
columnName
);
}
private
Prepared
commandIfTableExists
(
Schema
schema
,
String
tableName
,
boolean
ifTableExists
,
Prepared
commandIfTableExists
)
{
private
Prepared
commandIfTableExists
(
Schema
schema
,
String
tableName
,
boolean
ifTableExists
,
Prepared
commandIfTableExists
)
{
return
tableIfTableExists
(
schema
,
tableName
,
ifTableExists
)
==
null
?
new
NoOperation
(
session
)
:
commandIfTableExists
;
}
private
AlterTableAlterColumn
parseAlterTableAlterColumnType
(
Schema
schema
,
String
tableName
,
String
columnName
,
boolean
ifTableExists
)
{
private
AlterTableAlterColumn
parseAlterTableAlterColumnType
(
Schema
schema
,
String
tableName
,
String
columnName
,
boolean
ifTableExists
)
{
Column
oldColumn
=
columnIfTableExists
(
schema
,
tableName
,
columnName
,
ifTableExists
);
Column
newColumn
=
parseColumnForTable
(
columnName
,
oldColumn
==
null
?
true
:
oldColumn
.
isNullable
());
Column
newColumn
=
parseColumnForTable
(
columnName
,
oldColumn
==
null
?
true
:
oldColumn
.
isNullable
());
AlterTableAlterColumn
command
=
new
AlterTableAlterColumn
(
session
,
schema
);
command
.
setTableName
(
tableName
);
...
...
@@ -5697,7 +5702,8 @@ public class Parser {
return
command
;
}
private
AlterTableAlterColumn
parseAlterTableAddColumn
(
String
tableName
,
Schema
schema
,
boolean
ifTableExists
)
{
private
AlterTableAlterColumn
parseAlterTableAddColumn
(
String
tableName
,
Schema
schema
,
boolean
ifTableExists
)
{
readIf
(
"COLUMN"
);
AlterTableAlterColumn
command
=
new
AlterTableAlterColumn
(
session
,
schema
);
...
...
h2/src/main/org/h2/expression/CompareLike.java
浏览文件 @
c87d9ab6
...
...
@@ -382,7 +382,7 @@ public class CompareLike extends Condition {
}
patternString
=
new
String
(
patternChars
,
0
,
patternLength
);
/
* optimises the common case of LIKE 'foo%' */
/
/ optimizes the common case of LIKE 'foo%'
if
(
compareMode
.
getName
().
equals
(
CompareMode
.
OFF
)
&&
patternLength
>
1
)
{
int
maxMatch
=
0
;
while
(
maxMatch
<
patternLength
&&
patternTypes
[
maxMatch
]
==
MATCH
)
{
...
...
h2/src/main/org/h2/security/CipherFactory.java
浏览文件 @
c87d9ab6
...
...
@@ -177,12 +177,12 @@ public class CipherFactory {
if
(
list
==
null
)
{
return
list
;
}
List
<
String
>
algos
=
new
LinkedList
<
String
>(
Arrays
.
asList
(
list
.
split
(
"\\s*,\\s*"
)));
boolean
dhAnonRemoved
=
algos
.
remove
(
"DH_anon"
);
boolean
ecdhAnonRemoved
=
algos
.
remove
(
"ECDH_anon"
);
List
<
String
>
algo
rithm
s
=
new
LinkedList
<
String
>(
Arrays
.
asList
(
list
.
split
(
"\\s*,\\s*"
)));
boolean
dhAnonRemoved
=
algo
rithm
s
.
remove
(
"DH_anon"
);
boolean
ecdhAnonRemoved
=
algo
rithm
s
.
remove
(
"ECDH_anon"
);
if
(
dhAnonRemoved
||
ecdhAnonRemoved
)
{
String
algosStr
=
Arrays
.
toString
(
algos
.
toArray
(
new
String
[
algo
s
.
size
()]));
return
(
algo
s
.
size
()
>
0
)
?
algosStr
.
substring
(
1
,
algosStr
.
length
()
-
1
):
""
;
String
string
=
Arrays
.
toString
(
algorithms
.
toArray
(
new
String
[
algorithm
s
.
size
()]));
return
(
algo
rithms
.
size
()
>
0
)
?
string
.
substring
(
1
,
string
.
length
()
-
1
):
""
;
}
return
list
;
}
...
...
@@ -203,13 +203,13 @@ public class CipherFactory {
* behavior.
*/
public
static
synchronized
void
removeAnonFromLegacyAlgorithms
()
{
String
legacy
AlgosOrig
=
getLegacyAlgorithmsSilently
();
if
(
legacy
AlgosOrig
==
null
)
{
String
legacy
Original
=
getLegacyAlgorithmsSilently
();
if
(
legacy
Original
==
null
)
{
return
;
}
String
legacy
AlgosNew
=
removeDhAnonFromCommaSeparatedList
(
legacyAlgosOrig
);
if
(!
legacy
AlgosOrig
.
equals
(
legacyAlgos
New
))
{
setLegacyAlgorithmsSilently
(
legacy
Algos
New
);
String
legacy
New
=
removeDhAnonFromCommaSeparatedList
(
legacyOriginal
);
if
(!
legacy
Original
.
equals
(
legacy
New
))
{
setLegacyAlgorithmsSilently
(
legacyNew
);
}
}
...
...
@@ -243,12 +243,12 @@ public class CipherFactory {
return
defaultLegacyAlgorithms
;
}
private
static
void
setLegacyAlgorithmsSilently
(
String
legacyAlgos
)
{
if
(
legacyAlgos
==
null
)
{
private
static
void
setLegacyAlgorithmsSilently
(
String
legacyAlgo
rithm
s
)
{
if
(
legacyAlgo
rithm
s
==
null
)
{
return
;
}
try
{
Security
.
setProperty
(
LEGACY_ALGORITHMS_SECURITY_KEY
,
legacyAlgos
);
Security
.
setProperty
(
LEGACY_ALGORITHMS_SECURITY_KEY
,
legacyAlgo
rithm
s
);
}
catch
(
SecurityException
e
)
{
// ignore
}
...
...
h2/src/test/org/h2/test/testScript.sql
浏览文件 @
c87d9ab6
...
...
@@ -2994,7 +2994,7 @@ alter view address_view recompile;
alter view if exists address_view recompile;
> ok
alter view if exists does
n
t_exist recompile;
alter view if exists does
_no
t_exist recompile;
> ok
select * from ADDRESS_VIEW;
...
...
@@ -10318,31 +10318,31 @@ insert into x(id) values(1);
delete
from
x
;
>
update
count
:
1
alter
table
if
exists
y
add
constraint
x_chk
check
(
b
=
'a'
);
alter
table
if
exists
y
add
constraint
x_ch
ec
k
check
(
b
=
'a'
);
>
ok
alter
table
if
exists
x
add
constraint
x_chk
check
(
b
=
'a'
);
alter
table
if
exists
x
add
constraint
x_ch
ec
k
check
(
b
=
'a'
);
>
ok
alter
table
if
exists
x
add
constraint
x_chk
check
(
b
=
'a'
);
alter
table
if
exists
x
add
constraint
x_ch
ec
k
check
(
b
=
'a'
);
>
exception
insert
into
x
(
id
,
b
)
values
(
1
,
'b'
);
>
exception
alter
table
if
exists
y
rename
constraint
x_ch
k
to
x_ch
k1
;
alter
table
if
exists
y
rename
constraint
x_ch
eck
to
x_chec
k1
;
>
ok
alter
table
if
exists
x
rename
constraint
x_ch
k
to
x_ch
k1
;
alter
table
if
exists
x
rename
constraint
x_ch
eck
to
x_chec
k1
;
>
ok
alter
table
if
exists
x
rename
constraint
x_ch
k
to
x_ch
k1
;
alter
table
if
exists
x
rename
constraint
x_ch
eck
to
x_chec
k1
;
>
exception
alter
table
if
exists
y
drop
constraint
x_chk1
;
alter
table
if
exists
y
drop
constraint
x_ch
ec
k1
;
>
ok
alter
table
if
exists
x
drop
constraint
x_chk1
;
alter
table
if
exists
x
drop
constraint
x_ch
ec
k1
;
>
ok
alter
table
if
exists
y
rename
to
z
;
...
...
h2/src/test/org/h2/test/unit/TestSecurity.java
浏览文件 @
c87d9ab6
...
...
@@ -37,7 +37,7 @@ public class TestSecurity extends TestBase {
testAES
();
testBlockCiphers
();
testRemoveAnonFromLegacyAlgorithms
();
//
testResetLegacyAlgo
s();
//
testResetLegacyAlgorithm
s();
}
private
static
void
testConnectWithHash
()
throws
SQLException
{
...
...
@@ -255,22 +255,22 @@ public class TestSecurity extends TestBase {
}
private
void
testRemoveAnonFromLegacyAlgorithms
()
{
String
legacyAlgos
=
"K_NULL, C_NULL, M_NULL, DHE_DSS_EXPORT"
+
String
legacyAlgo
rithm
s
=
"K_NULL, C_NULL, M_NULL, DHE_DSS_EXPORT"
+
", DHE_RSA_EXPORT, DH_anon_EXPORT, DH_DSS_EXPORT, DH_RSA_EXPORT, RSA_EXPORT"
+
", DH_anon, ECDH_anon, RC4_128, RC4_40, DES_CBC, DES40_CBC"
;
String
expectedLegacy
Algos
WithoutDhAnon
=
"K_NULL, C_NULL, M_NULL, DHE_DSS_EXPORT"
+
String
expectedLegacyWithoutDhAnon
=
"K_NULL, C_NULL, M_NULL, DHE_DSS_EXPORT"
+
", DHE_RSA_EXPORT, DH_anon_EXPORT, DH_DSS_EXPORT, DH_RSA_EXPORT, RSA_EXPORT"
+
", RC4_128, RC4_40, DES_CBC, DES40_CBC"
;
assertEquals
(
expectedLegacy
Algos
WithoutDhAnon
,
CipherFactory
.
removeDhAnonFromCommaSeparatedList
(
legacyAlgos
));
assertEquals
(
expectedLegacyWithoutDhAnon
,
CipherFactory
.
removeDhAnonFromCommaSeparatedList
(
legacyAlgo
rithm
s
));
legacyAlgos
=
"ECDH_anon, DH_anon_EXPORT, DH_anon"
;
expectedLegacy
Algos
WithoutDhAnon
=
"DH_anon_EXPORT"
;
assertEquals
(
expectedLegacy
Algos
WithoutDhAnon
,
CipherFactory
.
removeDhAnonFromCommaSeparatedList
(
legacyAlgos
));
legacyAlgo
rithm
s
=
"ECDH_anon, DH_anon_EXPORT, DH_anon"
;
expectedLegacyWithoutDhAnon
=
"DH_anon_EXPORT"
;
assertEquals
(
expectedLegacyWithoutDhAnon
,
CipherFactory
.
removeDhAnonFromCommaSeparatedList
(
legacyAlgo
rithm
s
));
legacyAlgos
=
null
;
assertNull
(
CipherFactory
.
removeDhAnonFromCommaSeparatedList
(
legacyAlgos
));
legacyAlgo
rithm
s
=
null
;
assertNull
(
CipherFactory
.
removeDhAnonFromCommaSeparatedList
(
legacyAlgo
rithm
s
));
}
/**
...
...
@@ -281,7 +281,7 @@ public class TestSecurity extends TestBase {
* to a modification of the global state with hard-to-track consequences.
*/
@SuppressWarnings
(
"unused"
)
private
void
testResetLegacyAlgos
()
{
private
void
testResetLegacyAlgo
rithm
s
()
{
String
legacyAlgorithmsBefore
=
CipherFactory
.
getLegacyAlgorithmsSilently
();
assertEquals
(
"Failed assumption: jdk.tls.legacyAlgorithms"
+
" has been modified from its initial setting"
,
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
c87d9ab6
...
...
@@ -719,7 +719,5 @@ xmlhttp xmlnode xmlns xmlstartdoc xmltext xmx xor xrmd xrunhprof xsi xsm xtea xt
xtime xts xvi xyz yacute year years yen yes yet yield yielding yjp ymd york you
young younger youngest your yourself youtube ytd yuml yyfxyy yyyymmdd zeile zen
zepfred zero zeroes zeros zeta zhang zip ziv zloty zone zones zurich zwj zwnj
incl reveal designators templates invoked candidate handshake optimises altered accomplished permanent algos clarify weaken excl alternatively
dita imjcc
\ No newline at end of file
recompiled incl reveal designators templates invoked candidate handshake altered
accomplished permanent clarify weaken excl alternatively dita imjcc optimizes
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论