From 51c8736da2b707ee313cede6941c466386e2a4a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Mon, 29 Apr 2024 14:54:15 +0200 Subject: [PATCH 1/2] hotFix collection_assign --- db/routines/vn/procedures/collection_assign.sql | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/db/routines/vn/procedures/collection_assign.sql b/db/routines/vn/procedures/collection_assign.sql index 8f23ebe4a..13bf7f836 100644 --- a/db/routines/vn/procedures/collection_assign.sql +++ b/db/routines/vn/procedures/collection_assign.sql @@ -16,6 +16,7 @@ BEGIN DECLARE vItemPackingTypeFk VARCHAR(1); DECLARE vWarehouseFk INT; DECLARE vLockName VARCHAR(215); + DECLARE vLockTime INT DEFAULT 30; DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN @@ -33,8 +34,8 @@ BEGIN pc.collectionAssignLockname INTO vHasTooMuchCollections, vLockName - FROM tCollection - JOIN productionConfig pc; + FROM productionConfig pc + LEFT JOIN tCollection; DROP TEMPORARY TABLE tCollection; @@ -53,6 +54,10 @@ BEGIN vItemPackingTypeFk ); + IF NOT GET_LOCK(vLockName, vLockTime) THEN + CALL util.throw(CONCAT('Cannot get lock: ', vLockName)); + END IF; + -- Se eliminan las colecciones sin asignar que estan obsoletas INSERT INTO ticketTracking(stateFk, ticketFk) SELECT s.id, tc.ticketFk -- 2.40.1 From 7b7afb05c56d1a7f9131df0d60e311cbc398abcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Mon, 29 Apr 2024 15:01:20 +0200 Subject: [PATCH 2/2] hotfix collection_assign --- db/routines/vn/procedures/collection_assign.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/collection_assign.sql b/db/routines/vn/procedures/collection_assign.sql index 13bf7f836..1c3ef06ab 100644 --- a/db/routines/vn/procedures/collection_assign.sql +++ b/db/routines/vn/procedures/collection_assign.sql @@ -35,7 +35,7 @@ BEGIN INTO vHasTooMuchCollections, vLockName FROM productionConfig pc - LEFT JOIN tCollection; + LEFT JOIN tCollection ON TRUE; DROP TEMPORARY TABLE tCollection; -- 2.40.1