From c770161ae80ba1d299dc8c7f14d214c379466fd5 Mon Sep 17 00:00:00 2001 From: Sergey Petrunia Date: Mon, 25 Aug 2008 21:02:54 +0400 Subject: [PATCH] BUG#36639: subselect.test crashes on 64 bit pentium4 when compiled for valgrind, commit into 5.0 - Use the compiler's default copy constructor for QUICK_RANGE_SELECT. bcopy(this, copy, ...) call caused some odd action on gcc-4.1.2 on x86_64 sql/opt_range.cc: BUG#36639: subselect.test crashes on 64 bit pentium4 when compiled for valgrind - Set QUICK_SELECT_DESC not to use MRR implementation (code moved to here from opt_range.h) sql/opt_range.h: BUG#36639: subselect.test crashes on 64 bit pentium4 when compiled for valgrind - Use the compiler's default copy constructor for QUICK_RANGE_SELECT. bcopy(this, copy, ...) call caused some odd action on gcc-4.1.2 on x86_64 --- sql/opt_range.cc | 7 +++++++ sql/opt_range.h | 9 +-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 7587db4e329..3502903552a 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -7103,6 +7103,13 @@ QUICK_SELECT_DESC::QUICK_SELECT_DESC(QUICK_RANGE_SELECT *q, used_key_parts (used_key_parts_arg) { QUICK_RANGE *r; + /* + Use default MRR implementation for reverse scans. No table engine + currently can do an MRR scan with output in reverse index order. + */ + multi_range_length= 0; + multi_range= NULL; + multi_range_buff= NULL; QUICK_RANGE **pr= (QUICK_RANGE**)ranges.buffer; QUICK_RANGE **end_range= pr + ranges.elements; diff --git a/sql/opt_range.h b/sql/opt_range.h index 8856223b371..d43f920be93 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -329,14 +329,7 @@ public: void dbug_dump(int indent, bool verbose); #endif private: - /* Used only by QUICK_SELECT_DESC */ - QUICK_RANGE_SELECT(const QUICK_RANGE_SELECT& org) : QUICK_SELECT_I() - { - bcopy(&org, this, sizeof(*this)); - multi_range_length= 0; - multi_range= NULL; - multi_range_buff= NULL; - } + /* Default copy ctor used by QUICK_SELECT_DESC */ };