From: Date: July 3 2007 6:27pm Subject: bk commit into 5.1 tree (tomas:1.2562) BUG#29525 List-Archive: http://lists.mysql.com/commits/30215 X-Bug: 29525 Message-Id: <20070703162736.D685518A20A33@linux.local> Below is the list of changes that have just been committed into a local 5.1 repository of tomas. When tomas does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2007-07-03 18:27:30+02:00, tomas@stripped +2 -0 Bug #29525 batching incorrect - "execute" is not local to handler, only perform reset of transaction related params at execute - the transaction related params (m_unsent_bytes) may _not_ be reset at start of statement, there might be batched operations pending sql/ha_ndbcluster.cc@stripped, 2007-07-03 18:27:27+02:00, tomas@stripped +19 -29 Bug #29525 batching incorrect - "execute" is not local to handler, only perform reset of transaction related params at execute - the transaction related params (m_unsent_bytes) may _not_ be reset at start of statement, there might be batched operations pending sql/ha_ndbcluster.h@stripped, 2007-07-03 18:27:27+02:00, tomas@stripped +0 -1 Bug #29525 batching incorrect - "execute" is not local to handler, only perform reset of transaction related params at execute - the transaction related params (m_unsent_bytes) may _not_ be reset at start of statement, there might be batched operations pending # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: tomas # Host: whalegate.ndb.mysql.com # Root: /home/tomas/mysql-5.1-telco-6.2 --- 1.475/sql/ha_ndbcluster.cc 2007-07-02 18:15:01 +02:00 +++ 1.476/sql/ha_ndbcluster.cc 2007-07-03 18:27:27 +02:00 @@ -276,26 +276,13 @@ return error; } -/* - When execute() is called, this resets the internal state on things that - were awaiting execute(), such as pending scan take-over operations and - rows for batched operations. - Also used to initialize the state at start of a statement. -*/ -void ha_ndbcluster::reset_state_at_execute() -{ - Thd_ndb *thd_ndb= get_thd_ndb(current_thd); - m_ops_pending= 0; - m_blobs_pending= FALSE; - thd_ndb->m_unsent_bytes= 0; -} - int execute_no_commit_ignore_no_key(ha_ndbcluster *h, NdbTransaction *trans) { int res= trans->execute(NdbTransaction::NoCommit, NdbOperation::AO_IgnoreError, h->m_force_send); - h->reset_state_at_execute(); + Thd_ndb *thd_ndb= get_thd_ndb(current_thd); + thd_ndb->m_unsent_bytes= 0; if (res == -1) return -1; @@ -320,7 +307,8 @@ int res= trans->execute(NdbTransaction::NoCommit, NdbOperation::AbortOnError, h->m_force_send); - h->reset_state_at_execute(); + Thd_ndb *thd_ndb= get_thd_ndb(current_thd); + thd_ndb->m_unsent_bytes= 0; return res; } } @@ -331,21 +319,20 @@ int res= trans->execute(NdbTransaction::Commit, NdbOperation::AbortOnError, h->m_force_send); - h->reset_state_at_execute(); + Thd_ndb *thd_ndb= get_thd_ndb(current_thd); + thd_ndb->m_unsent_bytes= 0; return res; } inline int execute_commit(THD *thd, NdbTransaction *trans) { - /* - We do not have to reset_state_at_execute() here, as this is at transaction - end time, and we will not take further action after this (nor can we - easily, as we execute outside the context of the ha_ndbcluster object). - */ - return trans->execute(NdbTransaction::Commit, - NdbOperation::AbortOnError, - thd->variables.ndb_force_send); + int res= trans->execute(NdbTransaction::Commit, + NdbOperation::AbortOnError, + thd->variables.ndb_force_send); + Thd_ndb *thd_ndb= get_thd_ndb(current_thd); + thd_ndb->m_unsent_bytes= 0; + return res; } inline @@ -356,7 +343,8 @@ int res= trans->execute(NdbTransaction::NoCommit, NdbOperation::AO_IgnoreError, h->m_force_send); - h->reset_state_at_execute(); + Thd_ndb *thd_ndb= get_thd_ndb(current_thd); + thd_ndb->m_unsent_bytes= 0; return res; } @@ -574,6 +562,7 @@ Thd_ndb *thd_ndb= get_thd_ndb(thd); thd_ndb->count++; thd_ndb->m_error= FALSE; + thd_ndb->m_unsent_bytes= 0; DBUG_VOID_RETURN; } @@ -5000,7 +4989,8 @@ DBUG_ASSERT(m_active_trans); // Start of transaction m_rows_changed= 0; - reset_state_at_execute(); + m_ops_pending= 0; + m_blobs_pending= FALSE; m_slow_path= thd_ndb->m_slow_path; #ifdef HAVE_NDB_BINLOG if (unlikely(m_slow_path)) @@ -5116,7 +5106,6 @@ trans= ndb->startTransaction(); if (trans == NULL) ERR_RETURN(ndb->getNdbError()); - reset_state_at_execute(); no_uncommitted_rows_reset(thd); thd_ndb->stmt= trans; thd_ndb->query_state&= NDB_QUERY_NORMAL; @@ -5124,7 +5113,8 @@ } m_active_trans= trans; // Start of statement - reset_state_at_execute(); + m_ops_pending= 0; + m_blobs_pending= FALSE; thd->set_current_stmt_binlog_row_based_if_mixed(); DBUG_RETURN(error); --- 1.183/sql/ha_ndbcluster.h 2007-06-18 07:37:30 +02:00 +++ 1.184/sql/ha_ndbcluster.h 2007-07-03 18:27:27 +02:00 @@ -547,7 +547,6 @@ void release_completed_operations(NdbTransaction*, bool); - void reset_state_at_execute(); friend int execute_commit(ha_ndbcluster*, NdbTransaction*); friend int execute_no_commit_ignore_no_key(ha_ndbcluster*, NdbTransaction*); friend int execute_no_commit(ha_ndbcluster*, NdbTransaction*, bool);