mdbx: исправление GET_MULTIPLE для случая одного значения.

Регрессия была внесена коммитом d94f34b2c0f9575e8fce0b7affff41d756bd1e99.
This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2024-11-26 15:49:45 +03:00
parent 6cfb2935f6
commit e754b442a2

View File

@ -16987,10 +16987,8 @@ static __hot int cursor_get(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data,
} }
rc = MDBX_SUCCESS; rc = MDBX_SUCCESS;
if (unlikely(C_INITIALIZED != (mc->mc_xcursor->mx_cursor.mc_flags & if (unlikely(C_INITIALIZED != (mc->mc_xcursor->mx_cursor.mc_flags &
(C_INITIALIZED | C_EOF)))) { (C_INITIALIZED | C_EOF))))
rc = MDBX_NOTFOUND;
break; break;
}
goto fetch_multiple; goto fetch_multiple;
case MDBX_NEXT_MULTIPLE: case MDBX_NEXT_MULTIPLE:
if (unlikely(!data)) if (unlikely(!data))
@ -17006,8 +17004,6 @@ static __hot int cursor_get(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data,
page_numkeys(mx->mc_pg[mx->mc_top]) * mx->mc_db->md_xsize; page_numkeys(mx->mc_pg[mx->mc_top]) * mx->mc_db->md_xsize;
data->iov_base = page_data(mx->mc_pg[mx->mc_top]); data->iov_base = page_data(mx->mc_pg[mx->mc_top]);
mx->mc_ki[mx->mc_top] = (indx_t)page_numkeys(mx->mc_pg[mx->mc_top]) - 1; mx->mc_ki[mx->mc_top] = (indx_t)page_numkeys(mx->mc_pg[mx->mc_top]) - 1;
} else {
rc = MDBX_NOTFOUND;
} }
} }
break; break;