Commit f76b64f5 authored by unknown's avatar unknown
Browse files

Fix for memory leak which was introduced by patch improving locking in SP.

Made mysql_make_view() to call destructor for st_lex_local objects before
throwing them away (this happens in case of error).


sql/sql_lex.h:
  Made LEX's destructor virtual to be able properly destroy objects
  of inherited classes (i.e. of st_lex_local).
sql/sql_view.cc:
  mysql_make_view():
    We should call destructor for st_lex_local object before throwing
    it away.
parent b1095fb0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -817,7 +817,7 @@ typedef struct st_lex
    hash_init(&spprocs, system_charset_info, 0, 0, 0, sp_lex_sp_key, 0, 0);
  }

  ~st_lex()
  virtual ~st_lex()
  {
    hash_free(&spfuns);
    hash_free(&spprocs);
+1 −0
Original line number Diff line number Diff line
@@ -854,6 +854,7 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
err:
  if (arena)
    thd->restore_backup_item_arena(arena, &backup);
  delete table->view;
  table->view= 0;	// now it is not VIEW placeholder
  thd->lex= old_lex;
  DBUG_RETURN(1);