diff --git a/lib/ecto/adapters/myxql/connection.ex b/lib/ecto/adapters/myxql/connection.ex index 386b5af7..2886339f 100644 --- a/lib/ecto/adapters/myxql/connection.ex +++ b/lib/ecto/adapters/myxql/connection.ex @@ -770,14 +770,6 @@ if Code.ensure_loaded?(MyXQL) do quote_name(literal) end - defp expr({:constant, _, [literal]}, _sources, _query) when is_binary(literal) do - [?', escape_string(literal), ?'] - end - - defp expr({:constant, _, [literal]}, _sources, _query) when is_number(literal) do - [to_string(literal)] - end - defp expr({:splice, _, [{:^, _, [_, length]}]}, _sources, _query) do Enum.intersperse(List.duplicate(??, length), ?,) end diff --git a/lib/ecto/adapters/postgres/connection.ex b/lib/ecto/adapters/postgres/connection.ex index 7de5bb1f..691dd46f 100644 --- a/lib/ecto/adapters/postgres/connection.ex +++ b/lib/ecto/adapters/postgres/connection.ex @@ -995,14 +995,6 @@ if Code.ensure_loaded?(Postgrex) do quote_name(literal) end - defp expr({:constant, _, [literal]}, _sources, _query) when is_binary(literal) do - [?', escape_string(literal), ?'] - end - - defp expr({:constant, _, [literal]}, _sources, _query) when is_number(literal) do - [to_string(literal)] - end - defp expr({:splice, _, [{:^, _, [idx, length]}]}, _sources, _query) do Enum.map_join(1..length, ",", &"$#{idx + &1}") end diff --git a/lib/ecto/adapters/tds/connection.ex b/lib/ecto/adapters/tds/connection.ex index d2e18902..aa4b633d 100644 --- a/lib/ecto/adapters/tds/connection.ex +++ b/lib/ecto/adapters/tds/connection.ex @@ -830,14 +830,6 @@ if Code.ensure_loaded?(Tds) do quote_name(literal) end - defp expr({:constant, _, [literal]}, _sources, _query) when is_binary(literal) do - [?', escape_string(literal), ?'] - end - - defp expr({:constant, _, [literal]}, _sources, _query) when is_number(literal) do - [to_string(literal)] - end - defp expr({:splice, _, [{:^, _, [idx, length]}]}, _sources, _query) do list_param_to_args(idx, length) end diff --git a/mix.lock b/mix.lock index 270dcdd1..00394279 100644 --- a/mix.lock +++ b/mix.lock @@ -6,7 +6,7 @@ "decimal": {:hex, :decimal, "2.3.0", "3ad6255aa77b4a3c4f818171b12d237500e63525c2fd056699967a3e7ea20f62", [:mix], [], "hexpm", "a4d66355cb29cb47c3cf30e71329e58361cfcb37c34235ef3bf1d7bf3773aeac"}, "deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"}, "earmark_parser": {:hex, :earmark_parser, "1.4.44", "f20830dd6b5c77afe2b063777ddbbff09f9759396500cdbe7523efd58d7a339c", [:mix], [], "hexpm", "4778ac752b4701a5599215f7030989c989ffdc4f6df457c5f36938cc2d2a2750"}, - "ecto": {:git, "https://github.com/elixir-ecto/ecto.git", "3ab6a20b255fe2cee1fd9f6ae160c6fde772dce7", [branch: "master"]}, + "ecto": {:git, "https://github.com/elixir-ecto/ecto.git", "7224c12734f1a2ad4b87ba769db87dbc80be3468", [branch: "master"]}, "ex_doc": {:hex, :ex_doc, "0.39.1", "e19d356a1ba1e8f8cfc79ce1c3f83884b6abfcb79329d435d4bbb3e97ccc286e", [:mix], [{:earmark_parser, "~> 1.4.44", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "8abf0ed3e3ca87c0847dfc4168ceab5bedfe881692f1b7c45f4a11b232806865"}, "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, "makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"}, diff --git a/test/ecto/adapters/tds_test.exs b/test/ecto/adapters/tds_test.exs index 0c45630f..93413141 100644 --- a/test/ecto/adapters/tds_test.exs +++ b/test/ecto/adapters/tds_test.exs @@ -698,7 +698,7 @@ defmodule Ecto.Adapters.TdsTest do assert all(query) == ~s{SELECT TOP(1) s0.[x] FROM [schema] AS s0} query = Schema |> select(fragment("?", constant(^"let's escape"))) |> plan() - assert all(query) == ~s{SELECT 'let''s escape' FROM [schema] AS s0} + assert all(query) == ~s{SELECT N'let''s escape' FROM [schema] AS s0} query = Schema