mvgijssel / arel_toolkit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix reordering of statements inside FROM statement

mvgijssel opened this issue · comments

The following spec fails

visit 'select', '1 FROM "b", (SELECT 1) "a", "c"', pg_node: 'PgQuery::RANGE_VAR'

with the following error from RSpec

      expected: "SELECT 1 FROM \"b\", (SELECT 1) \"a\", \"c\""
           got: "SELECT 1 FROM \"b\", \"c\" (SELECT 1) \"a\""

For some reason the subquery inside of the FROM moves to the back.