Skip to content

Commit 0310ad2

Browse files
committed
Handle empty password with caching_sha2_password.
1 parent 85025c9 commit 0310ad2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/MySqlConnector/Core/ServerSession.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,10 @@ private async Task<PayloadData> SwitchAuthenticationAsync(ConnectionSettings cs,
390390
await SendReplyAsync(payload, ioBehavior, cancellationToken).ConfigureAwait(false);
391391
payload = await ReceiveReplyAsync(ioBehavior, cancellationToken).ConfigureAwait(false);
392392

393+
// OK payload can be sent immediately (e.g., if password is empty( (short-circuiting the )
394+
if (OkPayload.IsOk(payload, SupportsDeprecateEof))
395+
return payload;
396+
393397
var cachingSha2ServerResponsePayload = CachingSha2ServerResponsePayload.Create(payload);
394398
if (cachingSha2ServerResponsePayload.Succeeded)
395399
return await ReceiveReplyAsync(ioBehavior, cancellationToken).ConfigureAwait(false);

0 commit comments

Comments
 (0)