1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 2 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1
/* Copyright (C) 2005 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
24
19
#include "rpl_tblmap.h"
25
20
#include "rpl_reporting.h"
26
21
#include "rpl_utility.h"
153
148
happen when, for example, the relay log gets rotated because of
156
std::string group_relay_log_name;
151
char group_relay_log_name[FN_REFLEN];
157
152
uint64_t group_relay_log_pos;
158
std::string event_relay_log_name;
153
char event_relay_log_name[FN_REFLEN];
159
154
uint64_t event_relay_log_pos;
160
155
uint64_t future_event_relay_log_pos;
204
199
volatile uint32_t slave_run_id; /* Incremented on slave start */
205
200
pthread_mutex_t log_space_lock;
206
201
pthread_cond_t log_space_cond;
207
Session * sql_session;
208
203
int32_t events_till_abort;
210
205
/* if not set, the value of other members of the structure are undefined */
238
233
UNTIL_LOG_NAMES_CMP_EQUAL= 0, UNTIL_LOG_NAMES_CMP_GREATER= 1
239
234
} until_log_names_cmp_result;
236
char cached_charset[6];
242
238
trans_retries varies between 0 to slave_transaction_retries and counts how
243
239
many times the slave has retried the present transaction; gets reset to 0
289
285
void inc_group_relay_log_pos(uint64_t log_pos,
290
286
bool skip_lock=0);
292
int32_t wait_for_pos(Session* session, String* log_name, int64_t log_pos,
288
int32_t wait_for_pos(THD* thd, String* log_name, int64_t log_pos,
293
289
int64_t timeout);
294
290
void close_temporary_tables();
317
void cleanup_context(Session *, bool);
314
Last charset (6 bytes) seen by slave SQL thread is cached here; it helps
315
the thread save 3 get_charset() per Query_log_event if the charset is not
316
changing from event to event (common situation).
317
When the 6 bytes are equal to 0 is used to mean "cache is invalidated".
319
void cached_charset_invalidate();
320
bool cached_charset_compare(char *charset) const;
322
void cleanup_context(THD *, bool);
318
323
void clear_tables_to_lock();
391
396
@retval false Replication thread is currently not inside a group
393
398
bool is_in_group() const {
394
return (sql_session->options & OPTION_BEGIN) ||
399
return (sql_thd->options & OPTION_BEGIN) ||
395
400
(m_flags & (1UL << IN_STMT));