Browse Source

Fixes typo: Set active once after executing prepared statement

Viktor Söderqvist 9 years ago
parent
commit
7e5142f9bd
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/mysql.erl

+ 3 - 2
src/mysql.erl

@@ -1,5 +1,6 @@
 %% MySQL/OTP – MySQL client library for Erlang/OTP
-%% Copyright (C) 2014 Viktor Söderqvist
+%% Copyright (C) 2014-2015 Viktor Söderqvist,
+%%               2016 Johan Lövdahl
 %%
 %% This file is part of MySQL/OTP.
 %%
@@ -803,7 +804,7 @@ execute_stmt(Stmt, Args, Timeout, State = #state{socket = Socket}) ->
         QueryResult ->
             QueryResult
     end,
-    inet:setopts(Socket, [{active, false}]),
+    inet:setopts(Socket, [{active, once}]),
     State1 = lists:foldl(fun update_state/2, State, Recs),
     State1#state.warning_count > 0 andalso State1#state.log_warnings
         andalso log_warnings(State1, Stmt#prepared.orig_query),