I'm having 2 MySQL tables
Person Table
============
Name
----
person1
person2
person3
Person Dependencies
===================
person dependency_person
--------------------------
person1 person2
person2 person3
person3 person1
in the Person Dependencies
table, is it possible to check for a circular dependency before inserting a row like in the third row(person3 person1)