提交 ebe14a0b authored 作者: Niklas Mehner's avatar Niklas Mehner

Fix merge issues

上级 f8a501d0
...@@ -15,6 +15,7 @@ import org.h2.engine.Session; ...@@ -15,6 +15,7 @@ import org.h2.engine.Session;
import org.h2.message.DbException; import org.h2.message.DbException;
import org.h2.schema.Schema; import org.h2.schema.Schema;
import org.h2.table.Table; import org.h2.table.Table;
import org.h2.table.TableType;
import org.h2.table.TableView; import org.h2.table.TableView;
/** /**
...@@ -43,7 +44,7 @@ public class DropSynonym extends SchemaCommand { ...@@ -43,7 +44,7 @@ public class DropSynonym extends SchemaCommand {
throw DbException.get(ErrorCode.TABLE_OR_VIEW_NOT_FOUND_1, synonymName); throw DbException.get(ErrorCode.TABLE_OR_VIEW_NOT_FOUND_1, synonymName);
} }
} else { } else {
if (!Table.SYNONYM.equals(synonym.getTableType())) { if (!TableType.SYNONYM.equals(synonym.getTableType())) {
throw DbException.get(ErrorCode.TABLE_OR_VIEW_NOT_FOUND_1, synonymName); throw DbException.get(ErrorCode.TABLE_OR_VIEW_NOT_FOUND_1, synonymName);
} }
session.getUser().checkRight(synonym, Right.ALL); session.getUser().checkRight(synonym, Right.ALL);
......
...@@ -1879,7 +1879,7 @@ public class MetaTable extends Table { ...@@ -1879,7 +1879,7 @@ public class MetaTable extends Table {
} }
case SYNONYMS: { case SYNONYMS: {
for (Table table : getAllTables(session)) { for (Table table : getAllTables(session)) {
if (!table.getTableType().equals(Table.SYNONYM)) { if (!table.getTableType().equals(TableType.SYNONYM)) {
continue; continue;
} }
String synonymName = identifier(table.getName()); String synonymName = identifier(table.getName());
......
...@@ -99,8 +99,8 @@ public class TableSynonym extends Table { ...@@ -99,8 +99,8 @@ public class TableSynonym extends Table {
} }
@Override @Override
public String getTableType() { public TableType getTableType() {
return SYNONYM; return TableType.SYNONYM;
} }
@Override @Override
......
...@@ -33,7 +33,12 @@ public enum TableType { ...@@ -33,7 +33,12 @@ public enum TableType {
/** /**
* The table type name for external table engines. * The table type name for external table engines.
*/ */
EXTERNAL_TABLE_ENGINE; EXTERNAL_TABLE_ENGINE,
/**
* The table type name for synonyms.
*/
SYNONYM;
@Override @Override
public String toString() { public String toString() {
......
...@@ -1086,6 +1086,8 @@ public class TestMetaData extends TestBase { ...@@ -1086,6 +1086,8 @@ public class TestMetaData extends TestBase {
rs.next(); rs.next();
assertEquals("SETTINGS", rs.getString("TABLE_NAME")); assertEquals("SETTINGS", rs.getString("TABLE_NAME"));
rs.next(); rs.next();
assertEquals("SYNONYMS", rs.getString("TABLE_NAME"));
rs.next();
assertEquals("TABLES", rs.getString("TABLE_NAME")); assertEquals("TABLES", rs.getString("TABLE_NAME"));
rs.next(); rs.next();
assertEquals("TABLE_PRIVILEGES", rs.getString("TABLE_NAME")); assertEquals("TABLE_PRIVILEGES", rs.getString("TABLE_NAME"));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论