Skip to content

Commit

Permalink
Fix Conflict issues with master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
cheenamalhotra committed Jun 30, 2018
1 parent 173b814 commit f8b061f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ public class SQLServerConnection implements ISQLServerConnection, java.io.Serial
private byte[] accessTokenInByte = null;

private SqlFedAuthToken fedAuthToken = null;

private String originalHostNameInCertificate = null;

private String originalHostNameInCertificate = null;

Expand Down Expand Up @@ -410,7 +408,7 @@ private enum State {
ServerPortPlaceHolder getRoutingInfo() {
return routingInfo;
}

// Permission targets
private static final String callAbortPerm = "callAbort";

Expand Down Expand Up @@ -1206,23 +1204,6 @@ Connection connectInternal(Properties propsIn,
activeConnectionProperties = (Properties) propsIn.clone();

pooledConnectionParent = pooledConnection;

String hostNameInCertificate = activeConnectionProperties.
getProperty(SQLServerDriverStringProperty.HOSTNAME_IN_CERTIFICATE.toString());

// hostNameInCertificate property can change when redirection is involved, so maintain this value
// for every instance of SQLServerConnection.
if (null == originalHostNameInCertificate && null != hostNameInCertificate && !hostNameInCertificate.isEmpty()) {
originalHostNameInCertificate = activeConnectionProperties.
getProperty(SQLServerDriverStringProperty.HOSTNAME_IN_CERTIFICATE.toString());
}

if (null != originalHostNameInCertificate && !originalHostNameInCertificate.isEmpty()) {
// if hostNameInCertificate has a legitimate value (and not empty or null),
// reset hostNameInCertificate to the original value every time we connect (or re-connect).
activeConnectionProperties.setProperty(SQLServerDriverStringProperty.HOSTNAME_IN_CERTIFICATE.toString(),
originalHostNameInCertificate);
}

String hostNameInCertificate = activeConnectionProperties.getProperty(SQLServerDriverStringProperty.HOSTNAME_IN_CERTIFICATE.toString());

Expand Down Expand Up @@ -3519,7 +3500,8 @@ private void logon(LogonCommand command) throws SQLServerException {
connectionCommand(sqlStmt, "Change Settings");
}
}
} finally {
}
finally {
if (integratedSecurity) {
if (null != authentication) {
authentication.ReleaseClientContext();
Expand Down Expand Up @@ -3741,6 +3723,7 @@ final void processEnvChange(TDSReader tdsReader) throws SQLServerException {

isRoutedInCurrentAttempt = true;
routingInfo = new ServerPortPlaceHolder(routingServerName, routingPortNumber, null, integratedSecurity);

break;

// Error on unrecognized, unused ENVCHANGES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ private boolean resetPrepStmtHandle(boolean discardCurrentCacheItem) {
prepStmtHandle = 0;
return statementPoolingUsed;
}

/** Flag set to true when statement execution is expected to return the prepared statement handle */
private boolean expectPrepStmtHandle = false;

Expand Down Expand Up @@ -252,6 +252,7 @@ private void closePreparedHandle() {
else {
isExecutedAtLeastOnce = false;
final int handleToClose = prepStmtHandle;

// Handle unprepare actions through statement pooling.
if (resetPrepStmtHandle(false)) {
connection.returnCachedPreparedStatementHandle(cachedPreparedStatementHandle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

@RunWith(JUnitPlatform.class)
public class ISQLServerBulkRecordIssuesTest extends AbstractTest {

static Statement stmt = null;
static PreparedStatement pStmt = null;
static String query;
Expand Down Expand Up @@ -271,6 +272,7 @@ public static void afterAllTests() throws SQLException {
con.close();
}
}

}

class BulkData implements ISQLServerBulkRecord {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,12 @@ private void Repro47239Internal(String mode) throws Exception {
catch (Exception ignored) {
}
}

}
}

private void Repro47239largeInternal(String mode) throws Exception {

assumeTrue("JDBC42".equals(Utils.getConfiguredProperty("JDBC_Version")), TestResource.getResource("R_incompatJDBC"));
// the DBConnection for detecting whether the server is SQL Azure or SQL Server.
con = DriverManager.getConnection(connectionString);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ public void testBatchedUnprepare() throws SQLException {
@Tag("slow")
public void testStatementPooling() throws Exception {
testStatementPoolingInternal("batchInsert");

}

/**
Expand Down

0 comments on commit f8b061f

Please sign in to comment.