summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-07-16 19:09:54 +0200
committerSergei Golubchik <sergii@pisem.net>2013-07-16 19:09:54 +0200
commit005c7e54214546584c8dc67a746e215f8dbe4b58 (patch)
treedea50cd7b32808413e058d43d20cf230d1cc7477 /sql/sql_select.cc
parentb9f220b45afaae9b61af29129a8c8ec5f9a7759b (diff)
parent4f5c10e6b565bc2761b9d083e25c6a36141552a0 (diff)
downloadmariadb-git-005c7e54214546584c8dc67a746e215f8dbe4b58.tar.gz
mysql-5.5.32 merge
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index e517c05c161..cacaea44d12 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -12,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file
@@ -8133,6 +8133,7 @@ JOIN::make_simple_join(JOIN *parent, TABLE *temp_table)
join_tab->ref.key = -1;
join_tab->read_first_record= join_init_read_record;
join_tab->join= this;
+ join_tab->ref.key_parts= 0;
bzero((char*) &join_tab->read_record,sizeof(join_tab->read_record));
temp_table->status=0;
temp_table->null_row=0;
@@ -14015,7 +14016,7 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
if (new_field)
new_field->init(table);
- if (copy_func && item->is_result_field())
+ if (copy_func && item->real_item()->is_result_field())
*((*copy_func)++) = item; // Save for copy_funcs
if (modify_item)
item->set_result_field(new_field);
@@ -19307,7 +19308,17 @@ create_sort_index(THD *thd, JOIN *join, ORDER *order,
tablesort_result_cache= table->sort.io_cache;
table->sort.io_cache= NULL;
- // select->cleanup(); // filesort did select
+ if (select->quick &&
+ select->quick->get_type() == QUICK_SELECT_I::QS_TYPE_GROUP_MIN_MAX)
+ {
+ tab->filesort_used_loose_index_scan= true;
+
+ QUICK_GROUP_MIN_MAX_SELECT *minmax_quick=
+ static_cast<QUICK_GROUP_MIN_MAX_SELECT*>(select->quick);
+ if (minmax_quick->is_agg_distinct())
+ tab->filesort_used_loose_index_scan_agg_distinct= true;
+ }
+
/*
If a quick object was created outside of create_sort_index()
that might be reused, then do not call select->cleanup() since