diff --git a/lib/myxql/client.ex b/lib/myxql/client.ex index ad9411a..d9cb773 100644 --- a/lib/myxql/client.ex +++ b/lib/myxql/client.ex @@ -298,7 +298,7 @@ defmodule MyXQL.Client do buffer? = Keyword.has_key?(socket_options, :buffer) client = %__MODULE__{connection_id: nil, sock: nil} - case :gen_tcp.connect(address, port, @sock_opts ++ socket_options, connect_timeout) do + case :gen_tcp.connect(address, port, socket_options ++ @sock_opts, connect_timeout) do {:ok, sock} when buffer? -> {:ok, %{client | sock: {:gen_tcp, sock}}} diff --git a/test/myxql_test.exs b/test/myxql_test.exs index 0a8ec09..a48b4ed 100644 --- a/test/myxql_test.exs +++ b/test/myxql_test.exs @@ -164,9 +164,7 @@ defmodule MyXQLTest do test "#{@protocol}: query with multiple rows", c do %MyXQL.Result{num_rows: 2} = - MyXQL.query!(c.conn, "INSERT INTO integers VALUES (10), (20)", [], - query_type: @protocol - ) + MyXQL.query!(c.conn, "INSERT INTO integers VALUES (10), (20)", [], query_type: @protocol) assert {:ok, %MyXQL.Result{columns: ["x"], rows: [[10], [20]]}} = MyXQL.query(c.conn, "SELECT * FROM integers") @@ -178,9 +176,7 @@ defmodule MyXQLTest do values = Enum.map_join(1..num, ", ", &"(#{&1})") result = - MyXQL.query!(c.conn, "INSERT INTO integers VALUES " <> values, [], - query_type: @protocol - ) + MyXQL.query!(c.conn, "INSERT INTO integers VALUES " <> values, [], query_type: @protocol) assert result.num_rows == num