Skip to content

Commit dbd865c

Browse files
committed
Fix for Bug#30805426, IN CASE OF ISAUTHMETHODSWITCHREQUESTPACKET ,
TOSERVERS > 1 ARE IGNORED.
1 parent 3662650 commit dbd865c

File tree

9 files changed

+268
-419
lines changed

9 files changed

+268
-419
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.0.20
55

6+
- Fix for Bug#30805426, IN CASE OF ISAUTHMETHODSWITCHREQUESTPACKET , TOSERVERS > 1 ARE IGNORED.
7+
68
- Fix for Bug#97714 (30570249), Contribution: Expose elapsed time for query interceptor to avoid hacky thread local implementations.
79
Thanks to Matti Sillanpää and Johnathan Crawford for their contribution.
810

src/main/core-api/java/com/mysql/cj/protocol/AuthenticationPlugin.java

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program is free software; you can redistribute it and/or modify it under
55
* the terms of the GNU General Public License, version 2.0, as published by the
@@ -107,29 +107,14 @@ default void destroy() {
107107
void setAuthenticationParameters(String user, String password);
108108

109109
/**
110-
* Process authentication handshake data from server and optionally
111-
* produce data to be sent back to the server. The driver will keep
112-
* calling this method until either an Exception is thrown
113-
* (authentication failure, please use appropriate SQLStates) or the
114-
* method returns false or driver receives an OK packet from the server
115-
* which indicates that the connection has been already approved.
110+
* Process authentication handshake data from server and optionally produce data to be sent back to the server.
111+
* The driver will keep calling this method on each new server packet arrival until either an Exception is thrown
112+
* (authentication failure, please use appropriate SQLStates) or the number of exchange iterations exceeded max
113+
* limit or an OK packet is sent by server indicating that the connection has been approved.
116114
*
117-
* If, on return from this method, toServer is a non-empty list of
118-
* buffers, then these buffers should be sent to the server in order and
119-
* without any reads in between them. If toServer is an empty list, no
120-
* data should be sent to server.
121-
*
122-
* If method returns true, it means that this plugin does not need any
123-
* more data from the server to conclude the handshake and this method
124-
* should not be called again. (Note that server can send an Auth Method
125-
* Switch request and then another handshake will start, possibly using a
126-
* different plugin.)
127-
*
128-
* If this method returns false, it means that plugin needs more data from
129-
* the server to conclude the handshake. In that case next handshake data
130-
* payload should be read from the server (after possibly writing data
131-
* from toServer as explained above). Then this method should be called
132-
* again with the new data in fromServer parameter.
115+
* If, on return from this method, toServer is a non-empty list of buffers, then these buffers will be sent to
116+
* the server in the same order and without any reads in between them. If toServer is an empty list, no
117+
* data will be sent to server, driver immediately reads the next packet from server.
133118
*
134119
* In case of errors the method should throw Exception.
135120
*
@@ -141,8 +126,7 @@ default void destroy() {
141126
* (the list can be empty, but buffers in the list
142127
* should contain data).
143128
*
144-
* @return False if more data should be read from the server and next call
145-
* to this method made, true otherwise.
129+
* @return return value is ignored.
146130
*/
147131
boolean nextAuthenticationStep(M fromServer, List<M> toServer);
148132
}

src/main/core-api/java/com/mysql/cj/protocol/Protocol.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program is free software; you can redistribute it and/or modify it under
55
* the terms of the GNU General Public License, version 2.0, as published by the
@@ -105,7 +105,7 @@ public interface Protocol<M extends Message> {
105105
*/
106106
void connect(String user, String password, String database);
107107

108-
void negotiateSSLConnection(int packLength);
108+
void negotiateSSLConnection();
109109

110110
void beforeHandshake();
111111

src/main/core-api/java/com/mysql/cj/protocol/ServerSession.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,6 @@ public interface ServerSession {
141141

142142
boolean hasLongColumnInfo();
143143

144-
/**
145-
* Does the server send back extra column info?
146-
*
147-
* @param hasLongColumnInfo
148-
* flag
149-
*/
150-
void setHasLongColumnInfo(boolean hasLongColumnInfo);
151-
152144
Map<String, String> getServerVariables();
153145

154146
String getServerVariable(String name);

0 commit comments

Comments
 (0)