-
Notifications
You must be signed in to change notification settings - Fork 298
fix CMySQLCursor.fetchmany #54
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
Conversation
Issue: When calling fetchmany iteratively and reaching end of rows in cursor, fetchmany does not updates self. _nextrow if there is no unread_result (only happens when the last batch is not a full batch). Fix: add an additional if/else where the self._nextrow is reset to (None, None) when unread_result is False.
fix CMySQLCursor.fetchmany bug
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 |
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. |
Could this please be reopened. fetchmany() is basically useless without this fix. However this fix also breaks fixone(), removing the change on line 108 mitigates this. |
lib/mysql/connector/cursor_cext.py
Outdated
@@ -105,7 +105,7 @@ def reset(self, free=True): | |||
When free is True (default) the result will be freed. | |||
""" | |||
self._rowcount = -1 | |||
self._nextrow = None | |||
self._nextrow = (None, None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line breaks the fetchone() function. Changing this line doesn't seem to be mandatory though since the fix below still makes fetchmany() work properly...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @paulkned, I didn't consider that self._nextrow is shared with fetchone() function. Line108 is not necessary for a change to fix the fetchmany issue.
@brucefeng10 Thanks for this, seems to work (see @paulkned's remark above). It looks like you need to sign some Oracle document though? |
Thanks for the contribution. |
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 |
Hello, I have signed the OCA and email it via my "brucefeng10@gmail.com" to your "oracle-ca_us@oracle.com" on Oct 28. -- |
@brucefeng10 : We are looking into it Thanks |
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. |
Hi, thank you for your contribution. Your code has been assigned to an internal queue. Please follow |
Note: the development team committed the patch and it's tagged for the upcoming 8.0.20 release. Also, thanks for improving MySQL :) |
Issue: When calling fetchmany iteratively and reaching end of rows in cursor, fetchmany does not updates self. _nextrow if there is no unread_result (only happens when the last batch is not a full batch).
Fix: add an additional if/else where the self._nextrow is reset to (None, None) when unread_result is False.