~ubuntu-branches/ubuntu/precise/mysql-5.5/precise-201203300109

« back to all changes in this revision

Viewing changes to storage/innobase/row/row0ins.c

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-02-14 23:59:22 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20120214235922-cux5uek1e5l0hje9
Tags: 5.5.20-0ubuntu1
* New upstream release.
* d/mysql-server-5.5.mysql.upstart: Fix stop on to make sure mysql is
  fully stopped before shutdown commences. (LP: #688541) Also simplify
  start on as it is redundant.
* d/control: Depend on upstart version which has apparmor profile load
  script to prevent failure on upgrade from lucid to precise.
  (LP: #907465)
* d/apparmor-profile: need to allow /run since that is the true path
  of /var/run files. (LP: #917542)
* d/control: mysql-server-5.5 has files in it that used to be owned
  by libmysqlclient-dev, so it must break/replace it. (LP: #912487)
* d/rules, d/control: 5.5.20 Fixes segfault on tests with gcc 4.6,
  change compiler back to system default.
* d/rules: Turn off embedded libedit/readline.(Closes: #659566)

Show diffs side-by-side

added added

removed removed

Lines of Context:
437
437
        dict_table_t*   table           = foreign->foreign_table;
438
438
        dict_index_t*   index           = foreign->foreign_index;
439
439
        upd_t*          update;
440
 
        upd_field_t*    ufield;
441
440
        dict_table_t*   parent_table;
442
441
        dict_index_t*   parent_index;
443
442
        upd_t*          parent_update;
444
 
        upd_field_t*    parent_ufield;
445
443
        ulint           n_fields_updated;
446
444
        ulint           parent_field_no;
447
445
        ulint           i;
477
475
                        dict_index_get_nth_col_no(parent_index, i));
478
476
 
479
477
                for (j = 0; j < parent_update->n_fields; j++) {
480
 
                        parent_ufield = parent_update->fields + j;
 
478
                        const upd_field_t*      parent_ufield
 
479
                                = &parent_update->fields[j];
481
480
 
482
481
                        if (parent_ufield->field_no == parent_field_no) {
483
482
 
484
483
                                ulint                   min_size;
485
484
                                const dict_col_t*       col;
486
485
                                ulint                   ufield_len;
 
486
                                upd_field_t*            ufield;
487
487
 
488
488
                                col = dict_index_get_nth_col(index, i);
489
489
 
496
496
                                ufield->field_no
497
497
                                        = dict_table_get_nth_col_pos(
498
498
                                        table, dict_col_get_no(col));
 
499
 
 
500
                                ufield->orig_len = 0;
499
501
                                ufield->exp = NULL;
500
502
 
501
503
                                ufield->new_val = parent_ufield->new_val;
983
985
                goto nonstandard_exit_func;
984
986
        }
985
987
 
986
 
        if ((node->is_delete
987
 
             && (foreign->type & DICT_FOREIGN_ON_DELETE_SET_NULL))
988
 
            || (!node->is_delete
989
 
                && (foreign->type & DICT_FOREIGN_ON_UPDATE_SET_NULL))) {
 
988
        if (node->is_delete
 
989
            ? (foreign->type & DICT_FOREIGN_ON_DELETE_SET_NULL)
 
990
            : (foreign->type & DICT_FOREIGN_ON_UPDATE_SET_NULL)) {
990
991
 
991
992
                /* Build the appropriate update vector which sets
992
993
                foreign->n_fields first fields in rec to SQL NULL */
995
996
 
996
997
                update->info_bits = 0;
997
998
                update->n_fields = foreign->n_fields;
 
999
                UNIV_MEM_INVALID(update->fields,
 
1000
                                 update->n_fields * sizeof *update->fields);
998
1001
 
999
1002
                for (i = 0; i < foreign->n_fields; i++) {
1000
1003
                        upd_field_t*    ufield = &update->fields[i];
1652
1655
        ulint           n_fields_cmp;
1653
1656
        btr_pcur_t      pcur;
1654
1657
        ulint           err             = DB_SUCCESS;
1655
 
        unsigned        allow_duplicates;
 
1658
        ulint           allow_duplicates;
1656
1659
        mtr_t           mtr;
1657
1660
        mem_heap_t*     heap            = NULL;
1658
1661
        ulint           offsets_[REC_OFFS_NORMAL_SIZE];
1683
1686
 
1684
1687
        btr_pcur_open(index, entry, PAGE_CUR_GE, BTR_SEARCH_LEAF, &pcur, &mtr);
1685
1688
 
1686
 
        allow_duplicates = thr_get_trx(thr)->duplicates & TRX_DUP_IGNORE;
 
1689
        allow_duplicates = thr_get_trx(thr)->duplicates;
1687
1690
 
1688
1691
        /* Scan index records and check if there is a duplicate */
1689
1692
 
1817
1820
                        sure that in roll-forward we get the same duplicate
1818
1821
                        errors as in original execution */
1819
1822
 
1820
 
                        if (trx->duplicates & TRX_DUP_IGNORE) {
 
1823
                        if (trx->duplicates) {
1821
1824
 
1822
1825
                                /* If the SQL-query will update or replace
1823
1826
                                duplicate key we will take X-lock for
1861
1864
                        offsets = rec_get_offsets(rec, cursor->index, offsets,
1862
1865
                                                  ULINT_UNDEFINED, &heap);
1863
1866
 
1864
 
                        if (trx->duplicates & TRX_DUP_IGNORE) {
 
1867
                        if (trx->duplicates) {
1865
1868
 
1866
1869
                                /* If the SQL-query will update or replace
1867
1870
                                duplicate key we will take X-lock for