Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Warning propagation improvements #101

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

Merged
merged 1 commit into from
Jul 28, 2016
Merged

Conversation

vtermanis
Copy link
Contributor

Dear MySQLdb team,

Here are a couple of suggestions regarding warnings issued by the library:

  1. Include error code in warnings, not just string
    I thought it would make sense for the Warning instances to not just have a string argument but, same as with errors, to also include the error code (as first argument, with string being second).
  2. Fix warning propagation for unbuffered queries
    db.warning_count() was called during nextset(). However, for unbuffered queries, the warning count is not available until the whole result has been fetched. By instead calling db.warning_count() later via _warning_check instead (which work as _defer_warnings is set), warnings are always received.

@methane
Copy link
Member

methane commented Jul 26, 2016

lgtm.
Would you add test which checks warning number?

@vtermanis
Copy link
Contributor Author

Sure, should I add it to test_MySQLdb_capabilities.py?

@vtermanis
Copy link
Contributor Author

vtermanis commented Jul 26, 2016

I've added a test - let me know if it's in the wrong place or not quite right in some other way. (Sorry for getting the pull request number wrong in the commit message! Never mind, I squashed & force-pushed.)

@methane methane merged commit 7431683 into PyMySQL:master Jul 28, 2016
@methane
Copy link
Member

methane commented Jul 28, 2016

thanks!

@vtermanis vtermanis deleted the warning_args branch July 28, 2016 13:57
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.