Skip to content
/ server Public

MDEV-38853 Guard VALIDITY_ASSERT in Json_writer for NDEBUG builds#4688

Open
alexDiaconuAlex wants to merge 1 commit intoMariaDB:10.6from
alexDiaconuAlex:MDEV-38853-json-writer-ndebug
Open

MDEV-38853 Guard VALIDITY_ASSERT in Json_writer for NDEBUG builds#4688
alexDiaconuAlex wants to merge 1 commit intoMariaDB:10.6from
alexDiaconuAlex:MDEV-38853-json-writer-ndebug

Conversation

@alexDiaconuAlex
Copy link

This fixes a release/NDEBUG build failure caused by unguarded VALIDITY_ASSERT usage
in Json_writer::add_unquoted_str() and Json_writer::add_str().

The VALIDITY_ASSERT blocks are now compiled only for debug builds or when
JSON_WRITER_UNIT_TEST is enabled, matching the availability of the referenced symbols.

JIRA: MDEV-38853

@CLAassistant
Copy link

CLAassistant commented Feb 23, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
3 out of 7 committers have signed the CLA.

✅ dbart
✅ hadeer-r
✅ alexDiaconuAlex
❌ Alexey Botchkov
❌ mariadb-poojalamba
❌ Thirunarayanan
❌ dr-m


Alexey Botchkov seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@grooverdan
Copy link
Member

@alexDiaconuAlex , you appear to have taken @BjarneDMat's patches from JIRA and submitted them as your own without even an attribution to the author. Can you please credit the author git commit --author 'Bjarne D Mathiesen <email>' --amend or as a part of the commit message attribute the author.

10.6 is the earliest maintained version. Can you:

  • Fix attribution
  • Rebase commit to 10.6 branch
  • force push to your github branch
  • edit this PR near the title and change the target branch to 10.6

I note there's a collation of patches. If there are greater version numbers with an addition change compared to the 10.6 branch, create a PR for just that change against the right main MariaDB version.

@gkodinov gkodinov added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label Feb 24, 2026
Copy link
Member

@gkodinov gkodinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution. This is a preliminary review.
The diff looks correct to me. As unfortunate that such #ifdefs are needed as it is.
Please (as Daniel suggests) re-base to 10.6 and also update the commit message to conform to CODING_GUIDELINES.md.

Then continue working with Daniel on the review.

Please also mention how exactly are you building the server in jira so it's documented.

Guard VALIDITY_ASSERT in Json_writer::add_unquoted_str() and
Json_writer::add_str() with !defined(NDEBUG) || defined(JSON_WRITER_UNIT_TEST)
to avoid references to debug-only symbols in release builds.

Patch by Bjarne D Mathiesen (from JIRA / MacPorts PR28680).
@alexDiaconuAlex alexDiaconuAlex force-pushed the MDEV-38853-json-writer-ndebug branch from 92eb020 to 455b1ff Compare February 24, 2026 12:46
@alexDiaconuAlex alexDiaconuAlex changed the base branch from main to 10.6 February 24, 2026 13:34
@alexDiaconuAlex
Copy link
Author

alexDiaconuAlex commented Feb 24, 2026

Thanks for the review! I've amended the commit message with proper attribution,
rebased the fix onto 10.6, force-pushed the branch, and retargeted the PR to 10.6.
Build steps were added to MDEV-38853.

I've also added the build steps to MDEV-38853 and documented the build method in jira.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements.

Development

Successfully merging this pull request may close these issues.

4 participants