diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-01-28 13:36:05 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-01-28 13:36:05 +0100 |
commit | 87de27e46b889d86cd872adf8ce613128d379911 (patch) | |
tree | 87f3ec6d65538b9bc199408f58daaa2ec9e7a702 /mysql-test | |
parent | f08a404a6d87f7c8c7fef1862eaf768cf920677b (diff) | |
parent | 34e84c227f1cb76771eabf229b4cf1b5292eef25 (diff) | |
download | mariadb-git-87de27e46b889d86cd872adf8ce613128d379911.tar.gz |
5.3 merge
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/distinct.result | 32 | ||||
-rw-r--r-- | mysql-test/r/group_min_max.result | 7 | ||||
-rw-r--r-- | mysql-test/r/subselect_sj.result | 15 | ||||
-rw-r--r-- | mysql-test/r/subselect_sj_jcl6.result | 15 | ||||
-rw-r--r-- | mysql-test/t/distinct.test | 25 | ||||
-rw-r--r-- | mysql-test/t/group_min_max.test | 9 | ||||
-rw-r--r-- | mysql-test/t/subselect_sj.test | 19 |
7 files changed, 122 insertions, 0 deletions
diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result index 75f054ecbbe..459ece978fd 100644 --- a/mysql-test/r/distinct.result +++ b/mysql-test/r/distinct.result @@ -847,6 +847,38 @@ time(f1) 00:00:00.000200 00:00:00.000300 drop table t1; +create table t1(i int, g int); +insert into t1 values (null, 1), (0, 2); +select distinct i from t1 group by g; +i +NULL +0 +drop table t1; +create table t1(i int, g blob); +insert into t1 values (null, 1), (0, 2); +select distinct i from t1 group by g; +i +NULL +0 +drop table t1; +create table t1 (a int) engine=myisam; +insert into t1 values (0),(7); +create table t2 (b int) engine=myisam; +insert into t2 values (7),(0),(3); +create algorithm=temptable view v as +select distinct (select max(a) from t1 where alias.b = a) as field1 from t2 as alias group by field1; +select * from v; +field1 +NULL +0 +7 +select distinct (select max(a) from t1 where alias.b = a) as field1 from t2 as alias group by field1; +field1 +NULL +0 +7 +drop view v; +drop table t1, t2; # # Bug #11744875: 4082: integer lengths cause truncation with distinct concat and innodb # diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result index ce0793b70a6..d1faec7f758 100644 --- a/mysql-test/r/group_min_max.result +++ b/mysql-test/r/group_min_max.result @@ -2933,6 +2933,13 @@ ORDER BY min_a; min_a NULL DROP TABLE t1; +create table t1 (a int, b varchar(1), key(b,a)) engine=myisam; +insert t1 values (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'f'),(7,'g'),(8,'h'),(null,'i'); +select min(a), b from t1 where a=7 or b='z' group by b; +min(a) b +7 g +flush tables; +drop table t1; # # LP BUG#888456 Wrong result with DISTINCT , ANY , subquery_cache=off , NOT NULL # diff --git a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result index 972725e30a4..d9fa9853da5 100644 --- a/mysql-test/r/subselect_sj.result +++ b/mysql-test/r/subselect_sj.result @@ -2768,6 +2768,21 @@ HAVING t1sum <> 1; t1sum b DROP TABLE t1, t2; # +# MDEV-3911: Assertion `fixed == 0' failed in Item_field::fix_fields +# on 2nd execution of PS with semijoin=on and IN subquery +# +CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (0,4),(8,6); +CREATE TABLE t2 (c INT, d INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (7,1),(0,7); +PREPARE stmt FROM ' SELECT * FROM t1 WHERE ( a, b ) IN ( SELECT c, d FROM t2 ) '; +execute stmt; +a b +execute stmt; +a b +deallocate prepare stmt; +drop table t1,t2; +# # MySQL Bug#13340270: assertion table->sort.record_pointers == __null # CREATE TABLE t1 ( diff --git a/mysql-test/r/subselect_sj_jcl6.result b/mysql-test/r/subselect_sj_jcl6.result index 125d58956f8..1ca8b44a0b8 100644 --- a/mysql-test/r/subselect_sj_jcl6.result +++ b/mysql-test/r/subselect_sj_jcl6.result @@ -2782,6 +2782,21 @@ HAVING t1sum <> 1; t1sum b DROP TABLE t1, t2; # +# MDEV-3911: Assertion `fixed == 0' failed in Item_field::fix_fields +# on 2nd execution of PS with semijoin=on and IN subquery +# +CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (0,4),(8,6); +CREATE TABLE t2 (c INT, d INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (7,1),(0,7); +PREPARE stmt FROM ' SELECT * FROM t1 WHERE ( a, b ) IN ( SELECT c, d FROM t2 ) '; +execute stmt; +a b +execute stmt; +a b +deallocate prepare stmt; +drop table t1,t2; +# # MySQL Bug#13340270: assertion table->sort.record_pointers == __null # CREATE TABLE t1 ( diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test index 051499f465b..f1c120a313d 100644 --- a/mysql-test/t/distinct.test +++ b/mysql-test/t/distinct.test @@ -658,6 +658,31 @@ select time(f1) from t1 ; select distinct time(f1) from t1 ; drop table t1; +# +# MDEV-3875 Wrong result (missing row) on a DISTINCT query with the same subquery in the SELECT list and GROUP BY +# MySQL Bug#66896 Distinct not distinguishing 0 from NULL when GROUP BY is used +# +create table t1(i int, g int); # remove_dup_with_hash_index +insert into t1 values (null, 1), (0, 2); +select distinct i from t1 group by g; +drop table t1; + +create table t1(i int, g blob); # remove_dup_with_compare +insert into t1 values (null, 1), (0, 2); +select distinct i from t1 group by g; +drop table t1; + +create table t1 (a int) engine=myisam; +insert into t1 values (0),(7); +create table t2 (b int) engine=myisam; +insert into t2 values (7),(0),(3); +create algorithm=temptable view v as +select distinct (select max(a) from t1 where alias.b = a) as field1 from t2 as alias group by field1; +select * from v; +select distinct (select max(a) from t1 where alias.b = a) as field1 from t2 as alias group by field1; +drop view v; +drop table t1, t2; + --echo # --echo # Bug #11744875: 4082: integer lengths cause truncation with distinct concat and innodb --echo # diff --git a/mysql-test/t/group_min_max.test b/mysql-test/t/group_min_max.test index b984acc78ea..19f7cbe40a1 100644 --- a/mysql-test/t/group_min_max.test +++ b/mysql-test/t/group_min_max.test @@ -1155,6 +1155,15 @@ ORDER BY min_a; DROP TABLE t1; +# +# MDEV-729 lp:998028 - Server crashes on normal shutdown in closefrm after executing a query from MyISAM table +# +create table t1 (a int, b varchar(1), key(b,a)) engine=myisam; +insert t1 values (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'f'),(7,'g'),(8,'h'),(null,'i'); +select min(a), b from t1 where a=7 or b='z' group by b; +flush tables; +drop table t1; + --echo # --echo # LP BUG#888456 Wrong result with DISTINCT , ANY , subquery_cache=off , NOT NULL --echo # diff --git a/mysql-test/t/subselect_sj.test b/mysql-test/t/subselect_sj.test index 4e93e07c1e3..efbd2b00f24 100644 --- a/mysql-test/t/subselect_sj.test +++ b/mysql-test/t/subselect_sj.test @@ -2463,6 +2463,25 @@ HAVING t1sum <> 1; DROP TABLE t1, t2; --echo # +--echo # MDEV-3911: Assertion `fixed == 0' failed in Item_field::fix_fields +--echo # on 2nd execution of PS with semijoin=on and IN subquery +--echo # + +CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (0,4),(8,6); + +CREATE TABLE t2 (c INT, d INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (7,1),(0,7); + +eval PREPARE stmt FROM ' SELECT * FROM t1 WHERE ( a, b ) IN ( SELECT c, d FROM t2 ) '; + +execute stmt; +execute stmt; + +deallocate prepare stmt; +drop table t1,t2; + +--echo # --echo # MySQL Bug#13340270: assertion table->sort.record_pointers == __null --echo # |