mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
backport of:
------------------------------------------------------------ revno: 2617.81.1 revision-id: tor.didriksen@sun.com-20090924061133-qo02zotz3yypmfpk parent: davi.arnaut@sun.com-20090923203724-tvz7x8dauzp686v7 committer: Tor Didriksen <tor.didriksen@sun.com> branch nick: 6.0-codebase-bf-opt timestamp: Thu 2009-09-24 08:11:33 +0200 message: Bug#47511 Segmentation fault during cleanup in sql_union (events_bugs.test) sql/sql_lex.h: Ensure that fields used during cleanup() are always initialized by constructors.
This commit is contained in:
parent
8a66b18c34
commit
aa70ca7156
1 changed files with 22 additions and 1 deletions
|
@ -403,6 +403,8 @@ public:
|
|||
struct LEX;
|
||||
class st_select_lex;
|
||||
class st_select_lex_unit;
|
||||
|
||||
|
||||
class st_select_lex_node {
|
||||
protected:
|
||||
st_select_lex_node *next, **prev, /* neighbor list */
|
||||
|
@ -440,8 +442,17 @@ public:
|
|||
{ return (void*) alloc_root(mem_root, (uint) size); }
|
||||
static void operator delete(void *ptr,size_t size) { TRASH(ptr, size); }
|
||||
static void operator delete(void *ptr, MEM_ROOT *mem_root) {}
|
||||
st_select_lex_node(): linkage(UNSPECIFIED_TYPE) {}
|
||||
|
||||
// Ensures that at least all members used during cleanup() are initialized.
|
||||
st_select_lex_node()
|
||||
: next(NULL), prev(NULL),
|
||||
master(NULL), slave(NULL),
|
||||
link_next(NULL), link_prev(NULL),
|
||||
linkage(UNSPECIFIED_TYPE)
|
||||
{
|
||||
}
|
||||
virtual ~st_select_lex_node() {}
|
||||
|
||||
inline st_select_lex_node* get_master() { return master; }
|
||||
virtual void init_query();
|
||||
virtual void init_select();
|
||||
|
@ -487,6 +498,8 @@ class select_result;
|
|||
class JOIN;
|
||||
class select_union;
|
||||
class Procedure;
|
||||
|
||||
|
||||
class st_select_lex_unit: public st_select_lex_node {
|
||||
protected:
|
||||
TABLE_LIST result_table_list;
|
||||
|
@ -498,6 +511,14 @@ protected:
|
|||
bool saved_error;
|
||||
|
||||
public:
|
||||
// Ensures that at least all members used during cleanup() are initialized.
|
||||
st_select_lex_unit()
|
||||
: union_result(NULL), table(NULL), result(NULL),
|
||||
cleaned(false),
|
||||
fake_select_lex(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
bool prepared, // prepare phase already performed for UNION (unit)
|
||||
optimized, // optimize phase already performed for UNION (unit)
|
||||
executed, // already executed
|
||||
|
|
Loading…
Reference in a new issue