summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ndb_bug26793.result8
-rw-r--r--mysql-test/r/ndb_read_multi_range.result19
-rw-r--r--mysql-test/t/ndb_bug26793.test35
-rw-r--r--mysql-test/t/ndb_read_multi_range.test22
4 files changed, 84 insertions, 0 deletions
diff --git a/mysql-test/r/ndb_bug26793.result b/mysql-test/r/ndb_bug26793.result
new file mode 100644
index 00000000000..a9a8a798546
--- /dev/null
+++ b/mysql-test/r/ndb_bug26793.result
@@ -0,0 +1,8 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE `test` (
+`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`t` VARCHAR( 10 ) NOT NULL
+) ENGINE = ndbcluster;
+GRANT USAGE ON *.* TO user1@localhost IDENTIFIED BY 'pass';
+DROP TABLE `test`.`test`;
+drop user user1@localhost;
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_bug26793.test b/mysql-test/t/ndb_bug26793.test
new file mode 100644
index 00000000000..f35d8808c1a
--- /dev/null
+++ b/mysql-test/t/ndb_bug26793.test
@@ -0,0 +1,35 @@
+-- source include/have_ndb.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE `test` (
+`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`t` VARCHAR( 10 ) NOT NULL
+) ENGINE = ndbcluster;
+
+# Add user1@localhost with a specific password
+# and connect as that user
+GRANT USAGE ON *.* TO user1@localhost IDENTIFIED BY 'pass';
+connect (user1,localhost,user1,pass,*NO-ONE*);
+
+# Run the query 100 times
+disable_query_log;
+disable_result_log;
+let $i= 100;
+while ($i)
+{
+select count(*) from information_schema.tables union all select count(*) from information_schema.tables union all select count(*) from information_schema.tables;
+dec $i;
+}
+enable_query_log;
+enable_result_log;
+
+disconnect user1;
+
+# Switch back to the default connection and cleanup
+connection default;
+DROP TABLE `test`.`test`;
+drop user user1@localhost;
+
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;