• Gleb Shchepa's avatar
    Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while · e219979e
    Gleb Shchepa authored
              ``FLUSH TABLES WITH READ LOCK''
    
    Concurrent execution of 1) multitable update with a
    NATURAL/USING join and 2) a such query as "FLUSH TABLES
    WITH READ LOCK" or "ALTER TABLE" of updating table led
    to a server crash.
    
    
    The mysql_multi_update_prepare() function call is optimized
    to lock updating tables only, so it postpones locking to
    the last, and if locking fails, it does cleanup of modified
    syntax structures and repeats a query analysis.  However,
    that cleanup procedure was incomplete for NATURAL/USING join
    syntax data: 1) some Field_item items pointed into freed
    table structures, and 2) the TABLE_LIST::join_columns fields
    was not reset.
    
    Major change:
      short-living Field *Natural_join_column::table_field has
      been replaced with long-living Item*.
    e219979e
table.h 32.7 KB