Skip to content

Initialize binlog event scalar members - #732

Open
SeojunKim-pumisj wants to merge 2 commits into
mysql:trunkfrom
SeojunKim-pumisj:fix-706-log-event-initialization
Open

Initialize binlog event scalar members#732
SeojunKim-pumisj wants to merge 2 commits into
mysql:trunkfrom
SeojunKim-pumisj:fix-706-log-event-initialization

Conversation

@SeojunKim-pumisj

@SeojunKim-pumisj SeojunKim-pumisj commented Aug 25, 2026

Copy link
Copy Markdown

What does this change do?

Initializes all scalar members of Log_event_header and the previously omitted scalar members of Rows_event in their construction paths. This keeps malformed-event early returns in a deterministic state and addresses GCC 15 uninitialized-use diagnostics.

Fixes #706.

Why is it needed?

Some parsing constructors can return early for malformed input before every scalar member has been assigned. Later cleanup or diagnostic paths may then observe indeterminate values, and GCC 15 reports potential uninitialized uses. Default initialization makes these objects safe and deterministic on every construction path.

How was it tested?

  • Added/updated MTR tests under mysql-test/
  • scripts/ci/mtr.sh passes locally
  • Ran the relevant full suite (name it): Not run

Added gunit coverage under unittest/gunit/binlogevents/ for:

  • Log_event_header construction defaults
  • deterministic Rows_event state after malformed input causes an early return

Docker validation using GCC 15.3.0 on Debian 13:

  • configured a Debug build with the repository warning policy (-Werror)
  • built event_initialization-t, including binlog_event.cpp and rows_event.cpp
  • ctest --test-dir /build -R '^event_initialization$' --output-on-failure: 1/1 passed
  • compiled sql/log_event.cc with -O2 -Werror=uninitialized -Werror=maybe-uninitialized: passed with no diagnostics

Additional checks:

  • clang-format applied using the repository style
  • git diff --check

MTR was not added because this change does not alter SQL behavior; the constructor gunit and optimized GCC 15 compilation directly exercise the affected initialization and diagnostic paths. A full server build and MTR suite were not run locally.

Contributor checklist

  • Code is formatted (scripts/ci/format.sh)
  • Commits are focused with descriptive messages

AI assistance

  • I did not use AI assistance for this contribution
  • I used AI assistance for this contribution

AI assistance was provided by OpenAI Codex for issue analysis, patch and test generation, Docker-based GCC 15 validation, and diff review. The resulting diff and repository state were inspected, and the checks listed above were run; a full server build and MTR suite have not been completed locally.

Areas touched

Replication, binary logging, binlog event parsing, and binlog event gunit tests.

Run untrusted pull request builds with restricted permissions against
validated revisions, and publish statuses and labels only from trusted
workflows that revalidate the repository, workflow run, PR head, and
ordering.

Replace the custom review client with the pinned OpenAI Codex Action,
bound its input to a validated PR diff, pin third-party actions, and
add dependency maintenance for GitHub Actions.

Retry a failed or empty Codex review once after a delay with a
configurable fallback model while preserving the same read-only
isolation boundary and structured output contract.

Publish structured Codex findings as one commit-bound GitHub review.
Validate each file and right-side line range against the current diff,
keep unanchored findings in the summary, prevent duplicate reviews, and
revalidate both reviewed revisions before posting.

Warm trusted Boost and ccache entries, align the MTR compiler cache
with the GCC build, shard MTR suites across runners, run tests in
parallel  with bounded retries, and retain diagnostics. Safely reset
head-scoped CI state, standardize labels, and remove the obsolete OCA
checkbox.

Require both the OCA Verified label and a current trusted approval
before adding Integrate. Revalidate both conditions around label
publication and remove Integrate if either condition no longer holds.

Temporarily disable parallel-run failures tracked by Bug#39882117 and
restore the required restart and expected output for the
buffer-pool-load MTR.

Change-Id: I7393e75cab3afa172a99237337c26e3974f955fa
@oracle-contributor-agreement

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Aug 25, 2026
Initialize Log_event_header and Rows_event scalar fields in every constructor path. This prevents GCC 15 from diagnosing potentially uninitialized reads in Rows_log_event and also gives malformed-event early returns deterministic state.
@SeojunKim-pumisj
SeojunKim-pumisj force-pushed the fix-706-log-event-initialization branch from 598c159 to 9f0cd25 Compare August 25, 2026 07:36
@github-actions github-actions Bot added Build Passed PR build passed MTR Passed MTR suite passed labels Aug 25, 2026
@SeojunKim-pumisj
SeojunKim-pumisj marked this pull request as ready for review August 29, 2026 14:41
@SeojunKim-pumisj
SeojunKim-pumisj requested a review from a team August 29, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build Passed PR build passed MTR Passed MTR suite passed OCA Required At least one contributor does not have an approved Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compiler warnings in In constructor ‘Log_event::Log_event(...)

2 participants