title: ON DELETE CASCADE deletes extra rows
body: <p>I have the following tables:</p>
  <pre class="lang-sql prettyprint-override"><code>CREATE TABLE workspace (
      id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
      uid VARCHAR(255),
      name NVARCHAR(255)
  );
  
  CREATE TABLE userGroup (
      id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
      workspaceId INT,
      FOREIGN KEY (workspaceId) REFERENCES workspace(id) ON DELETE CASCADE,
      name NVARCHAR(255)
  );
  
  CREATE TABLE userWorkspaceMapping (
      id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
      workspaceId INT,
      FOREIGN KEY (workspaceId) REFERENCES workspace(id) ON DELETE CASCADE,
      userId INT,
      FOREIGN KEY (userId) REFERENCES user(id),
      userGroupId INT,
      FOREIGN KEY (userGroupId) REFERENCES userGroup(id) ON DELETE CASCADE
  );
  </code></pre>
  <p>And this data for <code>userWorkspaceMapping</code>:</p>
  <pre><code>+----+-------------+--------+-------------+
  | id | workspaceId | userId | userGroupId |
  +----+-------------+--------+-------------+
  | 1  |      1      |    1   |      1      |    &lt;------- I want to delete only this row
  | 2  |      2      |    1   |      3      |
  | 3  |      3      |    1   |      5      |
  +-----------------------------------------+
  </code></pre>
  <p>When I delete a <code>workspace</code>, all three rows in <code>userWorkspaceMapping</code> are deleted, <strong>instead of just the first one</strong>.</p>
  <pre class="lang-sql prettyprint-override"><code>delete from workspace
  where id = 1;
  </code></pre>
  <p><strong>Why is everything being deleted in <code>userWorkspaceMapping</code>?</strong></p>
  <p>Here's the fiddle: <a href="https://www.db-fiddle.com/f/tHMZy2rnyvoHH13E7dS99A/1" rel="nofollow noreferrer">https://www.db-fiddle.com/f/tHMZy2rnyvoHH13E7dS99A/1</a></p>