Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return inserted ids for mysql bulk insert #487

Closed
wants to merge 1 commit into from

Conversation

a2ikm
Copy link

@a2ikm a2ikm commented Jan 10, 2018

This counts only inserted records for ON DUPLICATE KEY UPDATE by comparing the number of inserting records and ROW_COUNT().

This works good with innodb_autoinc_lock_mode = 0 and 1, but not with 2.
ref https://dev.mysql.com/doc/refman/5.7/en/innodb-auto-increment-handling.html#innodb-auto-increment-lock-modes and #279.

@jkowens
Copy link
Collaborator

jkowens commented Jan 13, 2018

@a2ikm thanks for your interest in contributing to this project. Unfortunately, because this requires specific settings for innodb_autoinc_lock_mode, doesn't work with MyISAM, and won't work with uuid primary keys, I don't think we'll go in this direction.

See also /pull/279.

If you want to add information about calculating IDs after import in the wiki that would be a nice addition.

@jkowens jkowens closed this Jan 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants