Problem/Issue : Getting Error : [Err] 1615 - Prepared statement needs to be re-prepared
I have a Stored Procedure which contains a Prepared Statement and a view
DROP PROCEDURE IF EXISTS `sampleProc`;
DELIMITER ;;
CREATE DEFINER = `root`@`localhost` PROCEDURE `sampleProc`()
BEGIN
SET @select = "SELECT * FROM `viewSample` ";
PREPARE stmt FROM @select ;
EXECUTE stmt ;
DEALLOCATE PREPARE stmt ;
END ;;
DELIMITER ;
Following call sometimes gives error CALL sampleProc();
Possible work around / solutions
It appears that the best solution is to increase the value of table_definition_cache , but it seems that it is not working , as it had already been increased from 1400 (default) to 16384. table_open_cache is also been increased to 32162
Variable_name Value
table_definition_cache 16384
table_open_cache 32162
table_open_cache_instances 4