Skip to content

Instantly share code, notes, and snippets.

@tk0miya
Last active December 19, 2015 12:19
Show Gist options
  • Select an option

  • Save tk0miya/5954387 to your computer and use it in GitHub Desktop.

Select an option

Save tk0miya/5954387 to your computer and use it in GitHub Desktop.
MySQL で INSERT 時にロックされてしまう件に関するメモ。
// Transaction 1.
BEGIN;
INSERT INTO users values(1, "tk0miya");
// Transaction 2.
BEGIN;
INSERT INTO users values(1, "suzuki");
// Transaction 1. が commit or rollback されるまでブロックされる. (なぜ?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment