fix: refs #7781 leave early before any updates on the proc
gitea/salix/pipeline/pr-master This commit looks good Details

This commit is contained in:
Pablo Natek 2024-10-04 07:52:13 +02:00
parent 09031822a6
commit 72bab95be1
1 changed files with 22 additions and 21 deletions

View File

@ -5,7 +5,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`expeditionPallet_bu
vWorkerFk INT,
OUT vPalletFk INT
)
BEGIN
proc: BEGIN
/**
* Builds an expedition pallet.
*
@ -56,6 +56,17 @@ BEGIN
FROM tExpedition
WHERE palletFk;
IF vExpeditionWithPallet THEN
UPDATE arcRead
SET error = (
SELECT GROUP_CONCAT(expeditionFk SEPARATOR ', ')
FROM tExpedition
WHERE palletFk
)
WHERE id = vArcId;
LEAVE proc;
END IF;
IF NOT vFreeExpeditionCount THEN
CALL util.throw ('NO_FREE_EXPEDITIONS');
END IF;
@ -93,15 +104,6 @@ BEGIN
FROM tExpedition
WHERE palletFk IS NULL;
IF vExpeditionWithPallet THEN
UPDATE arcRead
SET error = (
SELECT GROUP_CONCAT(expeditionFk SEPARATOR ', ')
FROM tExpedition
WHERE palletFk
)
WHERE id = vArcId;
ELSE
UPDATE arcRead SET error = NULL WHERE id = vArcId;
SELECT printerFk INTO vPrinterFk FROM arcRead WHERE id = vArcId;
@ -115,7 +117,6 @@ BEGIN
);
UPDATE expeditionPallet SET isPrint = TRUE WHERE id = vPalletFk;
END IF;
DROP TEMPORARY TABLE tExpedition;
END$$