1

I've read this question: What is MySQL's default ON DELETE behavior? which outlines the behaviours of different options - NO ACTION, RESTRICT, SET NULL, and CASCADE for on update / on delete actions for MySQL foreign keys.

However, there's another option - just blank. You can set it to blank - it's not a required field per se.

What does leaving it blank do? Is it the same as setting it to "NO ACTION"?

picture

Community
  • 1
  • 1
joshua.paling
  • 13,762
  • 4
  • 45
  • 60
  • This seems more a question about phpmyadmin than mysql itself. I don't use it, but my guess is it's equivalent to not having an ON DELETE option in the CREATE TABLE command. – Barmar Aug 02 '13 at 04:55
  • It's not a question about phpmyadmin - I don't use that either. That screenshot is from Navicat, and the option is also available in Sequel Pro. – joshua.paling Aug 03 '13 at 05:54
  • Fair enough, but my point is that the meaning of a menu option depends on that GUI application, not the RDBMS itself. I was only wrong about which GUI application you're using. – Barmar Aug 03 '13 at 06:48

1 Answers1

0

The documentation for InnoDB's foreign key handling is not clear about this. I would also speculate that the default action depends on the engine.

Most likely you are using InnoDB.

Based on my own testing, not specifying the ON action for a foreign key is the same as NO ACTION, which for InnoDB is also the same as RESTRICT. It does change output of SHOW CREATE TABLE though.

Explosion Pills
  • 188,624
  • 52
  • 326
  • 405