我有这个例程在开发中工作,我把它复制到生产中,我在更新行上得到一个“检查你的语法附近......”错误。如果我取出限制子句,它会保存。
就像我说的,这在 Dev 中工作。复制并粘贴结构def,所以我知道它是相同的。
DELIMITER ;;
CREATE DEFINER=`user`@`%` PROCEDURE `SQS_Get_Messages`(IN queue_requested INT, IN queue_limit INT)
SQL SECURITY INVOKER
BEGIN
DECLARE my_uuid INT;
DECLARE fake INT;
DECLARE now DATETIME;
SELECT Get_Lock('message_get',10) INTO fake;
SELECT NOW() INTO now;
SELECT UNIX_TIMESTAMP()+mod(UUID_SHORT(),1000) INTO my_uuid;
UPDATE sqs SET `status`= my_uuid, `started_timestamp` = now WHERE `status` = 0 and `queue` = queue_requested LIMIT queue_limit;
SELECT RELEASE_LOCK('message_get') INTO fake;
SELECT `id`,`body`,`status` from sqs WHERE `status` = my_uuid;
END;;
DELIMITER ;