提交 9293d8ad authored 作者: noelgrandin's avatar noelgrandin

Hash indexes can only index one column. Rather throw an error message than…

Hash indexes can only index one column. Rather throw an error message than silently converting it to a different type of index.
上级 c9612df0
...@@ -234,7 +234,10 @@ public class RegularTable extends TableBase { ...@@ -234,7 +234,10 @@ public class RegularTable extends TableBase {
index = new PageBtreeIndex(this, indexId, indexName, cols, indexType, create, session); index = new PageBtreeIndex(this, indexId, indexName, cols, indexType, create, session);
} }
} else { } else {
if (indexType.isHash() && cols.length <= 1) { if (indexType.isHash()) {
if (cols.length != 1) {
throw DbException.getUnsupportedException("hash indexes may index only one column");
}
if (indexType.isUnique()) { if (indexType.isUnique()) {
index = new HashIndex(this, indexId, indexName, cols, indexType); index = new HashIndex(this, indexId, indexName, cols, indexType);
} else { } else {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论