diff options
author | Tor Didriksen <tor.didriksen@oracle.com> | 2012-03-27 14:55:29 +0200 |
---|---|---|
committer | Tor Didriksen <tor.didriksen@oracle.com> | 2012-03-27 14:55:29 +0200 |
commit | daf4107355221f0b7cffb84d449089115da85a63 (patch) | |
tree | eb8b53852f9d700a9134a2a695bdda43eb17b12f /sql/item_subselect.cc | |
parent | 499e8659e86cdae8665c9970bb6ce34124de977a (diff) | |
parent | 10120d363dbde6f825d4b9ce3226b7e3bf374c7d (diff) | |
download | mariadb-git-daf4107355221f0b7cffb84d449089115da85a63.tar.gz |
merge 5.1 => 5.5
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r-- | sql/item_subselect.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 0c4b96f7be0..a6bcdbd8645 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -1030,7 +1030,13 @@ Item_in_subselect::single_value_transformer(JOIN *join, print_where(item, "rewrite with MIN/MAX", QT_ORDINARY);); if (thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY) { - DBUG_ASSERT(select_lex->non_agg_field_used()); + /* + If the argument is a field, we assume that fix_fields() has + tagged the select_lex with non_agg_field_used. + We reverse that decision after this rewrite with MIN/MAX. + */ + if (item->get_arg(0)->type() == Item::FIELD_ITEM) + DBUG_ASSERT(select_lex->non_agg_field_used()); select_lex->set_non_agg_field_used(false); } |