When I execute this command in MySQL:
SET FOREIGN_KEY_CHECKS=0;
Does it affect the whole engine or it is only my current transaction?
# will get you the current local (session based) state. SHOW Variables WHERE Variable_name='foreign_key_checks';
If you didn't SET GLOBAL, only your session was affected.