It is not possible to find any information about this, but is the "SET foreign_key_checks = 0" area the current connection, the current session, or the current transaction?
This is a session statement.
This temporarily violates the foreign key constraint. Sometimes it is necessary to change data so that referential integrity is compromised during the modification process.
The answer can be found here : "It is based on the session. Take a test to make sure, but this is my understanding of this."