Skip to content

Implement unread_result setter in CMySQLConnection #50

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

Closed
wants to merge 1 commit into from

Conversation

mcouthon
Copy link

CMySQLConnection inherits from MySQLConnectionAbstract, which implements both the unread_result property and the unread_result setter.

In python, if you inherit a property and a setter from a base class (in this case, MySQLConnectionAbstract), and then override the property, this also overrides the setter. So then when other code tries to use the setter (e.g. here), it fails.

`CMySQLConnection` inherits from `MySQLConnectionAbstract`, which implements both the `unread_result` property _and_ the `unread_result` setter.

In python, if you inherit a property and a setter from a base class (in this case, `MySQLConnectionAbstract`), and then override the property, this _also overrides the setter_.  So then when other code tries to use the setter (e.g. [here](https://github.com/mysql/mysql-connector-python/blob/master/lib/mysql/connector/cursor.py#L835)), it fails.
@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

@polaskj
Copy link

polaskj commented May 6, 2019

+1 on getting this merged in. Ran into the same issue, and resolved with this PR. 👍

@mysql-oca-bot
Copy link

Hi, there was no response to our request to sign an OCA or confirm the code is submitted under the terms of the OCA. As such this request will be closed.
Thanks

@mcouthon
Copy link
Author

Sorry, couldn't be bothered to go through the process just to merge a fix.

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

Successfully merging this pull request may close these issues.

3 participants