summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorguilhem@mysql.com <>2004-11-16 00:04:12 +0100
committerguilhem@mysql.com <>2004-11-16 00:04:12 +0100
commite38dae0bc19160035a5b5c8a966e6dc6d1b3420e (patch)
tree4b3acfdee8480e9e03666d068ee6a08eed12672b /sql/log_event.cc
parent162587878858b8c960d40956aae6258b84522607 (diff)
parent99417e07ebf210ce214bc5def4f15baa03857e0f (diff)
downloadmariadb-git-e38dae0bc19160035a5b5c8a966e6dc6d1b3420e.tar.gz
Merge
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc26
1 files changed, 16 insertions, 10 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index ccc563d31ac..a8bff43c80d 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -2384,16 +2384,22 @@ void Load_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_ev
/*
Load_log_event::set_fields()
+
+ Note that this function can not use the member variable
+ for the database, since LOAD DATA INFILE on the slave
+ can be for a different database than the current one.
+ This is the reason for the affected_db argument to this method.
*/
#ifndef MYSQL_CLIENT
-void Load_log_event::set_fields(List<Item> &field_list)
+void Load_log_event::set_fields(const char* affected_db,
+ List<Item> &field_list)
{
uint i;
const char* field = fields;
for (i= 0; i < num_fields; i++)
{
- field_list.push_back(new Item_field(db, table_name, field));
+ field_list.push_back(new Item_field(affected_db, table_name, field));
field+= field_lens[i] + 1;
}
}
@@ -2546,7 +2552,7 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli,
ex.skip_lines = skip_lines;
List<Item> field_list;
- set_fields(field_list);
+ set_fields(thd->db,field_list);
thd->variables.pseudo_thread_id= thread_id;
if (net)
{
@@ -2563,13 +2569,13 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli,
if (thd->cuted_fields)
{
/* log_pos is the position of the LOAD event in the master log */
- sql_print_error("\
-Slave: load data infile on table '%s' at log position %s in log \
-'%s' produced %ld warning(s). Default database: '%s'",
- (char*) table_name,
- llstr(log_pos,llbuff), RPL_LOG_NAME,
- (ulong) thd->cuted_fields,
- print_slave_db_safe(thd->db));
+ sql_print_warning("Slave: load data infile on table '%s' at "
+ "log position %s in log '%s' produced %ld "
+ "warning(s). Default database: '%s'",
+ (char*) table_name,
+ llstr(log_pos,llbuff), RPL_LOG_NAME,
+ (ulong) thd->cuted_fields,
+ print_slave_db_safe(thd->db));
}
if (net)
net->pkt_nr= thd->net.pkt_nr;