• Tor Didriksen's avatar
    Bug#13580775 ASSERTION FAILED: RECORD_LENGTH == M_RECORD_LENGTH · f3a7873c
    Tor Didriksen authored
    Bug#13011410 CRASH IN FILESORT CODE WITH GROUP BY/ROLLUP
    
    The assert in 13580775 is visible in 5.6 only, 
    but shows that all versions are vulnerable.
    13011410 crashes in all versions.
    
    filesort tries to re-use the sort buffer between invocations in order to save
    malloc/free overhead.
    The fix for Bug 11748783 - 37359: FILESORT CAN BE MORE EFFICIENT.
    added an assert that buffer properties (num_records, record_length) are
    consistent between invocations. Indeed, they are not necessarily consistent.
      
    Fix: re-allocate the sort buffer if properties change.
    
    
    mysql-test/r/partition.result:
      New tests.
    mysql-test/t/partition.test:
      New tests.
    sql/filesort.cc:
      If we already have allocated a sort buffer in a previous execution,
      then verify that it is big enough for the current one.
    sql/table.h:
      Add sort_keys_size; Number of bytes allocated for the sort_keys buffer.
    f3a7873c
table.h 60.1 KB