Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2579,11 +2579,11 @@ private void writeSqlVariant(TDSWriter tdsWriter, Object colValue, ResultSet sou
break;

case TIMEN:
bulkScale = variantType.getScale();
int timeBulkScale = variantType.getScale();
int timeHeaderLength = 0x08; // default
if (2 >= bulkScale) {
if (2 >= timeBulkScale) {
timeHeaderLength = 0x06;
} else if (4 >= bulkScale) {
} else if (4 >= timeBulkScale) {
timeHeaderLength = 0x07;
} else {
timeHeaderLength = 0x08;
Expand All @@ -2595,8 +2595,8 @@ private void writeSqlVariant(TDSWriter tdsWriter, Object colValue, ResultSet sou
// header
// length
// defers
tdsWriter.writeByte((byte) bulkScale);
tdsWriter.writeTime((java.sql.Timestamp) colValue, bulkScale);
tdsWriter.writeByte((byte) timeBulkScale);
tdsWriter.writeTime((java.sql.Timestamp) colValue, timeBulkScale);
break;

case DATETIME8:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ public void setUseBulkCopyForBatchInsert(boolean useBulkCopyForBatchInsert) {
private boolean sendTimeAsDatetime = SQLServerDriverBooleanProperty.SEND_TIME_AS_DATETIME.getDefaultValue();

@Override
public synchronized final boolean getSendTimeAsDatetime() {
public final boolean getSendTimeAsDatetime() {
return !isKatmaiOrLater() || sendTimeAsDatetime;
}

Expand Down Expand Up @@ -3132,7 +3132,7 @@ public void abort(Executor executor) throws SQLException {

setState(State.Closed);

if (null != tdsChannel)
if (null != tdsChannel && null != executor)
executor.execute(() -> tdsChannel.close());

loggerExternal.exiting(getClassNameLogging(), "abort");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ public java.util.UUID getClientConnectionId() throws SQLServerException {
}

@Override
public synchronized void setSendTimeAsDatetime(boolean sendTimeAsDateTimeValue) throws SQLServerException {
public void setSendTimeAsDatetime(boolean sendTimeAsDateTimeValue) throws SQLServerException {
checkClosed();
wrappedConnection.setSendTimeAsDatetime(sendTimeAsDateTimeValue);
}
Expand Down