Skip to content

Commit 7cb8351

Browse files
author
spicychickensauce
committed
Account for different key order in OTP 25/26
1 parent c5cc3c5 commit 7cb8351

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/ecto/adapters/sqlite3/connection/join_test.exs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,11 @@ defmodule Ecto.Adapters.SQLite3.Connection.JoinTest do
150150
|> select([p, q], {p.id, q.x})
151151
|> plan()
152152

153+
# Key order differs between OTP 25 and 26, so we can't hardcode the column names below
154+
[col1, col2] = Map.keys(types)
155+
153156
assert ~s{SELECT s0."id", v1."x" FROM "schema" AS s0 } <>
154-
~s{INNER JOIN (SELECT column1 AS y, column2 AS x FROM (VALUES ($1::INTEGER,$2::INTEGER),($3::INTEGER,$4::INTEGER))) } <>
157+
~s{INNER JOIN (SELECT column1 AS #{col1}, column2 AS #{col2} FROM (VALUES ($1::INTEGER,$2::INTEGER),($3::INTEGER,$4::INTEGER))) } <>
155158
~s{AS v1 ON (v1."x" = s0."x") AND (v1."y" = s0."y")} ==
156159
all(query)
157160
end

0 commit comments

Comments
 (0)