提交 56118c48 authored 作者: Thomas Mueller's avatar Thomas Mueller

For in-memory databases, queries with a "group by" column that is also a hash…

For in-memory databases, queries with a "group by" column that is also a hash index threw a RuntimeException.
上级 384b18f5
...@@ -18,7 +18,9 @@ Change Log ...@@ -18,7 +18,9 @@ Change Log
<h1>Change Log</h1> <h1>Change Log</h1>
<h2>Next Version (unreleased)</h2> <h2>Next Version (unreleased)</h2>
<ul><li>Improved error message for some syntax errors. <ul><li>For in-memory databases, queries with a "group by" column that
is also a hash index threw a RuntimeException.
</li><li>Improved error message for some syntax errors.
</li><li>File system abstraction: if used directly, some file systems did not work correctly </li><li>File system abstraction: if used directly, some file systems did not work correctly
with spliced byte buffers (the database engine doesn't use those). with spliced byte buffers (the database engine doesn't use those).
</li><li>To use the MVStore storage engine (which is still work in progress), append </li><li>To use the MVStore storage engine (which is still work in progress), append
......
...@@ -250,6 +250,10 @@ public class Select extends Query { ...@@ -250,6 +250,10 @@ public class Select extends Query {
if (index.getIndexType().isScan()) { if (index.getIndexType().isScan()) {
continue; continue;
} }
if (index.getIndexType().isHash()) {
// does not allow scanning entries
continue;
}
if (isGroupSortedIndex(topTableFilter, index)) { if (isGroupSortedIndex(topTableFilter, index)) {
return index; return index;
} }
......
...@@ -4,6 +4,20 @@ ...@@ -4,6 +4,20 @@
-- Initial Developer: H2 Group -- Initial Developer: H2 Group
-- --
--- special grammar and test cases --------------------------------------------------------------------------------------------- --- special grammar and test cases ---------------------------------------------------------------------------------------------
create table test(x int);
> ok
create hash index on test(x);
> ok
select 1 from test group by x;
> 1
> -
> rows: 0
drop table test;
> ok
call regexp_replace('x', 'x', '\'); call regexp_replace('x', 'x', '\');
> exception > exception
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论