summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-02-04 09:51:13 +0100
committerunknown <monty@mysql.com>2004-02-04 09:51:13 +0100
commit4b44b849ba7ba7e8c5e7de5de40726888f21f847 (patch)
tree31e9a2d94fcf1da78736b366ca1865d44e704f2f /sql/opt_range.cc
parent7ba7ce6e6db22382e40a4fd90ada9cccae32bf13 (diff)
downloadmariadb-git-4b44b849ba7ba7e8c5e7de5de40726888f21f847.tar.gz
Fixed problem with range optimization over overlapping ranges (#2448)
mysql-test/r/ctype_tis620.result: Cleanup test mysql-test/r/range.result: Test problem with range optimization over overlapping ranges (#2448) mysql-test/t/ctype_tis620.test: Cleanup test mysql-test/t/range.test: Test problem with range optimization over overlapping ranges (#2448) sql/mysqld.cc: Remove debug statement strings/ctype-tis620.c: est problem with range optimization over overlapping ranges (#2448)
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r--sql/opt_range.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index bed1b52a79a..188d503b767 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -1710,6 +1710,8 @@ key_or(SEL_ARG *key1,SEL_ARG *key2)
return 0; // OOM
tmp->copy_max_to_min(&key);
tmp->increment_use_count(key1->use_count+1);
+ /* Increment key count as it may be used for next loop */
+ key.increment_use_count(1);
new_arg->next_key_part=key_or(tmp->next_key_part,key.next_key_part);
key1=key1->insert(new_arg);
break;
@@ -2708,15 +2710,18 @@ int QUICK_SELECT_DESC::get_next()
}
else
{
- /* Heikki changed Sept 11, 2002: since InnoDB does not store the cursor
- position if READ_KEY_EXACT is used to a primary key with all
- key columns specified, we must use below HA_READ_KEY_OR_NEXT,
- so that InnoDB stores the cursor position and is able to move
- the cursor one step backward after the search. */
+ /*
+ Heikki changed Sept 11, 2002: since InnoDB does not store the cursor
+ position if READ_KEY_EXACT is used to a primary key with all
+ key columns specified, we must use below HA_READ_KEY_OR_NEXT,
+ so that InnoDB stores the cursor position and is able to move
+ the cursor one step backward after the search. */
DBUG_ASSERT(range->flag & NEAR_MAX || range_reads_after_key(range));
- /* Note: even if max_key is only a prefix, HA_READ_AFTER_KEY will
- * do the right thing - go past all keys which match the prefix */
+ /*
+ Note: even if max_key is only a prefix, HA_READ_AFTER_KEY will
+ do the right thing - go past all keys which match the prefix
+ */
result=file->index_read(record, (byte*) range->max_key,
range->max_length,
((range->flag & NEAR_MAX) ?