Closed ciaoben closed 1 year ago
As a driver I am on mysql2 0.5.5 (last version)
This is expected in Sequel 5. Looks like you are using class table inheritance, and in Sequel 5, that makes the model dataset select from a subquery, and you cannot update a subquery. You can switch to:
DB[:users].join(:managers, :id=>:id).
where{{managers[:customer_id]=>customer.id, :status=>'enabled'}}.
update(:status=>:disabled)
Complete Description of Issue
I have a simple relation between two Models: Customer has one Manager. If I run this code:
With version 4.40 I would get this query:
With version 5.56:
It tries to update on a join, and my mariadb version 10.3.38 complains:
I think mariadb doesn't not like update on joins. Is the new behavior wanted? Is there a way to avoid it or make it work in this scenario?
Thanks
Simplest Possible Self-Contained Example Showing the Bug
No response
Full Backtrace of Exception (if any)
No response
SQL Log (if any)
No response
Ruby Version
2.3
Sequel Version
5.56