summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/explain.test16
-rw-r--r--mysql-test/t/select.test14
-rw-r--r--mysql-test/t/subselect.test19
-rw-r--r--mysql-test/t/type_blob.test8
4 files changed, 57 insertions, 0 deletions
diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test
index c6c30b58341..8380aa668b0 100644
--- a/mysql-test/t/explain.test
+++ b/mysql-test/t/explain.test
@@ -265,3 +265,19 @@ DEALLOCATE PREPARE stmt;
DROP TABLE t1;
--echo End of 5.1 tests.
+
+--echo #
+--echo # Bug#776295: EXPLAIN EXTENDED with always false multiple equality
+--echo # in the WHERE condition of a derived table
+--echo #
+
+CREATE TABLE t1 (a int) ;
+
+CREATE TABLE t2 (a int) ;
+INSERT INTO t2 VALUES (8);
+
+EXPLAIN EXTENDED
+SELECT * FROM ( SELECT t1.a FROM t1,t2 WHERE t2.a = t1.a ) AS t;
+
+DROP TABLE t1,t2;
+
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index fb04562a173..3d5ffd185ba 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -4211,3 +4211,17 @@ SELECT t2.f23 FROM
DROP TABLE t1,t2,t3,t4,t5,t6,t7;
--echo End of 5.1 tests
+
+--echo #
+--echo # BUG#776274: substitution of a single row table
+--echo #
+
+CREATE TABLE t1 (a int NOT NULL , b int);
+INSERT INTO t1 VALUES (2,2);
+
+SELECT * FROM t1 WHERE a = b;
+EXPLAIN
+SELECT * FROM t1 WHERE a = b;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 2015ab83513..737c1836cd3 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -4333,3 +4333,22 @@ EXPLAIN SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1);
SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1);
DROP table t1,t2;
+
+--echo #
+--echo # Bug#751350: crash with pushed condition for outer references when
+--echo # there should be none of such conditions
+--echo #
+
+CREATE TABLE t1 (a int, b int) ;
+INSERT INTO t1 VALUES (0,0),(0,0);
+
+EXPLAIN
+SELECT b FROM t1
+ WHERE ('0') IN ( SELECT a FROM t1 GROUP BY a )
+ GROUP BY b;
+
+SELECT b FROM t1
+ WHERE ('0') IN ( SELECT a FROM t1 GROUP BY a )
+ GROUP BY b;
+
+DROP TABLE t1;
diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test
index 4e097edf73d..843cd0ffafa 100644
--- a/mysql-test/t/type_blob.test
+++ b/mysql-test/t/type_blob.test
@@ -628,3 +628,11 @@ DROP TABLE t1;
--echo End of 5.1 tests
+#
+# Problem when comparing blobs #778901
+#
+
+CREATE TABLE t1 ( f1 blob, f2 blob );
+INSERT INTO t1 VALUES ('','');
+SELECT f1,f2,"found row" FROM t1 WHERE f1 = f2 ;
+DROP TABLE t1;