diff options
author | Igor Babaev <igor@askmonty.org> | 2013-10-13 13:43:29 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2013-10-13 13:43:29 -0700 |
commit | c7db46a2427e933a379d0a8c62221c344a29ea06 (patch) | |
tree | 9b18bd0d93bea6517341827cfd02540054633174 /mysql-test/r/derived_view.result | |
parent | e37639e9349b56296d452e69e970df939383d7e1 (diff) | |
parent | 78b580b77965d63d4292a72a3ba12d0cc83b01a3 (diff) | |
download | mariadb-git-c7db46a2427e933a379d0a8c62221c344a29ea06.tar.gz |
Merge 5.3-5.5
Diffstat (limited to 'mysql-test/r/derived_view.result')
-rw-r--r-- | mysql-test/r/derived_view.result | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/r/derived_view.result b/mysql-test/r/derived_view.result index 8630087ba72..a3d38021a28 100644 --- a/mysql-test/r/derived_view.result +++ b/mysql-test/r/derived_view.result @@ -2215,6 +2215,35 @@ DROP VIEW v1; DROP TABLE t1,t2; set optimizer_switch=@save_optimizer_switch; # +# mdev-5078: sum over a view/derived table +# +CREATE TABLE t1 (a int); +INSERT INTO t1 (a) VALUES (1), (2); +CREATE TABLE t2 (b int(11)); +INSERT INTO t2 (b) VALUES (1), (2); +CREATE VIEW v AS SELECT b as c FROM t2; +SELECT a, (SELECT SUM(a + c) FROM v) FROM t1; +a (SELECT SUM(a + c) FROM v) +1 5 +2 7 +SELECT a, (SELECT SUM(a + c) FROM (SELECT b as c FROM t2) AS v1) FROM t1; +a (SELECT SUM(a + c) FROM (SELECT b as c FROM t2) AS v1) +1 5 +2 7 +DROP VIEW v; +DROP TABLE t1,t2; +# +# mdev-5105: memory overwrite in multi-table update +# using natuaral join with a view +# +create table t1(a int,b tinyint,c tinyint)engine=myisam; +create table t2(a tinyint,b float,c int, d int, e int, f int, key (b), key(c), key(d), key(e), key(f))engine=myisam; +create table t3(a int,b int,c int, d int, e int, f int, key(a), key(b), key(c), key(d), key(e), key(f))engine=myisam; +create view v1 as select t2.b a, t1.b b, t2.c c, t2.d d, t2.e e, t2.f f from t1,t2 where t1.a=t2.a; +update t3 natural join v1 set a:=1; +drop view v1; +drop table t1,t2,t3; +# # end of 5.3 tests # set optimizer_switch=@exit_optimizer_switch; |