mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
MemorySanitizer report:
==851408==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 ha_federated::end_bulk_insert() storage/federated/ha_federated.cc:2035:30
#1 mysql_insert(THD*, ...) sql/sql_insert.cc:1258:11
...
Memory was marked as uninitialized
#0 __msan_allocated_memory
#1 my_malloc mysys/my_malloc.c:116:7
SUMMARY: MemorySanitizer: use-of-uninitialized-value ... end_bulk_insert()
table_will_be_deleted is a handler member with no in-class
initializer, and the handler object itself is heap-allocated via
my_malloc(), so it starts out as garbage. It was only ever set in
extra(HA_EXTRA_PREPARE_FOR_DROP) and in external_lock(). For a
TEMPORARY table, statement execution can reach end_bulk_insert(),
which reads the flag, without external_lock() having run first, so the
read sees uninitialized memory.
The fix initializes table_will_be_deleted in reset(). Both
ha_federated::open() and ha_federatedx::open() call reset(), so the
flag is initialized on first open and cleared after every statement.
That also covers the first statement after open (e.g. CREATE TEMPORARY
TABLE ... ENGINE=FEDERATED ... SELECT, where external_lock() is not
called).
The files in this directory are not used by MariaDB MariaDB uses the new federated storage engine that can be found in the federatedx directory. This directory is only kept around to make it easy to merge code from the MySQL source repositories that uses the old and disabled federated code.