~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: kalebral at gmail
  • Date: 2010-12-04 04:58:08 UTC
  • mto: (1971.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1972.
  • Revision ID: kalebral@gmail.com-20101204045808-acto22oxfg43m02e
a few more updates of files that did not have license or had incorrect license structure

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (C) 1996, 2010, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1996, 2010, 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
96
96
        ut_ad(mutex_own(&kernel_mutex));
97
97
        ut_ad(sess);
98
98
 
99
 
        trx = static_cast<trx_t *>(mem_alloc(sizeof(trx_t)));
 
99
        trx = mem_alloc(sizeof(trx_t));
100
100
 
101
101
        trx->magic_n = TRX_MAGIC_N;
102
102
 
124
124
        trx->table_id = 0;
125
125
 
126
126
        trx->mysql_thd = NULL;
 
127
        trx->active_trans = 0;
127
128
        trx->duplicates = 0;
128
129
 
129
130
        trx->mysql_n_tables_locked = 0;
186
187
        trx->autoinc_locks = ib_vector_create(
187
188
                mem_heap_create(sizeof(ib_vector_t) + sizeof(void*) * 4), 4);
188
189
 
189
 
        trx->log_commit_id= FALSE;
190
 
 
191
190
        return(trx);
192
191
}
193
192
 
747
746
                mutex_enter(&(rseg->mutex));
748
747
 
749
748
                if (trx->insert_undo != NULL) {
750
 
                        trx_undo_set_state_at_finish(trx->insert_undo, &mtr);
 
749
                        trx_undo_set_state_at_finish(
 
750
                                rseg, trx, trx->insert_undo, &mtr);
751
751
                }
752
752
 
753
753
                undo = trx->update_undo;
762
762
                        transaction commit for this transaction. */
763
763
 
764
764
                        update_hdr_page = trx_undo_set_state_at_finish(
765
 
                                undo, &mtr);
 
765
                                rseg, trx, undo, &mtr);
766
766
 
767
767
                        /* We have to do the cleanup for the update log while
768
768
                        holding the rseg mutex because update log headers
774
774
 
775
775
                mutex_exit(&(rseg->mutex));
776
776
 
777
 
                /* Update the highest commit id currently in the system */
778
 
                if (trx_log_commit_id(trx))
779
 
                {
780
 
                        mutex_enter(&commit_id_mutex);
781
 
                        trx_sys_flush_commit_id(trx_sys_commit_id,
782
 
                                                TRX_SYS_DRIZZLE_LOG_INFO,
783
 
                                                &mtr);
784
 
                        mutex_exit(&commit_id_mutex);
 
777
                /* Update the latest MySQL binlog name and offset info
 
778
                in trx sys header if MySQL binlogging is on or the database
 
779
                server is a MySQL replication slave */
 
780
 
 
781
                if (trx->mysql_log_file_name
 
782
                    && trx->mysql_log_file_name[0] != '\0') {
 
783
                        trx_sys_update_mysql_binlog_offset(
 
784
                                trx->mysql_log_file_name,
 
785
                                trx->mysql_log_offset,
 
786
                                TRX_SYS_MYSQL_LOG_INFO, &mtr);
 
787
                        trx->mysql_log_file_name = NULL;
785
788
                }
786
789
 
787
790
                /* The following call commits the mini-transaction, making the
1242
1245
                /* It might be that the 'sig' slot is unused also in this
1243
1246
                case, but we choose the easy way of using mem_alloc */
1244
1247
 
1245
 
          sig = static_cast<trx_sig_t *>(mem_alloc(sizeof(trx_sig_t)));
 
1248
                sig = mem_alloc(sizeof(trx_sig_t));
1246
1249
        }
1247
1250
 
1248
1251
        UT_LIST_ADD_LAST(signals, trx->signals, sig);
1477
1480
{
1478
1481
        commit_node_t*  node;
1479
1482
 
1480
 
        node = static_cast<commit_node_t *>(mem_heap_alloc(heap, sizeof(commit_node_t)));
 
1483
        node = mem_heap_alloc(heap, sizeof(commit_node_t));
1481
1484
        node->common.type  = QUE_NODE_COMMIT;
1482
1485
        node->state = COMMIT_NODE_SEND;
1483
1486
 
1496
1499
        commit_node_t*  node;
1497
1500
        que_thr_t*      next_thr;
1498
1501
 
1499
 
        node = static_cast<commit_node_t *>(thr->run_node);
 
1502
        node = thr->run_node;
1500
1503
 
1501
1504
        ut_ad(que_node_get_type(node) == QUE_NODE_COMMIT);
1502
1505
 
1790
1793
/*===================*/
1791
1794
        trx_t*  trx)    /*!< in: transaction */
1792
1795
{
 
1796
        page_t*         update_hdr_page;
1793
1797
        trx_rseg_t*     rseg;
1794
1798
        ib_uint64_t     lsn             = 0;
1795
1799
        mtr_t           mtr;
1822
1826
                }
1823
1827
 
1824
1828
                if (trx->update_undo) {
1825
 
                        trx_undo_set_state_at_prepare(
 
1829
                        update_hdr_page = trx_undo_set_state_at_prepare(
1826
1830
                                trx, trx->update_undo, &mtr);
1827
1831
                }
1828
1832