summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2002-09-13 01:09:50 +0300
committerunknown <monty@mashka.mysql.fi>2002-09-13 01:09:50 +0300
commitbdf11b22cd43d07daac9a80712c1c1fc93b60a23 (patch)
treeb4b341aa53853abcd9753dd5609115ba469b1fab /sql
parentaaa3075c9ed0e1a411ffbd824fd36e4294ddb580 (diff)
parentf3d5cb8b6a6b0c2c1a5a935ded5720c67e5a7233 (diff)
downloadmariadb-git-bdf11b22cd43d07daac9a80712c1c1fc93b60a23.tar.gz
Merge work:/my/mysql-4.0 into mashka.mysql.fi:/home/my/mysql-4.0
Docs/manual.texi: Auto merged
Diffstat (limited to 'sql')
-rw-r--r--sql/opt_range.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 4d8290628a7..181d97ceacc 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -2623,13 +2623,19 @@ 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. */
+
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 */
result=file->index_read(record, (byte*) range->max_key,
range->max_length,
((range->flag & NEAR_MAX) ?
- HA_READ_KEY_EXACT : HA_READ_AFTER_KEY));
+ HA_READ_KEY_OR_NEXT : HA_READ_AFTER_KEY));
result = file->index_prev(record);
}
if (result)