MDEV-35911 Assertion `marked_for_write_or_computed()' failed in bool Field_new_decimal::store_value(const my_decimal*, int*)

disable the assert.

also, use the same check for check_that_all_fields_are_given_values()
as it's used in not_null_fields_have_null_values() - to avoid
issuing the same warning twice.
This commit is contained in:
Sergei Golubchik 2025-01-24 13:48:12 +01:00
parent b8b77177c2
commit 9a0ac0cdf7
4 changed files with 24 additions and 2 deletions

View File

@ -388,4 +388,15 @@ id rate
3 15
4 5
drop table t1;
#
# MDEV-35911 Assertion `marked_for_write_or_computed()' failed in bool Field_new_decimal::store_value(const my_decimal*, int*)
#
set sql_mode='';
create table t1 (c fixed,c2 binary (1),c5 fixed not null);
create trigger tr1 before update on t1 for each row set @a=0;
insert into t1 (c) values (1);
Warnings:
Warning 1364 Field 'c5' doesn't have a default value
drop table t1;
set sql_mode=default;
# End of 10.5 tests

View File

@ -415,4 +415,14 @@ select * from t1;
drop table t1;
--echo #
--echo # MDEV-35911 Assertion `marked_for_write_or_computed()' failed in bool Field_new_decimal::store_value(const my_decimal*, int*)
--echo #
set sql_mode='';
create table t1 (c fixed,c2 binary (1),c5 fixed not null);
create trigger tr1 before update on t1 for each row set @a=0;
insert into t1 (c) values (1);
drop table t1;
set sql_mode=default;
--echo # End of 10.5 tests

View File

@ -172,7 +172,9 @@ int convert_null_to_field_value_or_error(Field *field, uint err)
return 0;
}
MY_BITMAP *old_map= dbug_tmp_use_all_columns(field->table, &field->table->write_set);
field->reset(); // Note: we ignore any potential failure of reset() here.
dbug_tmp_restore_column_map(&field->table->write_set, old_map);
if (field == field->table->next_number_field)
{

View File

@ -950,8 +950,7 @@ bool mysql_insert(THD *thd, TABLE_LIST *table_list,
if (fields.elements || !value_count || table_list->view != 0)
{
if (table->triggers &&
table->triggers->has_triggers(TRG_EVENT_INSERT, TRG_ACTION_BEFORE))
if (table->field != table->field_to_fill())
{
/* BEFORE INSERT triggers exist, the check will be done later, per row */
}