File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -588,13 +588,9 @@ defmodule Ecto.Adapters.MyXQL do
588588 args: args
589589 ]
590590
591- # Trap exits in case mysql dies in the middle of execution so that we can surface the error
592- old_trap_exit = Process . flag ( :trap_exit , true )
593591 port = Port . open ( { :spawn_executable , abs_cmd } , port_opts )
594- # Use this as a signal to close the port since we cannot
595- # send an exit command to mysql in batch mode
596- exit_signal = ";SELECT '__ECTO_EOF__';\n "
597- Port . command ( port , [ contents , exit_signal ] )
592+ port ! { self ( ) , { :command , contents } }
593+ port ! { self ( ) , { :command , ";SELECT '__ECTO_EOF__';\n " } }
598594 result = collect_output ( port , "" )
599595 Process . flag ( :trap_exit , old_trap_exit )
600596 result
@@ -657,9 +653,6 @@ defmodule Ecto.Adapters.MyXQL do
657653 collect_output ( port , acc )
658654 end
659655
660- { :EXIT , ^ port , _reason } ->
661- { acc , 1 }
662-
663656 { ^ port , { :exit_status , status } } ->
664657 { acc , status }
665658 end
You can’t perform that action at this time.
0 commit comments