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

« back to all changes in this revision

Viewing changes to plugin/innobase/read/read0read.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:
168
168
read_view_oldest_copy_or_open_new(
169
169
/*==============================*/
170
170
        trx_id_t        cr_trx_id,      /*!< in: trx_id of creating
171
 
                                        transaction, or ut_dulint_zero
172
 
                                        used in purge */
 
171
                                        transaction, or 0 used in purge */
173
172
        mem_heap_t*     heap)           /*!< in: memory heap from which
174
173
                                        allocated */
175
174
{
191
190
 
192
191
        n = old_view->n_trx_ids;
193
192
 
194
 
        if (!ut_dulint_is_zero(old_view->creator_trx_id)) {
 
193
        if (old_view->creator_trx_id) {
195
194
                n++;
196
195
        } else {
197
196
                needs_insert = FALSE;
206
205
        while (i < n) {
207
206
                if (needs_insert
208
207
                    && (i >= old_view->n_trx_ids
209
 
                        || ut_dulint_cmp(old_view->creator_trx_id,
210
 
                                         read_view_get_nth_trx_id(old_view, i))
211
 
                        > 0)) {
 
208
                        || old_view->creator_trx_id
 
209
                        > read_view_get_nth_trx_id(old_view, i))) {
212
210
 
213
211
                        read_view_set_nth_trx_id(view_copy, i,
214
212
                                                 old_view->creator_trx_id);
252
250
read_view_open_now(
253
251
/*===============*/
254
252
        trx_id_t        cr_trx_id,      /*!< in: trx_id of creating
255
 
                                        transaction, or ut_dulint_zero
256
 
                                        used in purge */
 
253
                                        transaction, or 0 used in purge */
257
254
        mem_heap_t*     heap)           /*!< in: memory heap from which
258
255
                                        allocated */
259
256
{
267
264
 
268
265
        view->creator_trx_id = cr_trx_id;
269
266
        view->type = VIEW_NORMAL;
270
 
        view->undo_no = ut_dulint_zero;
 
267
        view->undo_no = 0;
271
268
 
272
269
        /* No future transactions should be visible in the view */
273
270
 
280
277
        /* No active transaction should be visible, except cr_trx */
281
278
 
282
279
        while (trx) {
283
 
                if (ut_dulint_cmp(trx->id, cr_trx_id) != 0
 
280
                if (trx->id != cr_trx_id
284
281
                    && (trx->conc_state == TRX_ACTIVE
285
282
                        || trx->conc_state == TRX_PREPARED)) {
286
283
 
292
289
                        trx_sys->max_trx_id can still be active, if it is
293
290
                        in the middle of its commit! Note that when a
294
291
                        transaction starts, we initialize trx->no to
295
 
                        ut_dulint_max. */
 
292
                        IB_ULONGLONG_MAX. */
296
293
 
297
 
                        if (ut_dulint_cmp(view->low_limit_no, trx->no) > 0) {
 
294
                        if (view->low_limit_no > trx->no) {
298
295
 
299
296
                                view->low_limit_no = trx->no;
300
297
                        }
367
364
 
368
365
        if (view->type == VIEW_HIGH_GRANULARITY) {
369
366
                fprintf(stderr,
370
 
                        "High-granularity read view undo_n:o %lu %lu\n",
371
 
                        (ulong) ut_dulint_get_high(view->undo_no),
372
 
                        (ulong) ut_dulint_get_low(view->undo_no));
 
367
                        "High-granularity read view undo_n:o %llu\n",
 
368
                        (ullint) view->undo_no);
373
369
        } else {
374
370
                fprintf(stderr, "Normal read view\n");
375
371
        }
376
372
 
377
 
        fprintf(stderr, "Read view low limit trx n:o %lu %lu\n",
378
 
                (ulong) ut_dulint_get_high(view->low_limit_no),
379
 
                (ulong) ut_dulint_get_low(view->low_limit_no));
 
373
        fprintf(stderr, "Read view low limit trx n:o " TRX_ID_FMT "\n",
 
374
                view->low_limit_no);
380
375
 
381
376
        fprintf(stderr, "Read view up limit trx id " TRX_ID_FMT "\n",
382
 
                TRX_ID_PREP_PRINTF(view->up_limit_id));
 
377
                view->up_limit_id);
383
378
 
384
379
        fprintf(stderr, "Read view low limit trx id " TRX_ID_FMT "\n",
385
 
                TRX_ID_PREP_PRINTF(view->low_limit_id));
 
380
                view->low_limit_id);
386
381
 
387
382
        fprintf(stderr, "Read view individually stored trx ids:\n");
388
383
 
390
385
 
391
386
        for (i = 0; i < n_ids; i++) {
392
387
                fprintf(stderr, "Read view trx id " TRX_ID_FMT "\n",
393
 
                        TRX_ID_PREP_PRINTF(
394
 
                                read_view_get_nth_trx_id(view, i)));
 
388
                        read_view_get_nth_trx_id(view, i));
395
389
        }
396
390
}
397
391
 
455
449
                        trx_sys->max_trx_id can still be active, if it is
456
450
                        in the middle of its commit! Note that when a
457
451
                        transaction starts, we initialize trx->no to
458
 
                        ut_dulint_max. */
 
452
                        IB_ULONGLONG_MAX. */
459
453
 
460
 
                        if (ut_dulint_cmp(view->low_limit_no, trx->no) > 0) {
 
454
                        if (view->low_limit_no > trx->no) {
461
455
 
462
456
                                view->low_limit_no = trx->no;
463
457
                        }