summaryrefslogtreecommitdiff
path: root/sql/sql_trigger.cc
diff options
context:
space:
mode:
authoristruewing@stella.local <>2007-11-18 20:28:37 +0100
committeristruewing@stella.local <>2007-11-18 20:28:37 +0100
commitb6831e182bb923b484904150991f20a845dc22d1 (patch)
tree436e0d2b3367acd094c89e35dffc784b3e3db7bf /sql/sql_trigger.cc
parent060527415532b145bd9612a45b82ea7fbd4ca94e (diff)
downloadmariadb-git-b6831e182bb923b484904150991f20a845dc22d1.tar.gz
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table Post-pushbuild fix for a Valgrind warning.
Diffstat (limited to 'sql/sql_trigger.cc')
-rw-r--r--sql/sql_trigger.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index 53f799fff1c..3129bd81572 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -489,8 +489,11 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
/* Under LOCK TABLES we must reopen the table to activate the trigger. */
if (!result && thd->locked_tables)
{
- close_data_files_and_morph_locks(thd, table->s->db.str,
- table->s->table_name.str);
+ /*
+ Must not use table->s->db.str or table->s->table_name.str here.
+ The strings are used in a loop even after the share may be freed.
+ */
+ close_data_files_and_morph_locks(thd, tables->db, tables->table_name);
thd->in_lock_tables= 1;
result= reopen_tables(thd, 1, 0);
thd->in_lock_tables= 0;