diff options
author | Tor Didriksen <tor.didriksen@oracle.com> | 2012-01-27 11:13:13 +0100 |
---|---|---|
committer | Tor Didriksen <tor.didriksen@oracle.com> | 2012-01-27 11:13:13 +0100 |
commit | 26c52659c9fb2ddbdabb661f0a089705d16a46c1 (patch) | |
tree | 13a6d176e94b731ec850c08098d4fdec9f2da797 /sql/table.h | |
parent | 040987f1ed060e04ae0cb733452d1de553d90341 (diff) | |
download | mariadb-git-26c52659c9fb2ddbdabb661f0a089705d16a46c1.tar.gz |
Bug#13580775 ASSERTION FAILED: RECORD_LENGTH == M_RECORD_LENGTH
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.
Diffstat (limited to 'sql/table.h')
-rw-r--r-- | sql/table.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/table.h b/sql/table.h index 20f11f4e7e1..690abdff714 100644 --- a/sql/table.h +++ b/sql/table.h @@ -157,6 +157,7 @@ typedef struct st_filesort_info { IO_CACHE *io_cache; /* If sorted through filesort */ uchar **sort_keys; /* Buffer for sorting keys */ + size_t sort_keys_size; /* Number of bytes allocated */ uchar *buffpek; /* Buffer for buffpek structures */ uint buffpek_len; /* Max number of buffpeks in the buffer */ uchar *addon_buf; /* Pointer to a buffer if sorted with fields */ |