~ubuntu-branches/ubuntu/quantal/mysql-5.5/quantal-security

« back to all changes in this revision

Viewing changes to sql/log_event.h

  • Committer: Package Import Robot
  • Author(s): Seth Arnold
  • Date: 2013-04-18 18:15:39 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20130418181539-7uo1w041b4h2ulbs
Tags: 5.5.31-0ubuntu0.12.10.1
* SECURITY UPDATE: Update to 5.5.31 to fix security issues (LP: #1170516)
  - http://www.oracle.com/technetwork/topics/security/cpuapr2013-1899555.html
* debian/patches/71_disable_rpl_tests.patch: refreshed.
* debian/patches/fix-mysqldump-test.patch: removed, fixed differently
  upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
 
1
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
   This program is free software; you can redistribute it and/or modify
4
4
   it under the terms of the GNU General Public License as published by
997
997
                                   mysql_mutex_t* log_lock,
998
998
                                   const Format_description_log_event
999
999
                                   *description_event);
 
1000
 
 
1001
  /**
 
1002
    Reads an event from a binlog or relay log. Used by the dump thread
 
1003
    this method reads the event into a raw buffer without parsing it.
 
1004
 
 
1005
    @Note If mutex is 0, the read will proceed without mutex.
 
1006
 
 
1007
    @Note If a log name is given than the method will check if the
 
1008
    given binlog is still active.
 
1009
 
 
1010
    @param[in]  file                log file to be read
 
1011
    @param[out] packet              packet to hold the event
 
1012
    @param[in]  lock                the lock to be used upon read
 
1013
    @param[in]  log_file_name_arg   the log's file name
 
1014
    @param[out] is_binlog_active    is the current log still active
 
1015
 
 
1016
    @retval 0                   success
 
1017
    @retval LOG_READ_EOF        end of file, nothing was read
 
1018
    @retval LOG_READ_BOGUS      malformed event
 
1019
    @retval LOG_READ_IO         io error while reading
 
1020
    @retval LOG_READ_MEM        packet memory allocation failed
 
1021
    @retval LOG_READ_TRUNC      only a partial event could be read
 
1022
    @retval LOG_READ_TOO_LARGE  event too large
 
1023
   */
1000
1024
  static int read_log_event(IO_CACHE* file, String* packet,
1001
 
                            mysql_mutex_t* log_lock);
 
1025
                            mysql_mutex_t* log_lock,
 
1026
                            const char *log_file_name_arg= NULL,
 
1027
                            bool* is_binlog_active= NULL);
1002
1028
  /*
1003
1029
    init_show_field_list() prepares the column names and types for the
1004
1030
    output of SHOW BINLOG EVENTS; it is used only by SHOW BINLOG
1021
1047
    return thd ? thd->db : 0;
1022
1048
  }
1023
1049
#else
1024
 
  Log_event() : temp_buf(0) {}
 
1050
  Log_event() : temp_buf(0), flags(0) {}
1025
1051
    /* avoid having to link mysqlbinlog against libpthread */
1026
1052
  static Log_event* read_log_event(IO_CACHE* file,
1027
1053
                                   const Format_description_log_event
2320
2346
#ifdef MYSQL_SERVER
2321
2347
  bool write(IO_CACHE* file);
2322
2348
#endif
2323
 
  bool is_valid() const
 
2349
  bool header_is_valid() const
2324
2350
  {
2325
2351
    return ((common_header_len >= ((binlog_version==1) ? OLD_HEADER_LEN :
2326
2352
                                   LOG_EVENT_MINIMAL_HEADER_LEN)) &&
2327
2353
            (post_header_len != NULL));
2328
2354
  }
 
2355
 
 
2356
  bool version_is_valid() const
 
2357
  {
 
2358
    /* It is invalid only when all version numbers are 0 */
 
2359
    return !(server_version_split[0] == 0 &&
 
2360
             server_version_split[1] == 0 &&
 
2361
             server_version_split[2] == 0);
 
2362
  }
 
2363
 
 
2364
  bool is_valid() const
 
2365
  {
 
2366
    return header_is_valid() && version_is_valid();
 
2367
  }
 
2368
 
2329
2369
  int get_data_size()
2330
2370
  {
2331
2371
    /*