Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dear mysql connector team,
Here are some improvements to the way warnings work in the library, for your consideration, as well as a couple of
close()
-handling ones. (Apologies for that not being a separate commit due to time constraints.)get_warnings
is set(
raise_on_warnings
behaves the same as before)This I think might be useful since warnings are immediately visible, especially during development.
Given (1) I think this makes sense
errors.Warning
subclassesWarning
Prerequisite for (1)
4.
errors.get\_mysql\_exception
can now return warnings where appropriatePrerequisite for (1)
Prerequisite for (1)
cursor[_cext].close()
If one e.g. calls
cursor.execute(...)
(unbuffered) and during looping over the result set an sql-unrelated exception occurs, duringcursor.close()
(e.g. viafinally
clause) the original exception will be override by the "unread result" one. I think it might make more sense to silence this exception when closing the cursor.connection.close()
does not leak socket ifcmd_quit
fails2nd statement in try-except closes socket, but might not be reached if
cmd_quit
fails first. Have each in their own try-except instead.