[MDEV-17723] Memory leak in btr_defragment_calc_n_recs_for_size() Created: 2018-11-15 Updated: 2021-04-13 Resolved: 2021-04-13 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB, Storage Engine - XtraDB |
| Affects Version/s: | 10.1.1, 10.2.0, 10.3.0, 10.4.0 |
| Fix Version/s: | 10.2.38, 10.3.29, 10.4.19, 10.5.10 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | optimize_table | ||
| Issue Links: |
|
||||||||
| Description |
|
The function btr_defragment_calc_n_recs_for_size() that was added to MariaDB 10.1.1 as part of There is a call to rec_get_offsets() that may invoke mem_heap_create(), but there is no call to mem_heap_free(heap). This should be reproducible with:
Simple fix: Add
Better fix: Remove this kind of use of rec_get_offsets(), and implement a record field iterator that can be used for computing the size of a record. There is no need to compute any offsets except when some algorithm requires random access to the fields of an index record. |
| Comments |
| Comment by Marko Mäkelä [ 2021-04-13 ] |
|
I think that I fixed this as part of |