提交 49953a3d authored 作者: Thomas Mueller's avatar Thomas Mueller

Multi-column indexes where the second or later column was descending did not…

Multi-column indexes where the second or later column was descending did not always produce correct results.
上级 f2dc39c0
......@@ -18,7 +18,9 @@ Change Log
<h1>Change Log</h1>
<h2>Next Version (unreleased)</h2>
<ul><li>When using large transactions or a small log size, the database could get very slow
<ul><li>Multi-column indexes where the second or later column was descending did not always
produce correct results (rows were missing in the result set, or the result set was empty).
</li><li>When using large transactions or a small log size, the database could get very slow
(profiling shows the hotspot is in FileObjectDisk.sync()).
</li><li>The Shell tool now prints the stack trace when the list mode is enabled.
</li><li>CREATE ALIAS ... AS: Compilation was incorrect if the source code contained
......
......@@ -49,7 +49,7 @@ public class IndexCursor implements Cursor {
if (idxCols != null) {
for (int i = 0; i < columns.length; i++) {
int idx = index.getColumnIndex(columns[i]);
if (idx == 0) {
if (idx >= 0) {
indexColumns[i] = idxCols[idx];
}
}
......
......@@ -249,6 +249,13 @@ public class TestIndex extends TestBase {
rs.next();
assertEquals(11, rs.getInt(1));
stat.execute("DROP TABLE TEST");
stat.execute("create table test(x int, y int)");
stat.execute("insert into test values(1, 1), (1, 2)");
stat.execute("create index test_x_y on test (x desc, y desc)");
rs = stat.executeQuery("select * from test where x=1 and y<2");
assertTrue(rs.next());
conn.close();
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论