Skip to content

Commit bb837c3

Browse files
combine sql and exit signal
1 parent 9fbb80d commit bb837c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/ecto/adapters/myxql.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,10 +591,10 @@ defmodule Ecto.Adapters.MyXQL do
591591
# Trap exits in case mysql dies in the middle of execution so that we can surface the error
592592
old_trap_exit = Process.flag(:trap_exit, true)
593593
port = Port.open({:spawn_executable, abs_cmd}, port_opts)
594-
Port.command(port, contents)
595594
# Use this as a signal to close the port since we cannot
596595
# send an exit command to mysql in batch mode
597-
Port.command(port, ";SELECT '__ECTO_EOF__';\n")
596+
exit_signal = ";SELECT '__ECTO_EOF__';\n"
597+
Port.command(port, [contents, exit_signal])
598598
result = collect_output(port, "")
599599
Process.flag(:trap_exit, old_trap_exit)
600600
result

0 commit comments

Comments
 (0)