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

Fix merge issues

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