Commit bb62c802 authored by bell@sanja.is.com.ua's avatar bell@sanja.is.com.ua

memory leaks fixed

parent 161662ba
...@@ -220,10 +220,12 @@ static int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, ...@@ -220,10 +220,12 @@ static int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
table->next= thd->derived_tables; table->next= thd->derived_tables;
thd->derived_tables= table; thd->derived_tables= table;
} }
}
else
free_tmp_table(thd, table);
exit: exit:
delete derived_result; delete derived_result;
lex->current_select= save_current_select; lex->current_select= save_current_select;
}
DBUG_RETURN(res); DBUG_RETURN(res);
} }
...@@ -339,8 +339,6 @@ static File_option view_parameters[]= ...@@ -339,8 +339,6 @@ static File_option view_parameters[]=
FILE_OPTIONS_STRING} FILE_OPTIONS_STRING}
}; };
static const uint required_view_parameters= 6;
static LEX_STRING view_file_type[]= {{(char*)"VIEW", 4}}; static LEX_STRING view_file_type[]= {{(char*)"VIEW", 4}};
...@@ -604,8 +602,6 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table) ...@@ -604,8 +602,6 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
{ {
/* move SP to main LEX */ /* move SP to main LEX */
sp_merge_funs(old_lex, lex); sp_merge_funs(old_lex, lex);
if (lex->spfuns.array.buffer)
hash_free(&lex->spfuns);
if (old_lex->proc_table == 0 && if (old_lex->proc_table == 0 &&
(old_lex->proc_table= (old_lex->proc_table=
(TABLE_LIST*)thd->calloc(sizeof(TABLE_LIST))) != 0) (TABLE_LIST*)thd->calloc(sizeof(TABLE_LIST))) != 0)
...@@ -619,6 +615,8 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table) ...@@ -619,6 +615,8 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
include_proc_table= 1; include_proc_table= 1;
} }
} }
if (lex->spfuns.array.buffer)
hash_free(&lex->spfuns);
old_next= table->next_global; old_next= table->next_global;
if ((table->next_global= lex->query_tables)) if ((table->next_global= lex->query_tables))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment