-
Notifications
You must be signed in to change notification settings - Fork 84
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
Result returned from INSERT is nil #41
Comments
+1 |
I have the same issue. Seems to be related to older versions of ActiveRecrod (4.2.10 is mine). def exec_query(sql, name = 'SQL', binds = [])
result = execute(sql, name)
ActiveRecord::Result.new(result.fields, result.to_a)
end The problem is that, the return of Maybe it occurrs because of sql nature, with multiple values in single query |
We've just run into this issue when attempting to add this library to our project. It's rails 4.2.11.3 and mysql2 0.5.3. |
I have the same issue with activerecord 3.2.22.2 and mysql2 0.3.21 - very old application, sorry. Taking a hint from the original post I tried to downgrade bulk_insert to commit 4313c04 (1.6.0 with AR 3.2 compatibility) but that didn't solve the problem. |
hi @darthwiz , is your project open source? As of today AR 3 compatibility should not be broken but there is no regression test. I am reviving this old PR to make sure that I put some regression tests for future contributions #61 (it would be great eventually to have the reference of a sample rails 3 application to add to the test cases) @rfbezerra @waynerobinson would you able to provide a patch working with your active record version? |
The main difference I can see in this diff v1.6.0...v1.7.0 is calling If I remember correctly, this was done to support returning primary keys for postgresql connections #32 . We can eventually restore the previous behaviour under some special conditions: e.g. when AR < 5 and the connection is mysql. |
In #77 I added some unit tests using mysql adapter.
The test is failing both for rails 3 and 4. |
This issue was resolved in release 1.9.0. Please feel free to confirm after the gem update and to re-open the issue if you still face the same problem |
Upgrading from v1.6.0 to v1.7.0, I'm seeing the following failure when trying to call
save!
on a bulk worker (usingmysql2 v0.4.5
database connector against mysql v5.7.23 server):The text was updated successfully, but these errors were encountered: