Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
d5006d2b
提交
d5006d2b
authored
9月 03, 2014
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Conditions on the "_rowid_" pseudo-column didn't use an index when using the MVStore.
上级
6a639782
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
26 行增加
和
6 行删除
+26
-6
changelog.html
h2/src/docsrc/html/changelog.html
+5
-2
MVPrimaryIndex.java
h2/src/main/org/h2/mvstore/db/MVPrimaryIndex.java
+8
-4
TestOptimizations.java
h2/src/test/org/h2/test/db/TestOptimizations.java
+13
-0
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
d5006d2b
...
@@ -17,7 +17,10 @@ Change Log
...
@@ -17,7 +17,10 @@ Change Log
<h1>
Change Log
</h1>
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
The Long.MIN_VALUE could not be parsed for auto-increment (identity) columns.
<ul><li>
Conditions on the "_rowid_" pseudo-column didn't use an index
when using the MVStore.
</li><li>
Fixed documentation that "offset" and "fetch" are also keywords since version 1.4.x.
</li><li>
The Long.MIN_VALUE could not be parsed for auto-increment (identity) columns.
</li><li>
Issue 573: Add implementation for Methods "isWrapperFor()" and "unwrap()" in
</li><li>
Issue 573: Add implementation for Methods "isWrapperFor()" and "unwrap()" in
other JDBC classes.
other JDBC classes.
</li><li>
Issue 572: MySQL compatibility for "order by" in update statements.
</li><li>
Issue 572: MySQL compatibility for "order by" in update statements.
...
@@ -159,7 +162,7 @@ Change Log
...
@@ -159,7 +162,7 @@ Change Log
</li><li>
Implicit relative paths are disabled (system property "h2.implicitRelativePath"),
</li><li>
Implicit relative paths are disabled (system property "h2.implicitRelativePath"),
so that the database URL jdbc:h2:test now needs to be written as jdbc:h2:./test.
so that the database URL jdbc:h2:test now needs to be written as jdbc:h2:./test.
</li><li>
"select ... fetch first 1 row only" is supported with the regular mode.
</li><li>
"select ... fetch first 1 row only" is supported with the regular mode.
This was disabled so far because "fetch"
is now a keyword
.
This was disabled so far because "fetch"
and "offset" are now keywords
.
See also Mode.supportOffsetFetch.
See also Mode.supportOffsetFetch.
</li><li>
Byte arrays are now sorted in unsigned mode
</li><li>
Byte arrays are now sorted in unsigned mode
(x'99' is larger than x'09').
(x'99' is larger than x'09').
...
...
h2/src/main/org/h2/mvstore/db/MVPrimaryIndex.java
浏览文件 @
d5006d2b
...
@@ -174,22 +174,26 @@ public class MVPrimaryIndex extends BaseIndex {
...
@@ -174,22 +174,26 @@ public class MVPrimaryIndex extends BaseIndex {
@Override
@Override
public
Cursor
find
(
Session
session
,
SearchRow
first
,
SearchRow
last
)
{
public
Cursor
find
(
Session
session
,
SearchRow
first
,
SearchRow
last
)
{
ValueLong
min
,
max
;
ValueLong
min
,
max
;
if
(
first
==
null
||
mainIndexColumn
<
0
)
{
if
(
first
==
null
)
{
min
=
MIN
;
min
=
MIN
;
}
else
if
(
mainIndexColumn
<
0
)
{
min
=
ValueLong
.
get
(
first
.
getKey
());
}
else
{
}
else
{
ValueLong
v
=
(
ValueLong
)
first
.
getValue
(
mainIndexColumn
);
ValueLong
v
=
(
ValueLong
)
first
.
getValue
(
mainIndexColumn
);
if
(
v
==
null
)
{
if
(
v
==
null
)
{
min
=
ZERO
;
min
=
ValueLong
.
get
(
first
.
getKey
())
;
}
else
{
}
else
{
min
=
v
;
min
=
v
;
}
}
}
}
if
(
last
==
null
||
mainIndexColumn
<
0
)
{
if
(
last
==
null
)
{
max
=
MAX
;
max
=
MAX
;
}
else
if
(
mainIndexColumn
<
0
)
{
max
=
ValueLong
.
get
(
last
.
getKey
());
}
else
{
}
else
{
ValueLong
v
=
(
ValueLong
)
last
.
getValue
(
mainIndexColumn
);
ValueLong
v
=
(
ValueLong
)
last
.
getValue
(
mainIndexColumn
);
if
(
v
==
null
)
{
if
(
v
==
null
)
{
max
=
MAX
;
max
=
ValueLong
.
get
(
last
.
getKey
())
;
}
else
{
}
else
{
max
=
v
;
max
=
v
;
}
}
...
...
h2/src/test/org/h2/test/db/TestOptimizations.java
浏览文件 @
d5006d2b
...
@@ -41,6 +41,7 @@ public class TestOptimizations extends TestBase {
...
@@ -41,6 +41,7 @@ public class TestOptimizations extends TestBase {
@Override
@Override
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
deleteDb
(
"optimizations"
);
deleteDb
(
"optimizations"
);
testFastRowIdCondition
();
testExplainRoundTrip
();
testExplainRoundTrip
();
testOrderByExpression
();
testOrderByExpression
();
testGroupSubquery
();
testGroupSubquery
();
...
@@ -78,6 +79,18 @@ public class TestOptimizations extends TestBase {
...
@@ -78,6 +79,18 @@ public class TestOptimizations extends TestBase {
testConvertOrToIn
();
testConvertOrToIn
();
deleteDb
(
"optimizations"
);
deleteDb
(
"optimizations"
);
}
}
private
void
testFastRowIdCondition
()
throws
Exception
{
Connection
conn
=
getConnection
(
"optimizations"
);
Statement
stat
=
conn
.
createStatement
();
stat
.
executeUpdate
(
"create table many(id int) "
+
"as select x from system_range(1, 10000)"
);
ResultSet
rs
=
stat
.
executeQuery
(
"explain analyze select * from many "
+
"where _rowid_ = 400"
);
rs
.
next
();
assertContains
(
rs
.
getString
(
1
),
"/* scanCount: 2 */"
);
conn
.
close
();
}
private
void
testExplainRoundTrip
()
throws
Exception
{
private
void
testExplainRoundTrip
()
throws
Exception
{
Connection
conn
=
getConnection
(
"optimizations"
);
Connection
conn
=
getConnection
(
"optimizations"
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论