~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/row/row0upd.c

  • Committer: Lee Bieber
  • Date: 2010-12-03 01:16:19 UTC
  • mfrom: (1819.9.81 update-innobase)
  • Revision ID: kalebral@gmail.com-20101203011619-n6v584rijwdet05b
Merge Stewart - update Innobase plugin based on InnoDB 1.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
searched delete is obviously to keep the x-latch for several
93
93
steps of query graph execution. */
94
94
 
 
95
/*************************************************************************
 
96
IMPORTANT NOTE: Any operation that generates redo MUST check that there
 
97
is enough space in the redo log before for that operation. This is
 
98
done by calling log_free_check(). The reason for checking the
 
99
availability of the redo log space before the start of the operation is
 
100
that we MUST not hold any synchonization objects when performing the
 
101
check.
 
102
If you make a change in this module make sure that no codepath is
 
103
introduced where a call to log_free_check() is bypassed. */
 
104
 
 
105
/*************************************************************************
 
106
IMPORTANT NOTE: Any operation that generates redo MUST check that there
 
107
is enough space in the redo log before for that operation. This is
 
108
done by calling log_free_check(). The reason for checking the
 
109
availability of the redo log space before the start of the operation is
 
110
that we MUST not hold any synchonization objects when performing the
 
111
check.
 
112
If you make a change in this module make sure that no codepath is
 
113
introduced where a call to log_free_check() is bypassed. */
 
114
 
95
115
/***********************************************************//**
96
116
Checks if an update vector changes some of the first ordering fields of an
97
117
index record. This is only used in foreign key checks and we can assume
367
387
                                them */
368
388
        dict_index_t*   index,  /*!< in: clustered index */
369
389
        ulint           type,   /*!< in: DATA_TRX_ID or DATA_ROLL_PTR */
370
 
        dulint          val)    /*!< in: value to write */
 
390
        ib_uint64_t     val)    /*!< in: value to write */
371
391
{
372
392
        dfield_t*       dfield;
373
393
        byte*           field;
526
546
        trx_write_roll_ptr(log_ptr, roll_ptr);
527
547
        log_ptr += DATA_ROLL_PTR_LEN;
528
548
 
529
 
        log_ptr += mach_dulint_write_compressed(log_ptr, trx->id);
 
549
        log_ptr += mach_ull_write_compressed(log_ptr, trx->id);
530
550
 
531
551
        return(log_ptr);
532
552
}
560
580
        *roll_ptr = trx_read_roll_ptr(ptr);
561
581
        ptr += DATA_ROLL_PTR_LEN;
562
582
 
563
 
        ptr = mach_dulint_parse_compressed(ptr, end_ptr, trx_id);
 
583
        ptr = mach_ull_parse_compressed(ptr, end_ptr, trx_id);
564
584
 
565
585
        return(ptr);
566
586
}
939
959
                }
940
960
 
941
961
                len = dtype_get_at_most_n_mbchars(col->prtype,
942
 
                                                  col->mbminlen, col->mbmaxlen,
 
962
                                                  col->mbminmaxlen,
943
963
                                                  field->prefix_len, len,
944
964
                                                  (const char*) data);
945
965
 
1388
1408
        dict_index_t*   clust_index;
1389
1409
        rec_t*          rec;
1390
1410
        mem_heap_t*     heap            = NULL;
 
1411
        row_ext_t**     ext;
1391
1412
        ulint           offsets_[REC_OFFS_NORMAL_SIZE];
1392
1413
        const ulint*    offsets;
1393
1414
        rec_offs_init(offsets_);
1404
1425
 
1405
1426
        offsets = rec_get_offsets(rec, clust_index, offsets_,
1406
1427
                                  ULINT_UNDEFINED, &heap);
 
1428
 
 
1429
        if (dict_table_get_format(node->table) >= DICT_TF_FORMAT_ZIP) {
 
1430
                /* In DYNAMIC or COMPRESSED format, there is no prefix
 
1431
                of externally stored columns in the clustered index
 
1432
                record. Build a cache of column prefixes. */
 
1433
                ext = &node->ext;
 
1434
        } else {
 
1435
                /* REDUNDANT and COMPACT formats store a local
 
1436
                768-byte prefix of each externally stored column.
 
1437
                No cache is needed. */
 
1438
                ext = NULL;
 
1439
                node->ext = NULL;
 
1440
        }
 
1441
 
1407
1442
        node->row = row_build(ROW_COPY_DATA, clust_index, rec, offsets,
1408
 
                              NULL, &node->ext, node->heap);
 
1443
                              NULL, ext, node->heap);
1409
1444
        if (node->is_delete) {
1410
1445
                node->upd_row = NULL;
1411
1446
                node->upd_ext = NULL;
1454
1489
        entry = row_build_index_entry(node->row, node->ext, index, heap);
1455
1490
        ut_a(entry);
1456
1491
 
1457
 
        log_free_check();
1458
1492
        mtr_start(&mtr);
1459
1493
 
1460
1494
        /* Set the query thread, so that ibuf_insert_low() will be
1557
1591
deletes it if this is a delete.
1558
1592
@return DB_SUCCESS if operation successfully completed, else error
1559
1593
code or DB_LOCK_WAIT */
1560
 
UNIV_INLINE
 
1594
static
1561
1595
ulint
1562
1596
row_upd_sec_step(
1563
1597
/*=============*/
1903
1937
        then we have to free the file segments of the index tree associated
1904
1938
        with the index */
1905
1939
 
1906
 
        if (node->is_delete
1907
 
            && ut_dulint_cmp(node->table->id, DICT_INDEXES_ID) == 0) {
 
1940
        if (node->is_delete && node->table->id == DICT_INDEXES_ID) {
1908
1941
 
1909
1942
                dict_drop_index_tree(btr_pcur_get_rec(pcur), mtr);
1910
1943
 
2049
2082
        if (node->state == UPD_NODE_UPDATE_CLUSTERED
2050
2083
            || node->state == UPD_NODE_INSERT_CLUSTERED) {
2051
2084
 
 
2085
                log_free_check();
2052
2086
                err = row_upd_clust_step(node, thr);
2053
2087
 
2054
2088
                if (err != DB_SUCCESS) {
2063
2097
        }
2064
2098
 
2065
2099
        while (node->index != NULL) {
 
2100
 
 
2101
                log_free_check();
2066
2102
                err = row_upd_sec_step(node, thr);
2067
2103
 
2068
2104
                if (err != DB_SUCCESS) {