Skip to content

Make MySQLCursor.callproc & stored_results more consistent #36

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

vtermanis
Copy link

The MySQLCursor.callproc() documentation states:

returns a modified copy of the input sequence

and

Result sets produced by the stored procedure are automatically fetched and stored as MySQLCursorBuffered instances

Currently the following limitations apply:

  1. The return value of callproc() is not necessarily a sequence, e.g. if using a dict or namedtuple cursor. Since procedure/function arguments are always supplied as a sequence it probably makes sense for a sequence (tuple) to always be returned.
  2. Although the documentation states that a MySQLCursorBuffered instance will be used for stored_results(), maybe it would make more sense to use the same cursor type (buffered) as chosen by the user, so they can process stored_results() output in a similar fashion to output from other queries.

This patch tries do addresses the above two issues.

- Choose matching (buffered) cursor for populating stored_results
  (e.g. so get dict result if using dict cursor)
- Always return simple sequence of arguments from callproc, even
  if cursor if of type dict or namedtuple
@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

@vtermanis
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=87188 for updates.
Thanks

@vtermanis vtermanis deleted the callproc_result_args branch December 13, 2017 11:20
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.

2 participants