diff options
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/group_by.test | 3 | ||||
-rw-r--r-- | mysql-test/t/subselect.test | 55 | ||||
-rw-r--r-- | mysql-test/t/type_decimal.test | 1 | ||||
-rw-r--r-- | mysql-test/t/view.test | 14 |
4 files changed, 71 insertions, 2 deletions
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 9774056f5ef..3211db5d6ed 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -790,8 +790,6 @@ drop table t1; SET SQL_MODE = ''; # - -# # Bug #32202: ORDER BY not working with GROUP BY # @@ -824,6 +822,7 @@ SELECT * FROM t1 GROUP BY c2 ORDER BY c2 DESC, c1 DESC; DROP TABLE t1; + --echo End of 5.0 tests # Bug #21174: Index degrades sort performance and # optimizer does not honor IGNORE INDEX. diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index ad940f3f5ad..87afc42d625 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -3159,6 +3159,60 @@ select count(*) from t1 where f12 = drop table t1,t2; +# +# BUG#33794 "MySQL crashes executing specific query on specific dump" +# +CREATE TABLE t4 ( + f7 varchar(32) collate utf8_bin NOT NULL default '', + f10 varchar(32) collate utf8_bin default NULL, + PRIMARY KEY (f7) +); +INSERT INTO t4 VALUES(1,1), (2,null); + +CREATE TABLE t2 ( + f4 varchar(32) collate utf8_bin NOT NULL default '', + f2 varchar(50) collate utf8_bin default NULL, + f3 varchar(10) collate utf8_bin default NULL, + PRIMARY KEY (f4), + UNIQUE KEY uk1 (f2) +); +INSERT INTO t2 VALUES(1,1,null), (2,2,null); + +CREATE TABLE t1 ( + f8 varchar(32) collate utf8_bin NOT NULL default '', + f1 varchar(10) collate utf8_bin default NULL, + f9 varchar(32) collate utf8_bin default NULL, + PRIMARY KEY (f8) +); +INSERT INTO t1 VALUES (1,'P',1), (2,'P',1), (3,'R',2); + +CREATE TABLE t3 ( + f6 varchar(32) collate utf8_bin NOT NULL default '', + f5 varchar(50) collate utf8_bin default NULL, + PRIMARY KEY (f6) +); +INSERT INTO t3 VALUES (1,null), (2,null); + +SELECT + IF(t1.f1 = 'R', a1.f2, t2.f2) AS a4, + IF(t1.f1 = 'R', a1.f3, t2.f3) AS f3, + SUM( + IF( + (SELECT VPC.f2 + FROM t2 VPC, t4 a2, t2 a3 + WHERE + VPC.f4 = a2.f10 AND a3.f2 = a4 + LIMIT 1) IS NULL, + 0, + t3.f5 + ) + ) AS a6 +FROM + t2, t3, t1 JOIN t2 a1 ON t1.f9 = a1.f4 +GROUP BY a4; + +DROP TABLE t1, t2; + --echo End of 5.0 tests. # @@ -3194,3 +3248,4 @@ CREATE TABLE t1 (s1 char(1)); INSERT INTO t1 VALUES ('a'); SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1); DROP TABLE t1; + diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test index 2ee6615a5ee..6841b3cdd68 100644 --- a/mysql-test/t/type_decimal.test +++ b/mysql-test/t/type_decimal.test @@ -477,6 +477,7 @@ show create table t1; select round(a,b) as c from t1 order by c; DROP TABLE t1, t2, t3, t4; + # # Bug #33143: Incorrect ORDER BY for ROUND()/TRUNCATE() result # diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 7f769c50449..58ef9c1eff1 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -3453,6 +3453,20 @@ DROP VIEW v2; DROP VIEW v3; DROP TABLE t1; +--echo # +--echo # Bug#29477: Not all fields of the target table were checked to have +--echo # a default value when inserting into a view. +--echo # +create table t1(f1 int, f2 int not null); +create view v1 as select f1 from t1; +insert into v1 values(1); +set @old_mode=@@sql_mode; +set @@sql_mode=traditional; +--error ER_NO_DEFAULT_FOR_VIEW_FIELD +insert into v1 values(1); +set @@sql_mode=@old_mode; +drop view v1; +drop table t1; --echo End of 5.0 tests. |