Commit aff73d7f authored by unknown's avatar unknown

full support for HA_READ_PREFIX_LAST_OR_PREV in ISAM

parent 37b734b5
......@@ -118,7 +118,7 @@ int _nisam_search(register N_INFO *info, register N_KEYDEF *keyinfo, uchar *key,
if ((nextflag & (SEARCH_SMALLER | SEARCH_LAST)) && flag != 0)
{
keypos=_nisam_get_last_key(info,keyinfo,buff,lastkey,keypos);
if ((nextflag & SEARCH_LAST) &&
if (!(nextflag & SEARCH_SMALLER) &&
_nisam_key_cmp(keyinfo->seg, info->lastkey, key, key_len, SEARCH_FIND))
{
my_errno=HA_ERR_KEY_NOT_FOUND; /* Didn't find key */
......
......@@ -41,5 +41,5 @@ uint NEAR nisam_read_vec[]=
{
SEARCH_FIND, SEARCH_FIND | SEARCH_BIGGER, SEARCH_FIND | SEARCH_SMALLER,
SEARCH_NO_FIND | SEARCH_BIGGER, SEARCH_NO_FIND | SEARCH_SMALLER,
SEARCH_FIND, SEARCH_LAST
SEARCH_FIND, SEARCH_LAST,SEARCH_LAST | SEARCH_SMALLER
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment