drop database if exists test; create database test; use test; drop table if exists `t1`; create table `t1` (`a` char(3) default null,key(`a`)) engine=innodb; drop table if exists `t2`; create table `t2` (`b` char(4))engine=myisam; drop table if exists `t3`; create table `t3` (`c` char(4)not null) engine=myisam; drop view if exists `v1`; create view `v1` as select `b` from `t2`; drop table if exists `v2`; drop view if exists `v2`; create view `v2` as select 1 as a from `t3` `s` left join `v1` `c` on 1 where `c` in (select 1 from `t1` where `b` = `a`); insert into `t3` values (); delimiter ;; drop procedure if exists `p1`;; create procedure `p1`(p_id bigint) begin select * from v2 where a = p_id; end ;; delimiter ; call p1(1); call p1(1); call p1(1); call p1(1); call p1(1);