Skip to content
Permalink
Browse files
MDEV-21373 DBUG compilation - bad synchronization in ha_heap::externa…
…l_lock()

ha_heap::external_lock contains some consistency checks for the table,#
in a debug compilation.

This code suffers from lack of synchronization, in a rare case
where mysql_lock_tables() fail, and unlock is forced, even if lock was
not previously taken.

To workaround, require EXTRA_DEBUG compile definition in order to activate
the consistency checks.The code still might be useful in some cases - but
the audience are developers looking for errors in single-threaded scenarios,
rather than multiuser stress-tests.
  • Loading branch information
vaintroub committed Jun 4, 2021
1 parent 2d38c5e commit b1b4d67
Showing 1 changed file with 1 addition and 1 deletion.
@@ -423,7 +423,7 @@ int ha_heap::reset_auto_increment(ulonglong value)

int ha_heap::external_lock(THD *thd, int lock_type)
{
#ifndef DBUG_OFF
#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG)
if (lock_type == F_UNLCK && file->s->changed && heap_check_heap(file, 0))
return HA_ERR_CRASHED;
#endif

0 comments on commit b1b4d67

Please sign in to comment.