summaryrefslogtreecommitdiff
path: root/sql/sql_repl.cc
diff options
context:
space:
mode:
authorKristian Nielsen <knielsen@knielsen-hq.org>2015-03-04 13:36:54 +0100
committerKristian Nielsen <knielsen@knielsen-hq.org>2015-03-04 13:36:54 +0100
commit3ef0b9b235a931be4264c096319976a180224354 (patch)
tree4b1ae3966d23fce4487b1c0a685699d2585b1d29 /sql/sql_repl.cc
parente33b48ae8b943b5d2aed4873f5ada7717860e162 (diff)
parent78c74dbe30d3a22feec5d069c7424d5a8a86ea4c (diff)
downloadmariadb-git-3ef0b9b235a931be4264c096319976a180224354.tar.gz
Merge MDEV-6589 and MDEV-6403 into 10.0.
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r--sql/sql_repl.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 7cbc21c2d04..26355e4de5d 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -2377,6 +2377,31 @@ impossible position";
info.fdev= tmp;
(*packet)[FLAGS_OFFSET+ev_offset] &= ~LOG_EVENT_BINLOG_IN_USE_F;
+
+ if (info.using_gtid_state)
+ {
+ /*
+ If this event has the field `created' set, then it will cause the
+ slave to delete all active temporary tables. This must not happen
+ if the slave received any later GTIDs in a previous connect, as
+ those GTIDs might have created new temporary tables that are still
+ needed.
+
+ So here, we check if the starting GTID position was already
+ reached before this format description event. If not, we clear the
+ `created' flag to preserve temporary tables on the slave. (If the
+ slave connects at a position past this event, it means that it
+ already received and handled it in a previous connect).
+ */
+ if (!info.gtid_state.is_pos_reached())
+ {
+ int4store((char*) packet->ptr()+LOG_EVENT_MINIMAL_HEADER_LEN+
+ ST_CREATED_OFFSET+ev_offset, (ulong) 0);
+ if (info.current_checksum_alg != BINLOG_CHECKSUM_ALG_OFF &&
+ info.current_checksum_alg != BINLOG_CHECKSUM_ALG_UNDEF)
+ fix_checksum(packet, ev_offset);
+ }
+ }
}
#ifndef DBUG_OFF