提交 358c0388 authored 作者: Thomas Mueller's avatar Thomas Mueller

It is now longer allowed to create an index on a CLOB or BLOB column.

上级 38ae35b2
...@@ -41,6 +41,9 @@ public class PageBtreeIndex extends PageIndex { ...@@ -41,6 +41,9 @@ public class PageBtreeIndex extends PageIndex {
public PageBtreeIndex(RegularTable table, int id, String indexName, IndexColumn[] columns, public PageBtreeIndex(RegularTable table, int id, String indexName, IndexColumn[] columns,
IndexType indexType, boolean create, Session session) { IndexType indexType, boolean create, Session session) {
initBaseIndex(table, id, indexName, columns, indexType); initBaseIndex(table, id, indexName, columns, indexType);
if (!database.isStarting() && create) {
checkIndexColumnTypes(columns);
}
// int test; // int test;
// trace.setLevel(TraceSystem.DEBUG); // trace.setLevel(TraceSystem.DEBUG);
tableData = table; tableData = table;
...@@ -51,9 +54,6 @@ public class PageBtreeIndex extends PageIndex { ...@@ -51,9 +54,6 @@ public class PageBtreeIndex extends PageIndex {
store.addIndex(this); store.addIndex(this);
if (create) { if (create) {
// new index // new index
if (!database.isStarting()) {
checkIndexColumnTypes(columns);
}
rootPageId = store.allocatePage(); rootPageId = store.allocatePage();
needRebuild = true; needRebuild = true;
// TODO currently the head position is stored in the log // TODO currently the head position is stored in the log
......
...@@ -106,7 +106,9 @@ public class TestLob extends TestBase { ...@@ -106,7 +106,9 @@ public class TestLob extends TestBase {
stat.execute("create table test(id int, name clob)"); stat.execute("create table test(id int, name clob)");
try { try {
stat.execute("create index idx_n on test(name)"); stat.execute("create index idx_n on test(name)");
fail(); if (!config.memory) {
fail();
}
} catch (SQLException e) { } catch (SQLException e) {
assertEquals(ErrorCode.FEATURE_NOT_SUPPORTED_1, e.getErrorCode()); assertEquals(ErrorCode.FEATURE_NOT_SUPPORTED_1, e.getErrorCode());
} }
...@@ -290,7 +292,7 @@ public class TestLob extends TestBase { ...@@ -290,7 +292,7 @@ public class TestLob extends TestBase {
Statement stat; Statement stat;
conn = getConnection("lob"); conn = getConnection("lob");
stat = conn.createStatement(); stat = conn.createStatement();
stat.execute("create table test(x clob unique)"); stat.execute("create memory table test(x clob unique)");
stat.execute("insert into test values('hello')"); stat.execute("insert into test values('hello')");
stat.execute("insert into test values('world')"); stat.execute("insert into test values('world')");
try { try {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论