diff options
author | unknown <mskold/marty@linux.site> | 2007-04-04 17:03:31 +0200 |
---|---|---|
committer | unknown <mskold/marty@linux.site> | 2007-04-04 17:03:31 +0200 |
commit | 7279edc72dd951e356db1cf9842115452a5773a1 (patch) | |
tree | dd37944358fa408c8d0b0528e0d416320718c1e4 /sql/ha_ndbcluster.cc | |
parent | 2770bf0bfcc73c78b37320c4662c27c72b9d9e12 (diff) | |
parent | 59a64c2b1604649be464d38141e2345c79d27bd3 (diff) | |
download | mariadb-git-7279edc72dd951e356db1cf9842115452a5773a1.tar.gz |
Merge mysql.com:/windows/Linux_space/MySQL/mysql-5.1
into mysql.com:/windows/Linux_space/MySQL/mysql-5.1-new-ndb
include/my_base.h:
Auto merged
sql/ha_ndbcluster.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_load.cc:
Auto merged
sql/sql_trigger.h:
Auto merged
sql/sql_update.cc:
Auto merged
sql/ha_ndbcluster.cc:
Merge
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r-- | sql/ha_ndbcluster.cc | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 5544dbd5fc6..08f29461bd8 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -2999,8 +2999,13 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data) if (thd->slave_thread) op->setAnyValue(thd->server_id); - // Execute update operation - if (!cursor && execute_no_commit(this,trans,FALSE) != 0) { + /* + Execute update operation if we are not doing a scan for update + and there exist UPDATE AFTER triggers + */ + + if ((!cursor || m_update_cannot_batch) && + execute_no_commit(this,trans,false) != 0) { no_uncommitted_rows_execute_failure(); DBUG_RETURN(ndb_err(trans)); } @@ -3057,7 +3062,7 @@ int ha_ndbcluster::delete_row(const byte *record) if (thd->slave_thread) ((NdbOperation *)trans->getLastDefinedOperation())->setAnyValue(thd->server_id); - if (!m_primary_key_update) + if (!(m_primary_key_update || m_delete_cannot_batch)) // If deleting from cursor, NoCommit will be handled in next_result DBUG_RETURN(0); } @@ -3902,7 +3907,13 @@ int ha_ndbcluster::extra(enum ha_extra_function operation) DBUG_PRINT("info", ("Turning OFF use of write instead of insert")); m_use_write= FALSE; break; - default: + case HA_EXTRA_DELETE_CANNOT_BATCH: + DBUG_PRINT("info", ("HA_EXTRA_DELETE_CANNOT_BATCH")); + m_delete_cannot_batch= TRUE; + break; + case HA_EXTRA_UPDATE_CANNOT_BATCH: + DBUG_PRINT("info", ("HA_EXTRA_UPDATE_CANNOT_BATCH")); + m_update_cannot_batch= TRUE; break; } @@ -3913,6 +3924,8 @@ int ha_ndbcluster::extra(enum ha_extra_function operation) int ha_ndbcluster::reset() { DBUG_ENTER("ha_ndbcluster::reset"); + m_delete_cannot_batch= FALSE; + m_update_cannot_batch= FALSE; cond_clear(); /* Regular partition pruning will set the bitmap appropriately. @@ -5922,6 +5935,8 @@ ha_ndbcluster::ha_ndbcluster(handlerton *hton, TABLE_SHARE *table_arg): m_bulk_insert_rows((ha_rows) 1024), m_rows_changed((ha_rows) 0), m_bulk_insert_not_flushed(FALSE), + m_delete_cannot_batch(FALSE), + m_update_cannot_batch(FALSE), m_ops_pending(0), m_skip_auto_increment(TRUE), m_blobs_pending(0), |