CREATE TABLE `blog` (
  `id` int(6) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE `post` (
  `id` int(6) unsigned NOT NULL AUTO_INCREMENT,
  `blog_id` int(6) unsigned NOT NULL REFERENCES blog (`id`),
  `title` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

INSERT INTO blog (name) VALUES ('One');
INSERT INTO post (blog_id, title) VALUES (1, 'Hello world');

# This query will fail with a syntax error
DELETE post FROM blog INNER JOIN post WHERE blog.id = post.blog_id RETURNING post.id;