diff options
Diffstat (limited to 'mysql-test/main/view.result')
-rw-r--r-- | mysql-test/main/view.result | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/main/view.result b/mysql-test/main/view.result index e9be123baa6..4585f370c1d 100644 --- a/mysql-test/main/view.result +++ b/mysql-test/main/view.result @@ -6777,6 +6777,21 @@ DROP PROCEDURE sp1; DROP VIEW v1; DROP TABLE t1, t2; # +# MDEV-23291: SUM column from a derived table returns invalid values +# +CREATE TABLE t1(a INT, b INT); +INSERT INTO t1 VALUES (1,1), (2,2); +CREATE view v1 AS +SELECT a as x, (select x) as y, (select y) as z FROM t1; +SELECT sum(z) FROM (SELECT a as x, (select x) as y, (select y) as z FROM t1) q; +sum(z) +3 +SELECT sum(z) FROM v1; +sum(z) +3 +DROP TABLE t1; +DROP VIEW v1; +# # End of 10.2 tests # # |