# HG changeset patch
# User Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
# Date 1670585713 -3600
# Node ID ba226d5d3996f85370810adc3fac213bb827b954
# Parent  5d6c577e2f74e9b746cef15e11aabe4fa3ef46c3
Fix file transfers

When the refactored BufferedMCLReader reaches the end of the segment
it keeps returning LineType.PROMPT until it is reset.

Usually this reset is done automatically by the BufferedMCLWriter.

However, in the file tranfer protocol there is a moment
where the server first acknowledges the end of the upload by sending
a segment containing PROMPT3, and then immediately another segment
containing the "&1 bla bla" status message.
Because the client doesn't send anything between these two, the
reader did not get reset.

diff --git a/src/main/java/org/monetdb/jdbc/MonetConnection.java b/src/main/java/org/monetdb/jdbc/MonetConnection.java
--- a/src/main/java/org/monetdb/jdbc/MonetConnection.java
+++ b/src/main/java/org/monetdb/jdbc/MonetConnection.java
@@ -3318,6 +3318,7 @@ public class MonetConnection
 								out.writeLine(error + "\n");
 								error = in.discardRemainder();
 							} else {
+								in.resetLineType();
 								in.advance();
 							}
 							break;