~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/que/que0que.c

  • Committer: Lee Bieber
  • Date: 2010-11-07 19:34:48 UTC
  • mfrom: (1910.1.2 build)
  • Revision ID: kalebral@gmail.com-20101107193448-64kdu912qej354sh
Merge Stewart - including adapting and expanding the "differences from mysql" page from the wiki.
Merge Stewart - fix bug 668143: drizzleslap with --commit runs second iteration data load in a transaction

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (C) 1996, 2009, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
29
29
#include "que0que.ic"
30
30
#endif
31
31
 
 
32
#include "srv0que.h"
32
33
#include "usr0sess.h"
33
34
#include "trx0trx.h"
34
35
#include "trx0roll.h"
166
167
 
167
168
        ut_ad(heap);
168
169
 
169
 
        fork = static_cast<que_fork_t *>(mem_heap_alloc(heap, sizeof(que_fork_t)));
 
170
        fork = mem_heap_alloc(heap, sizeof(que_fork_t));
170
171
 
171
172
        fork->common.type = QUE_NODE_FORK;
172
173
        fork->n_active_thrs = 0;
208
209
 
209
210
        ut_ad(parent && heap);
210
211
 
211
 
        thr = static_cast<que_thr_t *>(mem_heap_alloc(heap, sizeof(que_thr_t)));
 
212
        thr = mem_heap_alloc(heap, sizeof(que_thr_t));
212
213
 
213
214
        thr->common.type = QUE_NODE_THR;
214
215
        thr->common.parent = parent;
425
426
void
426
427
que_fork_error_handle(
427
428
/*==================*/
428
 
        trx_t*  /*trx __attribute__((unused))*/,        /*!< in: trx */
 
429
        trx_t*  trx __attribute__((unused)),    /*!< in: trx */
429
430
        que_t*  fork)   /*!< in: query graph which was run before signal
430
431
                        handling started, NULL not allowed */
431
432
{
527
528
        switch (que_node_get_type(node)) {
528
529
 
529
530
        case QUE_NODE_FORK:
530
 
                fork = static_cast<que_fork_t *>(node);
 
531
                fork = node;
531
532
 
532
533
                thr = UT_LIST_GET_FIRST(fork->thrs);
533
534
 
540
541
                break;
541
542
        case QUE_NODE_THR:
542
543
 
543
 
                thr = static_cast<que_thr_t *>(node);
 
544
                thr = node;
544
545
 
545
546
                if (thr->magic_n != QUE_THR_MAGIC_N) {
546
547
                        fprintf(stderr,
558
559
                break;
559
560
        case QUE_NODE_UNDO:
560
561
 
561
 
                undo = static_cast<undo_node_t *>(node);
 
562
                undo = node;
562
563
 
563
564
                mem_heap_free(undo->heap);
564
565
 
565
566
                break;
566
567
        case QUE_NODE_SELECT:
567
568
 
568
 
                sel = static_cast<sel_node_t *>(node);
 
569
                sel = node;
569
570
 
570
571
                sel_node_free_private(sel);
571
572
 
572
573
                break;
573
574
        case QUE_NODE_INSERT:
574
575
 
575
 
                ins = static_cast<ins_node_t *>(node);
 
576
                ins = node;
576
577
 
577
578
                que_graph_free_recursive(ins->select);
578
579
 
580
581
 
581
582
                break;
582
583
        case QUE_NODE_PURGE:
583
 
                purge = static_cast<purge_node_t *>(node);
 
584
                purge = node;
584
585
 
585
586
                mem_heap_free(purge->heap);
586
587
 
588
589
 
589
590
        case QUE_NODE_UPDATE:
590
591
 
591
 
                upd = static_cast<upd_node_t *>(node);
 
592
                upd = node;
592
593
 
593
594
                if (upd->in_mysql_interface) {
594
595
 
607
608
 
608
609
                break;
609
610
        case QUE_NODE_CREATE_TABLE:
610
 
                cre_tab = static_cast<tab_node_t *>(node);
 
611
                cre_tab = node;
611
612
 
612
613
                que_graph_free_recursive(cre_tab->tab_def);
613
614
                que_graph_free_recursive(cre_tab->col_def);
617
618
 
618
619
                break;
619
620
        case QUE_NODE_CREATE_INDEX:
620
 
                cre_ind = static_cast<ind_node_t *>(node);
 
621
                cre_ind = node;
621
622
 
622
623
                que_graph_free_recursive(cre_ind->ind_def);
623
624
                que_graph_free_recursive(cre_ind->field_def);
799
800
        ulint           fork_type;
800
801
        ibool           stopped;
801
802
 
802
 
        fork = static_cast<que_fork_t *>(thr->common.parent);
 
803
        fork = thr->common.parent;
803
804
        trx = thr_get_trx(thr);
804
805
 
805
806
        mutex_enter(&kernel_mutex);
1283
1284
        que_thr_t*      thr)    /*!< in: query thread */
1284
1285
{
1285
1286
        que_thr_t*      next_thr;
 
1287
        ulint           cumul_resource;
1286
1288
        ulint           loop_count;
1287
1289
 
1288
1290
        ut_ad(thr->state == QUE_THR_RUNNING);
1289
1291
        ut_a(thr_get_trx(thr)->error_state == DB_SUCCESS);
1290
1292
        ut_ad(!mutex_own(&kernel_mutex));
1291
1293
 
 
1294
        /* cumul_resource counts how much resources the OS thread (NOT the
 
1295
        query thread) has spent in this function */
 
1296
 
1292
1297
        loop_count = QUE_MAX_LOOPS_WITHOUT_CHECK;
 
1298
        cumul_resource = 0;
1293
1299
loop:
1294
1300
        /* Check that there is enough space in the log to accommodate
1295
1301
        possible log entries by this query step; if the operation can touch