Commit 41221091 authored by Sergei Petrunia's avatar Sergei Petrunia

MDEV-22553: Assertion `info->lastpos == (~ (my_off_t) 0)' failed in mi_rkey

In mi_check_index_tuple(), when rowid filter check returns
CHECK_OUT_OF_RANGE, set info->lastpos= HA_OFFSET_ERROR, like
it is done above for the ICP check.
parent 0d6d801e
#
# MDEV-22553: Assertion `info->lastpos == (~ (my_off_t) 0)' failed in mi_rkey with rowid_filer=on
#
CREATE TABLE t1 (
a smallint(6) DEFAULT NULL,
b bigint(20) DEFAULT NULL,
c varchar(64) DEFAULT NULL,
d varchar(64) DEFAULT NULL,
e smallint(6) DEFAULT NULL,
f bigint(20) DEFAULT NULL,
KEY a (a),
KEY d (d),
KEY f (f)
) ENGINE=MyISAM;
ALTER TABLE t1 DISABLE KEYS;
# Insert a lot of rows
ALTER TABLE t1 ENABLE KEYS;
# Must not crash:
SELECT * FROM t1 WHERE ( a BETWEEN 255 AND 270 OR f = 200 ) AND f IN ( 1, 4, 112, 143 ) AND d IN ('Montana', 'South Dakota');
a b c d e f
DROP TABLE t1;
This diff is collapsed.
......@@ -561,7 +561,15 @@ check_result_t mi_check_index_tuple(MI_INFO *info, uint keynr, uchar *record)
if (need_unpack && mi_unpack_index_tuple(info, keynr, record))
res= CHECK_ERROR;
else
res= info->rowid_filter_func(info->rowid_filter_func_arg);
{
if ((res= info->rowid_filter_func(info->rowid_filter_func_arg)) ==
CHECK_OUT_OF_RANGE)
{
/* We got beyond the end of scanned range */
info->lastpos= HA_OFFSET_ERROR; /* No active record */
my_errno= HA_ERR_END_OF_FILE;
}
}
}
return res;
}
......
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