Driver version
8.2.2.jre11 (older versions are affected, too)
SQL Server version
Microsoft SQL Server 2016 (SP2) (KB4052908) - 13.0.5026.0 (X64) Mar 18 2018 09:11:49 Copyright (c) Microsoft Corporation Express Edition (64-bit) on Windows 10 Pro 10.0 (Build 18363: ) (Hypervisor)
Client Operating System
Windows/Linux
JAVA/JVM version
11.0.6
Table schema
Table will be created by test.
create table TEST2 (KEY1 numeric(19,0) not null, KEY2 numeric(19,0) not null, primary key (KEY1, KEY2))
Problem description
Prepare database with always encrypted feature. Update connection details in ExecuteBatchTest.java and run tests in attached gradle project.
- Expected behaviour:
No column is encrypted, so it does not matter, whether columnEncryptionSetting is enabled or not.
- Actual behaviour:
Only test with connection string containing "columnEncryptionSetting=Enabled" fails.
- Error message/stack trace:
java.lang.AssertionError at com.microsoft.sqlserver.jdbc.TDSCommand.onRequestComplete(IOBuffer.java:7397) at com.microsoft.sqlserver.jdbc.TDSWriter.writePacket(IOBuffer.java:4071) at com.microsoft.sqlserver.jdbc.TDSWriter.endMessage(IOBuffer.java:3185) at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(IOBuffer.java:7556) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatementBatch(SQLServerPreparedStatement.java:2786) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtBatchExecCmd.doExecute(SQLServerPreparedStatement.java:2675) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7194) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2979) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:248) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:223) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeBatch(SQLServerPreparedStatement.java:2076) at ExecuteBatchTest.executeBatch(ExecuteBatchTest.java:65) at ExecuteBatchTest.test(ExecuteBatchTest.java:38)
- Any other details that can be helpful:
Second batch fails.
JDBC trace logs
mssql-jdbc-trace.txt
Reproduction code
mssql-batch-sample.zip
Driver version
8.2.2.jre11 (older versions are affected, too)
SQL Server version
Microsoft SQL Server 2016 (SP2) (KB4052908) - 13.0.5026.0 (X64) Mar 18 2018 09:11:49 Copyright (c) Microsoft Corporation Express Edition (64-bit) on Windows 10 Pro 10.0 (Build 18363: ) (Hypervisor)
Client Operating System
Windows/Linux
JAVA/JVM version
11.0.6
Table schema
Table will be created by test.
create table TEST2 (KEY1 numeric(19,0) not null, KEY2 numeric(19,0) not null, primary key (KEY1, KEY2))Problem description
Prepare database with always encrypted feature. Update connection details in ExecuteBatchTest.java and run tests in attached gradle project.
No column is encrypted, so it does not matter, whether columnEncryptionSetting is enabled or not.
Only test with connection string containing "columnEncryptionSetting=Enabled" fails.
java.lang.AssertionError at com.microsoft.sqlserver.jdbc.TDSCommand.onRequestComplete(IOBuffer.java:7397) at com.microsoft.sqlserver.jdbc.TDSWriter.writePacket(IOBuffer.java:4071) at com.microsoft.sqlserver.jdbc.TDSWriter.endMessage(IOBuffer.java:3185) at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(IOBuffer.java:7556) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatementBatch(SQLServerPreparedStatement.java:2786) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtBatchExecCmd.doExecute(SQLServerPreparedStatement.java:2675) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7194) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2979) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:248) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:223) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeBatch(SQLServerPreparedStatement.java:2076) at ExecuteBatchTest.executeBatch(ExecuteBatchTest.java:65) at ExecuteBatchTest.test(ExecuteBatchTest.java:38)Second batch fails.
JDBC trace logs
mssql-jdbc-trace.txt
Reproduction code
mssql-batch-sample.zip