summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2005-06-17 17:27:47 +0300
committerbell@sanja.is.com.ua <>2005-06-17 17:27:47 +0300
commita11677026f6aed1281e6fd7cdc9250bbe892132f (patch)
treea1524e75158ce5df834d60837e8609e95d3b7d3f /mysql-test
parentd3d5d6b0752daaed00287cc05eb3120a2a06c0de (diff)
downloadmariadb-git-a11677026f6aed1281e6fd7cdc9250bbe892132f.tar.gz
fixed printing of sum(distinct ) & avg(distinct ) & cast(... as decimal) (BUG#7015, BUG#11387)
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/view.result17
-rw-r--r--mysql-test/t/view.test18
2 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 84be086ae37..b178af1bb1c 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -1726,3 +1726,20 @@ sum(a)
drop procedure p1;
drop view v1;
drop table t1;
+create table t1 (s1 int);
+create view v1 as select sum(distinct s1) from t1;
+select * from v1;
+sum(distinct s1)
+NULL
+drop view v1;
+create view v1 as select avg(distinct s1) from t1;
+select * from v1;
+avg(distinct s1)
+NULL
+drop view v1;
+drop table t1;
+create view v1 as select cast(1 as decimal);
+select * from v1;
+cast(1 as decimal)
+1.00
+drop view v1;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 0477ab0ea20..23d482254d1 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -1569,3 +1569,21 @@ drop procedure p1;
drop view v1;
drop table t1;
+#
+# using sum(distinct ) & avg(distinct ) in views (BUG#7015)
+#
+create table t1 (s1 int);
+create view v1 as select sum(distinct s1) from t1;
+select * from v1;
+drop view v1;
+create view v1 as select avg(distinct s1) from t1;
+select * from v1;
+drop view v1;
+drop table t1;
+
+#
+# using cast(... as decimal) in views (BUG#11387);
+#
+create view v1 as select cast(1 as decimal);
+select * from v1;
+drop view v1;