summaryrefslogtreecommitdiff
path: root/sql/ha_ndbcluster.cc
diff options
context:
space:
mode:
authorunknown <stewart@willster.(none)>2006-09-20 17:09:53 +1000
committerunknown <stewart@willster.(none)>2006-09-20 17:09:53 +1000
commitd4d3dcacaa896fb5cc4ad25885bf2521a07e04d1 (patch)
tree7582e9a203ff3160ce8d4932f981c4446243eab6 /sql/ha_ndbcluster.cc
parente34496e5d827c774a92891fb8201a53a27564e38 (diff)
parentec2512cf184c6746df48e2dfd5f493c3278e393a (diff)
downloadmariadb-git-d4d3dcacaa896fb5cc4ad25885bf2521a07e04d1.tar.gz
Merge willster.(none):/home/stewart/Documents/MySQL/4.1/ndb
into willster.(none):/home/stewart/Documents/MySQL/4.1/bug19914-mk2 sql/ha_ndbcluster.cc: Auto merged sql/ha_ndbcluster.h: Auto merged sql/sql_select.cc: Auto merged
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r--sql/ha_ndbcluster.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 0df680b7aa3..193dbbcbcc4 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -161,6 +161,7 @@ int execute_no_commit(ha_ndbcluster *h, NdbConnection *trans)
if (m_batch_execute)
return 0;
#endif
+ h->release_completed_operations(trans);
return trans->execute(NoCommit,AbortOnError,h->m_force_send);
}
@@ -194,6 +195,7 @@ int execute_no_commit_ie(ha_ndbcluster *h, NdbConnection *trans)
if (m_batch_execute)
return 0;
#endif
+ h->release_completed_operations(trans);
return trans->execute(NoCommit, AO_IgnoreError,h->m_force_send);
}
@@ -2749,6 +2751,25 @@ int ha_ndbcluster::close_scan()
if (!cursor)
DBUG_RETURN(1);
+ 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= m_active_cursor->lockTuple()))
+ {
+ m_lock_tuple= false;
+ ERR_RETURN(trans->getNdbError());
+ }
+ m_ops_pending++;
+ }
m_lock_tuple= false;
if (m_ops_pending)
{
@@ -5357,6 +5378,19 @@ 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
ndbcluster_show_status(THD* thd)
{