elixir-ecto / ecto_sql

SQL-based adapters for Ecto and database migrations
https://hexdocs.pm/ecto_sql
Apache License 2.0
578 stars 312 forks source link

Use proper range increment for values list #641

Closed greg-rychlewski closed 1 month ago

greg-rychlewski commented 1 month ago

Re-reading the SQL generated in the error report for empty values list I noticed it produces 2 empty values:

SELECT TRUE FROM "users" AS u0 INNER JOIN (VALUES (),()) AS v1 () ON u0."id" = v1."id" LIMIT 1

So just adjusting the range increment to be right. We might no have to care about it but just in case we make more changes to empty list behaviour in the future I want to avoid getting bit by this.

greg-rychlewski commented 1 month ago

rate limit =(. i will re-run later

josevalim commented 1 month ago

This syntax will require a more recent Elixir version, but we can use https://www.erlang.org/docs/23/man/lists#seq-3 meanwhile.

greg-rychlewski commented 1 month ago

thank you :)

greg-rychlewski commented 1 month ago

@josevalim is it alright if I merge this one?