ErrorHandler - Present more error info about MySQL connections #224
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.
Overview
Present more error info about MySQL connections. This may be most useful if you're debugging a failure
in MySQL-SSL.
Technical Details
This is a work-around for a quirk in
DB_mysqli::connect()
-- it suppresses warningsgenerated by
mysqli_real_connect()
. But those can be useful!Th work-around depends on your boot mode (Civi-first vs CMS-first).
It applies to Civi-first. For CMS-first, the CMS error-handler is active
at the critical moment -- and it doesn't have such a work-around.
I'm on the fence about merging this. This should be safe enough (very narrow
impact). But it would be cleaner (and probably better) to patch
DB_mysqli::connect()
to simply allow warnings. (Or, failing that, bufferthe warnings -- and let them through if we hit any subsequent problems.)
Addressing that root cause would make it less sensitive to boot-mode.
Of course, warnings have been suppressed for so long... it's hard to know if
we might create some backlash from it...