Skip to content

Commit

Permalink
prepare bug fix (#2)
Browse files Browse the repository at this point in the history
Co-authored-by: song <[email protected]>
  • Loading branch information
lastincisor and lastincisor authored Jun 9, 2022
1 parent dd61577 commit 6304705
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/core-impl/java/com/mysql/cj/ServerPreparedQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,19 @@ public void serverPrepare(String sql) throws IOException {
boolean checkEOF = !this.session.getServerSession().isEOFDeprecated();

if (this.parameterCount > 0) {
this.parameterFields = this.session.getProtocol().read(ColumnDefinition.class, new ColumnDefinitionFactory(this.parameterCount, null))
.getFields();
if (checkEOF) { // Skip the following EOF packet.
this.session.getProtocol().skipPacket();
}

this.parameterFields = this.session.getProtocol().read(ColumnDefinition.class, new ColumnDefinitionFactory(this.parameterCount, null))
.getFields();
}

// Read in the result set column information
if (fieldCount > 0) {
this.resultFields = this.session.getProtocol().read(ColumnDefinition.class, new ColumnDefinitionFactory(fieldCount, null));
if (checkEOF) { // Skip the following EOF packet.
this.session.getProtocol().skipPacket();
}
}
}
}
Expand Down

0 comments on commit 6304705

Please sign in to comment.