summaryrefslogtreecommitdiff
path: root/mysql-test/r/view.result
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2006-02-01 20:43:43 -0800
committerunknown <igor@rurik.mysql.com>2006-02-01 20:43:43 -0800
commit06b5e4993cef23cbe7fbd39f7887a0beb29ffe0d (patch)
tree360fc2fd65bed95e7be429918bd9b5877bae3faa /mysql-test/r/view.result
parentaf1b1152744c76658c5a4cbe9745037fdeb1d120 (diff)
downloadmariadb-git-06b5e4993cef23cbe7fbd39f7887a0beb29ffe0d.tar.gz
Fixed bug #16382.
When an ambiguous field name is used in a group by clause a warning is issued in the find_order_in_list function by a call to push_warning_printf. An expression that was not always valid was passed to this call as the field name parameter. mysql-test/r/view.result: Added a test case for bug #16382. mysql-test/t/view.test: Added a test case for bug #16382.
Diffstat (limited to 'mysql-test/r/view.result')
-rw-r--r--mysql-test/r/view.result34
1 files changed, 34 insertions, 0 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 2be1f5e5edd..e209e393d00 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -2504,3 +2504,37 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
DROP VIEW v1;
DROP TABLE t1;
+CREATE TABLE t1 (x varchar(10));
+INSERT INTO t1 VALUES (null), ('foo'), ('bar'), (null);
+CREATE VIEW v1 AS SELECT * FROM t1;
+SELECT IF(x IS NULL, 'blank', 'not blank') FROM v1 GROUP BY x;
+IF(x IS NULL, 'blank', 'not blank')
+blank
+not blank
+not blank
+SELECT IF(x IS NULL, 'blank', 'not blank') AS x FROM t1 GROUP BY x;
+x
+blank
+not blank
+not blank
+Warnings:
+Warning 1052 Column 'x' in group statement is ambiguous
+SELECT IF(x IS NULL, 'blank', 'not blank') AS x FROM v1;
+x
+blank
+not blank
+not blank
+blank
+SELECT IF(x IS NULL, 'blank', 'not blank') AS y FROM v1 GROUP BY y;
+y
+blank
+not blank
+SELECT IF(x IS NULL, 'blank', 'not blank') AS x FROM v1 GROUP BY x;
+x
+blank
+not blank
+not blank
+Warnings:
+Warning 1052 Column 'x' in group statement is ambiguous
+DROP VIEW v1;
+DROP TABLE t1;