summaryrefslogtreecommitdiff
path: root/sql/sql_repl.cc
diff options
context:
space:
mode:
authordlenev@brandersnatch.localdomain <>2005-03-16 04:32:47 +0300
committerdlenev@brandersnatch.localdomain <>2005-03-16 04:32:47 +0300
commitf1691140421ecdb37e4706add568b88162a9ec37 (patch)
tree3fa8e5965f7758c8da8c6827d247549163f01785 /sql/sql_repl.cc
parent3f6fdabe4f5f8d5b2ce91e8842809a8e45e1ba87 (diff)
downloadmariadb-git-f1691140421ecdb37e4706add568b88162a9ec37.tar.gz
WL#874 "Extended LOAD DATA".
Now one can use user variables as target for data loaded from file (besides table's columns). Also LOAD DATA got new SET-clause in which one can specify values for table columns as expressions. For example the following is possible: LOAD DATA INFILE 'words.dat' INTO TABLE t1 (a, @b) SET c = @b + 1; This patch also implements new way of replicating LOAD DATA. Now we do it similarly to other queries. We store LOAD DATA query in new Execute_load_query event (which is last in the sequence of events representing LOAD DATA). When we are executing this event we simply rewrite part of query which holds name of file (we use name of temporary file) and then execute it as usual query. In the beggining of this sequence we use Begin_load_query event which is almost identical to Append_file event
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r--sql/sql_repl.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 0284ab542df..634b6ab0995 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -1511,17 +1511,16 @@ int log_loaded_block(IO_CACHE* file)
lf_info->last_pos_in_file = file->pos_in_file;
if (lf_info->wrote_create_file)
{
- Append_block_log_event a(lf_info->thd, lf_info->db, buffer, block_len,
- lf_info->log_delayed);
+ Append_block_log_event a(lf_info->thd, lf_info->thd->db, buffer,
+ block_len, lf_info->log_delayed);
mysql_bin_log.write(&a);
}
else
{
- Create_file_log_event c(lf_info->thd,lf_info->ex,lf_info->db,
- lf_info->table_name, *lf_info->fields,
- lf_info->handle_dup, lf_info->ignore, buffer,
- block_len, lf_info->log_delayed);
- mysql_bin_log.write(&c);
+ Begin_load_query_log_event b(lf_info->thd, lf_info->thd->db,
+ buffer, block_len,
+ lf_info->log_delayed);
+ mysql_bin_log.write(&b);
lf_info->wrote_create_file = 1;
DBUG_SYNC_POINT("debug_lock.created_file_event",10);
}