~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Lee Bieber
  • Date: 2011-02-23 23:22:48 UTC
  • mfrom: (2183.2.20 list2)
  • mto: This revision was merged to the branch mainline in revision 2197.
  • Revision ID: kalebral@gmail.com-20110223232248-ev4y8pyt16b806o0
Merge Olaf - Use List::size()

Show diffs side-by-side

added added

removed removed

Lines of Context:
313
313
{
314
314
        upd_node_t*     node;
315
315
 
316
 
        node = mem_heap_alloc(heap, sizeof(upd_node_t));
 
316
        node = static_cast<upd_node_t *>(mem_heap_alloc(heap, sizeof(upd_node_t)));
317
317
        node->common.type = QUE_NODE_UPDATE;
318
318
 
319
319
        node->state = UPD_NODE_UPDATE_CLUSTERED;
381
381
void
382
382
row_upd_index_entry_sys_field(
383
383
/*==========================*/
384
 
        const dtuple_t* entry,  /*!< in: index entry, where the memory buffers
385
 
                                for sys fields are already allocated:
 
384
        dtuple_t*       entry,  /*!< in/out: index entry, where the memory
 
385
                                buffers for sys fields are already allocated:
386
386
                                the function just copies the new values to
387
387
                                them */
388
388
        dict_index_t*   index,  /*!< in: clustered index */
398
398
        pos = dict_index_get_sys_col_pos(index, type);
399
399
 
400
400
        dfield = dtuple_get_nth_field(entry, pos);
401
 
        field = dfield_get_data(dfield);
 
401
        field = static_cast<byte *>(dfield_get_data(dfield));
402
402
 
403
403
        if (type == DATA_TRX_ID) {
404
404
                trx_write_trx_id(field, val);
476
476
#endif /* !UNIV_HOTBACKUP */
477
477
 
478
478
/***********************************************************//**
479
 
Replaces the new column values stored in the update vector to the record
480
 
given. No field size changes are allowed. */
 
479
Replaces the new column values stored in the update vector to the
 
480
record given. No field size changes are allowed. This function is
 
481
usually invoked on a clustered index. The only use case for a
 
482
secondary index is row_ins_sec_index_entry_by_modify() or its
 
483
counterpart in ibuf_insert_to_index_page(). */
481
484
UNIV_INTERN
482
485
void
483
486
row_upd_rec_in_place(
534
537
        roll_ptr_t      roll_ptr,/*!< in: roll ptr of the undo log record */
535
538
        byte*           log_ptr,/*!< pointer to a buffer of size > 20 opened
536
539
                                in mlog */
537
 
        mtr_t*          mtr __attribute__((unused))) /*!< in: mtr */
 
540
        mtr_t*          /*mtr __attribute__((unused))*/) /*!< in: mtr */
538
541
{
539
542
        ut_ad(dict_index_is_clust(index));
540
543
        ut_ad(mtr);
645
648
                                mlog_close(mtr, log_ptr);
646
649
 
647
650
                                mlog_catenate_string(mtr,
648
 
                                                     dfield_get_data(new_val),
 
651
                                                     static_cast<byte *>(dfield_get_data(new_val)),
649
652
                                                     len);
650
653
 
651
654
                                log_ptr = mlog_open(mtr, MLOG_BUF_MARGIN);
904
907
                                        out: fetched length of the prefix */
905
908
        mem_heap_t*     heap)           /*!< in: heap where to allocate */
906
909
{
907
 
        byte*   buf = mem_heap_alloc(heap, *len);
 
910
        byte* buf = static_cast<byte *>(mem_heap_alloc(heap, *len));
908
911
 
909
912
        *len = btr_copy_externally_stored_field_prefix(buf, *len,
910
913
                                                       zip_size,
942
945
        }
943
946
 
944
947
        len = dfield_get_len(dfield);
945
 
        data = dfield_get_data(dfield);
 
948
        data = static_cast<const byte *>(dfield_get_data(dfield));
946
949
 
947
950
        if (field->prefix_len > 0) {
948
951
                ibool           fetch_ext = dfield_is_ext(dfield)
993
996
                stored part of the column.  The data
994
997
                will have to be copied. */
995
998
                ut_a(uf->orig_len > BTR_EXTERN_FIELD_REF_SIZE);
996
 
                buf = mem_heap_alloc(heap, uf->orig_len);
 
999
                buf = static_cast<byte *>(mem_heap_alloc(heap, uf->orig_len));
997
1000
                /* Copy the locally stored prefix. */
998
1001
                memcpy(buf, data,
999
1002
                       uf->orig_len - BTR_EXTERN_FIELD_REF_SIZE);
1143
1146
        table = index->table;
1144
1147
        ut_ad(n_cols == dict_table_get_n_cols(table));
1145
1148
 
1146
 
        ext_cols = mem_heap_alloc(heap, n_cols * sizeof *ext_cols);
 
1149
        ext_cols = static_cast<ulint *>(mem_heap_alloc(heap, n_cols * sizeof *ext_cols));
1147
1150
        n_ext_cols = 0;
1148
1151
 
1149
1152
        dtuple_set_info_bits(row, update->info_bits);
1622
1625
ulint
1623
1626
row_upd_clust_rec_by_insert(
1624
1627
/*========================*/
1625
 
        upd_node_t*     node,   /*!< in: row update node */
 
1628
        upd_node_t*     node,   /*!< in/out: row update node */
1626
1629
        dict_index_t*   index,  /*!< in: clustered index of the record */
1627
1630
        que_thr_t*      thr,    /*!< in: query thread */
1628
1631
        ibool           referenced,/*!< in: TRUE if index may be referenced in
1629
1632
                                a foreign key constraint */
1630
 
        mtr_t*          mtr)    /*!< in: mtr; gets committed here */
 
1633
        mtr_t*          mtr)    /*!< in/out: mtr; gets committed here */
1631
1634
{
1632
1635
        mem_heap_t*     heap    = NULL;
1633
1636
        btr_pcur_t*     pcur;
1648
1651
 
1649
1652
        if (node->state != UPD_NODE_INSERT_CLUSTERED) {
1650
1653
                rec_t*          rec;
1651
 
                dict_index_t*   index;
 
1654
                dict_index_t*   node_index;
1652
1655
                ulint           offsets_[REC_OFFS_NORMAL_SIZE];
1653
1656
                ulint*          offsets;
1654
1657
                rec_offs_init(offsets_);
1666
1669
                record is removed from the index tree, or updated. */
1667
1670
 
1668
1671
                rec = btr_cur_get_rec(btr_cur);
1669
 
                index = dict_table_get_first_index(table);
1670
 
                offsets = rec_get_offsets(rec, index, offsets_,
 
1672
                node_index = dict_table_get_first_index(table);
 
1673
                offsets = rec_get_offsets(rec, node_index, offsets_,
1671
1674
                                          ULINT_UNDEFINED, &heap);
1672
1675
                change_ownership = btr_cur_mark_extern_inherited_fields(
1673
 
                        btr_cur_get_page_zip(btr_cur), rec, index, offsets,
 
1676
                        btr_cur_get_page_zip(btr_cur), rec, node_index, offsets,
1674
1677
                        node->update, mtr);
1675
1678
                if (referenced) {
1676
1679
                        /* NOTE that the following call loses
1677
1680
                        the position of pcur ! */
1678
1681
 
1679
1682
                        err = row_upd_check_references_constraints(
1680
 
                                node, pcur, table, index, offsets, thr, mtr);
 
1683
                                node, pcur, table, node_index, offsets, thr, mtr);
1681
1684
 
1682
1685
                        if (err != DB_SUCCESS) {
1683
1686
 
2151
2154
 
2152
2155
        trx_start_if_not_started(trx);
2153
2156
 
2154
 
        node = thr->run_node;
 
2157
        node = static_cast<upd_node_t *>(thr->run_node);
2155
2158
 
2156
2159
        sel_node = node->select;
2157
2160