Skip to content

Commit

Permalink
Bug#32169848 THD_NDB TRANSACTION FUNCTIONALITY [#3]
Browse files Browse the repository at this point in the history
Move misplaced comment verbatim

Change-Id: Iec47fcbdc5f145e8131dd24b3c34a66258ef74fd
  • Loading branch information
blaudden committed May 19, 2021
1 parent 57f9490 commit a1aef87
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions storage/ndb/plugin/ha_ndbcluster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7135,22 +7135,6 @@ THR_LOCK_DATA **ha_ndbcluster::store_lock(THD *thd, THR_LOCK_DATA **to,
return to;
}

/*
As MySQL will execute an external lock for every new table it uses
we can use this to start the transactions.
If we are in auto_commit mode we just need to start a transaction
for the statement, this will be stored in thd_ndb.stmt.
If not, we have to start a master transaction if there doesn't exist
one from before, this will be stored in thd_ndb.all

When a table lock is held one transaction will be started which holds
the table lock and for each statement a hupp transaction will be started
If we are locking the table then:
- save the NdbDictionary::Table for easy access
- save reference to table statistics
- refresh list of the indexes for the table if needed (if altered)
*/

static int ndbcluster_update_apply_status(THD *thd, int do_update) {
Thd_ndb *thd_ndb = get_thd_ndb(thd);

Expand Down Expand Up @@ -7348,6 +7332,22 @@ int ha_ndbcluster::init_handler_for_statement(THD *thd) {
return ret;
}

/*
As MySQL will execute an external lock for every new table it uses
we can use this to start the transactions.
If we are in auto_commit mode we just need to start a transaction
for the statement, this will be stored in thd_ndb.stmt.
If not, we have to start a master transaction if there doesn't exist
one from before, this will be stored in thd_ndb.all

When a table lock is held one transaction will be started which holds
the table lock and for each statement a hupp transaction will be started
If we are locking the table then:
- save the NdbDictionary::Table for easy access
- save reference to table statistics
- refresh list of the indexes for the table if needed (if altered)
*/

int ha_ndbcluster::external_lock(THD *thd, int lock_type) {
DBUG_TRACE;
if (lock_type != F_UNLCK) {
Expand Down

0 comments on commit a1aef87

Please sign in to comment.