summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
authorunknown <sergefp@mysql.com>2006-04-13 16:05:32 +0400
committerunknown <sergefp@mysql.com>2006-04-13 16:05:32 +0400
commitc89555edcc64a151a3eb59bd470ce3961d73415a (patch)
treef0115920deee6e75b83871b9627dd4a138bd270a /sql/opt_range.cc
parent10633fd8397f8450b5076bb98f336f6d20967b5d (diff)
downloadmariadb-git-c89555edcc64a151a3eb59bd470ce3961d73415a.tar.gz
BUG#19021, Crash in ROR-index_merge optimizer:
get_best_covering_ror_intersect() was copying ror_scans starting from the end of the array and not from its beginning. mysql-test/r/index_merge_innodb.result: Testcase for BUG#19021 mysql-test/t/index_merge_innodb.test: Testcase for BUG#19021 sql/opt_range.cc: BUG#19021: In get_best_covering_ror_intersect(), the array of pointers to scans to be used is [tree->ror_scans, ror_scan_mark), and not [ror_scan_mark, ...)
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r--sql/opt_range.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index d76495a0678..ae02bb8934c 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -3176,7 +3176,7 @@ TRP_ROR_INTERSECT *get_best_covering_ror_intersect(PARAM *param,
sizeof(ROR_SCAN_INFO*)*
best_num)))
DBUG_RETURN(NULL);
- memcpy(trp->first_scan, ror_scan_mark, best_num*sizeof(ROR_SCAN_INFO*));
+ memcpy(trp->first_scan, tree->ror_scans, best_num*sizeof(ROR_SCAN_INFO*));
trp->last_scan= trp->first_scan + best_num;
trp->is_covering= TRUE;
trp->read_cost= total_cost;