Closed farzadbekran closed 2 years ago
Woah, a serious issue indeed! Thanks for the detailed write-up.
Here's a simpler means of reproducing the issue:
x:=true
constraint x equals true
undefine x
:commit
y:=false
ERR: RelVarNotDefinedError "x"
This is caused by the lack of constraint checking in relation undefinition. Oops!
When I define two RelVars, add a foreign key, insert a couple of tuples and
undefine
the RelVar being referenced by the other one, no errors occur, which leads to an inconsistency in the DB.To reproduce, do these in tutd:
I think undefining
x
should not be allowed here, since it breaks foreign key constraint fory
.