diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-07-07 11:30:03 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-07-07 11:30:03 +0200 |
commit | 9e11e055ce1461caecbb30e8300dfdcd48af22f1 (patch) | |
tree | 48f5dc07a29e44a106c37e7e8e3234c62abbebf6 /mysql-test/r/subselect_no_scache.result | |
parent | 2b5c9bc2c813ea7963959e515da5d60392c35431 (diff) | |
parent | 6b99859fff6b8c0a52ea45965834c9c3fdfc4cb3 (diff) | |
download | mariadb-git-9e11e055ce1461caecbb30e8300dfdcd48af22f1.tar.gz |
Merge branch '10.0' into 10.1
Diffstat (limited to 'mysql-test/r/subselect_no_scache.result')
-rw-r--r-- | mysql-test/r/subselect_no_scache.result | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result index cc3d20ef163..9a37719c38a 100644 --- a/mysql-test/r/subselect_no_scache.result +++ b/mysql-test/r/subselect_no_scache.result @@ -4707,7 +4707,7 @@ pk SET SESSION sql_mode=@old_sql_mode; drop table t2, t1; drop view v1; -End of 5.0 tests. +# End of 5.0 tests. create table t_out (subcase char(3), a1 char(2), b1 char(2), c1 char(2)); create table t_in (a2 char(2), b2 char(2), c2 char(2)); @@ -5582,7 +5582,7 @@ insert into t2 values ('x'), ('y'); select * from t2 where a=(select a from t1) and a='x'; ERROR 21000: Subquery returns more than 1 row drop table t1,t2; -End of 5.1 tests +# End of 5.1 tests # # Bug #11765713 58705: # OPTIMIZER LET ENGINE DEPEND ON UNINITIALIZED VALUES @@ -6194,7 +6194,7 @@ WHERE (c_sq1_alias1.col_int_nokey != @var2 OR c_sq1_alias1.pk != @var3)) ) AS alias3; pk col_int_nokey col_int_key col_time_key col_varchar_key col_varchar_nokey DROP TABLE t1,t2; -End of 5.2 tests +# End of 5.2 tests # # BUG#779885: Crash in eliminate_item_equal with materialization=on in # @@ -7151,9 +7151,10 @@ INSERT INTO t1 VALUES (1),(2); CREATE TABLE t2 (f2 INT, KEY(f2)); INSERT INTO t2 VALUES (3); CREATE ALGORITHM=MERGE VIEW v2 AS SELECT * FROM t2; +SELECT ( SELECT MIN(t2.f2) FROM t1 ) AS sq FROM t2 GROUP BY sq; +ERROR 42000: Can't group on 'sq' SELECT ( SELECT MIN(v2.f2) FROM t1 ) AS sq FROM v2 GROUP BY sq; -sq -3 +ERROR 42000: Can't group on 'sq' SELECT * FROM v2 where ( SELECT MIN(v2.f2) FROM t1 ) > 0; f2 3 @@ -7161,9 +7162,10 @@ SELECT count(*) FROM v2 group by ( SELECT MIN(v2.f2) FROM t1 ); count(*) 1 delete from t1; +SELECT ( SELECT MIN(t2.f2) FROM t1 ) AS sq FROM t2 GROUP BY sq; +ERROR 42000: Can't group on 'sq' SELECT ( SELECT MIN(v2.f2) FROM t1 ) AS sq FROM v2 GROUP BY sq; -sq -NULL +ERROR 42000: Can't group on 'sq' drop view v2; drop table t1,t2; # @@ -7178,6 +7180,29 @@ f1 f2 foo bar DROP TABLE t1; # +# MDEV-10146: Wrong result (or questionable result and behavior) +# with aggregate function in uncorrelated SELECT subquery +# +CREATE TABLE t1 (f1 INT); +CREATE VIEW v1 AS SELECT * FROM t1; +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (f2 int); +INSERT INTO t2 VALUES (3); +SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1; +( SELECT MAX(f1) FROM t2 ) +2 +SELECT ( SELECT MAX(f1) FROM t2 ) FROM v1; +( SELECT MAX(f1) FROM t2 ) +2 +INSERT INTO t2 VALUES (4); +SELECT ( SELECT MAX(f1) FROM t2 ) FROM v1; +ERROR 21000: Subquery returns more than 1 row +SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1; +ERROR 21000: Subquery returns more than 1 row +drop view v1; +drop table t1,t2; +# End of 10.0 tests +# # MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops # with UNION in ALL subquery # @@ -7204,7 +7229,7 @@ SELECT * FROM t1, t2 WHERE f3 = f2 AND f1 > ANY ( SELECT 'foo'); f1 f2 f3 DROP TABLE t1, t2; SET NAMES default; -End of 10.1 tests +# End of 10.1 tests set optimizer_switch=default; select @@optimizer_switch like '%subquery_cache=on%'; @@optimizer_switch like '%subquery_cache=on%' |