Skip to content

Commit

Permalink
Fix planned values inspect (#4272)
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-rychlewski authored Aug 27, 2023
1 parent 743ce04 commit 66a14d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ecto/query/inspect.ex
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ defimpl Inspect, for: Ecto.Query do
defp inspect_source(%{source: {nil, schema}}, _names), do: inspect(schema)
defp inspect_source(%{source: {:fragment, _, _} = source} = part, names), do: "#{expr(source, names, part)}"

defp inspect_source(%{source: {:values, _, [types, _]}}, _names) do
defp inspect_source(%{source: {:values, _, [types | _]}}, _names) do
fields = Keyword.keys(types)
"values (#{Enum.join(fields, ", ")})"
end
Expand Down
1 change: 1 addition & 0 deletions test/ecto/query/inspect_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ defmodule Ecto.Query.InspectTest do
test "values lists" do
query = from v in values([%{a: 1, b: 2, c: 3}], %{a: :integer, b: :integer, c: :integer})
assert i(query) == "from v0 in values (a, b, c)"
assert i(plan(query)) == "from v0 in values (a, b, c)"
end

def plan(query) do
Expand Down

0 comments on commit 66a14d4

Please sign in to comment.