-
Notifications
You must be signed in to change notification settings - Fork 62
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
fix(agent): don't skip arguments when calling mysqli::real_connect
#976
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #976 +/- ##
=======================================
Coverage 78.54% 78.54%
=======================================
Files 196 196
Lines 27103 27103
=======================================
Hits 21287 21287
Misses 5816 5816
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Allow connecting to mysqldb via socket.
Test slowsql functionality when mysqldb is accessed via socket.
When one of the arguments in nr_php_mysqli_link_real_connect is null, the entire argument is skipped. This causes a fatal error when attempting to connect to a database through a Unix socket, without specifying a port number. This change ensures all arguments are passed on to real_connect in the correct order, including any nulls.
The correct default for the $flags argument is 0, not null. Passing a null causes a warning.
lavarou
force-pushed
the
fix/mysqli_real_connect
branch
from
October 15, 2024 21:56
e937403
to
e9099ac
Compare
zsistla
reviewed
Oct 15, 2024
Part of the problem is that argc in the function previously only incremented for non-null parameters, so it's throwing the count off when we are using it in if statements. Additionally, for our instrumentation to work, the first three parameters should only be added if they are non-null (note the comment that exists before adding the remaining params). So we need to keep track of the required first three in addition to all other arguments that are being added. We also need the count of the required parameters so that we can properly assess whether we need to do call call mysqli::select_db. We can handle this with an additional param to specify whether a value should be added as an arg if it is set or not set.
kovshenin
reviewed
Oct 16, 2024
kovshenin
reviewed
Oct 16, 2024
* changed is_set to null_ok * removed extra check on flags since we can specify null_ok to false.
ZNeumann
approved these changes
Oct 17, 2024
bduranleau-nr
approved these changes
Oct 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.