You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to merge multiple relations together, the last one below incorrectly generates joins that are out of order and throw an error in Postgres. Not sure if this is related to #25806. There seem to be a few open issues that have not been resolved that are similar to this one.
All of the queries except for the last one are successful:
!! #<ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: missing FROM-clause entry for table "users"
LINE 1: ...LEFT OUTER JOIN "locations" ON "locations"."id" = "users"."l...
^
: SELECT "lists".* FROM "lists" LEFT OUTER JOIN "locations" ON "locations"."id" = "users"."location_id" LEFT OUTER JOIN "users" ON "users"."id" = "list_items"."contributor_user_id" INNER JOIN "list_items" ON "lists"."id" = "list_items"."list_id" WHERE (list_status_code!='Deleted') AND "list_items"."domain" = $1 AND "list_items"."domain" = $2 AND "users"."opt_out" = $3 AND (birthday >= '1817-02-02 18:03:12.184201' and birthday <= '2017-02-02 18:03:12.184290' or birthday is null) AND (1=1) AND (city='Brooklyn')>
Expected behavior
It should do the joins in the correct order.
Actual behavior
It joins in the wrong order and throws an error.
System configuration
Rails version: 5.0.1
Ruby version: 2.3.3
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails team are limited, and so we are asking for your help.
If you can still reproduce this error on the 5-1-stable branch or on master, please reply with all of the information you have about it in order to keep the issue open.
Thank you for all your contributions.
Steps to reproduce
When attempting to merge multiple relations together, the last one below incorrectly generates joins that are out of order and throw an error in Postgres. Not sure if this is related to #25806. There seem to be a few open issues that have not been resolved that are similar to this one.
All of the queries except for the last one are successful:
Expected behavior
It should do the joins in the correct order.
Actual behavior
It joins in the wrong order and throws an error.
System configuration
Rails version: 5.0.1
Ruby version: 2.3.3
The text was updated successfully, but these errors were encountered: