diff --git a/src/main/core-impl/java/com/mysql/cj/ServerPreparedQuery.java b/src/main/core-impl/java/com/mysql/cj/ServerPreparedQuery.java index 29c07db4..fb59a490 100644 --- a/src/main/core-impl/java/com/mysql/cj/ServerPreparedQuery.java +++ b/src/main/core-impl/java/com/mysql/cj/ServerPreparedQuery.java @@ -557,7 +557,7 @@ public class ServerPreparedQuery extends ClientPreparedQuery { if (this.queryBindings != null) { hadLongData = this.queryBindings.clearBindValues(); - this.queryBindings.setLongParameterSwitchDetected(clearServerParameters && hadLongData ? false : true); + this.queryBindings.setLongParameterSwitchDetected(clearServerParameters && hadLongData ? true : false); } if (clearServerParameters && hadLongData) { @@ -576,6 +576,8 @@ public class ServerPreparedQuery extends ClientPreparedQuery { this.session.getProtocol().getServerSession().preserveOldTransactionState(); this.session.clearInputStream(); } + // Nothing to be detected after a reset... + this.queryBindings.setLongParameterSwitchDetected(false); } }