diff options
author | unknown <tomas@whalegate.ndb.mysql.com> | 2007-06-19 12:14:02 +0200 |
---|---|---|
committer | unknown <tomas@whalegate.ndb.mysql.com> | 2007-06-19 12:14:02 +0200 |
commit | 228fc721a9d4ef572d6ae9a53736a2adc5106e47 (patch) | |
tree | 36aff3088c6d5740d27a525ce209a08b26b7e758 /sql/ha_ndbcluster_cond.h | |
parent | c982517540027ac3cb7218b42a2af802587d64e8 (diff) | |
download | mariadb-git-228fc721a9d4ef572d6ae9a53736a2adc5106e47.tar.gz |
Bug #29185 Large IN list crashes mysqld with cluster and condition pushdown
Diffstat (limited to 'sql/ha_ndbcluster_cond.h')
-rw-r--r-- | sql/ha_ndbcluster_cond.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/sql/ha_ndbcluster_cond.h b/sql/ha_ndbcluster_cond.h index d4e68de6635..adc12e8cd74 100644 --- a/sql/ha_ndbcluster_cond.h +++ b/sql/ha_ndbcluster_cond.h @@ -259,8 +259,24 @@ class Ndb_cond : public Sql_alloc ~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 recursively causes stack issues for + big IN clauses + */ + if (prev != NULL) + { + next= prev= NULL; + return; + } + Ndb_cond *n= next; + while (n) + { + Ndb_cond *tmp= n; + n= n->next; + delete tmp; + } next= prev= NULL; }; Ndb_item *ndb_item; |