diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-11-28 15:08:12 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-11-28 15:08:12 +0100 |
commit | e79847d16a0f51137ca46f23af7d5276dce7952d (patch) | |
tree | be71c60badd9dc5a88b07f968688024c1f09a348 /sql/sql_base.cc | |
parent | a293d0788c2425ef702f02b4cce41ed1cf56055f (diff) | |
download | mariadb-git-e79847d16a0f51137ca46f23af7d5276dce7952d.tar.gz |
after merge fixes
sql/sql_base.cc:
fix a memory leak
storage/xtradb/handler/ha_innodb.cc:
fix for a visual studio
storage/xtradb/row/row0ins.c:
valgrind complains about uninitialized variable.
incorrect errors in the innodb.test too
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index c8b1067425b..ee44629a192 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2309,7 +2309,12 @@ bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list, bool link_in) if (thd->killed || !table) DBUG_RETURN(TRUE); - orig_table= *table; + /* + make a copy. we may need to restore it later. + don't use orig_table=*table, because we need an exact replica, + not a C++ copy that may modify the data in the copy constructor. + */ + memcpy(&orig_table, table, sizeof(*table)); if (open_unireg_entry(thd, table, table_list, table_name, table->s->table_cache_key.str, @@ -2322,9 +2327,10 @@ bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list, bool link_in) properly release name-lock in this case we should restore this object to its original state. */ - *table= orig_table; + memcpy(table, &orig_table, sizeof(*table)); DBUG_RETURN(TRUE); } + orig_table.alias.free(); share= table->s; /* |