Can't really find any details on this, but is the scope of 'SET foreign_key_checks = 0' the current connection, current session or current transaction?
Asked
Active
Viewed 5,171 times
2 Answers
8
It's a session-based statement.
This is to temporarily break the Foreign Key Constraint. It is sometimes necessary to change data in a way that referential integrity needs to be broken during the modification process.
John Woo
- 249,283
- 65
- 481
- 481
7
It is session-based. Full answer and explanation can be found in this other Stack Overflow answer:
“It is session-based. Do a test to be sure, but that's my understanding of it.”
Giacomo1968
- 24,837
- 11
- 67
- 96