• Monty's avatar
    MDEV-8200 aria bug with insert select and lock tables · 1f18bd63
    Monty authored
    This bug happens when locking the same Aria "transactional" table
    (page format) more then once with LOCK TABLES and inserting into one
    of them with INSERT ... SELECT when the table is empty.
    
    Fixed by ensuring we don't use fast bulk insert if table is opened
    twice with LOCK TABLES (as this changes table->s->state)
    
    Code changes:
    - Added use_count to MARIA_USED_TABLES to be able to check if
      table is opened twice for a statement/lock table
    - Don't clear history or reset info->start_state if we
      don't have versioning. One reason for the bug was
      was that info->start_state was set to point to different
      states for the two tables.  If there is no versioning
      info->start_state should always point to info->s->state.common.
    
    Other things:
    - Fixed also some typos that was noticed while scanning the code
    - More DBUG_PRINT
    1f18bd63
ma_state.c 24.6 KB