diff options
author | unknown <tomas@poseidon.ndb.mysql.com> | 2004-09-28 19:22:04 +0000 |
---|---|---|
committer | unknown <tomas@poseidon.ndb.mysql.com> | 2004-09-28 19:22:04 +0000 |
commit | 1dd9333fb150c19dfec4fe306a763ae60d63acae (patch) | |
tree | 79c242638bdb4ca73dc7258099d7a83bcc98a771 /sql/ha_ndbcluster.cc | |
parent | 1ddc28a471dbf33e446d20fd4fcfcbb0e49eea62 (diff) | |
parent | bc6207eef1a8bf1b60442d1634382342020da8c0 (diff) | |
download | mariadb-git-1dd9333fb150c19dfec4fe306a763ae60d63acae.tar.gz |
Merge
sql/ha_ndbcluster.cc:
Auto merged
mysql-test/mysql-test-run.sh:
SCCS merged
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r-- | sql/ha_ndbcluster.cc | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 0f4d9630fe1..dc3bfc32a2f 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -147,7 +147,25 @@ int execute_no_commit(ha_ndbcluster *h, NdbConnection *trans) int m_batch_execute= 0; if (false && m_batch_execute) return 0; - return trans->execute(NoCommit); + return trans->execute(NoCommit,AbortOnError,1); +} + +inline +int execute_commit(ha_ndbcluster *h, NdbConnection *trans) +{ + int m_batch_execute= 0; + if (false && m_batch_execute) + return 0; + return trans->execute(Commit,AbortOnError,1); +} + +inline +int execute_no_commit_ie(ha_ndbcluster *h, NdbConnection *trans) +{ + int m_batch_execute= 0; + if (false && m_batch_execute) + return 0; + return trans->execute(NoCommit,IgnoreError,1); } /* @@ -802,7 +820,7 @@ void ha_ndbcluster::release_metadata() int ha_ndbcluster::get_ndb_lock_type(enum thr_lock_type type) { int lm; - if (type == TL_WRITE_ALLOW_WRITE) + if (type >= TL_WRITE_ALLOW_WRITE) lm= NdbOperation::LM_Exclusive; else if (uses_blob_value(retrieve_all_fields)) /* @@ -994,7 +1012,7 @@ int ha_ndbcluster::pk_read(const byte *key, uint key_len, byte *buf) } } - if (trans->execute(NoCommit, IgnoreError) != 0) + if (execute_no_commit_ie(this,trans) != 0) { table->status= STATUS_NOT_FOUND; DBUG_RETURN(ndb_err(trans)); @@ -1115,7 +1133,7 @@ int ha_ndbcluster::unique_index_read(const byte *key, } } - if (trans->execute(NoCommit, IgnoreError) != 0) + if (execute_no_commit_ie(this,trans) != 0) { table->status= STATUS_NOT_FOUND; DBUG_RETURN(ndb_err(trans)); @@ -1192,7 +1210,7 @@ inline int ha_ndbcluster::next_result(byte *buf) } else { - if (ops_pending && (trans->execute(Commit) != 0)) + if (ops_pending && (execute_commit(this,trans) != 0)) DBUG_RETURN(ndb_err(trans)); trans->restart(); } @@ -1626,7 +1644,7 @@ int ha_ndbcluster::write_row(byte *record) } else { - if (trans->execute(Commit) != 0) + if (execute_commit(this,trans) != 0) { skip_auto_increment= true; no_uncommitted_rows_execute_failure(); @@ -2668,14 +2686,13 @@ THR_LOCK_DATA **ha_ndbcluster::store_lock(THD *thd, enum thr_lock_type lock_type) { DBUG_ENTER("store_lock"); - if (lock_type != TL_IGNORE && m_lock.type == TL_UNLOCK) { - + /* If we are not doing a LOCK TABLE, then allow multiple writers */ - if ((lock_type >= TL_WRITE_CONCURRENT_INSERT && + if ((lock_type >= TL_WRITE_ALLOW_WRITE && lock_type <= TL_WRITE) && !thd->in_lock_tables) lock_type= TL_WRITE_ALLOW_WRITE; @@ -2913,7 +2930,7 @@ int ndbcluster_commit(THD *thd, void *ndb_transaction) "stmt" : "all")); DBUG_ASSERT(ndb && trans); - if (trans->execute(Commit) != 0) + if (execute_commit(0,trans) != 0) { const NdbError err= trans->getNdbError(); const NdbOperation *error_op= trans->getNdbErrorOperation(); |