1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge branch '10.4' into 10.5

This commit is contained in:
Sergei Golubchik
2020-05-09 20:43:36 +02:00
100 changed files with 1571 additions and 289 deletions

View File

@ -6161,22 +6161,22 @@ int handler::compare_key2(key_range *range) const
/**
ICP callback - to be called by an engine to check the pushed condition
*/
extern "C" enum icp_result handler_index_cond_check(void* h_arg)
extern "C" check_result_t handler_index_cond_check(void* h_arg)
{
handler *h= (handler*)h_arg;
THD *thd= h->table->in_use;
enum icp_result res;
check_result_t res;
enum thd_kill_levels abort_at= h->has_transactions() ?
THD_ABORT_SOFTLY : THD_ABORT_ASAP;
if (thd_kill_level(thd) > abort_at)
return ICP_ABORTED_BY_USER;
return CHECK_ABORTED_BY_USER;
if (h->end_range && h->compare_key2(h->end_range) > 0)
return ICP_OUT_OF_RANGE;
return CHECK_OUT_OF_RANGE;
h->increment_statistics(&SSV::ha_icp_attempts);
if ((res= h->pushed_idx_cond->val_int()? ICP_MATCH : ICP_NO_MATCH) ==
ICP_MATCH)
if ((res= h->pushed_idx_cond->val_int()? CHECK_POS : CHECK_NEG) ==
CHECK_POS)
h->increment_statistics(&SSV::ha_icp_match);
return res;
}
@ -6187,12 +6187,30 @@ extern "C" enum icp_result handler_index_cond_check(void* h_arg)
keys of the rows whose data is to be fetched against the used rowid filter
*/
extern "C" int handler_rowid_filter_check(void *h_arg)
extern "C"
check_result_t handler_rowid_filter_check(void *h_arg)
{
handler *h= (handler*) h_arg;
TABLE *tab= h->get_table();
/*
Check for out-of-range and killed conditions only if we haven't done it
already in the pushed index condition check
*/
if (!h->pushed_idx_cond)
{
THD *thd= h->table->in_use;
enum thd_kill_levels abort_at= h->has_transactions() ?
THD_ABORT_SOFTLY : THD_ABORT_ASAP;
if (thd_kill_level(thd) > abort_at)
return CHECK_ABORTED_BY_USER;
if (h->end_range && h->compare_key2(h->end_range) > 0)
return CHECK_OUT_OF_RANGE;
}
h->position(tab->record[0]);
return h->pushed_rowid_filter->check((char *) h->ref);
return h->pushed_rowid_filter->check((char*)h->ref)? CHECK_POS: CHECK_NEG;
}