Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

planner: plan cache statistic result is not correct. #18066

Closed
danmay319 opened this issue Jun 17, 2020 · 0 comments · Fixed by #18067
Closed

planner: plan cache statistic result is not correct. #18066

danmay319 opened this issue Jun 17, 2020 · 0 comments · Fixed by #18067
Assignees
Labels
sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@danmay319
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

The bug can be reproduced by executing following SQLs.

use test;
drop table t;
create table t(a int);
Prepare stmt from "select * from t";
execute stmt;
select EXEC_COUNT,plan_cache_hits, plan_in_cache from information_schema.statements_summary where digest_text='select * from t';
execute stmt;
select EXEC_COUNT,plan_cache_hits, plan_in_cache from information_schema.statements_summary where digest_text='select * from t';
prepare stmt from "select * from t";
execute stmt;
select @@last_plan_from_cache;
select EXEC_COUNT,plan_cache_hits, plan_in_cache from information_schema.statements_summary where digest_text='select * from t';

2. What did you expect to see? (Required)

the `plan_in_cache` of last statement's result is 0 

3. What did you see instead (Required)

the `plan_in_cache` of last statement's result is 1

4. Affected version (Required)

v4.0.0

5. Root Cause Analysis

planInCache should be cleared if PlanInCache is false.

@danmay319 danmay319 added the type/bug The issue is confirmed as a bug. label Jun 17, 2020
@danmay319 danmay319 self-assigned this Jun 17, 2020
@danmay319 danmay319 changed the title planner: fix plan cache statistic result. planner: plan cache statistic result is not correct. Jun 17, 2020
@danmay319 danmay319 added the sig/planner SIG: Planner label Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant