summaryrefslogtreecommitdiff
path: root/sql/slave.h
diff options
context:
space:
mode:
authorkonstantin@mysql.com <>2006-06-28 23:47:45 +0400
committerkonstantin@mysql.com <>2006-06-28 23:47:45 +0400
commit55d148c5c259ed5cd77eb12f2f29c368f502a3c8 (patch)
tree0604cb0378ffd697c49e6d0a5753e39aeb18f147 /sql/slave.h
parent9bcb24b65eb51fddaec849f6947c03b991351ea9 (diff)
downloadmariadb-git-55d148c5c259ed5cd77eb12f2f29c368f502a3c8.tar.gz
A fix for Bug#19022 "Memory bug when switching db during trigger execution".
No test case as the bug is in an existing test case (rpl_trigger.test when it is run under valgrind). The warning was caused by memory corruption in replication slave: thd->db was pointing at a stack address that was previously used by sp_head::execute()::old_db. This happened because mysql_change_db behaved differently in replication slave and did not make a copy of the argument to assign to thd->db. The solution is to always free the old value of thd->db and allocate a new copy, regardless whether we're running in a replication slave or not.
Diffstat (limited to 'sql/slave.h')
-rw-r--r--sql/slave.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/sql/slave.h b/sql/slave.h
index 7f08105c0b9..c355f7172a9 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -550,7 +550,6 @@ int add_table_rule(HASH* h, const char* table_spec);
int add_wild_table_rule(DYNAMIC_ARRAY* a, const char* table_spec);
void init_table_rule_hash(HASH* h, bool* h_inited);
void init_table_rule_array(DYNAMIC_ARRAY* a, bool* a_inited);
-const char *rewrite_db(const char* db, uint *new_db_len);
const char *print_slave_db_safe(const char *db);
int check_expected_error(THD* thd, RELAY_LOG_INFO* rli, int error_code);
void skip_load_data_infile(NET* net);