Bug #18384 InnoDB memory leak on duplicate key errors in 5.0 if row has many columns
Submitted: 21 Mar 2006 8:14 Modified: 19 Jun 2010 0:05
Reporter: Heikki Tuuri Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:5.0.3 and later OS:Any (All)
Assigned to: Marko Mäkelä CPU Architecture:Any

[21 Mar 2006 8:14] Heikki Tuuri
Description:
InnoDB leaks memory in the code below because it forgets to free heap. The leak only happens with rows with about 90 columns or more.

row0ins.c:

        if (cursor->low_match >= n_unique) {

                rec = btr_cur_get_rec(cursor);

                if (!page_rec_is_infimum(rec)) {
                        offsets = rec_get_offsets(rec, cursor->index, offsets,
                                                ULINT_UNDEFINED, &heap);

Marko has a patch here:

http://bugs.mysql.com/bug.php?id=17674

How to repeat:
Use INSERT IGNORE to a table with many duplicates.

Suggested fix:
Marko has a patch.
[21 Mar 2006 9:14] Marko Mäkelä
I have committed the patch to the InnoDB source code repository.
[5 Apr 2006 19:19] Elliot Murphy
Fixed in InnoDB snapshot368; fixes are in 5.0.20.
[11 Apr 2006 2:15] Paul DuBois
Noted in 5.0.20 changelog.

<literal>InnoDB</literal> had a memory leak for duplicate-key
errors with tables having 90 columns or more. (Bug #18384)
[5 May 2010 15:18] Bugs System
Pushed into 5.1.47 (revid:joro@sun.com-20100505145753-ivlt4hclbrjy8eye) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[6 May 2010 1:58] Paul DuBois
Push resulted from incorporation of InnoDB tree. No changes pertinent to this bug. Re-closing.
[28 May 2010 6:06] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100524190136-egaq7e8zgkwb9aqi) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (pib:16)
[28 May 2010 6:35] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100524190941-nuudpx60if25wsvx) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[28 May 2010 7:02] Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100524185725-c8k5q7v60i5nix3t) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[29 May 2010 15:29] Paul DuBois
Push resulted from incorporation of InnoDB tree. No changes pertinent to this bug.
Re-closing.
[17 Jun 2010 12:06] Bugs System
Pushed into 5.1.47-ndb-7.0.16 (revid:martin.skold@mysql.com-20100617114014-bva0dy24yyd67697) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 12:52] Bugs System
Pushed into 5.1.47-ndb-6.2.19 (revid:martin.skold@mysql.com-20100617115448-idrbic6gbki37h1c) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)
[17 Jun 2010 13:34] Bugs System
Pushed into 5.1.47-ndb-6.3.35 (revid:martin.skold@mysql.com-20100617114611-61aqbb52j752y116) (version source revid:vasil.dimov@oracle.com-20100331130613-8ja7n0vh36a80457) (merge vers: 5.1.46) (pib:16)