summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authormonty@mysql.com <>2004-10-23 03:30:27 +0300
committermonty@mysql.com <>2004-10-23 03:30:27 +0300
commit8b6839e6446fde2931583d4d8b74bb531add5062 (patch)
tree1f64399a0e4969a64a4f1500ed9f131f3cc00bf5 /mysql-test/t
parentf5b33f6e6ae065496688f8fd1390c4d6a0826cd2 (diff)
downloadmariadb-git-8b6839e6446fde2931583d4d8b74bb531add5062.tar.gz
Fixed wrong range test code for HEAP tables. This caused a crash when doing a range test with a key that didn't have lower or upper bound (Bug #6082)
More test cases
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/heap.test10
-rw-r--r--mysql-test/t/key.test11
-rw-r--r--mysql-test/t/ps.test13
3 files changed, 34 insertions, 0 deletions
diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test
index 37fc5a43227..e1776245d9e 100644
--- a/mysql-test/t/heap.test
+++ b/mysql-test/t/heap.test
@@ -164,3 +164,13 @@ CREATE TABLE `job_titles` (
SELECT MAX(job_title_id) FROM job_titles;
DROP TABLE job_titles;
+
+#
+# Test of delete with NOT NULL
+# (Bug #6082)
+#
+
+CREATE TABLE t1 (a INT NOT NULL, B INT, KEY(B)) ENGINE=HEAP;
+INSERT INTO t1 VALUES(1,1), (1,NULL);
+SELECT * FROM t1 WHERE B is not null;
+DROP TABLE t1;
diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test
index 620b8e415b8..662baa5ea9d 100644
--- a/mysql-test/t/key.test
+++ b/mysql-test/t/key.test
@@ -272,5 +272,16 @@ select c1 from t1 where c2='\Z\Z\Z\Z';
DELETE FROM t1 WHERE (c1 = 3);
check table t1;
select c1 from t1 where c2='\Z\Z\Z\Z';
+
+#
+# test delete of keys in a different order
+#
+truncate table t1;
+insert into t1 values(1,"aaaa"),(2,"aaab"),(3,"aaac"),(4,"aaccc");
+delete from t1 where c1=3;
+delete from t1 where c1=1;
+delete from t1 where c1=4;
+check table t1;
+
drop table t1;
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index 76da86dc6df..978ce2bc2c3 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -449,3 +449,16 @@ execute stmt;
select found_rows();
deallocate prepare stmt;
drop table t1;
+
+#
+# Bug#6047 "permission problem when executing mysql_stmt_execute with derived
+# table"
+#
+
+CREATE TABLE t1 (N int, M tinyint);
+INSERT INTO t1 VALUES (1,0),(1,0),(2,0),(2,0),(3,0);
+PREPARE stmt FROM 'UPDATE t1 AS P1 INNER JOIN (SELECT N FROM t1 GROUP BY N HAVING COUNT(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2';
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
+