Browse Source

workaround for missing columns in equery result

Anton Lebedevich 13 years ago
parent
commit
e4188e588e
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/pgsql_sock.erl

+ 8 - 0
src/pgsql_sock.erl

@@ -345,6 +345,14 @@ on_message({$n, <<>>}, State) ->
 
 %% BindComplete
 on_message({$2, <<>>}, State) ->
+    #state{queue = Q} = State,
+    %% TODO remove this workaround, send Describe on handle_cast(equery)
+    case queue:get(Q) of
+        {_, {equery, #statement{columns = C}, _}} ->
+            notify(State, {columns, C});
+        _ ->
+            ok
+    end,
     {noreply, State};
 
 %% CloseComplete