summaryrefslogtreecommitdiffstats
path: root/storage/maria/ma_key.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-01 18:15:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-01 18:15:00 +0000
commita2a2e32c02643a0cec111511220227703fda1cd5 (patch)
tree69cc2b631234c2a8e026b9cd4d72676c61c594df /storage/maria/ma_key.c
parentReleasing progress-linux version 1:10.11.8-1~progress7.99u1. (diff)
downloadmariadb-a2a2e32c02643a0cec111511220227703fda1cd5.tar.xz
mariadb-a2a2e32c02643a0cec111511220227703fda1cd5.zip
Merging upstream version 1:11.4.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'storage/maria/ma_key.c')
-rw-r--r--storage/maria/ma_key.c40
1 files changed, 31 insertions, 9 deletions
diff --git a/storage/maria/ma_key.c b/storage/maria/ma_key.c
index d47e8cf7..1b58c1c1 100644
--- a/storage/maria/ma_key.c
+++ b/storage/maria/ma_key.c
@@ -678,22 +678,44 @@ int _ma_read_key_record(MARIA_HA *info, uchar *buf, MARIA_RECORD_POS filepos)
CHECK_OUT_OF_RANGE to indicate that we don't have any active row.
*/
-check_result_t ma_check_index_cond(register MARIA_HA *info, uint keynr,
- uchar *record)
+check_result_t ma_check_index_cond_real(register MARIA_HA *info, uint keynr,
+ uchar *record)
{
check_result_t res= CHECK_POS;
+ DBUG_ASSERT(info->index_cond_func || info->rowid_filter_func);
+
+ if (_ma_put_key_in_record(info, keynr, FALSE, record))
+ {
+ /* Impossible case; Can only happen if bug in code */
+ _ma_print_error(info, HA_ERR_CRASHED, 0);
+ info->cur_row.lastpos= HA_OFFSET_ERROR; /* No active record */
+ my_errno= HA_ERR_CRASHED;
+ return CHECK_ERROR;
+ }
+
if (info->index_cond_func)
{
- if (_ma_put_key_in_record(info, keynr, FALSE, record))
+ if ((res= info->index_cond_func(info->index_cond_func_arg)) ==
+ CHECK_OUT_OF_RANGE)
{
- /* Impossible case; Can only happen if bug in code */
- _ma_print_error(info, HA_ERR_CRASHED, 0);
+ /* We got beyond the end of scanned range */
info->cur_row.lastpos= HA_OFFSET_ERROR; /* No active record */
- my_errno= HA_ERR_CRASHED;
- res= CHECK_ERROR;
+ my_errno= HA_ERR_END_OF_FILE;
+ return res;
}
- else if ((res= info->index_cond_func(info->index_cond_func_arg)) ==
- CHECK_OUT_OF_RANGE)
+ /*
+ If we got an error, out-of-range condition, or ICP condition computed to
+ FALSE - we don't need to check the Rowid Filter.
+ */
+ if (res != CHECK_POS)
+ return res;
+ }
+
+ /* Check the Rowid Filter, if present */
+ if (info->rowid_filter_func)
+ {
+ if ((res= info->rowid_filter_func(info->rowid_filter_func_arg)) ==
+ CHECK_OUT_OF_RANGE)
{
/* We got beyond the end of scanned range */
info->cur_row.lastpos= HA_OFFSET_ERROR; /* No active record */