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

Add null check.

上级 26b991b4
...@@ -198,6 +198,9 @@ public class AlterTableAddConstraint extends SchemaCommand { ...@@ -198,6 +198,9 @@ public class AlterTableAddConstraint extends SchemaCommand {
} }
case CommandInterface.ALTER_TABLE_ADD_CONSTRAINT_REFERENTIAL: { case CommandInterface.ALTER_TABLE_ADD_CONSTRAINT_REFERENTIAL: {
Table refTable = refSchema.resolveTableOrView(session, refTableName); Table refTable = refSchema.resolveTableOrView(session, refTableName);
if (refTable == null) {
throw DbException.get(ErrorCode.TABLE_OR_VIEW_NOT_FOUND_1, refTableName);
}
session.getUser().checkRight(refTable, Right.ALL); session.getUser().checkRight(refTable, Right.ALL);
if (!refTable.canReference()) { if (!refTable.canReference()) {
throw DbException.getUnsupportedException("Reference " + throw DbException.getUnsupportedException("Reference " +
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论