Skip to content

Commit

Permalink
WL#16319, Remove deprecated insensitive terminology based methods.
Browse files Browse the repository at this point in the history
Change-Id: Iefd7ebe56b796cb5cf703792b16509c7a06b6c41
  • Loading branch information
fjssilva committed Apr 12, 2024
1 parent cc89dad commit 9901917
Show file tree
Hide file tree
Showing 19 changed files with 12 additions and 1,017 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

Version 9.0.0

- WL#16319, Remove deprecated insensitive terminology based methods.

- WL#16324, Update static MySQL keywords list.

- Fix for Bug#110512 (Bug#35223851), Contribution: Replace synchronized with ReentrantLock.
Expand Down
12 changes: 6 additions & 6 deletions src/main/core-api/java/com/mysql/cj/conf/PropertyKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public enum PropertyKey {
allowMultiQueries("allowMultiQueries", true), //
allowNanAndInf("allowNanAndInf", true), //
allowPublicKeyRetrieval("allowPublicKeyRetrieval", true), //
allowReplicaDownConnections("allowReplicaDownConnections", "allowSlaveDownConnections", true), //
allowSourceDownConnections("allowSourceDownConnections", "allowMasterDownConnections", true), //
allowReplicaDownConnections("allowReplicaDownConnections", true), //
allowSourceDownConnections("allowSourceDownConnections", true), //
allowUrlInLocalInfile("allowUrlInLocalInfile", true), //
alwaysSendSetIsolation("alwaysSendSetIsolation", true), //
authenticationPlugins("authenticationPlugins", true), //
Expand Down Expand Up @@ -137,7 +137,7 @@ public enum PropertyKey {
ldapServerHostname("ldapServerHostname", true), //
loadBalanceAutoCommitStatementRegex("loadBalanceAutoCommitStatementRegex", true), //
loadBalanceAutoCommitStatementThreshold("loadBalanceAutoCommitStatementThreshold", true), //
loadBalanceBlocklistTimeout("loadBalanceBlocklistTimeout", "loadBalanceBlacklistTimeout", true), //
loadBalanceBlocklistTimeout("loadBalanceBlocklistTimeout", true), //
loadBalanceConnectionGroup("loadBalanceConnectionGroup", true), //
loadBalanceExceptionChecker("loadBalanceExceptionChecker", true), //
loadBalanceHostRemovalGracePeriod("loadBalanceHostRemovalGracePeriod", true), //
Expand Down Expand Up @@ -182,11 +182,11 @@ public enum PropertyKey {
profilerEventHandler("profilerEventHandler", true), //
profileSQL("profileSQL", true), //
propertiesTransform("propertiesTransform", true), //
queriesBeforeRetrySource("queriesBeforeRetrySource", "queriesBeforeRetryMaster", true), //
queriesBeforeRetrySource("queriesBeforeRetrySource", true), //
queryInfoCacheFactory("queryInfoCacheFactory", "parseInfoCacheFactory", true), //
queryInterceptors("queryInterceptors", true), //
queryTimeoutKillsConnection("queryTimeoutKillsConnection", true), //
readFromSourceWhenNoReplicas("readFromSourceWhenNoReplicas", "readFromMasterWhenNoSlaves", true), //
readFromSourceWhenNoReplicas("readFromSourceWhenNoReplicas", true), //
readOnlyPropagatesToServer("readOnlyPropagatesToServer", true), //
reconnectAtTxEnd("reconnectAtTxEnd", true), //
replicationConnectionGroup("replicationConnectionGroup", true), //
Expand All @@ -198,7 +198,7 @@ public enum PropertyKey {
rewriteBatchedStatements("rewriteBatchedStatements", true), //
rollbackOnPooledClose("rollbackOnPooledClose", true), //
scrollTolerantForwardOnly("scrollTolerantForwardOnly", true), //
secondsBeforeRetrySource("secondsBeforeRetrySource", "secondsBeforeRetryMaster", true), //
secondsBeforeRetrySource("secondsBeforeRetrySource", true), //
selfDestructOnPingMaxOperations("selfDestructOnPingMaxOperations", true), //
selfDestructOnPingSecondsLifetime("selfDestructOnPingSecondsLifetime", true), //
sendFractionalSeconds("sendFractionalSeconds", true), //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ public class ReplicationConnectionUrl extends ConnectionUrl {

private static final String TYPE_SOURCE = "SOURCE";
private static final String TYPE_REPLICA = "REPLICA";
@Deprecated
private static final String TYPE_SOURCE_DEPRECATED = "MASTER";
@Deprecated
private static final String TYPE_REPLICA_DEPRECATED = "SLAVE";

private List<HostInfo> sourceHosts = new ArrayList<>();
private List<HostInfo> replicaHosts = new ArrayList<>();
Expand All @@ -64,11 +60,9 @@ public ReplicationConnectionUrl(ConnectionUrlParser connStrParser, Properties in
for (HostInfo hi : this.hosts) {
Map<String, String> hostProperties = hi.getHostProperties();
if (hostProperties.containsKey(PropertyKey.TYPE.getKeyName())) {
if (TYPE_SOURCE.equalsIgnoreCase(hostProperties.get(PropertyKey.TYPE.getKeyName()))
|| TYPE_SOURCE_DEPRECATED.equalsIgnoreCase(hostProperties.get(PropertyKey.TYPE.getKeyName()))) {
if (TYPE_SOURCE.equalsIgnoreCase(hostProperties.get(PropertyKey.TYPE.getKeyName()))) {
this.sourceHosts.add(hi);
} else if (TYPE_REPLICA.equalsIgnoreCase(hostProperties.get(PropertyKey.TYPE.getKeyName()))
|| TYPE_REPLICA_DEPRECATED.equalsIgnoreCase(hostProperties.get(PropertyKey.TYPE.getKeyName()))) {
} else if (TYPE_REPLICA.equalsIgnoreCase(hostProperties.get(PropertyKey.TYPE.getKeyName()))) {
this.replicaHosts.add(hi);
} else {
undefinedHosts.add(hi);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ public class ReplicationDnsSrvConnectionUrl extends ConnectionUrl {
private static final int DEFAULT_PORT = HostInfo.NO_PORT;
private static final String TYPE_SOURCE = "SOURCE";
private static final String TYPE_REPLICA = "REPLICA";
@Deprecated
private static final String TYPE_SOURCE_DEPRECATED = "MASTER";
@Deprecated
private static final String TYPE_REPLICA_DEPRECATED = "SLAVE";

private List<HostInfo> sourceHosts = new ArrayList<>();
private List<HostInfo> replicaHosts = new ArrayList<>();
Expand All @@ -68,11 +64,9 @@ public ReplicationDnsSrvConnectionUrl(ConnectionUrlParser connStrParser, Propert
for (HostInfo hi : this.hosts) {
Map<String, String> hostProperties = hi.getHostProperties();
if (hostProperties.containsKey(PropertyKey.TYPE.getKeyName())) {
if (TYPE_SOURCE.equalsIgnoreCase(hostProperties.get(PropertyKey.TYPE.getKeyName()))
|| TYPE_SOURCE_DEPRECATED.equalsIgnoreCase(hostProperties.get(PropertyKey.TYPE.getKeyName()))) {
if (TYPE_SOURCE.equalsIgnoreCase(hostProperties.get(PropertyKey.TYPE.getKeyName()))) {
this.sourceHosts.add(hi);
} else if (TYPE_REPLICA.equalsIgnoreCase(hostProperties.get(PropertyKey.TYPE.getKeyName()))
|| TYPE_REPLICA_DEPRECATED.equalsIgnoreCase(hostProperties.get(PropertyKey.TYPE.getKeyName()))) {
} else if (TYPE_REPLICA.equalsIgnoreCase(hostProperties.get(PropertyKey.TYPE.getKeyName()))) {
this.replicaHosts.add(hi);
} else {
undefinedHosts.add(hi);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public class NativeConstants {
public static final int COM_BINLOG_DUMP = 18;
public static final int COM_TABLE_DUMP = 19;
public static final int COM_CONNECT_OUT = 20;
@Deprecated
public static final int COM_REGISTER_SLAVE = 21;
public static final int COM_STMT_PREPARE = 22;
public static final int COM_STMT_EXECUTE = 23;
Expand Down
23 changes: 0 additions & 23 deletions src/main/user-api/java/com/mysql/cj/jdbc/JdbcConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ public interface JdbcConnection extends java.sql.Connection, MysqlConnection, Tr
*/
void changeUser(String userName, String newPassword) throws SQLException;

@Deprecated
void clearHasTriedMaster();

/**
* Prepares a statement on the client, using client-side emulation
* (irregardless of the configuration property 'useServerPrepStmts')
Expand Down Expand Up @@ -198,15 +195,6 @@ public interface JdbcConnection extends java.sql.Connection, MysqlConnection, Tr
*/
String getStatementComment();

/**
* Has this connection tried to execute a query on the "source"
* server (first host in a multiple host list).
*
* @return true if it has tried
*/
@Deprecated
boolean hasTriedMaster();

/**
* Is this connection currently a participant in an XA transaction?
*
Expand All @@ -232,17 +220,6 @@ public interface JdbcConnection extends java.sql.Connection, MysqlConnection, Tr
*/
boolean isSourceConnection();

/**
* Use {@link #isSourceConnection()} instead.
*
* @return true if it's a source connection
* @deprecated
*/
@Deprecated
default boolean isMasterConnection() {
return isSourceConnection();
}

/**
* Does this connection have the same resource name as the given
* connection (for XA)?
Expand Down
136 changes: 0 additions & 136 deletions src/main/user-api/java/com/mysql/cj/jdbc/ha/ReplicationConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,158 +32,22 @@ public interface ReplicationConnection extends JdbcConnection {

public JdbcConnection getSourceConnection();

/**
* Use {@link #getSourceConnection()} instead.
*
* @return {@link JdbcConnection}
* @deprecated
*/
@Deprecated
default public JdbcConnection getMasterConnection() {
return getSourceConnection();
}

public void promoteReplicaToSource(String host) throws SQLException;

/**
* Use {@link #promoteReplicaToSource(String)} instead.
*
* @param host
* host name
* @throws SQLException
* in case of failure
* @deprecated
*/
@Deprecated
default public void promoteSlaveToMaster(String host) throws SQLException {
promoteReplicaToSource(host);
}

public void removeSourceHost(String host) throws SQLException;

/**
* Use {@link #removeSourceHost(String)} instead.
*
* @param host
* host name
* @throws SQLException
* in case of failure
* @deprecated
*/
@Deprecated
default public void removeMasterHost(String host) throws SQLException {
removeSourceHost(host);
}

public void removeSourceHost(String host, boolean waitUntilNotInUse) throws SQLException;

/**
* Use {@link #removeSourceHost(String, boolean)} instead.
*
* @param host
* host name
* @param waitUntilNotInUse
* remove immediately or wait for it's release
* @throws SQLException
* in case of failure
* @deprecated
*/
@Deprecated
default public void removeMasterHost(String host, boolean waitUntilNotInUse) throws SQLException {
removeSourceHost(host, waitUntilNotInUse);
}

public boolean isHostSource(String host);

/**
* Use {@link #isHostSource(String)} instead.
*
* @param host
* host name
* @return true if it's a source host
* @deprecated
*/
@Deprecated
default public boolean isHostMaster(String host) {
return isHostSource(host);
}

public JdbcConnection getReplicaConnection();

/**
* Use {@link #getReplicaConnection()} instead.
*
* @return {@link JdbcConnection}
* @deprecated
*/
@Deprecated
default public JdbcConnection getSlavesConnection() {
return getReplicaConnection();
}

public void addReplicaHost(String host) throws SQLException;

/**
* Use {@link #addReplicaHost(String)} instead.
*
* @param host
* host name
* @throws SQLException
* in case of failure
* @deprecated
*/
@Deprecated
default public void addSlaveHost(String host) throws SQLException {
addReplicaHost(host);
}

public void removeReplica(String host) throws SQLException;

/**
* Use {@link #removeReplica(String)} instead.
*
* @param host
* host name
* @throws SQLException
* in case of failure
* @deprecated
*/
@Deprecated
default public void removeSlave(String host) throws SQLException {
removeReplica(host);
}

public void removeReplica(String host, boolean closeGently) throws SQLException;

/**
* Use {@link #removeReplica(String, boolean)} instead.
*
* @param host
* host name
* @param closeGently
* mode
* @throws SQLException
* in case of failure
* @deprecated
*/
@Deprecated
default public void removeSlave(String host, boolean closeGently) throws SQLException {
removeReplica(host, closeGently);
}

public boolean isHostReplica(String host);

/**
* Use {@link #isHostReplica(String)} instead.
*
* @param host
* host name
* @return true if it's a replica
* @deprecated
*/
@Deprecated
default public boolean isHostSlave(String host) {
return isHostReplica(host);
}

}
17 changes: 0 additions & 17 deletions src/main/user-impl/java/com/mysql/cj/jdbc/ConnectionImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,6 @@ public static JdbcConnection getInstance(HostInfo hostInfo) throws SQLException

private int origPortToConnectTo;

/*
* For testing failover scenarios
*/
private boolean hasTriedSourceFlag = false;

private List<QueryInterceptor> queryInterceptors;

protected JdbcPropertySet propertySet;
Expand Down Expand Up @@ -620,12 +615,6 @@ public void cleanup(Throwable whyCleanedUp) {
}
}

@Deprecated
@Override
public void clearHasTriedMaster() {
this.hasTriedSourceFlag = false;
}

@Override
public void clearWarnings() throws SQLException {
// firstWarning = null;
Expand Down Expand Up @@ -1299,12 +1288,6 @@ public Properties getProperties() {
return this.props;
}

@Deprecated
@Override
public boolean hasTriedMaster() {
return this.hasTriedSourceFlag;
}

/**
* Sets varying properties that depend on server information. Called once we have connected to the server.
*
Expand Down
12 changes: 0 additions & 12 deletions src/main/user-impl/java/com/mysql/cj/jdbc/ConnectionWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -619,12 +619,6 @@ public void changeUser(String userName, String newPassword) throws SQLException
}
}

@Deprecated
@Override
public void clearHasTriedMaster() {
this.mc.clearHasTriedMaster();
}

@Override
public java.sql.PreparedStatement clientPrepareStatement(String sql) throws SQLException {
try {
Expand Down Expand Up @@ -703,12 +697,6 @@ public String getStatementComment() {
return this.mc.getStatementComment();
}

@Deprecated
@Override
public boolean hasTriedMaster() {
return this.mc.hasTriedMaster();
}

@Override
public boolean lowerCaseTableNames() {
return this.mc.lowerCaseTableNames();
Expand Down
Loading

0 comments on commit 9901917

Please sign in to comment.