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

« back to all changes in this revision

Viewing changes to sql/rpl_record.cc

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 08:30:45 UTC
  • mfrom: (1.4.1)
  • Revision ID: package-import@ubuntu.com-20120222083045-2rd53r4bnyx7qus4
Tags: 5.1.61-0ubuntu0.11.04.1
* SECURITY UPDATE: Update to 5.1.61 to fix multiple security issues
  (LP: #937869)
  - http://www.oracle.com/technetwork/topics/security/cpujan2012-366304.html
  - CVE-2011-2262
  - CVE-2012-0075
  - CVE-2012-0112
  - CVE-2012-0113
  - CVE-2012-0114
  - CVE-2012-0115
  - CVE-2012-0116
  - CVE-2012-0117
  - CVE-2012-0118
  - CVE-2012-0119
  - CVE-2012-0120
  - CVE-2012-0484
  - CVE-2012-0485
  - CVE-2012-0486
  - CVE-2012-0487
  - CVE-2012-0488
  - CVE-2012-0489
  - CVE-2012-0490
  - CVE-2012-0491
  - CVE-2012-0492
  - CVE-2012-0493
  - CVE-2012-0494
  - CVE-2012-0495
  - CVE-2012-0496

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright 2007 MySQL AB. All rights reserved.
 
1
/*
 
2
   Copyright (c) 2007, 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
#include "mysql_priv.h"
17
19
#include "rpl_rli.h"
180
182
unpack_row(Relay_log_info const *rli,
181
183
           TABLE *table, uint const colcnt,
182
184
           uchar const *const row_data, MY_BITMAP const *cols,
183
 
           uchar const **const row_end, ulong *const master_reclength,
184
 
           const bool abort_on_warning, const bool first_row)
 
185
           uchar const **const row_end, ulong *const master_reclength)
185
186
{
186
187
  DBUG_ENTER("unpack_row");
187
188
  DBUG_ASSERT(row_data);
251
252
        }
252
253
        else
253
254
        {
254
 
          MYSQL_ERROR::enum_warning_level error_type=
255
 
            MYSQL_ERROR::WARN_LEVEL_NOTE;
256
 
          if (abort_on_warning && (table->file->has_transactions() ||
257
 
                                   first_row))
258
 
          {
259
 
            error = HA_ERR_ROWS_EVENT_APPLY;
260
 
            error_type= MYSQL_ERROR::WARN_LEVEL_ERROR;
261
 
          }
262
 
          else
263
 
          {
264
 
            f->set_default();
265
 
            error_type= MYSQL_ERROR::WARN_LEVEL_WARN;
266
 
          }
267
 
          push_warning_printf(current_thd, error_type,
268
 
                              ER_BAD_NULL_ERROR,
269
 
                              ER(ER_BAD_NULL_ERROR),
 
255
          f->set_default();
 
256
          push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
257
                              ER_BAD_NULL_ERROR, ER(ER_BAD_NULL_ERROR),
270
258
                              f->field_name);
271
259
        }
272
260
      }
350
338
  @param skip   Number of columns for which default/nullable check 
351
339
                should be skipped.
352
340
  @param check  Specifies if lack of default error needs checking.
353
 
  @param abort_on_warning
354
 
                Controls how to react on lack of a field's default.
355
 
                The parameter mimics the master side one for
356
 
                @c check_that_all_fields_are_given_values.
357
 
                
 
341
 
358
342
  @returns 0 on success or a handler level error code
359
343
 */ 
360
 
int prepare_record(TABLE *const table, 
361
 
                   const uint skip, const bool check,
362
 
                   const bool abort_on_warning, const bool first_row)
 
344
int prepare_record(TABLE *const table, const uint skip, const bool check)
363
345
{
364
346
  DBUG_ENTER("prepare_record");
365
347
 
366
 
  int error= 0;
367
348
  restore_record(table, s->default_values);
368
349
 
369
350
  /*
386
367
    if ((f->flags &  NO_DEFAULT_VALUE_FLAG) &&
387
368
        (f->real_type() != MYSQL_TYPE_ENUM))
388
369
    {
389
 
 
390
 
      MYSQL_ERROR::enum_warning_level error_type=
391
 
        MYSQL_ERROR::WARN_LEVEL_NOTE;
392
 
      if (abort_on_warning && (table->file->has_transactions() ||
393
 
                               first_row))
394
 
      {
395
 
        error= HA_ERR_ROWS_EVENT_APPLY;
396
 
        error_type= MYSQL_ERROR::WARN_LEVEL_ERROR;
397
 
      }
398
 
      else
399
 
      {
400
 
        f->set_default();
401
 
        error_type= MYSQL_ERROR::WARN_LEVEL_WARN;
402
 
      }
403
 
      push_warning_printf(current_thd, error_type,
 
370
      f->set_default();
 
371
      push_warning_printf(current_thd,
 
372
                          MYSQL_ERROR::WARN_LEVEL_WARN,
404
373
                          ER_NO_DEFAULT_FOR_FIELD,
405
374
                          ER(ER_NO_DEFAULT_FOR_FIELD),
406
375
                          f->field_name);
407
376
    }
408
377
  }
409
378
 
410
 
  DBUG_RETURN(error);
 
379
  DBUG_RETURN(0);
411
380
}
412
381
 
413
382
#endif // HAVE_REPLICATION