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-10-09 15:37:56+02:00, tomas@stripped +1 -0
recommit of removal of m_active_transaction
sql/ha_ndbcluster.cc@stripped, 2007-10-09 15:37:53+02:00, tomas@stripped +34 -37
recommit of removal of m_active_transaction
diff -Nrup a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
--- a/sql/ha_ndbcluster.cc 2007-10-09 15:10:12 +02:00
+++ b/sql/ha_ndbcluster.cc 2007-10-09 15:37:53 +02:00
@@ -2139,7 +2139,7 @@ static void shrink_varchar(Field* field,
int ha_ndbcluster::pk_read(const uchar *key, uint key_len, uchar *buf,
uint32 part_id)
{
- NdbConnection *trans= m_active_trans;
+ NdbConnection *trans= m_thd_ndb->trans;
NdbOperation *op;
uchar *row;
int res;
@@ -2192,7 +2192,7 @@ int ha_ndbcluster::pk_read(const uchar *
int ha_ndbcluster::complemented_read(const uchar *old_data, uchar *new_data,
uint32 old_part_id)
{
- NdbTransaction *trans= m_active_trans;
+ NdbTransaction *trans= m_thd_ndb->trans;
NdbOperation *op;
DBUG_ENTER("complemented_read");
@@ -2349,7 +2349,7 @@ static char dummy_row[1];
int ha_ndbcluster::peek_indexed_rows(const uchar *record,
bool check_pk)
{
- NdbTransaction *trans= m_active_trans;
+ NdbTransaction *trans= m_thd_ndb->trans;
NdbOperation *op;
const NdbOperation *first, *last;
uint i;
@@ -2450,7 +2450,7 @@ int ha_ndbcluster::peek_indexed_rows(con
int ha_ndbcluster::unique_index_read(const uchar *key,
uint key_len, uchar *buf)
{
- NdbTransaction *trans= m_active_trans;
+ NdbTransaction *trans= m_thd_ndb->trans;
NdbOperation *op;
uchar *row;
DBUG_ENTER("ha_ndbcluster::unique_index_read");
@@ -2531,7 +2531,7 @@ inline int ha_ndbcluster::fetch_next(Ndb
DBUG_ENTER("fetch_next");
int local_check;
int error;
- NdbTransaction *trans= m_active_trans;
+ NdbTransaction *trans= m_thd_ndb->trans;
if ((error= scan_handle_lock_tuple(cursor, trans)) != 0)
DBUG_RETURN(error);
@@ -2633,7 +2633,7 @@ inline int ha_ndbcluster::next_result(uc
}
else
{
- DBUG_RETURN(ndb_err(m_active_trans));
+ DBUG_RETURN(ndb_err(m_thd_ndb->trans));
}
}
@@ -2672,7 +2672,7 @@ ha_ndbcluster::pk_unique_index_read_key(
ndb_record= m_ndb_record_fragment;
}
}
- op= m_active_trans->readTuple(key_rec, (const char *)key,
+ op= m_thd_ndb->trans->readTuple(key_rec, (const char *)key,
ndb_record, (char *)buf, lm, mask);
if (uses_blob_value(table->read_set) &&
@@ -2962,7 +2962,7 @@ int ha_ndbcluster::ordered_index_scan(co
bool sorted, bool descending,
uchar* buf, part_id_range *part_spec)
{
- NdbTransaction *trans= m_active_trans;
+ NdbTransaction *trans= m_thd_ndb->trans;
NdbIndexScanOperation *op;
struct ordered_index_scan_data data;
uchar *mask;
@@ -3069,7 +3069,7 @@ int ha_ndbcluster::full_table_scan(const
uchar *buf)
{
NdbScanOperation *op;
- NdbTransaction *trans= m_active_trans;
+ NdbTransaction *trans= m_thd_ndb->trans;
part_id_range part_spec;
uchar *mask= (uchar *)(table->read_set->bitmap);
const NdbRecord *ndb_record= m_ndb_record;
@@ -3194,7 +3194,7 @@ int ha_ndbcluster::ndb_write_row(uchar *
bool batched_update)
{
bool has_auto_increment;
- NdbTransaction *trans= m_active_trans;
+ NdbTransaction *trans= m_thd_ndb->trans;
NdbOperation *op;
THD *thd= table->in_use;
Thd_ndb *thd_ndb= get_thd_ndb(thd);
@@ -3477,7 +3477,7 @@ int ha_ndbcluster::update_row(const ucha
{
THD *thd= table->in_use;
Thd_ndb *thd_ndb= get_thd_ndb(thd);
- NdbTransaction *trans= m_active_trans;
+ NdbTransaction *trans= m_thd_ndb->trans;
NdbScanOperation* cursor= m_active_cursor;
NdbOperation *op;
uint32 old_part_id= 0, new_part_id= 0;
@@ -3692,7 +3692,7 @@ int ha_ndbcluster::ndb_delete_row(const
{
THD *thd= table->in_use;
Thd_ndb *thd_ndb= get_thd_ndb(thd);
- NdbTransaction *trans= m_active_trans;
+ NdbTransaction *trans= m_thd_ndb->trans;
NdbScanOperation* cursor= m_active_cursor;
NdbOperation *op;
uint32 part_id;
@@ -4193,7 +4193,7 @@ int ha_ndbcluster::rnd_init(bool scan)
int ha_ndbcluster::close_scan()
{
- NdbTransaction *trans= m_active_trans;
+ NdbTransaction *trans= m_thd_ndb->trans;
int error;
DBUG_ENTER("close_scan");
@@ -4578,7 +4578,7 @@ int ha_ndbcluster::reset()
int
ha_ndbcluster::flush_bulk_insert()
{
- NdbTransaction *trans= m_active_trans;
+ NdbTransaction *trans= m_thd_ndb->trans;
DBUG_ENTER("ha_ndbcluster::flush_bulk_insert");
DBUG_PRINT("info", ("Sending inserts to NDB, rows_inserted: %d",
(int)m_rows_inserted));
@@ -4887,8 +4887,8 @@ int ha_ndbcluster::init_handler_for_stat
MySQL Server calls external lock
Other handlers in the same stmt or transaction should use
- the same NDB transaction. This is done by setting up the m_active_trans
- pointer to point to the NDB transaction.
+ the same NDB transaction. This is done by setting up the m_thd_ndb
+ pointer to point to the NDB transaction object.
*/
DBUG_ENTER("ha_ndbcluster::init_handler_for_statement");
@@ -4898,8 +4898,8 @@ int ha_ndbcluster::init_handler_for_stat
m_autoincrement_prefetch=
(ha_rows) thd->variables.ndb_autoincrement_prefetch_sz;
- m_active_trans= thd_ndb->trans;
- DBUG_ASSERT(m_active_trans);
+ m_thd_ndb= thd_ndb;
+ DBUG_ASSERT(m_thd_ndb->trans);
// Start of transaction
m_rows_changed= 0;
m_ops_pending= 0;
@@ -5004,7 +5004,7 @@ int ha_ndbcluster::external_lock(THD *th
And since the handler is no longer part of the transaction
it can't have open cursors, ops or blobs pending.
*/
- m_active_trans= NULL;
+ m_thd_ndb= NULL;
if (m_active_cursor)
DBUG_PRINT("warning", ("m_active_cursor != NULL"));
@@ -6758,7 +6758,7 @@ void ha_ndbcluster::get_auto_increment(u
ha_ndbcluster::ha_ndbcluster(handlerton *hton, TABLE_SHARE *table_arg):
handler(hton, table_arg),
- m_active_trans(NULL),
+ m_thd_ndb(NULL),
m_active_cursor(NULL),
m_table(NULL),
m_table_info(NULL),
@@ -6851,12 +6851,8 @@ ha_ndbcluster::~ha_ndbcluster()
m_row_buffer_size= 0;
// Check for open cursor/transaction
- if (m_active_cursor) {
- }
DBUG_ASSERT(m_active_cursor == NULL);
- if (m_active_trans) {
- }
- DBUG_ASSERT(m_active_trans == NULL);
+ DBUG_ASSERT(m_thd_ndb == NULL);
// Discard any generated condition
DBUG_PRINT("info", ("Deleting generated condition"));
@@ -8313,6 +8309,7 @@ ha_ndbcluster::records_in_range(uint inx
NDB_INDEX_DATA& d=m_index[inx];
const NDBINDEX* index= d.index;
Ndb* ndb=get_ndb();
+ NdbTransaction* active_trans= m_thd_ndb ? m_thd_ndb->trans : 0;
NdbTransaction* trans=NULL;
NdbIndexScanOperation* op=NULL;
int res=0;
@@ -8346,7 +8343,7 @@ ha_ndbcluster::records_in_range(uint inx
}
// Define scan op for the range
- if ((trans=m_active_trans) == NULL ||
+ if ((trans=active_trans) == NULL ||
trans->commitStatus() != NdbTransaction::Started)
{
DBUG_PRINT("info", ("no active trans"));
@@ -8375,9 +8372,9 @@ ha_ndbcluster::records_in_range(uint inx
d.index_stat_query_count++;
} while (0);
- if (trans != m_active_trans && rows == 0)
+ if (trans != active_trans && rows == 0)
rows = 1;
- if (trans != m_active_trans && trans != NULL)
+ if (trans != active_trans && trans != NULL)
ndb->closeTransaction(trans);
if (res != 0)
DBUG_RETURN(HA_POS_ERROR);
@@ -9656,7 +9653,7 @@ ha_ndbcluster::read_multi_range_first(KE
DBUG_ASSERT(cur_index_type != UNDEFINED_INDEX);
- const NdbOperation* lastOp= m_active_trans->getLastDefinedOperation();
+ const NdbOperation* lastOp= m_thd_ndb->trans->getLastDefinedOperation();
NdbOperation::LockMode lm=
(NdbOperation::LockMode)get_ndb_lock_type(m_lock.type, table->read_set);
uchar *row_buf= (uchar *)buffer->buffer;
@@ -9719,7 +9716,7 @@ ha_ndbcluster::read_multi_range_first(KE
if (!(op= pk_unique_index_read_key(active_index,
r->start_key.key,
row_buf, lm)))
- ERR_RETURN(m_active_trans->getNdbError());
+ ERR_RETURN(m_thd_ndb->trans->getNdbError());
if (m_user_defined_partitioning &&
(cur_index_type == PRIMARY_KEY_ORDERED_INDEX ||
@@ -9755,12 +9752,12 @@ ha_ndbcluster::read_multi_range_first(KE
else
mask= (uchar *)(table->read_set->bitmap);
- NdbIndexScanOperation *scanOp= m_active_trans->scanIndex
+ NdbIndexScanOperation *scanOp= m_thd_ndb->trans->scanIndex
(m_index[active_index].ndb_record_key, read_multi_bounds_callback,
&data, num_scan_ranges, m_index[active_index].ndb_record_row, lm,
mask, flags, parallelism, 0);
if (!scanOp)
- ERR_RETURN(m_active_trans->getNdbError());
+ ERR_RETURN(m_thd_ndb->trans->getNdbError());
m_active_cursor= scanOp;
/*
@@ -9786,9 +9783,9 @@ ha_ndbcluster::read_multi_range_first(KE
* Set first operation in multi range
*/
m_current_multi_operation=
- lastOp ? lastOp->next() : m_active_trans->getFirstDefinedOperation();
- if (execute_no_commit_ie(this, m_active_trans, true))
- ERR_RETURN(m_active_trans->getNdbError());
+ lastOp ? lastOp->next() : m_thd_ndb->trans->getFirstDefinedOperation();
+ if (execute_no_commit_ie(this, m_thd_ndb->trans, true))
+ ERR_RETURN(m_thd_ndb->trans->getNdbError());
m_multi_range_result_ptr= buffer->buffer;
@@ -9819,7 +9816,7 @@ ha_ndbcluster::read_multi_range_next(KEY
KEY_MULTI_RANGE *old_multi_range_curr= multi_range_curr;
multi_range_curr= old_multi_range_curr + 1;
const NdbOperation *op= m_current_multi_operation;
- m_current_multi_operation= m_active_trans->getNextCompletedOperation(op);
+ m_current_multi_operation= m_thd_ndb->trans->getNextCompletedOperation(op);
const uchar *src_row= m_multi_range_result_ptr;
m_multi_range_result_ptr= src_row + table_share->reclength;
@@ -9838,7 +9835,7 @@ ha_ndbcluster::read_multi_range_next(KEY
}
else if (error.classification != NdbError::NoDataFound)
{
- DBUG_RETURN(ndb_err(m_active_trans));
+ DBUG_RETURN(ndb_err(m_thd_ndb->trans));
}
/* No row found, so fall through to try the next range. */
| Thread |
|---|
| • bk commit into 5.1 tree (tomas:1.2654) | tomas | 9 Oct |