Skip to content

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

Closed
wants to merge 3 commits into from
Closed

Conversation

brucefeng10
Copy link

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.

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.
@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

@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

@paulkned
Copy link

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.

@@ -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)

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...

Copy link
Author

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.

@erikkemperman
Copy link

@brucefeng10 Thanks for this, seems to work (see @paulkned's remark above). It looks like you need to sign some Oracle document though?

@mysql-admin
Copy link

Thanks for the contribution.
@brucefeng10 , In order to be able to process it You need to sign the OCA (as indicated above).
Reopening the pull request so the OCA can be opened (and fixed if needed)
Thanks
==Omer

@mysql-admin mysql-admin reopened this Nov 25, 2019
@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

@brucefeng10
Copy link
Author

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

Hello, I have signed the OCA and email it via my "brucefeng10@gmail.com" to your "oracle-ca_us@oracle.com" on Oct 28.
Didn't you receive it?

--

@mysql-admin
Copy link

@brucefeng10 : We are looking into it

Thanks
==Omer

@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

@brucefeng10
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=97830 for updates.
Thanks

@philip
Copy link

philip commented Jan 17, 2020

Note: the development team committed the patch and it's tagged for the upcoming 8.0.20 release.

Also, thanks for improving MySQL :)

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.

6 participants