Skip to content

Commit 6248de0

Browse files
committed
Don't dispose command when closing connection.
It's unexpected that disposing MySqlCommand would be a side-effect of CommandBehavior.CloseConnection; the commit that originally introduced this didn't provide a justification for this behaviour.
1 parent 663796b commit 6248de0

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/MySqlConnector/MySql.Data.MySqlClient/MySqlDataReader.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -543,10 +543,7 @@ internal async ValueTask DisposeAsync(IOBehavior ioBehavior, CancellationToken c
543543
connection.FinishQuerying(m_hasWarnings);
544544

545545
if ((m_behavior & CommandBehavior.CloseConnection) != 0)
546-
{
547-
(Command as IDisposable)?.Dispose();
548546
await connection.CloseAsync(ioBehavior).ConfigureAwait(false);
549-
}
550547
Command = null;
551548
}
552549
}

0 commit comments

Comments
 (0)