• Sergey Vojtovich's avatar
    BUG#46961 - archive engine loses rows during self joining select! · a7de2057
    Sergey Vojtovich authored
    SELECT with join (not only self-join) from archive table may
    return incomplete result set, when result set size exceeds
    join buffer size.
    
    The problem was that archive row counter was initialzed too
    early, when ha_archive::info() method was called. Later,
    when optimizer exceeds join buffer, it attempts to reuse
    handler without calling ha_archive::info() again (which is
    correct).
    
    Fixed by moving row counter initialization from
    ha_archive::info() to ha_archive::rnd_init().
    
    mysql-test/r/archive.result:
      A test case for BUG#46961.
    mysql-test/t/archive.test:
      A test case for BUG#46961.
    storage/archive/ha_archive.cc:
      Since a cursor may get reused without a call to ::info(),
      move assignment of scan_rows to a proper place, that is
      ::rnd_init().
    a7de2057
archive.test 101 KB