Add missing LEX_STRING::str
s for my_snprintf
#3538
Open
+3
−3
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 Jira issue number for this PR is: MDEV-21978Description
This commit backports a fix group from #3360 for 11.5.
These are the only mistakes introduced during 11.5.x.
What problem is the patch trying to solve?
When these members switched from plain
char*
toLEX_CSTRING
, not all usages were converted. Specifically, in this commit are args ofmy_snprintf
derivatives.Because until MDEV-21978 (#3360), automated type checks were unavailable for those functions due to their incompatibility, so these tools didn’t catch them.
If some output changed that is not visible in a test case, what was it looking like before the change and how it's looking with this patch applied?
str
is the initial member ofLEX_CSTRING
(typedef
ofstruct st_mysql_const_lex_string
), so this difference did not cause incompatibility on most platforms with seamless alignments;howëver, my co-mentor notes that Visual Studio reads garbage.
Release Notes
-Wformat
Checks onmy_vsnprintf
and Users #3360 (comment) backports.)How can this PR be tested?
This difference only manifests when
LEX_CSTRING::str
does not align on the0
th index of the overallLEX_CSTRING
.Besides using Visual Studio as noted, another deception to disregard this leniency is to shift the
str
member away from the0
th alignment, such as adding a padding member before it or moving it after memberlength
.Basing the PR against the correct MariaDB version
main
branch.PR quality check