• Nikita Malyavin's avatar
    MDEV-30924 Server crashes in MYSQL_LOG::is_open upon ALTER vs FUNCTION · 3ad0e7ed
    Nikita Malyavin authored
    ASAN showed use-after-free in binlog_online_alter_end_trans, during
    running through thd->online_alter_cache_list.
    
    In online_alter_binlog_get_cache_data, new_cache_data was allocated on
    thd->mem_root, in case of autocommit=1, but this mem_root could be freed
    in sp_head::execute, upon using stored functions.
    
    It appears that thd->transaction->mem_root exists even in single-stmt
    transaction mode (i.e autocommit=1), so it can be used in all cases.
    This mem_root will remain valid till the end of transaction, including
    commit phase.
    3ad0e7ed
alter_table_online_debug.result 32.7 KB