===== sql/ha_ndbcluster_cond.h 1.2 vs edited ===== --- 1.2/sql/ha_ndbcluster_cond.h 2007-04-23 12:12:10 +02:00 +++ edited/sql/ha_ndbcluster_cond.h 2007-06-19 07:04:32 +02:00 @@ -259,8 +259,23 @@ ~Ndb_cond() { if (ndb_item) delete ndb_item; - ndb_item= NULL; - if (next) delete next; + ndb_item= NULL; + /* + First item in the linked list deletes all in a loop + Note - doing it recurtively causes stack issues for + big IN clauses + */ + if (prev != NULL) + { + next= prev= NULL; + return; + } + Ndb_cond *n= next; + while (n) + { + n= n->next; + delete n; + } next= prev= NULL; }; Ndb_item *ndb_item;