Skip to content

Commit

Permalink
We rely on handler_stats pointing to a valid active_handler_stats
Browse files Browse the repository at this point in the history
instance, for ICP accounting, which is created
during ha_handler_stats_reset().  Always invoke that method
during table init to ensure that the handler, regardless of
implementation, has the pointer set correctly
  • Loading branch information
DaveGosselin-MariaDB authored and spetrunia committed Apr 23, 2024
1 parent a11a101 commit 86e727b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mysql-test/main/rowid_filter_myisam.result
Expand Up @@ -688,7 +688,7 @@ ANALYZE
"filtered": 8.529999733,
"r_total_filtered": 100,
"index_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'",
"r_icp_filtered": 100,
"r_icp_filtered": 0,
"attached_condition": "t1.fl2 = 0",
"r_filtered": 100
}
Expand Down
6 changes: 1 addition & 5 deletions sql/table.cc
Expand Up @@ -5871,11 +5871,7 @@ void TABLE::init(THD *thd, TABLE_LIST *tl)
(*f_ptr)->cond_selectivity= 1.0;
}

/* enable and clear or disable engine query statistics */
if (thd->should_collect_handler_stats())
file->ha_handler_stats_reset();
else
file->ha_handler_stats_disable();
file->ha_handler_stats_reset();

notnull_cond= 0;
DBUG_ASSERT(!file->keyread_enabled());
Expand Down

0 comments on commit 86e727b

Please sign in to comment.