Below is the list of changes that have just been committed into a local
5.0 repository of psergey. When psergey does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1904 05/04/29 01:16:32 sergefp@stripped +3 -0
Fix for BUG#10244:
Make get_quick_select_for_ref() accept estimated # records as parameter and
set QUICK_RANGE_SELECT::records, as this value is used to allocate buffers
in Multi-Range Read.
sql/sql_select.cc
1.321 05/04/29 01:16:28 sergefp@stripped +2 -1
Added "records" parameter to get_quick_select_for_ref()
sql/opt_range.h
1.53 05/04/29 01:16:28 sergefp@stripped +4 -2
Added "records" parameter to get_quick_select_for_ref()
sql/opt_range.cc
1.155 05/04/29 01:16:28 sergefp@stripped +19 -6
Make get_quick_select_for_ref() accept estimated # records as parameter and
set QUICK_RANGE_SELECT::records, as this value is used to allocate buffers
in Multi-Range Read.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: sergefp
# Host: newbox.mylan
# Root: /home/psergey/mysql-5.0-test-valgrind
--- 1.154/sql/opt_range.cc 2005-04-26 01:56:06 +04:00
+++ 1.155/sql/opt_range.cc 2005-04-29 01:16:28 +04:00
@@ -5513,14 +5513,26 @@
}
-/****************************************************************************
- Create a QUICK RANGE based on a key
- This allocates things in a new memory root, as this may be called many times
- during a query.
-****************************************************************************/
+/*
+ Create quick select from ref/ref_or_null scan.
+ SYNOPSIS
+ get_quick_select_for_ref()
+ thd Thread handle
+ table Table to access
+ ref ref[_or_null] scan parameters
+ records Estimate of number of records (needed only to construct
+ quick select)
+ NOTES
+ This allocates things in a new memory root, as this may be called many
+ times during a query.
+
+ RETURN
+ Quick select that retrieves the same rows as passed ref scan
+ NULL on error.
+*/
QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table,
- TABLE_REF *ref)
+ TABLE_REF *ref, ha_rows records)
{
MEM_ROOT *old_root= thd->mem_root;
/* The following call may change thd->mem_root */
@@ -5537,6 +5549,7 @@
delete quick;
goto err;
}
+ quick->records= records;
if (cp_buffer_from_ref(thd,ref) && thd->is_fatal_error ||
!(range= new QUICK_RANGE()))
--- 1.52/sql/opt_range.h 2004-12-29 16:06:54 +03:00
+++ 1.53/sql/opt_range.h 2005-04-29 01:16:28 +04:00
@@ -281,7 +281,8 @@
friend class TRP_ROR_INTERSECT;
friend
QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table,
- struct st_table_ref *ref);
+ struct st_table_ref *ref,
+ ha_rows records);
friend bool get_quick_keys(struct st_qsel_param *param,
QUICK_RANGE_SELECT *quick,KEY_PART *key,
SEL_ARG *key_tree,
@@ -709,5 +710,6 @@
};
QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table,
- struct st_table_ref *ref);
+ struct st_table_ref *ref,
+ ha_rows records);
#endif
--- 1.320/sql/sql_select.cc 2005-04-21 12:32:55 +04:00
+++ 1.321/sql/sql_select.cc 2005-04-29 01:16:28 +04:00
@@ -10971,7 +10971,8 @@
*/
if (!(select->quick= (tab->type == JT_FT ?
new FT_SELECT(thd, table, tab->ref.key) :
- get_quick_select_for_ref(thd, table, &tab->ref))))
+ get_quick_select_for_ref(thd, table, &tab->ref,
+ tab->found_records))))
goto err;
}
}
| Thread |
|---|
| • bk commit into 5.0 tree (sergefp:1.1904) BUG#10244 | Sergey Petrunia | 28 Apr |