Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
Disable the metadata lock
set @@global.tidb_enable_metadata_lock=off;
create table t(a int);
prepare stmt from 'select * from t where a = ?';
begin;
set @a=1;
execute stmt using @a;
insert into t values (1);
execute stmt using @a;
select @@last_plan_from_cache;
select * from t where a = 1;
2. What did you expect to see? (Required)
The second EXECUTE should not use the cached plan, and it should return a result.
3. What did you see instead (Required)
Used the cached plan, and no result was returned.
4. What is your TiDB version? (Required)
master