fix: refs #7760 collection_assing added global handler sqlexception #3076

Merged
guillermo merged 1 commits from 7760-collectionAssingHandler into master 2024-10-07 05:47:55 +00:00
1 changed files with 7 additions and 1 deletions
Showing only changes of commit 4da63900a2 - Show all commits

View File

@ -3,7 +3,7 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`collection_assign`(
vUserFk INT,
OUT vCollectionFk INT
)
BEGIN
BEGIN
/**
* Comprueba si existen colecciones libres que se ajustan
* al perfil del usuario y le asigna la más antigua.
@ -45,6 +45,12 @@ BEGIN
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
-- Si hay colecciones sin terminar, sale del proceso
DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
ROLLBACK;
RESIGNAL;
END;
CALL collection_get(vUserFk);
SELECT (pc.maxNotReadyCollections - COUNT(*)) <= 0, pc.maxNotAssignedCollectionLifeTime