Skip to content

Conversation

beifangxiuwhx
Copy link

@beifangxiuwhx beifangxiuwhx commented Jul 16, 2025

Bugfix for https://bugs.mysql.com/bug.php?id=96310

I have signed OCA and my account in Oracle is kindaichweng@gmail.com

PROBLEM:

When variable 'log_bin' is ON (that is, mysql will generate binary log for DML query) some invalid date from default value will be accepted by mysql.

Repeat:

SET sql_mode='';
CREATE TABLE default_date(a DATE NOT NULL DEFAULT '0000-00-00');

SET sql_mode=default;

INSERT INTO default_date VALUES(); -- invalid data will be accepted.

Solution:

We need not mark_columns_per_binlog_row_image IN TABLE::mark_columns_needed_for_insert, which is unnecessary and will change table->write_set and validate_default_values_of_unset_fields will skip data check finally

PROBLEM:
--------

When variable 'log_bin' is ON (that is, mysql will generate binary log for DML query)
some invalid date from default value will be accepted by mysql.

Repeat:

SET sql_mode='';
CREATE TABLE default_date(a DATE NOT NULL DEFAULT '0000-00-00');
SET sql_mode=default;

INSERT INTO default_date VALUES();  -- invalid data will be accepted.

Solution:
--------

We need not mark_columns_per_binlog_row_image  IN TABLE::mark_columns_needed_for_insert,
which is unnecessary and  will change table->write_set and
validate_default_values_of_unset_fields will skip data check finally

fix
@mysql-oca-bot
Copy link

Hi, thank you for submitting this pull request. In order to consider your code we need you to sign the Oracle Contribution Agreement (OCA). Please review the details and follow the instructions at https://oca.opensource.oracle.com/
Please make sure to include your MySQL bug system user (email) in the returned form.
Thanks

@beifangxiuwhx
Copy link
Author

Hi, thank you for submitting this pull request. In order to consider your code we need you to sign the Oracle Contribution Agreement (OCA). Please review the details and follow the instructions at https://oca.opensource.oracle.com/ Please make sure to include your MySQL bug system user (email) in the returned form. Thanks

I have signed OCA and my account in Oracle is kindaichweng@gmail.com

@beifangxiuwhx
Copy link
Author

I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

@beifangxiuwhx
Copy link
Author

"I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it."

@mysql-oca-bot
Copy link

Hi, thank you for your contribution. Your code has been assigned to an internal queue. Please follow
bug http://bugs.mysql.com/bug.php?id=96310 for updates.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants