Skip to content
/ server Public

MDEV-29804 Fix SHOW BINLOG EVENTS displaying incorrect session variable values#4766

Open
tarunw07 wants to merge 1 commit intoMariaDB:10.11from
tarunw07:MDEV-29804-fix-show-binlog-events
Open

MDEV-29804 Fix SHOW BINLOG EVENTS displaying incorrect session variable values#4766
tarunw07 wants to merge 1 commit intoMariaDB:10.11from
tarunw07:MDEV-29804-fix-show-binlog-events

Conversation

@tarunw07
Copy link

@tarunw07 tarunw07 commented Mar 9, 2026

Problem

Query_log_event::pack_info() was displaying inverted values for
foreign_key_checks and unique_checks in SHOW BINLOG EVENTS.

The flags OPTION_NO_FOREIGN_KEY_CHECKS and OPTION_RELAXED_UNIQUE_CHECKS
are set when these checks are disabled (value=0), but pack_info() was
printing them as =1.

Fix

  • Changed foreign_key_checks=1foreign_key_checks=0 when
    OPTION_NO_FOREIGN_KEY_CHECKS is set
  • Changed unique_checks=1unique_checks=0 when
    OPTION_RELAXED_UNIQUE_CHECKS is set

Open Questions

check_constraint_checks is currently not being displayed in SHOW BINLOG EVENTS output even when set to a non-default value. Should check_constraint_checks also be included in the output, and if so, should that fix be part of this patch?

JIRA

https://jira.mariadb.org/browse/MDEV-29804

@CLAassistant
Copy link

CLAassistant commented Mar 9, 2026

CLA assistant check
All committers have signed the CLA.

@tarunw07 tarunw07 changed the base branch from main to 10.6 March 9, 2026 21:36
@gkodinov gkodinov added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label Mar 10, 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.

Please rebase to 10.11.

set foreign_key_checks= 0, sql_auto_is_null=1, check_constraint_checks=0, unique_checks=0;
create table t (a int, check(a>1), foreign key(a) references x (x)) engine=InnoDB as select 1 as a;

show binlog events;
Copy link
Member

Choose a reason for hiding this comment

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

there is an include file that provides some stability to this. Right now the buildbot tests are failing because of this printing different things depending on how the server is compiled.

Copy link
Author

Choose a reason for hiding this comment

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

Ok I found that input file. I'll modify this test.

@@ -0,0 +1,10 @@
set foreign_key_checks= 0, sql_auto_is_null=1, check_constraint_checks=0, unique_checks=0;
Copy link
Member

Choose a reason for hiding this comment

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

All the files in this suite are prefixed with "binlog_". And there's already a number of binlog_show_binlog_event*.test files in there.
I'd add a suffix saying what's actually tested.

Copy link
Author

Choose a reason for hiding this comment

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

Noted. Fixing this as well.

@tarunw07 tarunw07 force-pushed the MDEV-29804-fix-show-binlog-events branch from d781678 to a5f4c98 Compare March 10, 2026 20:45
@tarunw07 tarunw07 changed the base branch from 10.6 to 10.11 March 10, 2026 20:49
…le values

Query_log_event::pack_info() was displaying inverted values for
foreign_key_checks and unique_checks. The flags
OPTION_NO_FOREIGN_KEY_CHECKS and OPTION_RELAXED_UNIQUE_CHECKS are set
when these checks are *disabled* (i.e., when the user sets them to 0),
but pack_info() was incorrectly printing them as =1. This caused SHOW
BINLOG EVENTS to show foreign_key_checks=1 and unique_checks=1 when
they were actually 0.
@tarunw07 tarunw07 force-pushed the MDEV-29804-fix-show-binlog-events branch from a5f4c98 to 9c289a3 Compare March 10, 2026 21:29
@tarunw07
Copy link
Author

@gkodinov I have pushed the following changes

  • Rebased it to 10.11
  • Modified it to display the sql_auto_is_null=1 properly
  • Renamed the test to follow the conventions that you have mentioned
  • Fixed the issues in the test to make it more stable

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.

3 participants