File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -589,13 +589,15 @@ defmodule Ecto.Adapters.MyXQL do
589589 ]
590590
591591 # Trap exits in case mysql dies in the middle of execution so that we can surface the error
592- # Process.flag(:trap_exit, true)
592+ old_trap_exit = Process . flag ( :trap_exit , true )
593593 port = Port . open ( { :spawn_executable , abs_cmd } , port_opts )
594594 Port . command ( port , contents )
595595 # Use this as a signal to close the port since we cannot
596596 # send an exit command to mysql in batch mode
597597 Port . command ( port , ";SELECT '__ECTO_EOF__';\n " )
598- collect_output ( port , "" )
598+ result = collect_output ( port , "" )
599+ Process . flag ( :trap_exit , old_trap_exit )
600+ result
599601 end
600602
601603 defp args_env ( opts , opt_args ) do
@@ -659,7 +661,7 @@ defmodule Ecto.Adapters.MyXQL do
659661 { acc , 1 }
660662
661663 { ^ port , { :exit_status , status } } ->
662- collect_output ( port , acc )
664+ { acc , status }
663665 end
664666 end
665667end
You can’t perform that action at this time.
0 commit comments