Skip to content

Commit

Permalink
Fix UUID serialisation
Browse files Browse the repository at this point in the history
  • Loading branch information
Cédric de Launois committed Feb 9, 2024
1 parent 1e89477 commit 41ec399
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -4800,6 +4800,7 @@ void writeRPCUUID(String sName, UUID uuidValue, boolean bOut) throws SQLServerEx

if (uuidValue == null) {
writeByte((byte) 0);
writeByte((byte) 0);

} else {
writeByte((byte) 0x10); // maximum length = 16
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/microsoft/sqlserver/jdbc/dtv.java
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,9 @@ final class SendByRPCOp extends DTVExecuteOp {
void execute(DTV dtv, String strValue) throws SQLServerException {
if (dtv.getJdbcType() == JDBCType.GUID) {
tdsWriter.writeRPCUUID(name, UUID.fromString(strValue), isOutParam);
} else {
tdsWriter.writeRPCStringUnicode(name, strValue, isOutParam, collation, dtv.isNonPLP);
}
tdsWriter.writeRPCStringUnicode(name, strValue, isOutParam, collation, dtv.isNonPLP);
}

void execute(DTV dtv, Clob clobValue) throws SQLServerException {
Expand Down

0 comments on commit 41ec399

Please sign in to comment.