summaryrefslogtreecommitdiff
path: root/sql/ha_ndbcluster.cc
diff options
context:
space:
mode:
authorunknown <joreland@mysql.com>2004-10-13 10:08:18 +0200
committerunknown <joreland@mysql.com>2004-10-13 10:08:18 +0200
commit92dce374ae968a6c57e65644bd52133aae5477ca (patch)
tree3d1ed1b1091cf7d2c0277e1fdeb3cbb0d63b2d48 /sql/ha_ndbcluster.cc
parentbeb3fddcf7b8cb852ee0be8debf4b9ea3d0ebcb2 (diff)
downloadmariadb-git-92dce374ae968a6c57e65644bd52133aae5477ca.tar.gz
Bug#6020, any lock >= write_allow_write is a write lock
mysql-test/r/ndb_lock.result: Add testcases for table locks mysql-test/t/ndb_lock.test: Add testcases for table locks
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r--sql/ha_ndbcluster.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 3441ee1e339..5588a6ae2a2 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -824,7 +824,7 @@ void ha_ndbcluster::release_metadata()
int ha_ndbcluster::get_ndb_lock_type(enum thr_lock_type type)
{
- if (type == TL_WRITE_ALLOW_WRITE)
+ if (type >= TL_WRITE_ALLOW_WRITE)
return NdbOperation::LM_Exclusive;
else if (uses_blob_value(retrieve_all_fields))
/*
@@ -1161,7 +1161,7 @@ inline int ha_ndbcluster::next_result(byte *buf)
If this an update or delete, call nextResult with false
to process any records already cached in NdbApi
*/
- bool contact_ndb= m_lock.type != TL_WRITE_ALLOW_WRITE;
+ bool contact_ndb= m_lock.type < TL_WRITE_ALLOW_WRITE;
do {
DBUG_PRINT("info", ("Call nextResult, contact_ndb: %d", contact_ndb));
/*
@@ -2731,6 +2731,9 @@ THR_LOCK_DATA **ha_ndbcluster::store_lock(THD *thd,
/* If we are not doing a LOCK TABLE, then allow multiple
writers */
+ /* Since NDB does not currently have table locks
+ this is treated as a ordinary lock */
+
if ((lock_type >= TL_WRITE_ALLOW_WRITE &&
lock_type <= TL_WRITE) && !thd->in_lock_tables)
lock_type= TL_WRITE_ALLOW_WRITE;