MDEV-38899 Fix Assertion !((f->flags & 4096U) && f->vcol_info) upon RBR with NOBLOB and unique blob#4763
Open
itzanway wants to merge 1 commit intoMariaDB:12.3from
Open
MDEV-38899 Fix Assertion !((f->flags & 4096U) && f->vcol_info) upon RBR with NOBLOB and unique blob#4763itzanway wants to merge 1 commit intoMariaDB:12.3from
!((f->flags & 4096U) && f->vcol_info) upon RBR with NOBLOB and unique blob#4763itzanway wants to merge 1 commit intoMariaDB:12.3from
Conversation
!((f->flags & 4096U) && f->vcol_info) upon RBR with NOBLOB and unique blob!((f->flags & 4096U) && f->vcol_info) upon RBR with NOBLOB and unique blob
d2d6371 to
c3f5419
Compare
gkodinov
requested changes
Mar 10, 2026
Member
gkodinov
left a comment
There was a problem hiding this comment.
Thank you for your contribution! Before I do an actual review please:
- fix the buildbot failures
- squash into a single commit
- add a good commit message to it compliant with CODING_STANDARDS.md
- Make sure there's no extra changes into the PR (there's now removal of the BUILD dir for some reason)
- rebase to 12.3 (as the first affected version): this is a bugfix.
45ada02 to
45b0f05
Compare
45b0f05 to
8e5fbb3
Compare
8e5fbb3 to
620733d
Compare
… RBR with NOBLOB Problem: When using Row-Based Replication (RBR) with binlog_row_image = NOBLOB, operations on a table with a UNIQUE constraint on a BLOB NOT NULL column cause a debug assertion failure in prepare_record() on the replica. A UNIQUE index on a BLOB creates a hidden virtual column (to store the blob's hash). This hidden virtual column inherits the NOT NULL property and receives the NO_DEFAULT_VALUE_FLAG (4096U). During replication, if the blob isn't included in the row image, prepare_record() evaluates missing columns and hits the overly strict assertion. Solution: Virtual columns evaluate their own expressions and do not use the default value mechanism. It is completely valid for them (especially automatically generated hidden ones) to have NO_DEFAULT_VALUE_FLAG set. Removed the invalid assertion: DBUG_ASSERT(!((f->flags & NO_DEFAULT_VALUE_FLAG) && f->vcol_info)); Added an MTR test case to prevent future regressions.
Author
|
Hi @gkodinov, I have addressed all the review comments:
My replication tests are now passing! The only remaining failure on the buildbot is main.opt_hints, which appears to be an unrelated flaky test. Could you please re-trigger the buildbot or take another look? Thank you! |
This file contains hidden or 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
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.
Fixes: Regression introduced by MDEV-36290.
Problem
When using Row-Based Replication (RBR) with
binlog_row_image = NOBLOB, operations on a table with aUNIQUEconstraint on aBLOB NOT NULLcolumn cause a debug assertion failure inprepare_record()on the replica.A
UNIQUEindex on aBLOBcreates a hidden virtual column (to store the blob's hash). This hidden virtual column inherits theNOT NULLproperty and receives theNO_DEFAULT_VALUE_FLAG(4096U). During replication, if the blob isn't included in the row image,prepare_record()evaluates missing columns and hits the overly strict assertion.Solution
Virtual columns evaluate their own expressions and do not use the default value mechanism. It is completely valid for them (especially automatically generated hidden ones) to have
NO_DEFAULT_VALUE_FLAGset.This PR removes the invalid assertion:
DBUG_ASSERT(!((f->flags & NO_DEFAULT_VALUE_FLAG) && f->vcol_info));and includes an MTR test case to prevent future regressions.