summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <dlenev@brandersnatch.localdomain>2005-03-04 20:54:24 +0300
committerunknown <dlenev@brandersnatch.localdomain>2005-03-04 20:54:24 +0300
commitf76b64f540fe7ee2505f14d8cd0c19aac0cead44 (patch)
treefbd033124ffb2c9d1f8c901a1390220220019891 /sql
parentb1095fb0cd0b42158f6ca3d8f157df5d23bec423 (diff)
downloadmariadb-git-f76b64f540fe7ee2505f14d8cd0c19aac0cead44.tar.gz
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.
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_lex.h4
-rw-r--r--sql/sql_view.cc1
2 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index e50c4edabb4..3588f376d2f 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -816,8 +816,8 @@ typedef struct st_lex
hash_init(&spfuns, system_charset_info, 0, 0, 0, sp_lex_sp_key, 0, 0);
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);
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 0c7bf2632ec..31277452118 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -854,6 +854,7 @@ ok2:
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);