Fix Exception when QueryCollector softLimit exceeded #1702
Merged
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.
The other match() case is:
This method always returns an array.
Before this PR the
match()
case would return null when the softLimit had been exceeded, which is the wrong data type used downstream. This resulted in Exception:Background
I discovered this issue while debugging a Laravel application that executed a lot of queries. I saw that the
phpdebugbar-id:
Response header was being omitted on a specific Response that was executing the queries. After some digging I found thesoft_limit
number and increased it to just above my query count. The debug bar then appeared.When tailing the application log I found the Exception:
I used Xdebug to trace where in the library the Exception was thrown, and dove into the code to find the softLimit usage and eventually the type mismatch.
Let me know if you require unit tests for this change, but I didn't see any existing tests for this feature.