Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
61fdac05
提交
61fdac05
authored
13 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
IBM DB2 and Apache Derby compatibility: support the pseudo-table SYSIBM.SYSDUMMY1.
上级
1c9a3212
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
50 行增加
和
1 行删除
+50
-1
changelog.html
h2/src/docsrc/html/changelog.html
+2
-1
features.html
h2/src/docsrc/html/features.html
+2
-0
Parser.java
h2/src/main/org/h2/command/Parser.java
+4
-0
Mode.java
h2/src/main/org/h2/engine/Mode.java
+7
-0
TestCompatibility.java
h2/src/test/org/h2/test/db/TestCompatibility.java
+35
-0
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
61fdac05
...
...
@@ -18,7 +18,8 @@ Change Log
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
ROWNUM() did not work in combination with IN(..). The following query did not work as expected:
<ul><li>
IBM DB2 and Apache Derby compatibility: support the pseudo-table SYSIBM.SYSDUMMY1.
</li><li>
ROWNUM() did not work in combination with IN(..). The following query did not work as expected:
select * from (select rownum r from test) where r in (1, 2).
</li><li>
H2 Console autocomplete: the autocomplete feature didn't support quoted names.
</li><li>
It is now longer allowed to create an index on a CLOB or BLOB column
...
...
This diff is collapsed.
Click to expand it.
h2/src/docsrc/html/features.html
浏览文件 @
61fdac05
...
...
@@ -1016,6 +1016,7 @@ or the SQL statement <code>SET MODE DB2</code>.
as an alternative for
<code>
LIMIT .. OFFSET
</code>
.
</li><li>
Concatenating
<code>
NULL
</code>
with another value
results in the other value.
</li><li>
Support the pseudo-table SYSIBM.SYSDUMMY1.
</li></ul>
<h3>
Derby Compatibility Mode
</h3>
...
...
@@ -1030,6 +1031,7 @@ or the SQL statement <code>SET MODE Derby</code>.
That means only one row with
<code>
NULL
</code>
in one of the columns is allowed.
</li><li>
Concatenating
<code>
NULL
</code>
with another value
results in the other value.
</li><li>
Support the pseudo-table SYSIBM.SYSDUMMY1.
</li></ul>
<h3>
HSQLDB Compatibility Mode
</h3>
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/command/Parser.java
浏览文件 @
61fdac05
...
...
@@ -607,6 +607,8 @@ public class Parser {
if
(
equalsToken
(
"SESSION"
,
schemaName
))
{
// for local temporary tables
schema
=
database
.
getSchema
(
session
.
getCurrentSchemaName
());
}
else
if
(
database
.
getMode
().
sysDummy1
&&
"SYSIBM"
.
equals
(
schemaName
))
{
// IBM DB2 and Apache Derby compatibility: SYSIBM.SYSDUMMY1
}
else
{
throw
DbException
.
get
(
ErrorCode
.
SCHEMA_NOT_FOUND_1
,
schemaName
);
}
...
...
@@ -1067,6 +1069,8 @@ public class Parser {
}
}
else
if
(
equalsToken
(
"DUAL"
,
tableName
))
{
table
=
getDualTable
(
false
);
}
else
if
(
database
.
getMode
().
sysDummy1
&&
equalsToken
(
"SYSDUMMY1"
,
tableName
))
{
table
=
getDualTable
(
false
);
}
else
{
table
=
readTableOrView
(
tableName
);
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/Mode.java
浏览文件 @
61fdac05
...
...
@@ -104,6 +104,11 @@ public class Mode {
*/
public
boolean
uniqueIndexSingleNullExceptAllColumnsAreNull
;
/**
* Support the pseudo-table SYSIBM.SYSDUMMY1.
*/
public
boolean
sysDummy1
;
/**
* Text can be concatenated using '+'.
*/
...
...
@@ -119,11 +124,13 @@ public class Mode {
mode
=
new
Mode
(
"DB2"
);
mode
.
aliasColumnName
=
true
;
mode
.
supportOffsetFetch
=
true
;
mode
.
sysDummy1
=
true
;
add
(
mode
);
mode
=
new
Mode
(
"Derby"
);
mode
.
aliasColumnName
=
true
;
mode
.
uniqueIndexSingleNull
=
true
;
mode
.
sysDummy1
=
true
;
add
(
mode
);
mode
=
new
Mode
(
"HSQLDB"
);
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/db/TestCompatibility.java
浏览文件 @
61fdac05
...
...
@@ -40,6 +40,8 @@ public class TestCompatibility extends TestBase {
testUniqueIndexOracle
();
testHsqlDb
();
testMySQL
();
testDB2
();
testDerby
();
testPlusSignAsConcatOperator
();
conn
.
close
();
...
...
@@ -224,4 +226,37 @@ public class TestCompatibility extends TestBase {
}
private
void
testDB2
()
throws
SQLException
{
conn
=
getConnection
(
"compatibility;MODE=DB2"
);
ResultSet
res
=
conn
.
createStatement
().
executeQuery
(
"SELECT 1 FROM sysibm.sysdummy1"
);
res
.
next
();
assertEquals
(
"1"
,
res
.
getString
(
1
));
conn
.
close
();
conn
=
getConnection
(
"compatibility;MODE=MySQL"
);
try
{
conn
.
createStatement
().
executeQuery
(
"SELECT 1 FROM sysibm.sysdummy1"
);
fail
();
}
catch
(
SQLException
e
)
{
// can't lookup sysibm.sysdummy1 on mode=MySQL etc.
}
conn
.
close
();
conn
=
getConnection
(
"compatibility"
);
}
private
void
testDerby
()
throws
SQLException
{
conn
=
getConnection
(
"compatibility;MODE=Derby"
);
ResultSet
res
=
conn
.
createStatement
().
executeQuery
(
"SELECT 1 FROM sysibm.sysdummy1"
);
res
.
next
();
assertEquals
(
"1"
,
res
.
getString
(
1
));
conn
.
close
();
conn
=
getConnection
(
"compatibility;MODE=PostgreSQL"
);
try
{
conn
.
createStatement
().
executeQuery
(
"SELECT 1 FROM sysibm.sysdummy1"
);
fail
();
}
catch
(
SQLException
e
)
{
// can't lookup sysibm.sysdummy1 on mode=MySQL etc.
}
conn
.
close
();
conn
=
getConnection
(
"compatibility"
);
}
}
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论