Skip to content

Commit

Permalink
issue-1670: initial changes for datetimeoffset sql_variant support
Browse files Browse the repository at this point in the history
  • Loading branch information
tkyc committed Jan 12, 2022
1 parent cd78ffe commit b65190a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/com/microsoft/sqlserver/jdbc/dtv.java
Original file line number Diff line number Diff line change
Expand Up @@ -4082,6 +4082,14 @@ private Object readSqlVariant(int intbaseType, int cbPropsActual, int valueLengt
convertedValue = tdsReader.readDateTime2(expectedValueLength, typeInfo, cal, jdbcType);
break;

case DATETIMEOFFSETN:
jdbcType = JDBCType.DATETIMEOFFSET;
scale = tdsReader.readUnsignedByte();
typeInfo.setScale(scale);
internalVariant.setScale(scale);
convertedValue = tdsReader.readDateTimeOffset(expectedValueLength, typeInfo, jdbcType);
break;

case BIGBINARY: // e.g binary20, binary 512, binary 8000 -> reads as bigbinary
case BIGVARBINARY:
if (cbPropsActual != sqlVariantProbBytes.BIGBINARY.getIntValue()) {
Expand Down

0 comments on commit b65190a

Please sign in to comment.