#At file:///localhome/jl208045/mysql/mysql-6.0-codebase-bugfixing-48093/ based on revid:oystein.grovlen@stripped
3829 Jorgen Loland 2010-01-15
BUG#48093: 6.0 Server not processing equivalent IN clauses
properly with Innodb tables
Followup patch, addressing comments from Igor regarding previously
pushed patch. In the previous patch, is_ror_scan was set
to FALSE in check_quick_select() if there were multiple ranges.
This patch sets is_ror_scan to FALSE for the same case a bit
earlier, in sel_arg_range_seq_next().
There is no new test case since the test pushed in the previous
patch still applies.
@ sql/opt_range.cc
Move setting of is_ror_scan= FALSE from check_quick_select() to sel_arg_range_seq_next() in case of multiple range lookup.
modified:
sql/opt_range.cc
=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc 2009-12-24 16:38:19 +0000
+++ b/sql/opt_range.cc 2010-01-15 08:26:06 +0000
@@ -7712,6 +7712,7 @@ uint sel_arg_range_seq_next(range_seq_t
seq->i--;
step_down_to(seq, key_tree->next);
key_tree= key_tree->next;
+ seq->param->is_ror_scan= FALSE;
break;
}
}
@@ -7902,6 +7903,7 @@ ha_rows check_quick_select(PARAM *param,
*mrr_flags |= HA_MRR_USE_DEFAULT_IMPL;
*bufsize= param->thd->variables.read_rnd_buff_size;
+ // Sets is_ror_scan to false for some queries, e.g. multi-ranges
rows= file->multi_range_read_info_const(keynr, &seq_if, (void*)&seq, 0,
bufsize, mrr_flags, cost);
if (rows != HA_POS_ERROR)
@@ -7927,20 +7929,11 @@ ha_rows check_quick_select(PARAM *param,
*/
param->is_ror_scan= FALSE;
}
- else if (param->table->s->primary_key == keynr && pk_is_clustered)
+ else
{
/* Clustered PK scan is always a ROR scan (TODO: same as above) */
- param->is_ror_scan= TRUE;
- }
- else if (param->range_count > 1)
- {
- /*
- Scaning multiple key values in the index: the records are ROR
- for each value, but not between values. E.g, "SELECT ... x IN
- (1,3)" returns ROR order for all records with x=1, then ROR
- order for records with x=3
- */
- param->is_ror_scan= FALSE;
+ if (param->table->s->primary_key == keynr && pk_is_clustered)
+ param->is_ror_scan= TRUE;
}
DBUG_PRINT("exit", ("Records: %lu", (ulong) rows));
Attachment: [text/bzr-bundle] bzr/jorgen.loland@sun.com-20100115082606-71wooovy2sfhkej4.bundle
| Thread |
|---|
| • bzr commit into mysql-6.0-codebase-bugfixing branch (jorgen.loland:3829)Bug#48093 | Jorgen Loland | 15 Jan |