mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
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
This commit is contained in:
parent
a024649081
commit
c07e346ca6
4 changed files with 28 additions and 7 deletions
4
mysql-test/main/unique.result
Normal file
4
mysql-test/main/unique.result
Normal file
|
@ -0,0 +1,4 @@
|
|||
CREATE TABLE t2 (n BLOB, UNIQUE(n));
|
||||
INSERT INTO t2 VALUES (1);
|
||||
DELETE FROM t2 WHERE n = 1;
|
||||
DROP TABLE t2;
|
12
mysql-test/main/unique.test
Normal file
12
mysql-test/main/unique.test
Normal file
|
@ -0,0 +1,12 @@
|
|||
--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;
|
15
sql/field.cc
15
sql/field.cc
|
@ -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 @@ public:
|
|||
|
||||
|
||||
/*
|
||||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue