Commit c07e346c authored by Monty's avatar Monty

MDEV-19252 Problem with DBUG_ASSERT_AS_PRINTF and marked_for_write()

Problem was that DBUG_FIX_WRITE_SET was not enabled when using
DBUG_ASSERT_AS_PRINTF
parent a0246490
CREATE TABLE t2 (n BLOB, UNIQUE(n));
INSERT INTO t2 VALUES (1);
DELETE FROM t2 WHERE n = 1;
DROP TABLE t2;
--source include/have_innodb.inc
#
# MDEV-19252 Warning about assertion failure marked_for_write_or_computed()
# printed by release build with DBUG_ASSERT_AS_PRINTF, but no failure on debug
# build
#
CREATE TABLE t2 (n BLOB, UNIQUE(n));
INSERT INTO t2 VALUES (1);
DELETE FROM t2 WHERE n = 1;
DROP TABLE t2;
......@@ -67,14 +67,19 @@ inline bool Field::marked_for_read() const
ptr < table->record[0] + table->s->reclength)));
}
/*
The name of this function is a bit missleading as in 10.4 we don't
have to test anymore if the field is computed. Instead we mark
changed fields with DBUG_FIX_WRITE_SET() in table.cc
*/
inline bool Field::marked_for_write_or_computed() const
{
return is_stat_field || !table ||
(!table->write_set ||
bitmap_is_set(table->write_set, field_index) ||
(!(ptr >= table->record[0] &&
ptr < table->record[0] + table->s->reclength)));
return (is_stat_field || !table ||
(!table->write_set ||
bitmap_is_set(table->write_set, field_index) ||
(!(ptr >= table->record[0] &&
ptr < table->record[0] + table->s->reclength))));
}
......
......@@ -8080,10 +8080,10 @@ class Turn_errors_to_warnings_handler : public Internal_error_handler
/*
to satisfy ASSERT_COLUMN_MARKED_FOR_WRITE Field's assert we temporarily
to satisfy marked_for_write_or_computed() Field's assert we temporarily
mark field for write before storing the generated value in it
*/
#ifndef DBUG_OFF
#ifdef DBUG_ASSERT_EXISTS
#define DBUG_FIX_WRITE_SET(f) bool _write_set_fixed= !bitmap_fast_test_and_set(write_set, (f)->field_index)
#define DBUG_RESTORE_WRITE_SET(f) if (_write_set_fixed) bitmap_clear_bit(write_set, (f)->field_index)
#else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment