summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2017-12-22 12:23:39 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2017-12-22 12:23:39 +0200
commit985d2d393c285ecd4539cb579b680f7b91fdaa1a (patch)
tree8cabf6c09758c30df04de96ca98c7827d5665493 /sql/item.cc
parenta76a2522ec4f8c069827e038997387a8b8eb3a3a (diff)
parent461cf3e5a3c2d346d75b1407b285f8daf9d01f67 (diff)
downloadmariadb-git-985d2d393c285ecd4539cb579b680f7b91fdaa1a.tar.gz
Merge remote-tracking branch 'origin/10.1' into 10.2
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 6dcb436baba..72e24c8ec70 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -4991,7 +4991,8 @@ resolve_ref_in_select_and_group(THD *thd, Item_ident *ref, SELECT_LEX *select)
if (thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY &&
select->having_fix_field &&
- select_ref != not_found_item && !group_by_ref)
+ select_ref != not_found_item && !group_by_ref &&
+ !ref->alias_name_used)
{
/*
Report the error if fields was found only in the SELECT item list and