From 739ae82ace3c34c9737bd7269376b3ce06ad1a59 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 22 Apr 2024 09:02:43 +0200 Subject: [PATCH] fix(binlog): refs #4409 Fix cursor name --- db/routines/util/functions/binlogQueue_getDelay.sql | 1 + db/routines/vn/procedures/ticket_recalcByScope.sql | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/db/routines/util/functions/binlogQueue_getDelay.sql b/db/routines/util/functions/binlogQueue_getDelay.sql index a440fc0ab..d6cf49377 100644 --- a/db/routines/util/functions/binlogQueue_getDelay.sql +++ b/db/routines/util/functions/binlogQueue_getDelay.sql @@ -1,6 +1,7 @@ DELIMITER $$ CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `util`.`binlogQueue_getDelay`(vCode VARCHAR(255)) RETURNS BIGINT + READS SQL DATA NOT DETERMINISTIC BEGIN /** diff --git a/db/routines/vn/procedures/ticket_recalcByScope.sql b/db/routines/vn/procedures/ticket_recalcByScope.sql index e20244648..41105fe23 100644 --- a/db/routines/vn/procedures/ticket_recalcByScope.sql +++ b/db/routines/vn/procedures/ticket_recalcByScope.sql @@ -13,7 +13,7 @@ BEGIN DECLARE vDone BOOL; DECLARE vTicketFk INT; - DECLARE cCur CURSOR FOR + DECLARE cTickets CURSOR FOR SELECT id FROM ticket WHERE refFk IS NULL AND ((vScope = 'client' AND clientFk = vId) @@ -22,11 +22,11 @@ BEGIN DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - OPEN cCur; + OPEN cTickets; myLoop: LOOP SET vDone = FALSE; - FETCH cCur INTO vTicketFk; + FETCH cTickets INTO vTicketFk; IF vDone THEN LEAVE myLoop; @@ -35,6 +35,6 @@ BEGIN CALL ticket_recalc(vTicketFk, NULL); END LOOP; - CLOSE cCur; + CLOSE cTickets; END$$ DELIMITER ;