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-12-11 15:18:37+01:00, tomas@stripped +2 -0
Bug#32670
- make sure transaction off is captured
sql/ha_ndbcluster.cc@stripped, 2007-12-11 15:18:34+01:00, tomas@stripped +13
-9
Bug#32670
- make sure transaction off is captured
sql/ha_ndbcluster.h@stripped, 2007-12-11 15:18:35+01:00, tomas@stripped +1
-1
Bug#32670
- make sure transaction off is captured
diff -Nrup a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
--- a/sql/ha_ndbcluster.cc 2007-12-10 10:52:32 +01:00
+++ b/sql/ha_ndbcluster.cc 2007-12-11 15:18:34 +01:00
@@ -2590,7 +2590,7 @@ inline int ha_ndbcluster::fetch_next(Ndb
(long) m_thd_ndb->m_unsent_bytes));
if (m_thd_ndb->m_unsent_bytes)
{
- if (execute_no_commit(this,trans,FALSE) != 0)
+ if (flush_bulk_insert() != 0)
DBUG_RETURN(-1);
}
contact_ndb= (local_check == 2);
@@ -4616,7 +4616,8 @@ ha_ndbcluster::flush_bulk_insert()
DBUG_ENTER("ha_ndbcluster::flush_bulk_insert");
DBUG_PRINT("info", ("Sending inserts to NDB, rows_inserted: %d",
(int)m_rows_inserted));
- if (m_transaction_on)
+
+ if (! (m_thd_ndb->trans_options & TNTO_TRANSACTIONS_OFF))
{
if (execute_no_commit(this,trans,FALSE) != 0)
{
@@ -4857,15 +4858,19 @@ void ha_ndbcluster::transaction_checks(T
{
if (thd->lex->sql_command == SQLCOM_LOAD)
{
- m_transaction_on= FALSE;
+ m_thd_ndb->trans_options|= TNTO_TRANSACTIONS_OFF;
/* Would be simpler if has_transactions() didn't always say "yes" */
thd->transaction.all.modified_non_trans_table=
thd->transaction.stmt.modified_non_trans_table= TRUE;
}
else if (!thd->transaction.on)
- m_transaction_on= FALSE;
- else
- m_transaction_on= thd->variables.ndb_use_transactions;
+ {
+ m_thd_ndb->trans_options|= TNTO_TRANSACTIONS_OFF;
+ }
+ else if (!thd->variables.ndb_use_transactions)
+ {
+ m_thd_ndb->trans_options|= TNTO_TRANSACTIONS_OFF;
+ }
}
int ha_ndbcluster::start_statement(THD *thd,
@@ -4978,7 +4983,6 @@ int ha_ndbcluster::external_lock(THD *th
if (lock_type != F_UNLCK)
{
DBUG_PRINT("info", ("lock_type != F_UNLCK"));
- transaction_checks(thd);
if (!thd_ndb->lock_count++)
{
if ((error= start_statement(thd, thd_ndb, ndb)))
@@ -4986,6 +4990,7 @@ int ha_ndbcluster::external_lock(THD *th
}
if ((error= init_handler_for_statement(thd, thd_ndb)))
goto error;
+ transaction_checks(thd);
DBUG_RETURN(0);
}
else
@@ -5089,7 +5094,6 @@ int ha_ndbcluster::start_stmt(THD *thd,
DBUG_ENTER("start_stmt");
Thd_ndb *thd_ndb= get_thd_ndb(thd);
- transaction_checks(thd);
if (!thd_ndb->start_stmt_count++)
{
Ndb *ndb= thd_ndb->ndb;
@@ -5098,6 +5102,7 @@ int ha_ndbcluster::start_stmt(THD *thd,
}
if ((error= init_handler_for_statement(thd, thd_ndb)))
goto error;
+ transaction_checks(thd);
DBUG_RETURN(0);
error:
thd_ndb->start_stmt_count--;
@@ -6842,7 +6847,6 @@ ha_ndbcluster::ha_ndbcluster(handlerton
m_dupkey((uint) -1),
m_force_send(TRUE),
m_autoincrement_prefetch((ha_rows) NDB_DEFAULT_AUTO_PREFETCH),
- m_transaction_on(TRUE),
m_cond(NULL),
m_multi_cursor(NULL)
{
diff -Nrup a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h
--- a/sql/ha_ndbcluster.h 2007-12-10 10:44:55 +01:00
+++ b/sql/ha_ndbcluster.h 2007-12-11 15:18:35 +01:00
@@ -243,6 +243,7 @@ enum THD_NDB_TRANS_OPTIONS
{
TNTO_INJECTED_APPLY_STATUS= 1 << 0
,TNTO_NO_LOGGING= 1 << 1
+ ,TNTO_TRANSACTIONS_OFF= 1 << 2
};
struct Ndb_local_table_statistics {
@@ -730,7 +731,6 @@ private:
// set from thread variables at external lock
bool m_force_send;
ha_rows m_autoincrement_prefetch;
- bool m_transaction_on;
ha_ndbcluster_cond *m_cond;
bool m_disable_multi_read;
| Thread |
|---|
| • bk commit into 5.1 tree (tomas:1.2661) BUG#32670 | tomas | 11 Dec |