2838 Tor Didriksen 2009-09-24
Bug#47511 Segmentation fault during cleanup in sql_union (events_bugs.test)
Segfaults were caused by calling cleanup() on objects which were not properly initialized.
@ sql/sql_lex.h
Ensure that fields used during cleanup() are always initialized by constructors.
modified:
sql/sql_lex.h
2837 Davi Arnaut 2009-09-23
Post-merge fix for Bug#45238: re-enable disabled test cases.
modified:
mysql-test/include/master-slave.inc
mysql-test/suite/rpl/t/rpl_backup_multi.test
mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
mysql-test/suite/rpl/t/rpl_row_colSize.test
mysql-test/suite/rpl/t/rpl_row_create_table.test
mysql-test/suite/rpl/t/rpl_stm_log.test
mysql-test/suite/rpl/t/rpl_temporary.test
mysql-test/suite/rpl/t/rpl_truncate_3innodb.test
=== modified file 'sql/sql_lex.h'
--- a/sql/sql_lex.h 2009-09-14 16:03:38 +0000
+++ b/sql/sql_lex.h 2009-09-24 06:11:33 +0000
@@ -329,6 +329,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 */
@@ -366,8 +368,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();
@@ -413,6 +424,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;
@@ -424,6 +437,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
Attachment: [text/bzr-bundle] bzr/tor.didriksen@sun.com-20090924061133-qo02zotz3yypmfpk.bundle
| Thread |
|---|
| • bzr push into mysql-6.0-bugfixing branch (tor.didriksen:2837 to 2838)Bug#47511 | Tor Didriksen | 24 Sep |