提交 3e4857fb authored 作者: Thomas Mueller's avatar Thomas Mueller

Referential integrity for in-memory databases didn't work in some cases in version 1.1.102.

上级 f88757ed
...@@ -390,7 +390,9 @@ public class ConstraintReferential extends Constraint { ...@@ -390,7 +390,9 @@ public class ConstraintReferential extends Constraint {
Value v = oldRow.getValue(refIdx).convertTo(col.getType()); Value v = oldRow.getValue(refIdx).convertTo(col.getType());
check.setValue(idx, v); check.setValue(idx, v);
} }
if (found(session, index, check, oldRow)) { // exclude the row only for self-referencing constraints
Row excluding = (refTable == table) ? oldRow : null;
if (found(session, index, check, excluding)) {
throw Message.getSQLException(ErrorCode.REFERENTIAL_INTEGRITY_VIOLATED_CHILD_EXISTS_1, throw Message.getSQLException(ErrorCode.REFERENTIAL_INTEGRITY_VIOLATED_CHILD_EXISTS_1,
getShortDescription()); getShortDescription());
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论