From 0c64cd83eb392a0d2085eb6340623273a3402d4d Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 12 Jun 2014 10:57:03 +0200 Subject: [PATCH] valgrind warning. initialize found_rows earlier, before any "goto err". --- sql/filesort.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sql/filesort.cc b/sql/filesort.cc index b1eb973086b..5ca6be2a2f4 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -166,6 +166,8 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, TABLE_LIST *tab= table->pos_in_table_list; Item_subselect *subselect= tab ? tab->containing_subselect() : 0; + *found_rows= HA_POS_ERROR; + MYSQL_FILESORT_START(table->s->db.str, table->s->table_name.str); DEBUG_SYNC(thd, "filesort_start"); @@ -686,7 +688,8 @@ static ha_rows find_all_keys(Sort_param *param, SQL_SELECT *select, ref_pos= ref_buff; quick_select=select && select->quick; record=0; - *found_rows= pq ? 0 : HA_POS_ERROR; // don't count unless pq is used + if (pq) // don't count unless pq is used + *found_rows= 0; flag= ((file->ha_table_flags() & HA_REC_NOT_IN_SEQ) || quick_select); if (flag) ref_pos= &file->ref[0];