~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/innobase/trx/trx0rec.c

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-12-09 06:02:39 UTC
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20101209060239-t0ujftvcvd558yno
Tags: upstream-2010.12.05
ImportĀ upstreamĀ versionĀ 2010.12.05

Show diffs side-by-side

added added

removed removed

Lines of Context:
242
242
 
243
243
        /* Store first some general parameters to the undo log */
244
244
        *ptr++ = TRX_UNDO_INSERT_REC;
245
 
        ptr += mach_dulint_write_much_compressed(ptr, trx->undo_no);
246
 
        ptr += mach_dulint_write_much_compressed(ptr, index->table->id);
 
245
        ptr += mach_ull_write_much_compressed(ptr, trx->undo_no);
 
246
        ptr += mach_ull_write_much_compressed(ptr, index->table->id);
247
247
        /*----------------------------------------*/
248
248
        /* Store then the fields required to uniquely determine the record
249
249
        to be inserted in the clustered index */
289
289
        ibool*          updated_extern, /*!< out: TRUE if we updated an
290
290
                                        externally stored fild */
291
291
        undo_no_t*      undo_no,        /*!< out: undo log record number */
292
 
        dulint*         table_id)       /*!< out: table id */
 
292
        table_id_t*     table_id)       /*!< out: table id */
293
293
{
294
294
        byte*           ptr;
295
295
        ulint           type_cmpl;
309
309
        *type = type_cmpl & (TRX_UNDO_CMPL_INFO_MULT - 1);
310
310
        *cmpl_info = type_cmpl / TRX_UNDO_CMPL_INFO_MULT;
311
311
 
312
 
        *undo_no = mach_dulint_read_much_compressed(ptr);
313
 
        ptr += mach_dulint_get_much_compressed_size(*undo_no);
 
312
        *undo_no = mach_ull_read_much_compressed(ptr);
 
313
        ptr += mach_ull_get_much_compressed_size(*undo_no);
314
314
 
315
 
        *table_id = mach_dulint_read_much_compressed(ptr);
316
 
        ptr += mach_dulint_get_much_compressed_size(*table_id);
 
315
        *table_id = mach_ull_read_much_compressed(ptr);
 
316
        ptr += mach_ull_get_much_compressed_size(*table_id);
317
317
 
318
318
        return(ptr);
319
319
}
598
598
        type_cmpl_ptr = ptr;
599
599
 
600
600
        *ptr++ = (byte) type_cmpl;
601
 
        ptr += mach_dulint_write_much_compressed(ptr, trx->undo_no);
 
601
        ptr += mach_ull_write_much_compressed(ptr, trx->undo_no);
602
602
 
603
 
        ptr += mach_dulint_write_much_compressed(ptr, table->id);
 
603
        ptr += mach_ull_write_much_compressed(ptr, table->id);
604
604
 
605
605
        /*----------------------------------------*/
606
606
        /* Store the state of the info bits */
620
620
        by some other trx as it must have committed by now for us to
621
621
        allow an over-write. */
622
622
        if (ignore_prefix) {
623
 
                ignore_prefix = ut_dulint_cmp(trx_id, trx->id) != 0;
 
623
                ignore_prefix = (trx_id != trx->id);
624
624
        }
625
 
        ptr += mach_dulint_write_compressed(ptr, trx_id);
 
625
        ptr += mach_ull_write_compressed(ptr, trx_id);
626
626
 
627
627
        field = rec_get_nth_field(rec, offsets,
628
628
                                  dict_index_get_sys_col_pos(
629
629
                                          index, DATA_ROLL_PTR), &flen);
630
630
        ut_ad(flen == DATA_ROLL_PTR_LEN);
631
631
 
632
 
        ptr += mach_dulint_write_compressed(ptr, trx_read_roll_ptr(field));
 
632
        ptr += mach_ull_write_compressed(ptr, trx_read_roll_ptr(field));
633
633
 
634
634
        /*----------------------------------------*/
635
635
        /* Store then the fields required to uniquely determine the
848
848
 
849
849
        /* Read the values of the system columns */
850
850
 
851
 
        *trx_id = mach_dulint_read_compressed(ptr);
852
 
        ptr += mach_dulint_get_compressed_size(*trx_id);
 
851
        *trx_id = mach_ull_read_compressed(ptr);
 
852
        ptr += mach_ull_get_compressed_size(*trx_id);
853
853
 
854
 
        *roll_ptr = mach_dulint_read_compressed(ptr);
855
 
        ptr += mach_dulint_get_compressed_size(*roll_ptr);
 
854
        *roll_ptr = mach_ull_read_compressed(ptr);
 
855
        ptr += mach_ull_get_compressed_size(*roll_ptr);
856
856
 
857
857
        return(ptr);
858
858
}
1168
1168
                                        index, otherwise NULL */
1169
1169
        roll_ptr_t*     roll_ptr)       /*!< out: rollback pointer to the
1170
1170
                                        inserted undo log record,
1171
 
                                        ut_dulint_zero if BTR_NO_UNDO_LOG
 
1171
                                        0 if BTR_NO_UNDO_LOG
1172
1172
                                        flag was specified */
1173
1173
{
1174
1174
        trx_t*          trx;
1186
1186
 
1187
1187
        if (flags & BTR_NO_UNDO_LOG_FLAG) {
1188
1188
 
1189
 
                *roll_ptr = ut_dulint_zero;
 
1189
                *roll_ptr = 0;
1190
1190
 
1191
1191
                return(DB_SUCCESS);
1192
1192
        }
1284
1284
                        undo->top_undo_no = trx->undo_no;
1285
1285
                        undo->guess_block = undo_block;
1286
1286
 
1287
 
                        UT_DULINT_INC(trx->undo_no);
 
1287
                        trx->undo_no++;
1288
1288
 
1289
1289
                        mutex_exit(&trx->undo_mutex);
1290
1290
 
1433
1433
        trx_id_t        rec_trx_id;
1434
1434
        ulint           type;
1435
1435
        undo_no_t       undo_no;
1436
 
        dulint          table_id;
 
1436
        table_id_t      table_id;
1437
1437
        trx_id_t        trx_id;
1438
1438
        roll_ptr_t      roll_ptr;
1439
1439
        roll_ptr_t      old_roll_ptr;
1523
1523
                                             roll_ptr, info_bits,
1524
1524
                                             NULL, heap, &update);
1525
1525
 
1526
 
        if (ut_dulint_cmp(table_id, index->table->id) != 0) {
 
1526
        if (UNIV_UNLIKELY(table_id != index->table->id)) {
1527
1527
                ptr = NULL;
1528
1528
 
1529
1529
                fprintf(stderr,
1544
1544
                fprintf(stderr,
1545
1545
                        "InnoDB: table %s, index %s, n_uniq %lu\n"
1546
1546
                        "InnoDB: undo rec address %p, type %lu cmpl_info %lu\n"
1547
 
                        "InnoDB: undo rec table id %lu %lu,"
1548
 
                        " index table id %lu %lu\n"
 
1547
                        "InnoDB: undo rec table id %llu,"
 
1548
                        " index table id %llu\n"
1549
1549
                        "InnoDB: dump of 150 bytes in undo rec: ",
1550
1550
                        index->table_name, index->name,
1551
1551
                        (ulong) dict_index_get_n_unique(index),
1552
1552
                        undo_rec, (ulong) type, (ulong) cmpl_info,
1553
 
                        (ulong) ut_dulint_get_high(table_id),
1554
 
                        (ulong) ut_dulint_get_low(table_id),
1555
 
                        (ulong) ut_dulint_get_high(index->table->id),
1556
 
                        (ulong) ut_dulint_get_low(index->table->id));
 
1553
                        (ullint) table_id,
 
1554
                        (ullint) index->table->id);
1557
1555
                ut_print_buf(stderr, undo_rec, 150);
1558
1556
                fputs("\n"
1559
1557
                      "InnoDB: index record ", stderr);
1564
1562
                fprintf(stderr, "\n"
1565
1563
                        "InnoDB: Record trx id " TRX_ID_FMT
1566
1564
                        ", update rec trx id " TRX_ID_FMT "\n"
1567
 
                        "InnoDB: Roll ptr in rec %lu %lu, in update rec"
1568
 
                        " %lu %lu\n",
1569
 
                        TRX_ID_PREP_PRINTF(rec_trx_id),
1570
 
                        TRX_ID_PREP_PRINTF(trx_id),
1571
 
                        (ulong) ut_dulint_get_high(old_roll_ptr),
1572
 
                        (ulong) ut_dulint_get_low(old_roll_ptr),
1573
 
                        (ulong) ut_dulint_get_high(roll_ptr),
1574
 
                        (ulong) ut_dulint_get_low(roll_ptr));
 
1565
                        "InnoDB: Roll ptr in rec " TRX_ID_FMT
 
1566
                        ", in update rec" TRX_ID_FMT "\n",
 
1567
                        rec_trx_id, trx_id,
 
1568
                        old_roll_ptr, roll_ptr);
1575
1569
 
1576
1570
                trx_purge_sys_print();
1577
1571
                return(DB_ERROR);