Skip to content

Commit ccca234

Browse files
committed
Replace 'DO SLEEP(0)'. Fixes #1115
This improves compatibility with MariaDB Xpand and SingleStore.
1 parent 65e06ec commit ccca234

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/MySqlConnector/Core/ServerSession.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ public void FinishQuerying()
315315
// KILL QUERY will kill a subsequent query if the command it was intended to cancel has already completed.
316316
// In order to handle this case, we issue a dummy query that will consume the pending cancellation.
317317
// See https://bugs.mysql.com/bug.php?id=45679
318-
Log.Debug("Session{0} sending 'DO SLEEP(0)' command to clear pending cancellation", m_logArguments);
319-
var payload = QueryPayload.Create(SupportsQueryAttributes, "DO SLEEP(0);");
318+
Log.Debug("Session{0} sending 'SLEEP(0)' command to clear pending cancellation", m_logArguments);
319+
var payload = QueryPayload.Create(SupportsQueryAttributes, "SELECT SLEEP(0) INTO @\uE001MySqlConnector\uE001Sleep;");
320320
#pragma warning disable CA2012 // Safe because method completes synchronously
321321
SendAsync(payload, IOBehavior.Synchronous, CancellationToken.None).GetAwaiter().GetResult();
322322
payload = ReceiveReplyAsync(IOBehavior.Synchronous, CancellationToken.None).GetAwaiter().GetResult();

0 commit comments

Comments
 (0)