diff options
author | unknown <timour@mysql.com> | 2005-06-15 10:12:49 +0300 |
---|---|---|
committer | unknown <timour@mysql.com> | 2005-06-15 10:12:49 +0300 |
commit | 476ca52ee7c0cb1bdee081fba4260d9aff39f5dc (patch) | |
tree | a5b3fda1a95fe8aecc8494d6133d874182c1f90d /.bzrignore | |
parent | 894fd6ae07466eca193819295bd8332e5fd572c9 (diff) | |
download | mariadb-git-476ca52ee7c0cb1bdee081fba4260d9aff39f5dc.tar.gz |
Fix for BUG#11211 "GROUP BY doesn't work correctly"
When the GROUP BY clause contains a column reference that can be resolved to
both an aliased column in the SELECT list, and to a column in the FROM clause,
the group column is resolved to the column in the FROM clause (for ANSI conformance).
However, it may be so that the user's intent is just the other way around, and he/she
gets the query results grouped by a completely different column than expexted.
This patch adds a warning in such cases that tells the user that there is potential
ambiguity in the group column.
sql/sql_select.cc
- Added a warning when a GROUP column is ambiguous due to that there is a
column reference with the same name both in the SELECT and FROM clauses.
In this case we resolve to the column in FROM clause and warn the user
of a possible ambiguity.
- More extensive comments.
- Changed the function to return bool instead of int (as in other places).
mysql-test/t/group_by.test
Added test for BUG#11211.
mysql-test/r/group_by.result
Added test for BUG#11211.
mysql-test/r/group_by.result:
Import patch 11211.diff
mysql-test/t/group_by.test:
Import patch 11211.diff
sql/sql_select.cc:
Import patch 11211.diff
BitKeeper/etc/ignore:
Added ndb/src/dummy.cpp to the ignore list
mysql-test/r/alias.result:
Added warning for potentially ambiguous column.
mysql-test/r/having.result:
Added warning for potentially ambiguous column.
Diffstat (limited to '.bzrignore')
-rw-r--r-- | .bzrignore | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/.bzrignore b/.bzrignore index ae028ae9426..9c6cf2c965c 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1116,3 +1116,4 @@ vio/test-ssl vio/test-sslclient vio/test-sslserver vio/viotest-ssl +ndb/src/dummy.cpp |