Skip to content

Commit 7b6f9a3

Browse files
committed
WL#15826, Deprecate autoDeserialize feature.
Change-Id: I0f02187ec1d966d3fac526a53ba768eb1f00aeec
1 parent 381b408 commit 7b6f9a3

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
Version 8.1.0
55

6+
- WL#15826, Deprecate autoDeserialize feature.
7+
68
- Fix for Bug#95039 (Bug#35534640), KeyManagementException: FIPS mode: only SunJSSE TrustManagers may be used.
79

810
- Fix for Bug#110321 (Bug#35167701), Issue in JDBC PreparedStatement on adding NO_BACKSLASH_ESCAPES in sql_mode.

src/main/resources/com/mysql/cj/LocalizedErrorMessages.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ Connection.BadExceptionInterceptor=Unable to load exception interceptor.
154154
Connection.CantDetectLocalConnect=Unable to determine if hostname ''{0}'' is local to this box because of exception, assuming it''s not.
155155
Connection.NoMetadataOnSocketFactory=Configured socket factory does not implement SocketMetadata, can not determine whether server is locally-connected, assuming not"
156156
Connection.LoginTimeout=Connection attempt exceeded defined timeout.
157+
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.
157158

158159
ConnectionGroup.0=Cannot remove host, only one configured host active.
159160
ConnectionGroup.1=Host is not configured: {0}

src/main/user-impl/java/com/mysql/cj/jdbc/ConnectionImpl.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,6 @@ protected ConnectionImpl() {
370370
* if a database access error occurs
371371
*/
372372
public ConnectionImpl(HostInfo hostInfo) throws SQLException {
373-
374373
try {
375374
// Stash away for later, used to clone this connection for Statement.cancel and Statement.setQueryTimeout().
376375
this.origHostInfo = hostInfo;
@@ -382,9 +381,7 @@ public ConnectionImpl(HostInfo hostInfo) throws SQLException {
382381
this.password = hostInfo.getPassword();
383382

384383
this.props = hostInfo.exposeAsProperties();
385-
386384
this.propertySet = new JdbcPropertySetImpl();
387-
388385
this.propertySet.initializeProperties(this.props);
389386

390387
// We need Session ASAP to get access to central driver functionality
@@ -413,31 +410,28 @@ public ConnectionImpl(HostInfo hostInfo) throws SQLException {
413410
if (exceptionInterceptorClasses != null && !"".equals(exceptionInterceptorClasses)) {
414411
this.exceptionInterceptor = new ExceptionInterceptorChain(exceptionInterceptorClasses, this.props, this.session.getLog());
415412
}
416-
417413
if (this.cachePrepStmts.getValue()) {
418414
createPreparedStatementCaches();
419415
}
420-
421416
if (this.propertySet.getBooleanProperty(PropertyKey.cacheCallableStmts).getValue()) {
422417
this.parsedCallableStatementCache = new LRUCache<>(this.propertySet.getIntegerProperty(PropertyKey.callableStmtCacheSize).getValue());
423418
}
424-
425419
if (this.propertySet.getBooleanProperty(PropertyKey.allowMultiQueries).getValue()) {
426420
this.propertySet.getProperty(PropertyKey.cacheResultSetMetadata).setValue(false); // we don't handle this yet
427421
}
428-
429422
if (this.propertySet.getBooleanProperty(PropertyKey.cacheResultSetMetadata).getValue()) {
430423
this.resultSetMetadataCache = new LRUCache<>(this.propertySet.getIntegerProperty(PropertyKey.metadataCacheSize).getValue());
431424
}
432-
433425
if (this.propertySet.getStringProperty(PropertyKey.socksProxyHost).getStringValue() != null) {
434426
this.propertySet.getProperty(PropertyKey.socketFactory).setValue(SocksProxySocketFactory.class.getName());
435427
}
436428

437-
this.dbmd = getMetaData(false, false);
429+
if (this.propertySet.getBooleanProperty(PropertyKey.autoDeserialize.getKeyName()).getValue()) {
430+
this.session.getLog().logWarn(Messages.getString("Connection.WarnAutoDeserialize"));
431+
}
438432

433+
this.dbmd = getMetaData(false, false);
439434
initializeSafeQueryInterceptors();
440-
441435
} catch (CJException e) {
442436
throw SQLExceptionsMapping.translateException(e, getExceptionInterceptor());
443437
}

0 commit comments

Comments
 (0)