diff options
author | mskold/marty@mysql.com/linux.site <> | 2006-08-15 13:37:39 +0200 |
---|---|---|
committer | mskold/marty@mysql.com/linux.site <> | 2006-08-15 13:37:39 +0200 |
commit | 66e8255491367f082aaa1c86ab40c10a48bce6c6 (patch) | |
tree | 42c3200c2545d7d50a212c9f8d7114c43268e9ec /sql/ha_ndbcluster.cc | |
parent | d03b39aaabb75e013809a3b11688accec30d87d2 (diff) | |
parent | 6a3143e2a0a564ffe9c1d32c431b9ce93595c70c (diff) | |
download | mariadb-git-66e8255491367f082aaa1c86ab40c10a48bce6c6.tar.gz |
Merge mysql.com:/windows/Linux_space/MySQL/mysql-4.1
into mysql.com:/windows/Linux_space/MySQL/mysql-5.0
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r-- | sql/ha_ndbcluster.cc | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 1af677fa754..74cdd9bee6d 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -235,6 +235,7 @@ int execute_no_commit(ha_ndbcluster *h, NdbTransaction *trans) if (m_batch_execute) return 0; #endif + h->release_completed_operations(trans); return trans->execute(NdbTransaction::NoCommit, NdbTransaction::AbortOnError, h->m_force_send); @@ -274,6 +275,7 @@ int execute_no_commit_ie(ha_ndbcluster *h, NdbTransaction *trans) if (m_batch_execute) return 0; #endif + h->release_completed_operations(trans); return trans->execute(NdbTransaction::NoCommit, NdbTransaction::AO_IgnoreError, h->m_force_send); @@ -2928,6 +2930,26 @@ int ha_ndbcluster::close_scan() NdbScanOperation *cursor= m_active_cursor ? m_active_cursor : m_multi_cursor; + if (m_lock_tuple) + { + /* + Lock level m_lock.type either TL_WRITE_ALLOW_WRITE + (SELECT FOR UPDATE) or TL_READ_WITH_SHARED_LOCKS (SELECT + LOCK WITH SHARE MODE) and row was not explictly unlocked + with unlock_row() call + */ + NdbOperation *op; + // Lock row + DBUG_PRINT("info", ("Keeping lock on scanned row")); + + if (!(op= cursor->lockTuple())) + { + m_lock_tuple= false; + ERR_RETURN(trans->getNdbError()); + } + m_ops_pending++; + } + m_lock_tuple= false; if (m_ops_pending) { /* @@ -5986,6 +6008,17 @@ int ha_ndbcluster::write_ndb_file() DBUG_RETURN(error); } +void +ha_ndbcluster::release_completed_operations(NdbConnection *trans) +{ + if (trans->hasBlobOperation()) + { + /* We are reading/writing BLOB fields, + releasing operation records is unsafe + */ + return; + } + trans->releaseCompletedOperations(); int ha_ndbcluster::read_multi_range_first(KEY_MULTI_RANGE **found_range_p, KEY_MULTI_RANGE *ranges, |