~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

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