summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <mskold/marty@linux.site>2007-08-14 15:34:04 +0200
committerunknown <mskold/marty@linux.site>2007-08-14 15:34:04 +0200
commitb76fd3ed3bdcdfa58ab1c1f9afbf844bd296e4da (patch)
treee9d2a30b877ae88474622046a3ce315d4b9f32c2
parent6e817c8d26533afd2c58f2e79f84d073008f0bda (diff)
parenta40202e6965d8c508defa223e6f1a13fd39051d4 (diff)
downloadmariadb-git-b76fd3ed3bdcdfa58ab1c1f9afbf844bd296e4da.tar.gz
Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb
into mysql.com:/windows/Linux_space/MySQL/mysql-5.0-ndb sql/ha_ndbcluster.cc: Auto merged
-rw-r--r--mysql-test/r/ndb_read_multi_range.result19
-rw-r--r--mysql-test/t/ndb_read_multi_range.test22
-rw-r--r--sql/ha_ndbcluster.cc3
3 files changed, 43 insertions, 1 deletions
diff --git a/mysql-test/r/ndb_read_multi_range.result b/mysql-test/r/ndb_read_multi_range.result
index 64a6749bed1..d18f4c1e65a 100644
--- a/mysql-test/r/ndb_read_multi_range.result
+++ b/mysql-test/r/ndb_read_multi_range.result
@@ -405,3 +405,22 @@ a b
1 1
10 10
drop table t2;
+create table t1 (id int primary key) engine ndb;
+insert into t1 values (1), (2), (3);
+create table t2 (id int primary key) engine ndb;
+insert into t2 select id from t1;
+create trigger kaboom after delete on t1
+for each row begin
+delete from t2 where id=old.id;
+end|
+select * from t1 order by id;
+id
+1
+2
+3
+delete from t1 where id in (1,2);
+select * from t2 order by id;
+id
+3
+drop trigger kaboom;
+drop table t1;
diff --git a/mysql-test/t/ndb_read_multi_range.test b/mysql-test/t/ndb_read_multi_range.test
index e1f1dfc1150..1d1d5f26552 100644
--- a/mysql-test/t/ndb_read_multi_range.test
+++ b/mysql-test/t/ndb_read_multi_range.test
@@ -291,3 +291,25 @@ insert into t2 values (1,1), (10,10);
select * from t2 use index (ab) where a in(1,10) order by a;
drop table t2;
+
+#bug#30337
+
+create table t1 (id int primary key) engine ndb;
+insert into t1 values (1), (2), (3);
+
+create table t2 (id int primary key) engine ndb;
+insert into t2 select id from t1;
+
+delimiter |;
+create trigger kaboom after delete on t1
+for each row begin
+ delete from t2 where id=old.id;
+end|
+delimiter ;|
+
+select * from t1 order by id;
+delete from t1 where id in (1,2);
+select * from t2 order by id;
+
+drop trigger kaboom;
+drop table t1;
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 9f552219662..2d674d98d41 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -6470,7 +6470,8 @@ ha_ndbcluster::read_multi_range_first(KEY_MULTI_RANGE **found_range_p,
if (uses_blob_value(m_retrieve_all_fields) ||
(cur_index_type == UNIQUE_INDEX &&
has_null_in_unique_index(active_index) &&
- null_value_index_search(ranges, ranges+range_count, buffer)))
+ null_value_index_search(ranges, ranges+range_count, buffer))
+ || m_delete_cannot_batch || m_update_cannot_batch)
{
m_disable_multi_read= TRUE;
DBUG_RETURN(handler::read_multi_range_first(found_range_p,