Skip to content

Commit

Permalink
WL#15826, Deprecate autoDeserialize feature.
Browse files Browse the repository at this point in the history
Change-Id: I0f02187ec1d966d3fac526a53ba768eb1f00aeec
  • Loading branch information
fjssilva committed Jun 26, 2023
1 parent 381b408 commit 7b6f9a3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 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 8.1.0

- WL#15826, Deprecate autoDeserialize feature.

- Fix for Bug#95039 (Bug#35534640), KeyManagementException: FIPS mode: only SunJSSE TrustManagers may be used.

- Fix for Bug#110321 (Bug#35167701), Issue in JDBC PreparedStatement on adding NO_BACKSLASH_ESCAPES in sql_mode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ Connection.BadExceptionInterceptor=Unable to load exception interceptor.
Connection.CantDetectLocalConnect=Unable to determine if hostname ''{0}'' is local to this box because of exception, assuming it''s not.
Connection.NoMetadataOnSocketFactory=Configured socket factory does not implement SocketMetadata, can not determine whether server is locally-connected, assuming not"
Connection.LoginTimeout=Connection attempt exceeded defined timeout.
Connection.WarnAutoDeserialize=This connection is using the auto-deserialization feature (''autoDeserialize=true'') which is deprecated and will be removed in a future release of MySQL Connector/J.

ConnectionGroup.0=Cannot remove host, only one configured host active.
ConnectionGroup.1=Host is not configured: {0}
Expand Down
14 changes: 4 additions & 10 deletions src/main/user-impl/java/com/mysql/cj/jdbc/ConnectionImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ protected ConnectionImpl() {
* if a database access error occurs
*/
public ConnectionImpl(HostInfo hostInfo) throws SQLException {

try {
// Stash away for later, used to clone this connection for Statement.cancel and Statement.setQueryTimeout().
this.origHostInfo = hostInfo;
Expand All @@ -382,9 +381,7 @@ public ConnectionImpl(HostInfo hostInfo) throws SQLException {
this.password = hostInfo.getPassword();

this.props = hostInfo.exposeAsProperties();

this.propertySet = new JdbcPropertySetImpl();

this.propertySet.initializeProperties(this.props);

// We need Session ASAP to get access to central driver functionality
Expand Down Expand Up @@ -413,31 +410,28 @@ public ConnectionImpl(HostInfo hostInfo) throws SQLException {
if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses, this.props, this.session.getLog());
}

if (this.cachePrepStmts.getValue()) {
createPreparedStatementCaches();
}

if (this.propertySet.getBooleanProperty(PropertyKey.cacheCallableStmts).getValue()) {
this.parsedCallableStatementCache = new LRUCache<>(this.propertySet.getIntegerProperty(PropertyKey.callableStmtCacheSize).getValue());
}

if (this.propertySet.getBooleanProperty(PropertyKey.allowMultiQueries).getValue()) {
this.propertySet.getProperty(PropertyKey.cacheResultSetMetadata).setValue(false); // we don't handle this yet
}

if (this.propertySet.getBooleanProperty(PropertyKey.cacheResultSetMetadata).getValue()) {
this.resultSetMetadataCache = new LRUCache<>(this.propertySet.getIntegerProperty(PropertyKey.metadataCacheSize).getValue());
}

if (this.propertySet.getStringProperty(PropertyKey.socksProxyHost).getStringValue() != null) {
this.propertySet.getProperty(PropertyKey.socketFactory).setValue(SocksProxySocketFactory.class.getName());
}

this.dbmd = getMetaData(false, false);
if (this.propertySet.getBooleanProperty(PropertyKey.autoDeserialize.getKeyName()).getValue()) {
this.session.getLog().logWarn(Messages.getString("Connection.WarnAutoDeserialize"));
}

this.dbmd = getMetaData(false, false);
initializeSafeQueryInterceptors();

} catch (CJException e) {
throw SQLExceptionsMapping.translateException(e, getExceptionInterceptor());
}
Expand Down

0 comments on commit 7b6f9a3

Please sign in to comment.