summaryrefslogtreecommitdiff
path: root/sql/records.cc
diff options
context:
space:
mode:
authorSergey Petrunia <sergefp@mysql.com>2008-07-15 21:46:02 +0400
committerSergey Petrunia <sergefp@mysql.com>2008-07-15 21:46:02 +0400
commit7a92412c5959ce3c216485be1951dead7d778326 (patch)
tree466955c9bb93adf167f39ad0a759ea8e1ac8144d /sql/records.cc
parenta3619d2e865eb5705a8acfc10db91ae700bb7043 (diff)
parent62513bb1bca33902fa909ca13b25c550046ee3ae (diff)
downloadmariadb-git-7a92412c5959ce3c216485be1951dead7d778326.tar.gz
Merge fix for BUG#35478 into 5.1
Diffstat (limited to 'sql/records.cc')
-rw-r--r--sql/records.cc23
1 files changed, 21 insertions, 2 deletions
diff --git a/sql/records.cc b/sql/records.cc
index cfcaf9df8e6..9e040de3fda 100644
--- a/sql/records.cc
+++ b/sql/records.cc
@@ -86,6 +86,23 @@ void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
The temporary file is normally used when the references doesn't fit into
a properly sized memory buffer. For most small queries the references
are stored in the memory buffer.
+ SYNOPSIS
+ init_read_record()
+ info OUT read structure
+ thd Thread handle
+ table Table the data [originally] comes from.
+ select SQL_SELECT structure. We may select->quick or
+ select->file as data source
+ use_record_cache Call file->extra_opt(HA_EXTRA_CACHE,...)
+ if we're going to do sequential read and some
+ additional conditions are satisfied.
+ print_error Copy this to info->print_error
+ disable_rr_cache Don't use rr_from_cache (used by sort-union
+ index-merge which produces rowid sequences that
+ are already ordered)
+
+ DESCRIPTION
+ This function sets up reading data via one of the methods:
The temporary file is also used when performing an update where a key is
modified.
@@ -140,7 +157,8 @@ void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
*/
void init_read_record(READ_RECORD *info,THD *thd, TABLE *table,
SQL_SELECT *select,
- int use_record_cache, bool print_error)
+ int use_record_cache, bool print_error,
+ bool disable_rr_cache)
{
IO_CACHE *tempfile;
DBUG_ENTER("init_read_record");
@@ -191,7 +209,8 @@ void init_read_record(READ_RECORD *info,THD *thd, TABLE *table,
it doesn't make sense to use cache - we don't read from the table
and table->sort.io_cache is read sequentially
*/
- if (!table->sort.addon_field &&
+ if (!disable_rr_cache &&
+ !table->sort.addon_field &&
! (specialflag & SPECIAL_SAFE_MODE) &&
thd->variables.read_rnd_buff_size &&
!(table->file->ha_table_flags() & HA_FAST_KEY_READ) &&