Skip to content

Commit

Permalink
Added no-op for getters/setters
Browse files Browse the repository at this point in the history
  • Loading branch information
tkyc committed Aug 21, 2024
1 parent 186531c commit b51d09b
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
xAzureSQLDW - - - - For tests not compatible with Azure Data Warehouse -
xAzureSQLMI - - - - For tests not compatible with Azure SQL Managed Instance
NTLM - - - - - - - For tests using NTLM Authentication mode (excluded by default)
kerberos - - - - - For tests using Kerberos authentication (excluded by default)
kerberos - - - - - For tests using Kerberos authentication (excluded by default)
reqExternalSetup - For tests requiring external setup (excluded by default)
clientCertAuth - - For tests requiring client certificate authentication
setup (excluded by default) - - - - - - - - - - - - - - - - - - - - - - -
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -4884,7 +4884,6 @@ void writeRPCStringUnicode(String sName, String sValue, boolean bOut,
if (nValueLen > DataTypes.SHORT_VARTYPE_MAX_BYTES || bOut) {
writeRPCNameValType(sName, bOut, TDSType.NVARCHAR);

// Handle Yukon v*max type header here.
writeVMaxHeader(nValueLen, // Length
bValueNull, // Is null?
collation);
Expand Down Expand Up @@ -5482,7 +5481,6 @@ void writeTVPColumnMetaData(TVP value) throws SQLServerException {
// Use PLP encoding on Yukon and later with long values
if (!isShortValue) // PLP
{
// Handle Yukon v*max type header here.
writeShort((short) 0xFFFF);
con.getDatabaseCollation().writeCollation(this);
} else // non PLP
Expand All @@ -5500,7 +5498,6 @@ void writeTVPColumnMetaData(TVP value) throws SQLServerException {
isShortValue = pair.getValue().precision <= DataTypes.SHORT_VARTYPE_MAX_BYTES;
// Use PLP encoding on Yukon and later with long values
if (!isShortValue) // PLP
// Handle Yukon v*max type header here.
writeShort((short) 0xFFFF);
else // non PLP
writeShort((short) DataTypes.SHORT_VARTYPE_MAX_BYTES);
Expand Down Expand Up @@ -5683,7 +5680,6 @@ void writeRPCByteArray(String sName, byte[] bValue, boolean bOut, JDBCType jdbcT
writeRPCNameValType(sName, bOut, tdsType);

if (usePLP) {
// Handle Yukon v*max type header here.
writeVMaxHeader(nValueLen, bValueNull, collation);

// Send the data.
Expand Down Expand Up @@ -6464,7 +6460,6 @@ void writeRPCInputStream(String sName, InputStream stream, long streamLength, bo

writeRPCNameValType(sName, bOut, jdbcType.isTextual() ? TDSType.BIGVARCHAR : TDSType.BIGVARBINARY);

// Handle Yukon v*max type header here.
writeVMaxHeader(streamLength, false, jdbcType.isTextual() ? collation : null);
}

Expand Down Expand Up @@ -6604,7 +6599,6 @@ void writeRPCReaderUnicode(String sName, Reader re, long reLength, boolean bOut,

writeRPCNameValType(sName, bOut, TDSType.NVARCHAR);

// Handle Yukon v*max type header here.
writeVMaxHeader(
(DataTypes.UNKNOWN_STREAM_LENGTH == reLength) ? DataTypes.UNKNOWN_STREAM_LENGTH : 2 * reLength, // Length
// (in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1346,4 +1346,27 @@ public interface ISQLServerDataSource extends javax.sql.CommonDataSource {
* @return cacheBulkCopyMetadata boolean value
*/
boolean getcacheBulkCopyMetadata();

/**
* useFlexibleCallableStatements is temporarily removed. This is meant as a no-op.
*
* Sets whether or not sp_sproc_columns will be used for parameter name lookup.
*
* @param useFlexibleCallableStatements
* When set to false, sp_sproc_columns is not used for parameter name lookup
* in callable statements. This eliminates a round trip to the server but imposes limitations
* on how parameters are set. When set to false, applications must either reference
* parameters by name or by index, not both. Parameters must also be set in the same
* order as the stored procedure definition.
*/
void setUseFlexibleCallableStatements(boolean useFlexibleCallableStatements);

/**
* useFlexibleCallableStatements is temporarily removed. This is meant as a no-op.
*
* Returns whether or not sp_sproc_columns is being used for parameter name lookup.
*
* @return useFlexibleCallableStatements
*/
boolean getUseFlexibleCallableStatements();
}
Original file line number Diff line number Diff line change
Expand Up @@ -8113,6 +8113,31 @@ public void setAccessTokenCallbackClass(String accessTokenCallbackClass) {
this.accessTokenCallbackClass = accessTokenCallbackClass;
}

/**
* useFlexibleCallableStatements is temporarily removed. This is meant as a no-op.
*
* Returns whether or not sp_sproc_columns is being used for parameter name lookup.
*
* @return useFlexibleCallableStatements
*/
public boolean getUseFlexibleCallableStatements() {
return true;

Check warning on line 8124 in src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java#L8124

Added line #L8124 was not covered by tests
}

/**
* useFlexibleCallableStatements is temporarily removed. This is meant as a no-op.
*
* Sets whether or not sp_sproc_columns will be used for parameter name lookup.
*
* @param useFlexibleCallableStatements
* When set to false, sp_sproc_columns is not used for parameter name lookup
* in callable statements. This eliminates a round trip to the server but imposes limitations
* on how parameters are set. When set to false, applications must either reference
* parameters by name or by index, not both. Parameters must also be set in the same
* order as the stored procedure definition.
*/
public void setUseFlexibleCallableStatements(boolean useFlexibleCallableStatements) {}

Check warning on line 8139 in src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java#L8139

Added line #L8139 was not covered by tests

/**
* Cleans up discarded prepared statement handles on the server using batched un-prepare actions if the batching
* threshold has been reached.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,23 @@ public int getMsiTokenCacheTtl() {
return 0;
}

/**
* useFlexibleCallableStatements is temporarily removed.
* This method is a no-op for backwards compatibility only.
*/
@Override
public void setUseFlexibleCallableStatements(boolean enable) {}

Check warning on line 1303 in src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataSource.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataSource.java#L1303

Added line #L1303 was not covered by tests


/**
* useFlexibleCallableStatements is temporarily removed.
* This method is a no-op for backwards compatibility only.
*/
@Override
public boolean getUseFlexibleCallableStatements() {
return true;

Check warning on line 1312 in src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataSource.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDataSource.java#L1312

Added line #L1312 was not covered by tests
}

/**
* Sets the {@link SQLServerAccessTokenCallback} delegate.
*
Expand Down

0 comments on commit b51d09b

Please sign in to comment.