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

sql_for_insert should be called inside exec_insert #26002

Conversation

kamipo
Copy link
Member

@kamipo kamipo commented Jul 31, 2016

exec_insert cannot return last inserted id if use_insert_returning?
is true. sql_for_insert should be called inside exec_insert.

@rails-bot
Copy link

r? @rafaelfranca

(@rails-bot has picked a reviewer for you, use r? to override)

@kamipo kamipo force-pushed the sql_for_insert_should_be_called_inside_exec_insert branch from 0e51df7 to 11b5d20 Compare July 31, 2016 06:22
`exec_insert` cannot return last inserted id if `use_insert_returning?`
is true. `sql_for_insert` should be called inside `exec_insert`.
@kamipo kamipo force-pushed the sql_for_insert_should_be_called_inside_exec_insert branch from 11b5d20 to 2ed25b3 Compare August 6, 2016 05:17
@rafaelfranca rafaelfranca merged commit c158258 into rails:master Aug 17, 2016
@kamipo kamipo deleted the sql_for_insert_should_be_called_inside_exec_insert branch August 17, 2016 03:17
kamipo added a commit to kamipo/rails that referenced this pull request Aug 17, 2016
Because `sql_for_insert` is only called in `use_insert_returning?` is
true since rails#26002.
kamipo added a commit to kamipo/rails that referenced this pull request Aug 19, 2016
This reverts rails#23067. rails#23067 is for propagating `pk` value from
`sql_for_insert` to `exec_insert` (avoiding extra query for pg adapter).
Now `exec_insert` includes `sql_for_insert` since rails#26002 therefore this
propagating is no longer needed.
@yahonda
Copy link
Member

yahonda commented Dec 19, 2016

@kamipo Would you do me a favor to take a look at rsim/oracle-enhanced#988 which is related with this pull request and give some advice if you have time. I have summarized the current status here.

kamipo added a commit that referenced this pull request Jan 11, 2019
Since #26002, `id_value` is no longer passed to `sql_for_insert`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants