diff options
author | unknown <mhansson/martin@linux-st28.site> | 2008-01-11 19:39:28 +0100 |
---|---|---|
committer | unknown <mhansson/martin@linux-st28.site> | 2008-01-11 19:39:28 +0100 |
commit | c37689f181fd35eef462386874ffdadf099999fe (patch) | |
tree | 7949ca401095fa4745abe0f8777c3266ce92bd72 /mysql-test/r/group_by.result | |
parent | d52a1a144bf382b21d868bed23dfddc00d0c619e (diff) | |
parent | ab0f3e4661f720c852e76771120127bdcce2cfea (diff) | |
download | mariadb-git-c37689f181fd35eef462386874ffdadf099999fe.tar.gz |
Merge mhansson@bk-internal:/home/bk/mysql-5.1-opt
into linux-st28.site:/home/martin/mysql/src/bug31797/my51-bug31797-pushee
mysql-test/r/group_by.result:
Auto merged
mysql-test/t/group_by.test:
Auto merged
sql/item.cc:
Auto merged
Diffstat (limited to 'mysql-test/r/group_by.result')
-rw-r--r-- | mysql-test/r/group_by.result | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 1472fdfdd7a..268f290ddca 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -1478,3 +1478,39 @@ NULL 1 2 DROP TABLE t1; +CREATE TABLE t1 ( a INT, b INT ); +SELECT b c, (SELECT a FROM t1 WHERE b = c) +FROM t1; +c (SELECT a FROM t1 WHERE b = c) +SELECT b c, (SELECT a FROM t1 WHERE b = c) +FROM t1 +HAVING b = 10; +c (SELECT a FROM t1 WHERE b = c) +SELECT MAX(b) c, (SELECT a FROM t1 WHERE b = c) +FROM t1 +HAVING b = 10; +ERROR 42S22: Reference 'c' not supported (reference to group function) +SET @old_sql_mode = @@sql_mode; +SET @@sql_mode='ONLY_FULL_GROUP_BY'; +SELECT b c, (SELECT a FROM t1 WHERE b = c) +FROM t1; +c (SELECT a FROM t1 WHERE b = c) +SELECT b c, (SELECT a FROM t1 WHERE b = c) +FROM t1 +HAVING b = 10; +ERROR 42000: non-grouping field 'b' is used in HAVING clause +SELECT MAX(b) c, (SELECT a FROM t1 WHERE b = c) +FROM t1 +HAVING b = 10; +ERROR 42S22: Reference 'c' not supported (reference to group function) +INSERT INTO t1 VALUES (1, 1); +SELECT b c, (SELECT a FROM t1 WHERE b = c) +FROM t1; +c (SELECT a FROM t1 WHERE b = c) +1 1 +INSERT INTO t1 VALUES (2, 1); +SELECT b c, (SELECT a FROM t1 WHERE b = c) +FROM t1; +ERROR 21000: Subquery returns more than 1 row +DROP TABLE t1; +SET @@sql_mode = @old_sql_mode; |