DELIMITER $$
CREATE OR REPLACE DEFINER=`vn-admin`@`localhost` PROCEDURE `vn`.`ticket_setProblemTooLittle`(
	vSelf INT
)
BEGIN
/**
 * Update the problems when the ticket is too small or is no longer so
 *
 * @param vSelf Id del ticket
 */
	
	CREATE OR REPLACE TEMPORARY TABLE tmp.ticket 
		(INDEX(ticketFk, isProblemCalcNeeded))
		ENGINE = MEMORY
		SELECT vSelf ticketFk, 
			ticket_isTooLittle(vSelf) hasProblem, 
			ticket_isProblemCalcNeeded(vSelf) isProblemCalcNeeded;
	
	CALL ticket_setProblem('isTooLittle');

	DROP TEMPORARY TABLE tmp.ticket;

END$$
DELIMITER ;