~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to sql/log_event.h

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2000-2006 MySQL AB
 
1
/*
 
2
   Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
2
3
 
3
4
   This program is free software; you can redistribute it and/or modify
4
5
   it under the terms of the GNU General Public License as published by
11
12
 
12
13
   You should have received a copy of the GNU General Public License
13
14
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
 
16
*/
15
17
 
16
18
/**
17
19
  @addtogroup Replication
264
266
                                   1 + 2          /* type, lc_time_names_number */ + \
265
267
                                   1 + 2          /* type, charset_database_number */ + \
266
268
                                   1 + 8          /* type, table_map_for_update */ + \
267
 
                                   1 + 4          /* type, master_data_written */)
 
269
                                   1 + 4          /* type, master_data_written */ + \
 
270
                                   1 + 16 + 1 + 60/* type, user_len, user, host_len, host */)
268
271
#define MAX_LOG_EVENT_HEADER   ( /* in order of Query_log_event::write */ \
269
272
  LOG_EVENT_HEADER_LEN + /* write_header */ \
270
273
  QUERY_HEADER_LEN     + /* write_data */   \
333
336
 
334
337
#define Q_MASTER_DATA_WRITTEN_CODE 10
335
338
 
 
339
#define Q_INVOKER 11
 
340
 
336
341
/* Intvar event post-header */
337
342
 
338
343
/* Intvar event data */
976
981
    return (void*) my_malloc((uint)size, MYF(MY_WME|MY_FAE));
977
982
  }
978
983
 
979
 
  static void operator delete(void *ptr, size_t size)
 
984
  static void operator delete(void *ptr, size_t)
980
985
  {
981
 
    my_free((uchar*) ptr, MYF(MY_WME|MY_ALLOW_ZERO_PTR));
 
986
    my_free(ptr, MYF(MY_WME|MY_ALLOW_ZERO_PTR));
982
987
  }
983
988
 
984
989
  /* Placement version of the above operators */
1546
1551
*/
1547
1552
class Query_log_event: public Log_event
1548
1553
{
 
1554
  LEX_STRING user;
 
1555
  LEX_STRING host;
1549
1556
protected:
1550
1557
  Log_event::Byte* data_buf;
1551
1558
public:
1777
1784
  void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
1778
1785
#endif
1779
1786
 
1780
 
  Slave_log_event(const char* buf, uint event_len);
 
1787
  Slave_log_event(const char* buf,
 
1788
                  uint event_len,
 
1789
                  const Format_description_log_event *description_event);
1781
1790
  ~Slave_log_event();
1782
1791
  int get_data_size();
1783
1792
  bool is_valid() const { return master_host != 0; }
3576
3585
  int write_row(const Relay_log_info *const, const bool);
3577
3586
 
3578
3587
  // Unpack the current row into m_table->record[0]
3579
 
  int unpack_current_row(const Relay_log_info *const rli,
3580
 
                         const bool abort_on_warning= TRUE)
3581
 
  { 
 
3588
  int unpack_current_row(const Relay_log_info *const rli)
 
3589
  {
3582
3590
    DBUG_ASSERT(m_table);
3583
3591
 
3584
 
    bool first_row= (m_curr_row == m_rows_buf);
3585
3592
    ASSERT_OR_RETURN_ERROR(m_curr_row < m_rows_end, HA_ERR_CORRUPT_EVENT);
3586
3593
    int const result= ::unpack_row(rli, m_table, m_width, m_curr_row, &m_cols,
3587
 
                                   &m_curr_row_end, &m_master_reclength,
3588
 
                                   abort_on_warning, first_row);
 
3594
                                   &m_curr_row_end, &m_master_reclength);
3589
3595
    if (m_curr_row_end > m_rows_end)
3590
3596
      my_error(ER_SLAVE_CORRUPT_EVENT, MYF(0));
3591
3597
    ASSERT_OR_RETURN_ERROR(m_curr_row_end <= m_rows_end, HA_ERR_CORRUPT_EVENT);