~clint-fewbar/ubuntu/natty/mysql-5.1/merge-5.1.49-2

« back to all changes in this revision

Viewing changes to sql/sql_binlog.cc

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-08-04 13:18:27 UTC
  • mfrom: (1.2.2 upstream) (2.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20100804131827-4tjg88vr9dd49s3k
Tags: 5.1.49-1ubuntu1
* Merge from debian unstable:
  + debian/control:
     * Update maintainer according to spec.
     * Move section from "misc" to "database".
     * Added libmysqlclient16-dev an empty transitional package. 
     * Added mysql-client-core-5.1 package.
     * Suggest mailx for mysql-server-5.1
     * Add mysql-testsuite package so you can run the testsuite seperately.
  + debian/additions/my.cnf:
    * Remove language options. Error message files are located in a different directory in Mysql
      5.0. Setting the language option to use /usr/share/mysql/english breaks Mysql 5.0. Both 5.0
      and 5.1 use a different value that works. (LP: #316974)
  + Add apparmor profile:
    + debian/apparmor-profile: apparmor-profile
    + debian/rules, debian/mysql-server-5.1.files: install apparmor profile
    + debian/mysql-server-5.1.dirs: add etc/apparmor.d/fore-complain
    + debian/mysql-server-5.1.postrm: remove symlink in force-complain/ on purge.
    + debian/mysql-server-5.1.README.Debian: add apparmor documentation.
    + debian/additions/my.cnf: Add warning about apparmor. (LP: #201799)
    + debian/mysql-server-5.1.postinst: reload apparmor profiles
  * Convert the package from sysvinit to upstart:
    + debian/mysql-server-5.1.mysql.upstart: Add upstart script.
    + debian/mysql-server-5.1.mysql.init: Dropped, unused now with upstart.
    + debian/additions/mysqld_safe_syslog.cnf: Dropped, unused now with upstart.
    + debian/additons/my.cnf: Remove pid declaration and setup error logging to /var/log/mysql since
      we're not piping anything around logger anymore.
    + debian/rules, debian/mysql-server-5.1.logcheck.ignore.{paranoid,worstation},
      debian/mysql-server-5.1.logcheck.ignore.server: : Remove references to mysqld_safe
    + debian/patches/38_scripts_mysqld_safe.sh_signals.dpatch: Dropped
  * Added -fno-strict-aliasing to CFLAGS to get around mysql testsuite build failures.
  * Add Apport hook (LP: #354188):
    + debian/mysql-server-5.1.py: apport package hook
    + debian/rules: Make it installable
  * debian/mysql-server-5.1.mysql-server.logrotate: Check to see if mysql is running before
    running logrotate. (LP: #513135)
  * Make the testsuite installable. (LP: #530752)
    + debian/mysql-server-5.1.files, debian/rules: install apport package hook
  * debian/mysql-server-5.1.preinst: Set mysql user's home directory
    to /nonexistent to protect against having the /var/lib/mysql
    user-writeable. If an attacker can trick mysqld into creating
    dot files in the home directory, he could do .rhost-like attacks
    on the system. (LP: #293258)
  * debian/control: mysql-client-5.1 should depend on mysql-core-client-5.1.
    (LP: #590952) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
  if (check_global_access(thd, SUPER_ACL))
43
43
    DBUG_VOID_RETURN;
44
44
 
45
 
  size_t coded_len= thd->lex->comment.length + 1;
 
45
  size_t coded_len= thd->lex->comment.length;
 
46
  if (!coded_len)
 
47
  {
 
48
    my_error(ER_SYNTAX_ERROR, MYF(0));
 
49
    DBUG_VOID_RETURN;
 
50
  }
46
51
  size_t decoded_len= base64_needed_decoded_length(coded_len);
47
 
  DBUG_ASSERT(coded_len > 0);
48
52
 
49
53
  /*
50
54
    Allocation
145
149
      /*
146
150
        Checking that the first event in the buffer is not truncated.
147
151
      */
148
 
      ulong event_len= uint4korr(bufptr + EVENT_LEN_OFFSET);
 
152
      ulong event_len;
 
153
      if (bytes_decoded < EVENT_LEN_OFFSET + 4 || 
 
154
          (event_len= uint4korr(bufptr + EVENT_LEN_OFFSET)) > 
 
155
           (uint) bytes_decoded)
 
156
      {
 
157
        my_error(ER_SYNTAX_ERROR, MYF(0));
 
158
        goto end;
 
159
      }
149
160
      DBUG_PRINT("info", ("event_len=%lu, bytes_decoded=%d",
150
161
                          event_len, bytes_decoded));
151
 
      if (bytes_decoded < EVENT_LEN_OFFSET || (uint) bytes_decoded < event_len)
152
 
      {
153
 
        my_error(ER_SYNTAX_ERROR, MYF(0));
154
 
        goto end;
155
 
      }
156
162
 
157
163
      /*
158
164
        If we have not seen any Format_description_event, then we must
190
196
      bufptr += event_len;
191
197
 
192
198
      DBUG_PRINT("info",("ev->get_type_code()=%d", ev->get_type_code()));
193
 
#ifndef HAVE_purify
194
 
      /*
195
 
        This debug printout should not be used for valgrind builds
196
 
        since it will read from unassigned memory.
197
 
      */
198
 
      DBUG_PRINT("info",("bufptr+EVENT_TYPE_OFFSET: 0x%lx",
199
 
                         (long) (bufptr+EVENT_TYPE_OFFSET)));
200
 
      DBUG_PRINT("info", ("bytes_decoded: %d   bufptr: 0x%lx  buf[EVENT_LEN_OFFSET]: %lu",
201
 
                          bytes_decoded, (long) bufptr,
202
 
                          (ulong) uint4korr(bufptr+EVENT_LEN_OFFSET)));
203
 
#endif
204
199
      ev->thd= thd;
205
200
      /*
206
201
        We go directly to the application phase, since we don't need