Skip to content

Commit

Permalink
fixing tagged string parameteres
Browse files Browse the repository at this point in the history
  • Loading branch information
mjaric committed Mar 5, 2018
1 parent ed616fa commit 4bef5e6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/tds_ecto/connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -803,8 +803,7 @@ if Code.ensure_loaded?(Tds) do

defp expr(%Tagged{value: other, type: type}, sources, query)
when type in [:varchar, :nvarchar] do
len = String.length(other)
"CAST(#{expr(other, sources, query)} AS #{column_type(type, [])}(#{len}))"
"CAST(#{expr(other, sources, query)} AS #{column_type(type, [])}(max))"
end

defp expr(%Tagged{value: other, type: type}, sources, query) do
Expand Down

0 comments on commit 4bef5e6

Please sign in to comment.