From 64ed96c8ae3b90699cb60451193bd5be97343808 Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 9 Jul 2024 14:47:12 +0200 Subject: [PATCH] feat: refs #7486 More debug --- db/routines/vn/procedures/collection_assign.sql | 14 +++++++------- db/routines/vn/procedures/collection_new.sql | 16 ++++++++-------- .../procedures/ticket_splitItemPackingType.sql | 11 +++++++++++ 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/db/routines/vn/procedures/collection_assign.sql b/db/routines/vn/procedures/collection_assign.sql index bf130b2c6..f9032a91d 100644 --- a/db/routines/vn/procedures/collection_assign.sql +++ b/db/routines/vn/procedures/collection_assign.sql @@ -26,16 +26,16 @@ BEGIN vErrorNumber = MYSQL_ERRNO, vErrorMsg = MESSAGE_TEXT; + CALL util.debugAdd('collection_assign', JSON_OBJECT( + 'errorNumber', vErrorNumber, + 'errorMsg', vErrorMsg, + 'lockName', vLockName, + 'userFk', vUserFk + )); -- Tmp + IF vLockName IS NOT NULL THEN DO RELEASE_LOCK(vLockName); - CALL util.debugAdd('collection_assign', JSON_OBJECT( - 'errorNumber', vErrorNumber, - 'errorMsg', vErrorMsg, - 'lockName', vLockName, - 'userFk', vUserFk - )); -- Tmp END IF; - RESIGNAL; END; diff --git a/db/routines/vn/procedures/collection_new.sql b/db/routines/vn/procedures/collection_new.sql index 029427306..0bd6e1b25 100644 --- a/db/routines/vn/procedures/collection_new.sql +++ b/db/routines/vn/procedures/collection_new.sql @@ -53,17 +53,17 @@ BEGIN vErrorNumber = MYSQL_ERRNO, vErrorMsg = MESSAGE_TEXT; + CALL util.debugAdd('collection_new', JSON_OBJECT( + 'errorNumber', vErrorNumber, + 'errorMsg', vErrorMsg, + 'lockName', vLockName, + 'userFk', vUserFk, + 'ticketFk', vTicketFk + )); -- Tmp + IF vLockName IS NOT NULL THEN DO RELEASE_LOCK(vLockName); - CALL util.debugAdd('collection_new', JSON_OBJECT( - 'errorNumber', vErrorNumber, - 'errorMsg', vErrorMsg, - 'lockName', vLockName, - 'userFk', vUserFk, - 'ticketFk', vTicketFk - )); -- Tmp END IF; - RESIGNAL; END; diff --git a/db/routines/vn/procedures/ticket_splitItemPackingType.sql b/db/routines/vn/procedures/ticket_splitItemPackingType.sql index d6e8e8a53..e2c55e28a 100644 --- a/db/routines/vn/procedures/ticket_splitItemPackingType.sql +++ b/db/routines/vn/procedures/ticket_splitItemPackingType.sql @@ -16,6 +16,8 @@ BEGIN DECLARE vNewTicketFk INT; DECLARE vPackingTypesToSplit INT; DECLARE vDone INT DEFAULT FALSE; + DECLARE vErrorNumber INT; + DECLARE vErrorMsg TEXT; DECLARE cur1 CURSOR FOR SELECT itemPackingTypeFk @@ -27,6 +29,15 @@ BEGIN DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN + GET DIAGNOSTICS CONDITION 1 + vErrorNumber = MYSQL_ERRNO, + vErrorMsg = MESSAGE_TEXT; + + CALL util.debugAdd('ticket_splitItemPackingType', JSON_OBJECT( + 'errorNumber', vErrorNumber, + 'errorMsg', vErrorMsg, + 'ticketFk', vTicketFk + )); -- Tmp RESIGNAL; END;