DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_setTooLittleProblemConfig`()
BEGIN
/**
 * Update the problems when the ticket is too small or is no longer so, 
 * derived from changes in the volumeConfig table
 * 
 */
	CREATE OR REPLACE TEMPORARY TABLE tmp.ticket 
		(INDEX(ticketFk))
		ENGINE = MEMORY
		SELECT t.id ticketFk, ticket_isTooLittle(t.id) hasProblem
			FROM ticket t 
			WHERE t.shipped >= util.midnight();
	
	CALL ticket_setProblem('isTooLittle');
	
	DROP TEMPORARY TABLE tmp.ticket;
END$$
DELIMITER ;