Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update command.cs #7

Closed
wants to merge 1 commit into from
Closed

Update command.cs #7

wants to merge 1 commit into from

Conversation

dyarkovoy
Copy link

@dyarkovoy dyarkovoy commented Jun 15, 2017

Currently if MySqlCommand was asynchronously executed with a CancellationToken, and that token is cancelled After the command is disposed, the MySqlCommand.Cancel() throws NullReferenceException because at that point command's connection is null. This is OK for release builds because the exception would be caught by System.Data.Common.DbCommand's internal logic, but it is very annoying to see these exceptions when debugging. Additionally, it ads extra unnecessary overhead of throwing/catching an exception. The fix is simply to check whether connection is null before calling CancelQuery.

Currently if MySqlCommand was asynchronously executed with a CancellationToken, and that token is cancelled After the command is disposed, the MySqlCommand throws NullReferenceException because at that point command's connection is null. This is OK for release builds because the exception would be caught by System.Data.Common.DbCommand's internal logic, but it is very annoying to see these exceptions when debugging. Additionally, it ads extra unnecessary overhead of throwing/catching an exception. The fix is simply to check whether connection is null before calling CancelQuery.
@mysql-oca-bot
Copy link

Hi, thank you for submitting this pull request. In order to consider your code we need you to sign the Oracle Contribution Agreement (OCA). Please review the details and follow the instructions at http://www.oracle.com/technetwork/community/oca-486395.html
Please make sure to include your MySQL bug system user (email) in the returned form.
Thanks

@dyarkovoy
Copy link
Author

dyarkovoy commented Jun 15, 2017 via email

@mysql-oca-bot
Copy link

Hi, thank you for your contribution. Please confirm this code is submitted under the terms of the OCA (Oracle's Contribution Agreement) you have previously signed by cutting and pasting the following text as a comment:
"I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it."
Thanks

@dyarkovoy
Copy link
Author

I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

@mysql-oca-bot
Copy link

Hi, thank you for your contribution. Your code has been assigned to an internal queue. Please follow
bug http://bugs.mysql.com/bug.php?id=86836 for updates.
Thanks

@lefred
Copy link

lefred commented Oct 20, 2020

Thank you for your contribution that has been added to 8.0.22: https://lefred.be/content/mysql-8-0-22-thank-you-for-the-contributions/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants