diff options
author | unknown <evgen@moonbone.local> | 2005-10-14 01:22:24 +0400 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2005-10-14 01:22:24 +0400 |
commit | 0390de8672255aed7d35734fa8bc0d87efbe532e (patch) | |
tree | e887a6ffbda953ab8bcb31e4c30fe52a546b8f43 /sql/sql_select.cc | |
parent | f4e6fca1bdc9fbf67cff12723c3f9fe15bb72956 (diff) | |
download | mariadb-git-0390de8672255aed7d35734fa8bc0d87efbe532e.tar.gz |
Fix bug #13855 select distinct with group by caused server crash
DISTINCT wasn't optimized away and caused creation of tmp table in wrong
case. This result in integer overrun and running out of memory.
Fix backported from 4.1. Now if optimizer founds that in result be only 1
row it removes distinct.
sql/sql_select.cc:
Fix bug #13855 select distinct with group by caused server crash
mysql-test/r/select.result:
Test case for bug#13855 select distinct with group by caused server crash
mysql-test/t/select.test:
Test case for bug#13855 select distinct with group by caused server crash
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 7c2c233d754..46f0139a608 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -626,6 +626,7 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds, { order=0; // The output has only one row simple_order=1; + select_distinct= 0; // No need in distinct for 1 row } calc_group_buffer(&join,group); |