Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

handle parameters for encoding 'parse'

  • Loading branch information...
commit d1b9e28da75ee2e2d7d81cdc3d37b0623d31b7a9 1 parent 009d537
@nniclausse nniclausse authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/lib/pgsql_proto.erl
View
6 src/lib/pgsql_proto.erl
@@ -566,10 +566,12 @@ encode_message(describe, {Object, Name}) ->
encode($D, <<ObjectP:8/integer, NameP/binary>>);
encode_message(flush, _) ->
encode($H, <<>>);
-encode_message(parse, {Name, Query, _Oids}) ->
+encode_message(parse, {Name, Query, Oids}) ->
StringName = string(Name),
StringQuery = string(Query),
- encode($P, <<StringName/binary, StringQuery/binary, 0:16/integer>>);
+ NOids=length(Oids),
+ OidsBin=lists:foldl(fun(X,Acc)-> << Acc/binary ,X:32/integer>> end, << >>, Oids),
+ encode($P, <<StringName/binary, StringQuery/binary, NOids:16/integer,OidsBin/binary>>);
encode_message(bind, Bind={NamePortal, NamePrepared,
Parameters, ParamsFormats,ResultFormats}) ->
%%io:format("encode bind: ~p~n", [Bind]),
Please sign in to comment.
Something went wrong with that request. Please try again.